diff --git a/apps/web/src/api-clients/_common/constants/api-doc-constant.ts b/apps/web/src/api-clients/_common/constants/api-doc-constant.ts index 163634c799..88f14c4551 100644 --- a/apps/web/src/api-clients/_common/constants/api-doc-constant.ts +++ b/apps/web/src/api-clients/_common/constants/api-doc-constant.ts @@ -25,6 +25,101 @@ */ export const API_DOC = { + 'alert-manager': { + alert: [ + 'create', + 'delete', + 'get', + 'history', + 'list', + 'update', + ], + 'escalation-policy': [ + 'create', + 'delete', + 'get', + 'list', + 'update', + ], + event: [ + 'create', + ], + 'event-rule': [ + 'change-order', + 'create', + 'delete', + 'get', + 'list', + 'update', + ], + note: [ + 'create', + 'delete', + 'get', + 'list', + 'update', + ], + 'notification-protocol': [ + 'create', + 'delete', + 'disable', + 'enable', + 'get', + 'list', + 'update-plugin', + 'update', + 'verify-plugin', + ], + service: [ + 'change-members', + 'create', + 'delete', + 'get', + 'list', + 'update', + ], + 'service-channel': [ + 'create-forward-channel', + 'create', + 'delete', + 'disable', + 'enable', + 'get', + 'list', + 'update', + ], + 'user-channel': [ + 'create', + 'delete', + 'disable', + 'enable', + 'get', + 'list', + 'update', + ], + 'user-group-channel': [ + 'create', + 'delete', + 'disable', + 'enable', + 'get', + 'list', + 'update', + ], + webhook: [ + 'create', + 'delete', + 'disable', + 'enable', + 'get', + 'list-errors', + 'list', + 'update-message-format', + 'update-plugin', + 'update', + 'verify-plugin', + ], + }, config: { 'domain-config': [ 'create', @@ -397,6 +492,79 @@ export const API_DOC = { 'analyze', ], }, + monitoring: { + alert: [ + 'assign-user', + 'create', + 'delete', + 'get', + 'list', + 'update-state', + 'update', + ], + 'data-source': [ + 'list', + ], + 'escalation-policy': [ + 'create', + 'delete', + 'get', + 'list', + 'set-default', + 'update', + ], + event: [ + 'list', + ], + 'event-rule': [ + 'change-order', + 'create', + 'delete', + 'get', + 'list', + 'update', + ], + log: [ + 'list', + ], + note: [ + 'create', + 'delete', + 'get', + 'list', + 'update', + ], + 'project-alert-config': [ + 'create', + 'delete', + 'get', + 'list', + 'update', + ], + webhook: [ + 'create', + 'delete', + 'disable', + 'enable', + 'get', + 'list', + 'update-plugin', + 'update', + 'verify-plugin', + ], + }, + notification: { + protocol: [ + 'create', + 'delete', + 'disable', + 'enable', + 'get', + 'list', + 'update-plugin', + 'update', + ], + }, opsflow: { comment: [ 'create', diff --git a/apps/web/src/api-clients/alert-manager/alert/composables/use-alert-api.ts b/apps/web/src/api-clients/alert-manager/alert/composables/use-alert-api.ts new file mode 100644 index 0000000000..d5aa525557 --- /dev/null +++ b/apps/web/src/api-clients/alert-manager/alert/composables/use-alert-api.ts @@ -0,0 +1,26 @@ +import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; + +import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; +import type { AlertCreateParameters } from '@/api-clients/alert-manager/alert/schema/api-verbs/create'; +import type { AlertDeleteParameters } from '@/api-clients/alert-manager/alert/schema/api-verbs/delete'; +import type { AlertGetParameters } from '@/api-clients/alert-manager/alert/schema/api-verbs/get'; +import type { AlertHistoryParameters } from '@/api-clients/alert-manager/alert/schema/api-verbs/history'; +import type { AlertListParameters } from '@/api-clients/alert-manager/alert/schema/api-verbs/list'; +import type { AlertUpdateParameters } from '@/api-clients/alert-manager/alert/schema/api-verbs/update'; +import type { AlertHistoryModel, AlertModel } from '@/api-clients/alert-manager/alert/schema/model'; + +export const useAlertApi = () => { + const actions = { + create: SpaceConnector.clientV2.alertManager.alert.create, + delete: SpaceConnector.clientV2.alertManager.alert.delete, + get: SpaceConnector.clientV2.alertManager.alert.get, + history: SpaceConnector.clientV2.alertManager.alert.history>, + list: SpaceConnector.clientV2.alertManager.alert.list>, + update: SpaceConnector.clientV2.alertManager.alert.update, + }; + + return { + alertAPI: actions, + }; +}; + diff --git a/apps/web/src/schema/alert-manager/alert/api-verbs/create.ts b/apps/web/src/api-clients/alert-manager/alert/schema/api-verbs/create.ts similarity index 85% rename from apps/web/src/schema/alert-manager/alert/api-verbs/create.ts rename to apps/web/src/api-clients/alert-manager/alert/schema/api-verbs/create.ts index 1ca43abb2b..6074e7775f 100644 --- a/apps/web/src/schema/alert-manager/alert/api-verbs/create.ts +++ b/apps/web/src/api-clients/alert-manager/alert/schema/api-verbs/create.ts @@ -1,4 +1,4 @@ -import type { AlertResourcesType, AlertSeverityType, AlertUrgencyType } from '@/schema/alert-manager/alert/type'; +import type { AlertResourcesType, AlertSeverityType, AlertUrgencyType } from '@/api-clients/alert-manager/alert/schema/type'; export interface AlertCreateParameters { title: string; diff --git a/apps/web/src/schema/alert-manager/alert/api-verbs/delete.ts b/apps/web/src/api-clients/alert-manager/alert/schema/api-verbs/delete.ts similarity index 100% rename from apps/web/src/schema/alert-manager/alert/api-verbs/delete.ts rename to apps/web/src/api-clients/alert-manager/alert/schema/api-verbs/delete.ts diff --git a/apps/web/src/schema/alert-manager/alert/api-verbs/get.ts b/apps/web/src/api-clients/alert-manager/alert/schema/api-verbs/get.ts similarity index 100% rename from apps/web/src/schema/alert-manager/alert/api-verbs/get.ts rename to apps/web/src/api-clients/alert-manager/alert/schema/api-verbs/get.ts diff --git a/apps/web/src/schema/alert-manager/alert/api-verbs/history.ts b/apps/web/src/api-clients/alert-manager/alert/schema/api-verbs/history.ts similarity index 100% rename from apps/web/src/schema/alert-manager/alert/api-verbs/history.ts rename to apps/web/src/api-clients/alert-manager/alert/schema/api-verbs/history.ts diff --git a/apps/web/src/schema/alert-manager/alert/api-verbs/list.ts b/apps/web/src/api-clients/alert-manager/alert/schema/api-verbs/list.ts similarity index 91% rename from apps/web/src/schema/alert-manager/alert/api-verbs/list.ts rename to apps/web/src/api-clients/alert-manager/alert/schema/api-verbs/list.ts index 2e9688c080..b5d9aa122f 100644 --- a/apps/web/src/schema/alert-manager/alert/api-verbs/list.ts +++ b/apps/web/src/api-clients/alert-manager/alert/schema/api-verbs/list.ts @@ -5,7 +5,7 @@ import type { AlertSeverityType, AlertStatusType, AlertTriggeredType, AlertUrgencyType, -} from '@/schema/alert-manager/alert/type'; +} from '@/api-clients/alert-manager/alert/schema/type'; export interface AlertListParameters { query?: Query; diff --git a/apps/web/src/schema/alert-manager/alert/api-verbs/update.ts b/apps/web/src/api-clients/alert-manager/alert/schema/api-verbs/update.ts similarity index 62% rename from apps/web/src/schema/alert-manager/alert/api-verbs/update.ts rename to apps/web/src/api-clients/alert-manager/alert/schema/api-verbs/update.ts index 7a3cb2a177..c67905fd95 100644 --- a/apps/web/src/schema/alert-manager/alert/api-verbs/update.ts +++ b/apps/web/src/api-clients/alert-manager/alert/schema/api-verbs/update.ts @@ -1,4 +1,4 @@ -import type { AlertUrgencyType, AlertStatusType } from '@/schema/alert-manager/alert/type'; +import type { AlertUrgencyType, AlertStatusType } from '@/api-clients/alert-manager/alert/schema/type'; export interface AlertUpdateParameters { alert_id: string; diff --git a/apps/web/src/schema/alert-manager/alert/constants.ts b/apps/web/src/api-clients/alert-manager/alert/schema/constants.ts similarity index 100% rename from apps/web/src/schema/alert-manager/alert/constants.ts rename to apps/web/src/api-clients/alert-manager/alert/schema/constants.ts diff --git a/apps/web/src/schema/alert-manager/alert/model.ts b/apps/web/src/api-clients/alert-manager/alert/schema/model.ts similarity index 95% rename from apps/web/src/schema/alert-manager/alert/model.ts rename to apps/web/src/api-clients/alert-manager/alert/schema/model.ts index cba934c392..c8b1e79a42 100644 --- a/apps/web/src/schema/alert-manager/alert/model.ts +++ b/apps/web/src/api-clients/alert-manager/alert/schema/model.ts @@ -5,7 +5,7 @@ import type { AlertUrgencyType, AlertHistoryActionType, AlertHistoryNotificationInfoType, -} from '@/schema/alert-manager/alert/type'; +} from '@/api-clients/alert-manager/alert/schema/type'; export interface AlertModel { alert_id: string; diff --git a/apps/web/src/schema/alert-manager/alert/type.ts b/apps/web/src/api-clients/alert-manager/alert/schema/type.ts similarity index 95% rename from apps/web/src/schema/alert-manager/alert/type.ts rename to apps/web/src/api-clients/alert-manager/alert/schema/type.ts index 5ffa4ecf5e..7f99c8c449 100644 --- a/apps/web/src/schema/alert-manager/alert/type.ts +++ b/apps/web/src/api-clients/alert-manager/alert/schema/type.ts @@ -2,7 +2,7 @@ import type { ALERT_SEVERITY, ALERT_STATUS, ALERT_TRIGGERED_TYPE, ALERT_URGENCY, ALERT_HISTORY_ACTION, ALERT_HISTORY_NOTIFICATION_STATE, -} from '@/schema/alert-manager/alert/constants'; +} from '@/api-clients/alert-manager/alert/schema/constants'; export type AlertStatusType = typeof ALERT_STATUS[keyof typeof ALERT_STATUS]; export type AlertUrgencyType = typeof ALERT_URGENCY[keyof typeof ALERT_URGENCY]; diff --git a/apps/web/src/api-clients/alert-manager/escalation-policy/composables/use-escalation-policy-api.ts b/apps/web/src/api-clients/alert-manager/escalation-policy/composables/use-escalation-policy-api.ts new file mode 100644 index 0000000000..7f361c35c2 --- /dev/null +++ b/apps/web/src/api-clients/alert-manager/escalation-policy/composables/use-escalation-policy-api.ts @@ -0,0 +1,24 @@ +import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; + +import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; +import type { EscalationPolicyCreateParameters } from '@/api-clients/alert-manager/escalation-policy/schema/api-verbs/create'; +import type { EscalationPolicyDeleteParameters } from '@/api-clients/alert-manager/escalation-policy/schema/api-verbs/delete'; +import type { EscalationPolicyGetParameters } from '@/api-clients/alert-manager/escalation-policy/schema/api-verbs/get'; +import type { EscalationPolicyListParameters } from '@/api-clients/alert-manager/escalation-policy/schema/api-verbs/list'; +import type { EscalationPolicyUpdateParameters } from '@/api-clients/alert-manager/escalation-policy/schema/api-verbs/update'; +import type { EscalationPolicyModel } from '@/api-clients/alert-manager/escalation-policy/schema/model'; + +export const useEscalationPolicyApi = () => { + const actions = { + create: SpaceConnector.clientV2.alertManager.escalationPolicy.create, + delete: SpaceConnector.clientV2.alertManager.escalationPolicy.delete, + get: SpaceConnector.clientV2.alertManager.escalationPolicy.get, + list: SpaceConnector.clientV2.alertManager.escalationPolicy.list>, + update: SpaceConnector.clientV2.alertManager.escalationPolicy.update, + }; + + return { + escalationPolicyAPI: actions, + }; +}; + diff --git a/apps/web/src/schema/alert-manager/escalation-policy/api-verbs/create.ts b/apps/web/src/api-clients/alert-manager/escalation-policy/schema/api-verbs/create.ts similarity index 86% rename from apps/web/src/schema/alert-manager/escalation-policy/api-verbs/create.ts rename to apps/web/src/api-clients/alert-manager/escalation-policy/schema/api-verbs/create.ts index d4ae69a1b3..6e985463db 100644 --- a/apps/web/src/schema/alert-manager/escalation-policy/api-verbs/create.ts +++ b/apps/web/src/api-clients/alert-manager/escalation-policy/schema/api-verbs/create.ts @@ -3,7 +3,7 @@ import type { EscalationPolicyFinishConditionType, EscalationPolicyRepeatType, EscalationPolicyRulesType, -} from '@/schema/alert-manager/escalation-policy/type'; +} from '@/api-clients/alert-manager/escalation-policy/schema/type'; export interface EscalationPolicyCreateParameters { name: string; diff --git a/apps/web/src/schema/alert-manager/escalation-policy/api-verbs/delete.ts b/apps/web/src/api-clients/alert-manager/escalation-policy/schema/api-verbs/delete.ts similarity index 100% rename from apps/web/src/schema/alert-manager/escalation-policy/api-verbs/delete.ts rename to apps/web/src/api-clients/alert-manager/escalation-policy/schema/api-verbs/delete.ts diff --git a/apps/web/src/schema/alert-manager/escalation-policy/api-verbs/get.ts b/apps/web/src/api-clients/alert-manager/escalation-policy/schema/api-verbs/get.ts similarity index 100% rename from apps/web/src/schema/alert-manager/escalation-policy/api-verbs/get.ts rename to apps/web/src/api-clients/alert-manager/escalation-policy/schema/api-verbs/get.ts diff --git a/apps/web/src/schema/alert-manager/escalation-policy/api-verbs/list.ts b/apps/web/src/api-clients/alert-manager/escalation-policy/schema/api-verbs/list.ts similarity index 70% rename from apps/web/src/schema/alert-manager/escalation-policy/api-verbs/list.ts rename to apps/web/src/api-clients/alert-manager/escalation-policy/schema/api-verbs/list.ts index 8cab61a71b..7dc1b6bf89 100644 --- a/apps/web/src/schema/alert-manager/escalation-policy/api-verbs/list.ts +++ b/apps/web/src/api-clients/alert-manager/escalation-policy/schema/api-verbs/list.ts @@ -1,6 +1,6 @@ import type { Query } from '@cloudforet/core-lib/space-connector/type'; -import type { EscalationPolicyFinishConditionType } from '@/schema/alert-manager/escalation-policy/type'; +import type { EscalationPolicyFinishConditionType } from '@/api-clients/alert-manager/escalation-policy/schema/type'; export interface EscalationPolicyListParameters { query?: Query; diff --git a/apps/web/src/schema/alert-manager/escalation-policy/api-verbs/update.ts b/apps/web/src/api-clients/alert-manager/escalation-policy/schema/api-verbs/update.ts similarity index 86% rename from apps/web/src/schema/alert-manager/escalation-policy/api-verbs/update.ts rename to apps/web/src/api-clients/alert-manager/escalation-policy/schema/api-verbs/update.ts index 933f30a875..68b8abd555 100644 --- a/apps/web/src/schema/alert-manager/escalation-policy/api-verbs/update.ts +++ b/apps/web/src/api-clients/alert-manager/escalation-policy/schema/api-verbs/update.ts @@ -3,7 +3,7 @@ import type { EscalationPolicyFinishConditionType, EscalationPolicyRepeatType, EscalationPolicyRulesType, -} from '@/schema/alert-manager/escalation-policy/type'; +} from '@/api-clients/alert-manager/escalation-policy/schema/type'; export interface EscalationPolicyUpdateParameters { escalation_policy_id: string; diff --git a/apps/web/src/schema/alert-manager/escalation-policy/constants.ts b/apps/web/src/api-clients/alert-manager/escalation-policy/schema/constants.ts similarity index 100% rename from apps/web/src/schema/alert-manager/escalation-policy/constants.ts rename to apps/web/src/api-clients/alert-manager/escalation-policy/schema/constants.ts diff --git a/apps/web/src/schema/alert-manager/escalation-policy/model.ts b/apps/web/src/api-clients/alert-manager/escalation-policy/schema/model.ts similarity index 89% rename from apps/web/src/schema/alert-manager/escalation-policy/model.ts rename to apps/web/src/api-clients/alert-manager/escalation-policy/schema/model.ts index 0293026271..eddce58ba8 100644 --- a/apps/web/src/schema/alert-manager/escalation-policy/model.ts +++ b/apps/web/src/api-clients/alert-manager/escalation-policy/schema/model.ts @@ -3,7 +3,7 @@ import type { EscalationPolicyFinishConditionType, EscalationPolicyRepeatType, EscalationPolicyRulesType, -} from '@/schema/alert-manager/escalation-policy/type'; +} from '@/api-clients/alert-manager/escalation-policy/schema/type'; export interface EscalationPolicyModel { escalation_policy_id: string; diff --git a/apps/web/src/schema/alert-manager/escalation-policy/type.ts b/apps/web/src/api-clients/alert-manager/escalation-policy/schema/type.ts similarity index 88% rename from apps/web/src/schema/alert-manager/escalation-policy/type.ts rename to apps/web/src/api-clients/alert-manager/escalation-policy/schema/type.ts index 8ea1fdb9cc..7ce746ea13 100644 --- a/apps/web/src/schema/alert-manager/escalation-policy/type.ts +++ b/apps/web/src/api-clients/alert-manager/escalation-policy/schema/type.ts @@ -1,7 +1,7 @@ import type { ESCALATION_POLICY_FINISH_CONDITION, ESCALATION_POLICY_STATE, -} from '@/schema/alert-manager/escalation-policy/constants'; +} from '@/api-clients/alert-manager/escalation-policy/schema/constants'; export type EscalationPolicyStateType = typeof ESCALATION_POLICY_STATE[keyof typeof ESCALATION_POLICY_STATE]; export type EscalationPolicyFinishConditionType = typeof ESCALATION_POLICY_FINISH_CONDITION[keyof typeof ESCALATION_POLICY_FINISH_CONDITION]; diff --git a/apps/web/src/api-clients/alert-manager/event-rule/composables/use-event-rule-api.ts b/apps/web/src/api-clients/alert-manager/event-rule/composables/use-event-rule-api.ts new file mode 100644 index 0000000000..aa054cadb8 --- /dev/null +++ b/apps/web/src/api-clients/alert-manager/event-rule/composables/use-event-rule-api.ts @@ -0,0 +1,26 @@ +import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; + +import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; +import type { EventRuleChangeOrderParameters } from '@/api-clients/alert-manager/event-rule/schema/api-verbs/change-order'; +import type { EventRuleCreateParameters } from '@/api-clients/alert-manager/event-rule/schema/api-verbs/create'; +import type { EventRuleDeleteParameters } from '@/api-clients/alert-manager/event-rule/schema/api-verbs/delete'; +import type { EventRuleGetParameters } from '@/api-clients/alert-manager/event-rule/schema/api-verbs/get'; +import type { EventRuleListParameters } from '@/api-clients/alert-manager/event-rule/schema/api-verbs/list'; +import type { EventRuleUpdateParameters } from '@/api-clients/alert-manager/event-rule/schema/api-verbs/update'; +import type { EventRuleModel } from '@/api-clients/alert-manager/event-rule/schema/model'; + +export const useEventRuleApi = () => { + const actions = { + changeOrder: SpaceConnector.clientV2.alertManager.eventRule.changeOrder, + create: SpaceConnector.clientV2.alertManager.eventRule.create, + delete: SpaceConnector.clientV2.alertManager.eventRule.delete, + get: SpaceConnector.clientV2.alertManager.eventRule.get, + list: SpaceConnector.clientV2.alertManager.eventRule.list>, + update: SpaceConnector.clientV2.alertManager.eventRule.update, + }; + + return { + eventRuleAPI: actions, + }; +}; + diff --git a/apps/web/src/schema/alert-manager/event-rule/api-verbs/change-order.ts b/apps/web/src/api-clients/alert-manager/event-rule/schema/api-verbs/change-order.ts similarity index 100% rename from apps/web/src/schema/alert-manager/event-rule/api-verbs/change-order.ts rename to apps/web/src/api-clients/alert-manager/event-rule/schema/api-verbs/change-order.ts diff --git a/apps/web/src/schema/alert-manager/event-rule/api-verbs/create.ts b/apps/web/src/api-clients/alert-manager/event-rule/schema/api-verbs/create.ts similarity index 89% rename from apps/web/src/schema/alert-manager/event-rule/api-verbs/create.ts rename to apps/web/src/api-clients/alert-manager/event-rule/schema/api-verbs/create.ts index ddda29c748..e0ec40ca8c 100644 --- a/apps/web/src/schema/alert-manager/event-rule/api-verbs/create.ts +++ b/apps/web/src/api-clients/alert-manager/event-rule/schema/api-verbs/create.ts @@ -4,7 +4,7 @@ import type { EventRuleConditionsPolicyType, EventRuleConditionsType, EventRuleOptions, EventRuleScopeType, -} from '@/schema/alert-manager/event-rule/type'; +} from '@/api-clients/alert-manager/event-rule/schema/type'; export interface EventRuleCreateParameters { name?: string; diff --git a/apps/web/src/schema/alert-manager/event-rule/api-verbs/delete.ts b/apps/web/src/api-clients/alert-manager/event-rule/schema/api-verbs/delete.ts similarity index 100% rename from apps/web/src/schema/alert-manager/event-rule/api-verbs/delete.ts rename to apps/web/src/api-clients/alert-manager/event-rule/schema/api-verbs/delete.ts diff --git a/apps/web/src/schema/alert-manager/event-rule/api-verbs/get.ts b/apps/web/src/api-clients/alert-manager/event-rule/schema/api-verbs/get.ts similarity index 100% rename from apps/web/src/schema/alert-manager/event-rule/api-verbs/get.ts rename to apps/web/src/api-clients/alert-manager/event-rule/schema/api-verbs/get.ts diff --git a/apps/web/src/schema/alert-manager/event-rule/api-verbs/list.ts b/apps/web/src/api-clients/alert-manager/event-rule/schema/api-verbs/list.ts similarity index 100% rename from apps/web/src/schema/alert-manager/event-rule/api-verbs/list.ts rename to apps/web/src/api-clients/alert-manager/event-rule/schema/api-verbs/list.ts diff --git a/apps/web/src/schema/alert-manager/event-rule/api-verbs/update.ts b/apps/web/src/api-clients/alert-manager/event-rule/schema/api-verbs/update.ts similarity index 88% rename from apps/web/src/schema/alert-manager/event-rule/api-verbs/update.ts rename to apps/web/src/api-clients/alert-manager/event-rule/schema/api-verbs/update.ts index dbe47c84e1..23b6fe77e5 100644 --- a/apps/web/src/schema/alert-manager/event-rule/api-verbs/update.ts +++ b/apps/web/src/api-clients/alert-manager/event-rule/schema/api-verbs/update.ts @@ -3,7 +3,7 @@ import type { EventRuleActionsType, EventRuleConditionsPolicyType, EventRuleConditionsType, EventRuleOptions, -} from '@/schema/alert-manager/event-rule/type'; +} from '@/api-clients/alert-manager/event-rule/schema/type'; export interface EventRuleUpdateParameters { event_rule_id: string; diff --git a/apps/web/src/schema/alert-manager/event-rule/constant.ts b/apps/web/src/api-clients/alert-manager/event-rule/schema/constants.ts similarity index 100% rename from apps/web/src/schema/alert-manager/event-rule/constant.ts rename to apps/web/src/api-clients/alert-manager/event-rule/schema/constants.ts diff --git a/apps/web/src/schema/alert-manager/event-rule/model.ts b/apps/web/src/api-clients/alert-manager/event-rule/schema/model.ts similarity index 91% rename from apps/web/src/schema/alert-manager/event-rule/model.ts rename to apps/web/src/api-clients/alert-manager/event-rule/schema/model.ts index 539eef9b03..60d08f2016 100644 --- a/apps/web/src/schema/alert-manager/event-rule/model.ts +++ b/apps/web/src/api-clients/alert-manager/event-rule/schema/model.ts @@ -5,7 +5,7 @@ import type { EventRuleConditionsType, EventRuleOptions, EventRuleScopeType, -} from '@/schema/alert-manager/event-rule/type'; +} from '@/api-clients/alert-manager/event-rule/schema/type'; export interface EventRuleModel { event_rule_id: string; diff --git a/apps/web/src/schema/alert-manager/event-rule/type.ts b/apps/web/src/api-clients/alert-manager/event-rule/schema/type.ts similarity index 89% rename from apps/web/src/schema/alert-manager/event-rule/type.ts rename to apps/web/src/api-clients/alert-manager/event-rule/schema/type.ts index 52004cdf13..3f7e7ba828 100644 --- a/apps/web/src/schema/alert-manager/event-rule/type.ts +++ b/apps/web/src/api-clients/alert-manager/event-rule/schema/type.ts @@ -1,5 +1,5 @@ -import type { AlertStatusType } from '@/schema/alert-manager/alert/type'; -import type { EVENT_RULE_CONDITIONS_POLICY, EVENT_RULE_URGENCY, EVENT_RULE_SCOPE } from '@/schema/alert-manager/event-rule/constant'; +import type { AlertStatusType } from '@/api-clients/alert-manager/alert/schema/type'; +import type { EVENT_RULE_CONDITIONS_POLICY, EVENT_RULE_URGENCY, EVENT_RULE_SCOPE } from '@/api-clients/alert-manager/event-rule/schema/constants'; export type EventRuleConditionsPolicyType = typeof EVENT_RULE_CONDITIONS_POLICY[keyof typeof EVENT_RULE_CONDITIONS_POLICY]; export type EventRuleUrgencyType = typeof EVENT_RULE_URGENCY[keyof typeof EVENT_RULE_URGENCY]; diff --git a/apps/web/src/api-clients/alert-manager/event/composables/use-event-api.ts b/apps/web/src/api-clients/alert-manager/event/composables/use-event-api.ts new file mode 100644 index 0000000000..5cc0d196b3 --- /dev/null +++ b/apps/web/src/api-clients/alert-manager/event/composables/use-event-api.ts @@ -0,0 +1,15 @@ +import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; + +import type { EventCreateParameters } from '@/api-clients/alert-manager/event/schema/api-verbs/create'; +import type { EventModel } from '@/api-clients/alert-manager/event/schema/model'; + +export const useEventApi = () => { + const actions = { + create: SpaceConnector.clientV2.alertManager.event.create, + }; + + return { + eventAPI: actions, + }; +}; + diff --git a/apps/web/src/schema/alert-manager/event/api-verbs/create.ts b/apps/web/src/api-clients/alert-manager/event/schema/api-verbs/create.ts similarity index 100% rename from apps/web/src/schema/alert-manager/event/api-verbs/create.ts rename to apps/web/src/api-clients/alert-manager/event/schema/api-verbs/create.ts diff --git a/apps/web/src/schema/alert-manager/event/constants.ts b/apps/web/src/api-clients/alert-manager/event/schema/constants.ts similarity index 100% rename from apps/web/src/schema/alert-manager/event/constants.ts rename to apps/web/src/api-clients/alert-manager/event/schema/constants.ts diff --git a/apps/web/src/schema/alert-manager/event/model.ts b/apps/web/src/api-clients/alert-manager/event/schema/model.ts similarity index 84% rename from apps/web/src/schema/alert-manager/event/model.ts rename to apps/web/src/api-clients/alert-manager/event/schema/model.ts index b41a6f0e6f..2a6b9c56aa 100644 --- a/apps/web/src/schema/alert-manager/event/model.ts +++ b/apps/web/src/api-clients/alert-manager/event/schema/model.ts @@ -1,4 +1,4 @@ -import type { EventSeverityType, EventType } from '@/schema/alert-manager/event/type'; +import type { EventSeverityType, EventType } from '@/api-clients/alert-manager/event/schema/type'; export interface EventModel { event_id: string; diff --git a/apps/web/src/schema/alert-manager/event/type.ts b/apps/web/src/api-clients/alert-manager/event/schema/type.ts similarity index 60% rename from apps/web/src/schema/alert-manager/event/type.ts rename to apps/web/src/api-clients/alert-manager/event/schema/type.ts index a33245a307..e2ab56d74e 100644 --- a/apps/web/src/schema/alert-manager/event/type.ts +++ b/apps/web/src/api-clients/alert-manager/event/schema/type.ts @@ -1,4 +1,4 @@ -import type { EVENT_SEVERITY, EVENT_TYPE } from '@/schema/alert-manager/event/constants'; +import type { EVENT_SEVERITY, EVENT_TYPE } from '@/api-clients/alert-manager/event/schema/constants'; export type EventSeverityType = typeof EVENT_SEVERITY[keyof typeof EVENT_SEVERITY]; export type EventType = typeof EVENT_TYPE[keyof typeof EVENT_TYPE]; diff --git a/apps/web/src/api-clients/alert-manager/note/composables/use-note-api.ts b/apps/web/src/api-clients/alert-manager/note/composables/use-note-api.ts new file mode 100644 index 0000000000..ed09f3c827 --- /dev/null +++ b/apps/web/src/api-clients/alert-manager/note/composables/use-note-api.ts @@ -0,0 +1,24 @@ +import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; + +import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; +import type { NoteCreateParameters } from '@/api-clients/alert-manager/note/schema/api-verbs/create'; +import type { NoteDeleteParameters } from '@/api-clients/alert-manager/note/schema/api-verbs/delete'; +import type { NoteGetParameters } from '@/api-clients/alert-manager/note/schema/api-verbs/get'; +import type { NoteListParameters } from '@/api-clients/alert-manager/note/schema/api-verbs/list'; +import type { NoteUpdateParameters } from '@/api-clients/alert-manager/note/schema/api-verbs/update'; +import type { NoteModel } from '@/api-clients/alert-manager/note/schema/model'; + +export const useNoteApi = () => { + const actions = { + create: SpaceConnector.clientV2.alertManager.note.create, + delete: SpaceConnector.clientV2.alertManager.note.delete, + get: SpaceConnector.clientV2.alertManager.note.get, + list: SpaceConnector.clientV2.alertManager.note.list>, + update: SpaceConnector.clientV2.alertManager.note.update, + }; + + return { + noteAPI: actions, + }; +}; + diff --git a/apps/web/src/schema/alert-manager/note/api-verbs/create.ts b/apps/web/src/api-clients/alert-manager/note/schema/api-verbs/create.ts similarity index 100% rename from apps/web/src/schema/alert-manager/note/api-verbs/create.ts rename to apps/web/src/api-clients/alert-manager/note/schema/api-verbs/create.ts diff --git a/apps/web/src/schema/alert-manager/note/api-verbs/delete.ts b/apps/web/src/api-clients/alert-manager/note/schema/api-verbs/delete.ts similarity index 100% rename from apps/web/src/schema/alert-manager/note/api-verbs/delete.ts rename to apps/web/src/api-clients/alert-manager/note/schema/api-verbs/delete.ts diff --git a/apps/web/src/schema/alert-manager/note/api-verbs/get.ts b/apps/web/src/api-clients/alert-manager/note/schema/api-verbs/get.ts similarity index 100% rename from apps/web/src/schema/alert-manager/note/api-verbs/get.ts rename to apps/web/src/api-clients/alert-manager/note/schema/api-verbs/get.ts diff --git a/apps/web/src/schema/alert-manager/note/api-verbs/list.ts b/apps/web/src/api-clients/alert-manager/note/schema/api-verbs/list.ts similarity index 100% rename from apps/web/src/schema/alert-manager/note/api-verbs/list.ts rename to apps/web/src/api-clients/alert-manager/note/schema/api-verbs/list.ts diff --git a/apps/web/src/schema/alert-manager/note/api-verbs/update.ts b/apps/web/src/api-clients/alert-manager/note/schema/api-verbs/update.ts similarity index 100% rename from apps/web/src/schema/alert-manager/note/api-verbs/update.ts rename to apps/web/src/api-clients/alert-manager/note/schema/api-verbs/update.ts diff --git a/apps/web/src/schema/alert-manager/note/model.ts b/apps/web/src/api-clients/alert-manager/note/schema/model.ts similarity index 100% rename from apps/web/src/schema/alert-manager/note/model.ts rename to apps/web/src/api-clients/alert-manager/note/schema/model.ts diff --git a/apps/web/src/api-clients/alert-manager/notification-protocol/composables/use-notification-protocol-api.ts b/apps/web/src/api-clients/alert-manager/notification-protocol/composables/use-notification-protocol-api.ts new file mode 100644 index 0000000000..cbff5e8e06 --- /dev/null +++ b/apps/web/src/api-clients/alert-manager/notification-protocol/composables/use-notification-protocol-api.ts @@ -0,0 +1,32 @@ +import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; + +import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; +import type { NotificationProtocolCreateParameters } from '@/api-clients/alert-manager/notification-protocol/schema/api-verbs/create'; +import type { NotificationProtocolDeleteParameters } from '@/api-clients/alert-manager/notification-protocol/schema/api-verbs/delete'; +import type { NotificationProtocolDisableParameters } from '@/api-clients/alert-manager/notification-protocol/schema/api-verbs/disable'; +import type { NotificationProtocolEnableParameters } from '@/api-clients/alert-manager/notification-protocol/schema/api-verbs/enable'; +import type { NotificationProtocolGetParameters } from '@/api-clients/alert-manager/notification-protocol/schema/api-verbs/get'; +import type { NotificationProtocolListParameters } from '@/api-clients/alert-manager/notification-protocol/schema/api-verbs/list'; +import type { NotificationProtocolUpdateParameters } from '@/api-clients/alert-manager/notification-protocol/schema/api-verbs/update'; +import type { NotificationProtocolUpdatePluginParameters } from '@/api-clients/alert-manager/notification-protocol/schema/api-verbs/update-plugin'; +import type { NotificationProtocolVerifyPluginParameters } from '@/api-clients/alert-manager/notification-protocol/schema/api-verbs/verify-plugin'; +import type { NotificationProtocolModel } from '@/api-clients/alert-manager/notification-protocol/schema/model'; + +export const useNotificationProtocolApi = () => { + const actions = { + create: SpaceConnector.clientV2.alertManager.notificationProtocol.create, + delete: SpaceConnector.clientV2.alertManager.notificationProtocol.delete, + disable: SpaceConnector.clientV2.alertManager.notificationProtocol.disable, + enable: SpaceConnector.clientV2.alertManager.notificationProtocol.enable, + get: SpaceConnector.clientV2.alertManager.notificationProtocol.get, + list: SpaceConnector.clientV2.alertManager.notificationProtocol.list>, + updatePlugin: SpaceConnector.clientV2.alertManager.notificationProtocol.updatePlugin, + update: SpaceConnector.clientV2.alertManager.notificationProtocol.update, + verifyPlugin: SpaceConnector.clientV2.alertManager.notificationProtocol.verifyPlugin, + }; + + return { + notificationProtocolAPI: actions, + }; +}; + diff --git a/apps/web/src/schema/alert-manager/notification-protocol/api-verbs/create.ts b/apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/create.ts similarity index 81% rename from apps/web/src/schema/alert-manager/notification-protocol/api-verbs/create.ts rename to apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/create.ts index 260e2f04eb..5177becb1e 100644 --- a/apps/web/src/schema/alert-manager/notification-protocol/api-verbs/create.ts +++ b/apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/create.ts @@ -1,6 +1,5 @@ import type { Tags } from '@/api-clients/_common/schema/model'; -import type { NotificationProtocolPluginInfoRequestType } from '@/schema/alert-manager/notification-protocol/type'; - +import type { NotificationProtocolPluginInfoRequestType } from '@/api-clients/alert-manager/notification-protocol/schema/type'; export interface NotificationProtocolCreateParameters { name: string; diff --git a/apps/web/src/schema/alert-manager/notification-protocol/api-verbs/delete.ts b/apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/delete.ts similarity index 100% rename from apps/web/src/schema/alert-manager/notification-protocol/api-verbs/delete.ts rename to apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/delete.ts diff --git a/apps/web/src/schema/alert-manager/notification-protocol/api-verbs/disable.ts b/apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/disable.ts similarity index 100% rename from apps/web/src/schema/alert-manager/notification-protocol/api-verbs/disable.ts rename to apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/disable.ts diff --git a/apps/web/src/schema/alert-manager/notification-protocol/api-verbs/enable.ts b/apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/enable.ts similarity index 100% rename from apps/web/src/schema/alert-manager/notification-protocol/api-verbs/enable.ts rename to apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/enable.ts diff --git a/apps/web/src/schema/alert-manager/notification-protocol/api-verbs/get.ts b/apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/get.ts similarity index 100% rename from apps/web/src/schema/alert-manager/notification-protocol/api-verbs/get.ts rename to apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/get.ts diff --git a/apps/web/src/schema/alert-manager/notification-protocol/api-verbs/list.ts b/apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/list.ts similarity index 67% rename from apps/web/src/schema/alert-manager/notification-protocol/api-verbs/list.ts rename to apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/list.ts index 173a7aa9fc..d6b3abc1a2 100644 --- a/apps/web/src/schema/alert-manager/notification-protocol/api-verbs/list.ts +++ b/apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/list.ts @@ -1,6 +1,6 @@ import type { Query } from '@cloudforet/core-lib/space-connector/type'; -import type { NotificationProtocolStateType } from '@/schema/alert-manager/notification-protocol/type'; +import type { NotificationProtocolStateType } from '@/api-clients/alert-manager/notification-protocol/schema/type'; export interface NotificationProtocolListParameters { query?: Query; diff --git a/apps/web/src/schema/alert-manager/notification-protocol/api-verbs/update-plugin.ts b/apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/update-plugin.ts similarity index 81% rename from apps/web/src/schema/alert-manager/notification-protocol/api-verbs/update-plugin.ts rename to apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/update-plugin.ts index 422a7f6d71..a0ebf66977 100644 --- a/apps/web/src/schema/alert-manager/notification-protocol/api-verbs/update-plugin.ts +++ b/apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/update-plugin.ts @@ -1,4 +1,4 @@ -import type { NotificationProtocolPluginUpgradeModeType } from '@/schema/alert-manager/notification-protocol/type'; +import type { NotificationProtocolPluginUpgradeModeType } from '@/api-clients/alert-manager/notification-protocol/schema/type'; export interface NotificationProtocolUpdatePluginParameters { protocol_id: string; diff --git a/apps/web/src/schema/alert-manager/notification-protocol/api-verbs/update.ts b/apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/update.ts similarity index 100% rename from apps/web/src/schema/alert-manager/notification-protocol/api-verbs/update.ts rename to apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/update.ts diff --git a/apps/web/src/schema/alert-manager/notification-protocol/api-verbs/verify-plugin.ts b/apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/verify-plugin.ts similarity index 100% rename from apps/web/src/schema/alert-manager/notification-protocol/api-verbs/verify-plugin.ts rename to apps/web/src/api-clients/alert-manager/notification-protocol/schema/api-verbs/verify-plugin.ts diff --git a/apps/web/src/schema/alert-manager/notification-protocol/constants.ts b/apps/web/src/api-clients/alert-manager/notification-protocol/schema/constants.ts similarity index 100% rename from apps/web/src/schema/alert-manager/notification-protocol/constants.ts rename to apps/web/src/api-clients/alert-manager/notification-protocol/schema/constants.ts diff --git a/apps/web/src/schema/alert-manager/notification-protocol/model.ts b/apps/web/src/api-clients/alert-manager/notification-protocol/schema/model.ts similarity index 86% rename from apps/web/src/schema/alert-manager/notification-protocol/model.ts rename to apps/web/src/api-clients/alert-manager/notification-protocol/schema/model.ts index 09858280e6..4d8e4e4fbe 100644 --- a/apps/web/src/schema/alert-manager/notification-protocol/model.ts +++ b/apps/web/src/api-clients/alert-manager/notification-protocol/schema/model.ts @@ -4,7 +4,7 @@ import type { Tags } from '@/api-clients/_common/schema/model'; import type { NotificationProtocolPluginInfoType, NotificationProtocolStateType, -} from '@/schema/alert-manager/notification-protocol/type'; +} from '@/api-clients/alert-manager/notification-protocol/schema/type'; export interface NotificationProtocolModel { protocol_id: string; diff --git a/apps/web/src/schema/alert-manager/notification-protocol/type.ts b/apps/web/src/api-clients/alert-manager/notification-protocol/schema/type.ts similarity index 92% rename from apps/web/src/schema/alert-manager/notification-protocol/type.ts rename to apps/web/src/api-clients/alert-manager/notification-protocol/schema/type.ts index 093b9d778d..4ac5864484 100644 --- a/apps/web/src/schema/alert-manager/notification-protocol/type.ts +++ b/apps/web/src/api-clients/alert-manager/notification-protocol/schema/type.ts @@ -1,6 +1,6 @@ import type { JsonSchema } from '@cloudforet/mirinae/types/controls/forms/json-schema-form/type'; -import type { NOTIFICATION_PROTOCOL_STATE, NOTIFICATION_PROTOCOL_PLUGIN_UPGRADE_MODE } from '@/schema/alert-manager/notification-protocol/constants'; +import type { NOTIFICATION_PROTOCOL_STATE, NOTIFICATION_PROTOCOL_PLUGIN_UPGRADE_MODE } from '@/api-clients/alert-manager/notification-protocol/schema/constants'; export type NotificationProtocolStateType = typeof NOTIFICATION_PROTOCOL_STATE[keyof typeof NOTIFICATION_PROTOCOL_STATE]; diff --git a/apps/web/src/api-clients/alert-manager/service-channel/composables/use-service-channel-api.ts b/apps/web/src/api-clients/alert-manager/service-channel/composables/use-service-channel-api.ts new file mode 100644 index 0000000000..f25d52ec78 --- /dev/null +++ b/apps/web/src/api-clients/alert-manager/service-channel/composables/use-service-channel-api.ts @@ -0,0 +1,30 @@ +import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; + +import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; +import type { ServiceChannelCreateParameters } from '@/api-clients/alert-manager/service-channel/schema/api-verbs/create'; +import type { ServiceChannelCreateForwardChannelParameters } from '@/api-clients/alert-manager/service-channel/schema/api-verbs/create-forward-channel'; +import type { ServiceChannelDeleteParameters } from '@/api-clients/alert-manager/service-channel/schema/api-verbs/delete'; +import type { ServiceChannelDisableParameters } from '@/api-clients/alert-manager/service-channel/schema/api-verbs/disable'; +import type { ServiceChannelEnableParameters } from '@/api-clients/alert-manager/service-channel/schema/api-verbs/enable'; +import type { ServiceChannelGetParameters } from '@/api-clients/alert-manager/service-channel/schema/api-verbs/get'; +import type { ServiceChannelListParameters } from '@/api-clients/alert-manager/service-channel/schema/api-verbs/list'; +import type { ServiceChannelUpdateParameters } from '@/api-clients/alert-manager/service-channel/schema/api-verbs/update'; +import type { ServiceChannelModel } from '@/api-clients/alert-manager/service-channel/schema/model'; + +export const useServiceChannelApi = () => { + const actions = { + createForwardChannel: SpaceConnector.clientV2.alertManager.serviceChannel.createForwardChannel, + create: SpaceConnector.clientV2.alertManager.serviceChannel.create, + delete: SpaceConnector.clientV2.alertManager.serviceChannel.delete, + disable: SpaceConnector.clientV2.alertManager.serviceChannel.disable, + enable: SpaceConnector.clientV2.alertManager.serviceChannel.enable, + get: SpaceConnector.clientV2.alertManager.serviceChannel.get, + list: SpaceConnector.clientV2.alertManager.serviceChannel.list>, + update: SpaceConnector.clientV2.alertManager.serviceChannel.update, + }; + + return { + serviceChannelAPI: actions, + }; +}; + diff --git a/apps/web/src/schema/alert-manager/service-channel/api-verbs/create-forward-channel.ts b/apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/create-forward-channel.ts similarity index 82% rename from apps/web/src/schema/alert-manager/service-channel/api-verbs/create-forward-channel.ts rename to apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/create-forward-channel.ts index 9cc120c911..ec8613bb5c 100644 --- a/apps/web/src/schema/alert-manager/service-channel/api-verbs/create-forward-channel.ts +++ b/apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/create-forward-channel.ts @@ -1,5 +1,5 @@ import type { Tags } from '@/api-clients/_common/schema/model'; -import type { ServiceChannelDataType, ServiceChannelScheduleInfoType } from '@/schema/alert-manager/service-channel/type'; +import type { ServiceChannelDataType, ServiceChannelScheduleInfoType } from '@/api-clients/alert-manager/service-channel/schema/type'; export interface ServiceChannelCreateForwardChannelParameters { name: string; diff --git a/apps/web/src/schema/alert-manager/service-channel/api-verbs/create.ts b/apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/create.ts similarity index 83% rename from apps/web/src/schema/alert-manager/service-channel/api-verbs/create.ts rename to apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/create.ts index 7a9cb76cdc..37e9b0d926 100644 --- a/apps/web/src/schema/alert-manager/service-channel/api-verbs/create.ts +++ b/apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/create.ts @@ -1,5 +1,5 @@ import type { Tags } from '@/api-clients/_common/schema/model'; -import type { ServiceChannelDataType, ServiceChannelScheduleInfoType } from '@/schema/alert-manager/service-channel/type'; +import type { ServiceChannelDataType, ServiceChannelScheduleInfoType } from '@/api-clients/alert-manager/service-channel/schema/type'; export interface ServiceChannelCreateParameters { protocol_id: string; diff --git a/apps/web/src/schema/alert-manager/service-channel/api-verbs/delete.ts b/apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/delete.ts similarity index 100% rename from apps/web/src/schema/alert-manager/service-channel/api-verbs/delete.ts rename to apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/delete.ts diff --git a/apps/web/src/schema/alert-manager/service-channel/api-verbs/disable.ts b/apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/disable.ts similarity index 100% rename from apps/web/src/schema/alert-manager/service-channel/api-verbs/disable.ts rename to apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/disable.ts diff --git a/apps/web/src/schema/alert-manager/service-channel/api-verbs/enable.ts b/apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/enable.ts similarity index 100% rename from apps/web/src/schema/alert-manager/service-channel/api-verbs/enable.ts rename to apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/enable.ts diff --git a/apps/web/src/schema/alert-manager/service-channel/api-verbs/get.ts b/apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/get.ts similarity index 100% rename from apps/web/src/schema/alert-manager/service-channel/api-verbs/get.ts rename to apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/get.ts diff --git a/apps/web/src/schema/alert-manager/service-channel/api-verbs/list.ts b/apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/list.ts similarity index 86% rename from apps/web/src/schema/alert-manager/service-channel/api-verbs/list.ts rename to apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/list.ts index c7283b3582..fe2f8b25ce 100644 --- a/apps/web/src/schema/alert-manager/service-channel/api-verbs/list.ts +++ b/apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/list.ts @@ -3,7 +3,7 @@ import type { Query } from '@cloudforet/core-lib/space-connector/type'; import type { ServiceChannelStateType, ServiceChannelType, -} from '@/schema/alert-manager/service-channel/type'; +} from '@/api-clients/alert-manager/service-channel/schema/type'; export interface ServiceChannelListParameters { query?: Query; diff --git a/apps/web/src/schema/alert-manager/service-channel/api-verbs/update.ts b/apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/update.ts similarity index 81% rename from apps/web/src/schema/alert-manager/service-channel/api-verbs/update.ts rename to apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/update.ts index 51dc4c2801..68221986b6 100644 --- a/apps/web/src/schema/alert-manager/service-channel/api-verbs/update.ts +++ b/apps/web/src/api-clients/alert-manager/service-channel/schema/api-verbs/update.ts @@ -1,5 +1,5 @@ import type { Tags } from '@/api-clients/_common/schema/model'; -import type { ServiceChannelDataType, ServiceChannelScheduleInfoType } from '@/schema/alert-manager/service-channel/type'; +import type { ServiceChannelDataType, ServiceChannelScheduleInfoType } from '@/api-clients/alert-manager/service-channel/schema/type'; export interface ServiceChannelUpdateParameters { channel_id: string; diff --git a/apps/web/src/schema/alert-manager/service-channel/constants.ts b/apps/web/src/api-clients/alert-manager/service-channel/schema/constants.ts similarity index 100% rename from apps/web/src/schema/alert-manager/service-channel/constants.ts rename to apps/web/src/api-clients/alert-manager/service-channel/schema/constants.ts diff --git a/apps/web/src/schema/alert-manager/service-channel/model.ts b/apps/web/src/api-clients/alert-manager/service-channel/schema/model.ts similarity index 80% rename from apps/web/src/schema/alert-manager/service-channel/model.ts rename to apps/web/src/api-clients/alert-manager/service-channel/schema/model.ts index 0d8bea6974..0b1f852dfe 100644 --- a/apps/web/src/schema/alert-manager/service-channel/model.ts +++ b/apps/web/src/api-clients/alert-manager/service-channel/schema/model.ts @@ -1,9 +1,10 @@ import type { Tags } from '@/api-clients/_common/schema/model'; import type { ServiceChannelDataType, + ServiceChannelScheduleInfoType, ServiceChannelStateType, - ServiceChannelType, ServiceChannelScheduleInfoType, -} from '@/schema/alert-manager/service-channel/type'; + ServiceChannelType, +} from '@/api-clients/alert-manager/service-channel/schema/type'; export interface ServiceChannelModel { channel_id: string; diff --git a/apps/web/src/schema/alert-manager/service-channel/type.ts b/apps/web/src/api-clients/alert-manager/service-channel/schema/type.ts similarity index 94% rename from apps/web/src/schema/alert-manager/service-channel/type.ts rename to apps/web/src/api-clients/alert-manager/service-channel/schema/type.ts index b349dd71f4..96809817e4 100644 --- a/apps/web/src/schema/alert-manager/service-channel/type.ts +++ b/apps/web/src/api-clients/alert-manager/service-channel/schema/type.ts @@ -3,7 +3,7 @@ import type { SERVICE_CHANNEL_STATE, SERVICE_CHANNEL_TYPE, SERVICE_CHANNEL_SCHEDULE_TYPE, -} from '@/schema/alert-manager/service-channel/constants'; +} from '@/api-clients/alert-manager/service-channel/schema/constants'; export type ServiceChannelStateType = typeof SERVICE_CHANNEL_STATE[keyof typeof SERVICE_CHANNEL_STATE]; export type ServiceChannelType = typeof SERVICE_CHANNEL_TYPE[keyof typeof SERVICE_CHANNEL_TYPE]; diff --git a/apps/web/src/api-clients/alert-manager/service/composables/use-service-api.ts b/apps/web/src/api-clients/alert-manager/service/composables/use-service-api.ts new file mode 100644 index 0000000000..f1006031cb --- /dev/null +++ b/apps/web/src/api-clients/alert-manager/service/composables/use-service-api.ts @@ -0,0 +1,26 @@ +import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; + +import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; +import type { ServiceChangeMembersParameters } from '@/api-clients/alert-manager/service/schema/api-verbs/change-members'; +import type { ServiceCreateParameters } from '@/api-clients/alert-manager/service/schema/api-verbs/create'; +import type { ServiceDeleteParameters } from '@/api-clients/alert-manager/service/schema/api-verbs/delete'; +import type { ServiceGetParameters } from '@/api-clients/alert-manager/service/schema/api-verbs/get'; +import type { ServiceListParameters } from '@/api-clients/alert-manager/service/schema/api-verbs/list'; +import type { ServiceUpdateParameters } from '@/api-clients/alert-manager/service/schema/api-verbs/update'; +import type { ServiceModel } from '@/api-clients/alert-manager/service/schema/model'; + +export const useServiceApi = () => { + const actions = { + changeMembers: SpaceConnector.clientV2.alertManager.service.changeMembers, + create: SpaceConnector.clientV2.alertManager.service.create, + delete: SpaceConnector.clientV2.alertManager.service.delete, + get: SpaceConnector.clientV2.alertManager.service.get, + list: SpaceConnector.clientV2.alertManager.service.list>, + update: SpaceConnector.clientV2.alertManager.service.update, + }; + + return { + serviceAPI: actions, + }; +}; + diff --git a/apps/web/src/schema/alert-manager/service/api-verbs/chagne-members.ts b/apps/web/src/api-clients/alert-manager/service/schema/api-verbs/change-members.ts similarity index 59% rename from apps/web/src/schema/alert-manager/service/api-verbs/chagne-members.ts rename to apps/web/src/api-clients/alert-manager/service/schema/api-verbs/change-members.ts index ebdd311bd8..9c6eb4dc90 100644 --- a/apps/web/src/schema/alert-manager/service/api-verbs/chagne-members.ts +++ b/apps/web/src/api-clients/alert-manager/service/schema/api-verbs/change-members.ts @@ -1,4 +1,4 @@ -import type { MembersType } from '@/schema/alert-manager/service/type'; +import type { MembersType } from '@/api-clients/alert-manager/service/schema/type'; export interface ServiceChangeMembersParameters { service_id: string; diff --git a/apps/web/src/schema/alert-manager/service/api-verbs/create.ts b/apps/web/src/api-clients/alert-manager/service/schema/api-verbs/create.ts similarity index 72% rename from apps/web/src/schema/alert-manager/service/api-verbs/create.ts rename to apps/web/src/api-clients/alert-manager/service/schema/api-verbs/create.ts index 21a95bb002..7710aa8519 100644 --- a/apps/web/src/schema/alert-manager/service/api-verbs/create.ts +++ b/apps/web/src/api-clients/alert-manager/service/schema/api-verbs/create.ts @@ -1,5 +1,5 @@ import type { Tags } from '@/api-clients/_common/schema/model'; -import type { MembersType, ServiceOptionsType } from '@/schema/alert-manager/service/type'; +import type { MembersType, ServiceOptionsType } from '@/api-clients/alert-manager/service/schema/type'; export interface ServiceCreateParameters { name: string; diff --git a/apps/web/src/schema/alert-manager/service/api-verbs/delete.ts b/apps/web/src/api-clients/alert-manager/service/schema/api-verbs/delete.ts similarity index 100% rename from apps/web/src/schema/alert-manager/service/api-verbs/delete.ts rename to apps/web/src/api-clients/alert-manager/service/schema/api-verbs/delete.ts diff --git a/apps/web/src/schema/alert-manager/service/api-verbs/get.ts b/apps/web/src/api-clients/alert-manager/service/schema/api-verbs/get.ts similarity index 100% rename from apps/web/src/schema/alert-manager/service/api-verbs/get.ts rename to apps/web/src/api-clients/alert-manager/service/schema/api-verbs/get.ts diff --git a/apps/web/src/schema/alert-manager/service/api-verbs/list.ts b/apps/web/src/api-clients/alert-manager/service/schema/api-verbs/list.ts similarity index 100% rename from apps/web/src/schema/alert-manager/service/api-verbs/list.ts rename to apps/web/src/api-clients/alert-manager/service/schema/api-verbs/list.ts diff --git a/apps/web/src/schema/alert-manager/service/api-verbs/update.ts b/apps/web/src/api-clients/alert-manager/service/schema/api-verbs/update.ts similarity index 74% rename from apps/web/src/schema/alert-manager/service/api-verbs/update.ts rename to apps/web/src/api-clients/alert-manager/service/schema/api-verbs/update.ts index bcfb7b6917..77486e249b 100644 --- a/apps/web/src/schema/alert-manager/service/api-verbs/update.ts +++ b/apps/web/src/api-clients/alert-manager/service/schema/api-verbs/update.ts @@ -1,5 +1,5 @@ import type { Tags } from '@/api-clients/_common/schema/model'; -import type { ServiceOptionsType } from '@/schema/alert-manager/service/type'; +import type { ServiceOptionsType } from '@/api-clients/alert-manager/service/schema/type'; export interface ServiceUpdateParameters { service_id: string; diff --git a/apps/web/src/schema/alert-manager/service/constants.ts b/apps/web/src/api-clients/alert-manager/service/schema/constants.ts similarity index 100% rename from apps/web/src/schema/alert-manager/service/constants.ts rename to apps/web/src/api-clients/alert-manager/service/schema/constants.ts diff --git a/apps/web/src/schema/alert-manager/service/model.ts b/apps/web/src/api-clients/alert-manager/service/schema/model.ts similarity index 91% rename from apps/web/src/schema/alert-manager/service/model.ts rename to apps/web/src/api-clients/alert-manager/service/schema/model.ts index bad20bc731..27c9ccca2c 100644 --- a/apps/web/src/schema/alert-manager/service/model.ts +++ b/apps/web/src/api-clients/alert-manager/service/schema/model.ts @@ -1,7 +1,7 @@ import type { Tags } from '@/api-clients/_common/schema/model'; import type { AlertsInfoType, AlertsType, HealthyType, MembersType, ServiceOptionsType, -} from '@/schema/alert-manager/service/type'; +} from '@/api-clients/alert-manager/service/schema/type'; export interface ServiceModel { service_id: string; diff --git a/apps/web/src/schema/alert-manager/service/type.ts b/apps/web/src/api-clients/alert-manager/service/schema/type.ts similarity index 92% rename from apps/web/src/schema/alert-manager/service/type.ts rename to apps/web/src/api-clients/alert-manager/service/schema/type.ts index 67cc5867ec..dec52b4ad4 100644 --- a/apps/web/src/schema/alert-manager/service/type.ts +++ b/apps/web/src/api-clients/alert-manager/service/schema/type.ts @@ -1,7 +1,7 @@ import type { NOTIFICATION_URGENCY, RECOVERY_MODE, MEMBERS_TYPE, SERVICE_ALERTS_TYPE, SERVICE_HEALTHY_TYPE, -} from '@/schema/alert-manager/service/constants'; +} from '@/api-clients/alert-manager/service/schema/constants'; export type NotificationUrgencyType = typeof NOTIFICATION_URGENCY[keyof typeof NOTIFICATION_URGENCY]; export type RecoveryModeType = typeof RECOVERY_MODE[keyof typeof RECOVERY_MODE]; diff --git a/apps/web/src/api-clients/alert-manager/user-channel/composables/use-user-channel-api.ts b/apps/web/src/api-clients/alert-manager/user-channel/composables/use-user-channel-api.ts new file mode 100644 index 0000000000..6da3118a1c --- /dev/null +++ b/apps/web/src/api-clients/alert-manager/user-channel/composables/use-user-channel-api.ts @@ -0,0 +1,28 @@ +import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; + +import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; +import type { UserChannelCreateParameters } from '@/api-clients/alert-manager/user-channel/schema/api-verbs/create'; +import type { UserChannelDeleteParameters } from '@/api-clients/alert-manager/user-channel/schema/api-verbs/delete'; +import type { UserChannelDisableParameters } from '@/api-clients/alert-manager/user-channel/schema/api-verbs/disable'; +import type { UserChannelEnableParameters } from '@/api-clients/alert-manager/user-channel/schema/api-verbs/enable'; +import type { UserChannelGetParameters } from '@/api-clients/alert-manager/user-channel/schema/api-verbs/get'; +import type { UserChannelListParameters } from '@/api-clients/alert-manager/user-channel/schema/api-verbs/list'; +import type { UserChannelUpdateParameters } from '@/api-clients/alert-manager/user-channel/schema/api-verbs/update'; +import type { UserChannelModel } from '@/api-clients/alert-manager/user-channel/schema/model'; + +export const useUserChannelApi = () => { + const actions = { + create: SpaceConnector.clientV2.alertManager.userChannel.create, + delete: SpaceConnector.clientV2.alertManager.userChannel.delete, + disable: SpaceConnector.clientV2.alertManager.userChannel.disable, + enable: SpaceConnector.clientV2.alertManager.userChannel.enable, + get: SpaceConnector.clientV2.alertManager.userChannel.get, + list: SpaceConnector.clientV2.alertManager.userChannel.list>, + update: SpaceConnector.clientV2.alertManager.userChannel.update, + }; + + return { + userChannelAPI: actions, + }; +}; + diff --git a/apps/web/src/schema/alert-manager/user-channel/api-verbs/create.ts b/apps/web/src/api-clients/alert-manager/user-channel/schema/api-verbs/create.ts similarity index 67% rename from apps/web/src/schema/alert-manager/user-channel/api-verbs/create.ts rename to apps/web/src/api-clients/alert-manager/user-channel/schema/api-verbs/create.ts index 1ba874cf52..9ffeb0383b 100644 --- a/apps/web/src/schema/alert-manager/user-channel/api-verbs/create.ts +++ b/apps/web/src/api-clients/alert-manager/user-channel/schema/api-verbs/create.ts @@ -1,5 +1,5 @@ import type { Tags } from '@/api-clients/_common/schema/model'; -import type { UserChannelScheduleInfoType } from '@/schema/alert-manager/user-channel/type'; +import type { UserChannelScheduleInfoType } from '@/api-clients/alert-manager/user-channel/schema/type'; export interface UserChannelCreateParameters { protocol_id: string; diff --git a/apps/web/src/schema/alert-manager/user-channel/api-verbs/delete.ts b/apps/web/src/api-clients/alert-manager/user-channel/schema/api-verbs/delete.ts similarity index 100% rename from apps/web/src/schema/alert-manager/user-channel/api-verbs/delete.ts rename to apps/web/src/api-clients/alert-manager/user-channel/schema/api-verbs/delete.ts diff --git a/apps/web/src/schema/alert-manager/user-channel/api-verbs/disable.ts b/apps/web/src/api-clients/alert-manager/user-channel/schema/api-verbs/disable.ts similarity index 100% rename from apps/web/src/schema/alert-manager/user-channel/api-verbs/disable.ts rename to apps/web/src/api-clients/alert-manager/user-channel/schema/api-verbs/disable.ts diff --git a/apps/web/src/schema/alert-manager/user-channel/api-verbs/enable.ts b/apps/web/src/api-clients/alert-manager/user-channel/schema/api-verbs/enable.ts similarity index 100% rename from apps/web/src/schema/alert-manager/user-channel/api-verbs/enable.ts rename to apps/web/src/api-clients/alert-manager/user-channel/schema/api-verbs/enable.ts diff --git a/apps/web/src/schema/alert-manager/user-channel/api-verbs/get.ts b/apps/web/src/api-clients/alert-manager/user-channel/schema/api-verbs/get.ts similarity index 100% rename from apps/web/src/schema/alert-manager/user-channel/api-verbs/get.ts rename to apps/web/src/api-clients/alert-manager/user-channel/schema/api-verbs/get.ts diff --git a/apps/web/src/schema/alert-manager/user-channel/api-verbs/list.ts b/apps/web/src/api-clients/alert-manager/user-channel/schema/api-verbs/list.ts similarity index 71% rename from apps/web/src/schema/alert-manager/user-channel/api-verbs/list.ts rename to apps/web/src/api-clients/alert-manager/user-channel/schema/api-verbs/list.ts index d746592400..6da2293dce 100644 --- a/apps/web/src/schema/alert-manager/user-channel/api-verbs/list.ts +++ b/apps/web/src/api-clients/alert-manager/user-channel/schema/api-verbs/list.ts @@ -1,6 +1,6 @@ import type { Query } from '@cloudforet/core-lib/space-connector/type'; -import type { UserChannelStateType } from '@/schema/alert-manager/user-channel/type'; +import type { UserChannelStateType } from '@/api-clients/alert-manager/user-channel/schema/type'; export interface UserChannelListParameters { query?: Query; diff --git a/apps/web/src/schema/alert-manager/user-channel/api-verbs/update.ts b/apps/web/src/api-clients/alert-manager/user-channel/schema/api-verbs/update.ts similarity index 70% rename from apps/web/src/schema/alert-manager/user-channel/api-verbs/update.ts rename to apps/web/src/api-clients/alert-manager/user-channel/schema/api-verbs/update.ts index b6a8cbe81c..2aeec64aa1 100644 --- a/apps/web/src/schema/alert-manager/user-channel/api-verbs/update.ts +++ b/apps/web/src/api-clients/alert-manager/user-channel/schema/api-verbs/update.ts @@ -1,5 +1,5 @@ import type { Tags } from '@/api-clients/_common/schema/model'; -import type { UserChannelScheduleInfoType } from '@/schema/alert-manager/user-channel/type'; +import type { UserChannelScheduleInfoType } from '@/api-clients/alert-manager/user-channel/schema/type'; export interface UserChannelUpdateParameters { channel_id: string; diff --git a/apps/web/src/schema/alert-manager/user-channel/constants.ts b/apps/web/src/api-clients/alert-manager/user-channel/schema/constants.ts similarity index 100% rename from apps/web/src/schema/alert-manager/user-channel/constants.ts rename to apps/web/src/api-clients/alert-manager/user-channel/schema/constants.ts diff --git a/apps/web/src/schema/alert-manager/user-channel/model.ts b/apps/web/src/api-clients/alert-manager/user-channel/schema/model.ts similarity index 86% rename from apps/web/src/schema/alert-manager/user-channel/model.ts rename to apps/web/src/api-clients/alert-manager/user-channel/schema/model.ts index bc046d561b..7b801b2ce2 100644 --- a/apps/web/src/schema/alert-manager/user-channel/model.ts +++ b/apps/web/src/api-clients/alert-manager/user-channel/schema/model.ts @@ -1,5 +1,5 @@ import type { Tags } from '@/api-clients/_common/schema/model'; -import type { UserChannelScheduleInfoType, UserChannelStateType } from '@/schema/alert-manager/user-channel/type'; +import type { UserChannelScheduleInfoType, UserChannelStateType } from '@/api-clients/alert-manager/user-channel/schema/type'; export interface UserChannelModel { channel_id: string; diff --git a/apps/web/src/schema/alert-manager/user-channel/type.ts b/apps/web/src/api-clients/alert-manager/user-channel/schema/type.ts similarity index 92% rename from apps/web/src/schema/alert-manager/user-channel/type.ts rename to apps/web/src/api-clients/alert-manager/user-channel/schema/type.ts index 4336b248f8..654d022915 100644 --- a/apps/web/src/schema/alert-manager/user-channel/type.ts +++ b/apps/web/src/api-clients/alert-manager/user-channel/schema/type.ts @@ -1,4 +1,4 @@ -import type { USER_CHANNEL_SCHEDULE_TYPE, USER_CHANNEL_STATE } from '@/schema/alert-manager/user-channel/constants'; +import type { USER_CHANNEL_SCHEDULE_TYPE, USER_CHANNEL_STATE } from '@/api-clients/alert-manager/user-channel/schema/constants'; export type UserChannelStateType = typeof USER_CHANNEL_STATE[keyof typeof USER_CHANNEL_STATE]; export type UserChannelScheduleType = typeof USER_CHANNEL_SCHEDULE_TYPE[keyof typeof USER_CHANNEL_SCHEDULE_TYPE]; diff --git a/apps/web/src/api-clients/alert-manager/user-group-channel/composables/use-user-group-channel-api.ts b/apps/web/src/api-clients/alert-manager/user-group-channel/composables/use-user-group-channel-api.ts new file mode 100644 index 0000000000..cb664ab266 --- /dev/null +++ b/apps/web/src/api-clients/alert-manager/user-group-channel/composables/use-user-group-channel-api.ts @@ -0,0 +1,28 @@ +import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; + +import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; +import type { UserGroupChannelCreateParameters } from '@/api-clients/alert-manager/user-group-channel/schema/api-verbs/create'; +import type { UserGroupChannelDeleteParameters } from '@/api-clients/alert-manager/user-group-channel/schema/api-verbs/delete'; +import type { UserGroupChannelDisableParameters } from '@/api-clients/alert-manager/user-group-channel/schema/api-verbs/disable'; +import type { UserGroupChannelEnableParameters } from '@/api-clients/alert-manager/user-group-channel/schema/api-verbs/enable'; +import type { UserGroupChannelGetParameters } from '@/api-clients/alert-manager/user-group-channel/schema/api-verbs/get'; +import type { UserGroupChannelListParameters } from '@/api-clients/alert-manager/user-group-channel/schema/api-verbs/list'; +import type { UserGroupChannelUpdateParameters } from '@/api-clients/alert-manager/user-group-channel/schema/api-verbs/update'; +import type { UserGroupChannelModel } from '@/api-clients/alert-manager/user-group-channel/schema/model'; + +export const useUserGroupChannelApi = () => { + const actions = { + create: SpaceConnector.clientV2.alertManager.userGroupChannel.create, + delete: SpaceConnector.clientV2.alertManager.userGroupChannel.delete, + disable: SpaceConnector.clientV2.alertManager.userGroupChannel.disable, + enable: SpaceConnector.clientV2.alertManager.userGroupChannel.enable, + get: SpaceConnector.clientV2.alertManager.userGroupChannel.get, + list: SpaceConnector.clientV2.alertManager.userGroupChannel.list>, + update: SpaceConnector.clientV2.alertManager.userGroupChannel.update, + }; + + return { + userGroupChannelAPI: actions, + }; +}; + diff --git a/apps/web/src/schema/alert-manager/user-group-channel/api-verbs/create.ts b/apps/web/src/api-clients/alert-manager/user-group-channel/schema/api-verbs/create.ts similarity index 83% rename from apps/web/src/schema/alert-manager/user-group-channel/api-verbs/create.ts rename to apps/web/src/api-clients/alert-manager/user-group-channel/schema/api-verbs/create.ts index 0b3172b938..92f3f9dcc4 100644 --- a/apps/web/src/schema/alert-manager/user-group-channel/api-verbs/create.ts +++ b/apps/web/src/api-clients/alert-manager/user-group-channel/schema/api-verbs/create.ts @@ -1,7 +1,7 @@ import type { Tags } from '@/api-clients/_common/schema/model'; import type { UserGroupChannelScheduleInfoType, -} from '@/schema/alert-manager/user-group-channel/type'; +} from '@/api-clients/alert-manager/user-group-channel/schema/type'; export interface UserGroupChannelCreateParameters { protocol_id: string; diff --git a/apps/web/src/schema/alert-manager/user-group-channel/api-verbs/delete.ts b/apps/web/src/api-clients/alert-manager/user-group-channel/schema/api-verbs/delete.ts similarity index 100% rename from apps/web/src/schema/alert-manager/user-group-channel/api-verbs/delete.ts rename to apps/web/src/api-clients/alert-manager/user-group-channel/schema/api-verbs/delete.ts diff --git a/apps/web/src/schema/alert-manager/user-group-channel/api-verbs/disable.ts b/apps/web/src/api-clients/alert-manager/user-group-channel/schema/api-verbs/disable.ts similarity index 100% rename from apps/web/src/schema/alert-manager/user-group-channel/api-verbs/disable.ts rename to apps/web/src/api-clients/alert-manager/user-group-channel/schema/api-verbs/disable.ts diff --git a/apps/web/src/schema/alert-manager/user-group-channel/api-verbs/enable.ts b/apps/web/src/api-clients/alert-manager/user-group-channel/schema/api-verbs/enable.ts similarity index 100% rename from apps/web/src/schema/alert-manager/user-group-channel/api-verbs/enable.ts rename to apps/web/src/api-clients/alert-manager/user-group-channel/schema/api-verbs/enable.ts diff --git a/apps/web/src/schema/alert-manager/user-group-channel/api-verbs/get.ts b/apps/web/src/api-clients/alert-manager/user-group-channel/schema/api-verbs/get.ts similarity index 100% rename from apps/web/src/schema/alert-manager/user-group-channel/api-verbs/get.ts rename to apps/web/src/api-clients/alert-manager/user-group-channel/schema/api-verbs/get.ts diff --git a/apps/web/src/schema/alert-manager/user-group-channel/api-verbs/list.ts b/apps/web/src/api-clients/alert-manager/user-group-channel/schema/api-verbs/list.ts similarity index 73% rename from apps/web/src/schema/alert-manager/user-group-channel/api-verbs/list.ts rename to apps/web/src/api-clients/alert-manager/user-group-channel/schema/api-verbs/list.ts index bc96d55c14..cb57908681 100644 --- a/apps/web/src/schema/alert-manager/user-group-channel/api-verbs/list.ts +++ b/apps/web/src/api-clients/alert-manager/user-group-channel/schema/api-verbs/list.ts @@ -1,6 +1,6 @@ import type { Query } from '@cloudforet/core-lib/space-connector/type'; -import type { UserGroupChannelStateType } from '@/schema/alert-manager/user-group-channel/type'; +import type { UserGroupChannelStateType } from '@/api-clients/alert-manager/user-group-channel/schema/type'; export interface UserGroupChannelListParameters { query?: Query; diff --git a/apps/web/src/schema/alert-manager/user-group-channel/api-verbs/update.ts b/apps/web/src/api-clients/alert-manager/user-group-channel/schema/api-verbs/update.ts similarity index 69% rename from apps/web/src/schema/alert-manager/user-group-channel/api-verbs/update.ts rename to apps/web/src/api-clients/alert-manager/user-group-channel/schema/api-verbs/update.ts index 63d204af10..26ec28a318 100644 --- a/apps/web/src/schema/alert-manager/user-group-channel/api-verbs/update.ts +++ b/apps/web/src/api-clients/alert-manager/user-group-channel/schema/api-verbs/update.ts @@ -1,5 +1,5 @@ import type { Tags } from '@/api-clients/_common/schema/model'; -import type { UserGroupChannelScheduleInfoType } from '@/schema/alert-manager/user-group-channel/type'; +import type { UserGroupChannelScheduleInfoType } from '@/api-clients/alert-manager/user-group-channel/schema/type'; export interface UserGroupChannelUpdateParameters { channel_id: string; diff --git a/apps/web/src/schema/alert-manager/user-group-channel/constants.ts b/apps/web/src/api-clients/alert-manager/user-group-channel/schema/constants.ts similarity index 100% rename from apps/web/src/schema/alert-manager/user-group-channel/constants.ts rename to apps/web/src/api-clients/alert-manager/user-group-channel/schema/constants.ts diff --git a/apps/web/src/schema/alert-manager/user-group-channel/model.ts b/apps/web/src/api-clients/alert-manager/user-group-channel/schema/model.ts similarity index 88% rename from apps/web/src/schema/alert-manager/user-group-channel/model.ts rename to apps/web/src/api-clients/alert-manager/user-group-channel/schema/model.ts index 2c86789ad5..a6a339a88d 100644 --- a/apps/web/src/schema/alert-manager/user-group-channel/model.ts +++ b/apps/web/src/api-clients/alert-manager/user-group-channel/schema/model.ts @@ -3,7 +3,7 @@ import type { Tags } from '@/api-clients/_common/schema/model'; import type { UserGroupChannelStateType, UserGroupChannelScheduleInfoType, -} from '@/schema/alert-manager/user-group-channel/type'; +} from '@/api-clients/alert-manager/user-group-channel/schema/type'; export interface UserGroupChannelModel { channel_id: string; diff --git a/apps/web/src/schema/alert-manager/user-group-channel/type.ts b/apps/web/src/api-clients/alert-manager/user-group-channel/schema/type.ts similarity index 92% rename from apps/web/src/schema/alert-manager/user-group-channel/type.ts rename to apps/web/src/api-clients/alert-manager/user-group-channel/schema/type.ts index 8850cfbbad..21541e0b73 100644 --- a/apps/web/src/schema/alert-manager/user-group-channel/type.ts +++ b/apps/web/src/api-clients/alert-manager/user-group-channel/schema/type.ts @@ -1,7 +1,7 @@ import type { USER_GROUP_CHANNEL_SCHEDULE_TYPE, USER_GROUP_CHANNEL_STATE, -} from '@/schema/alert-manager/user-group-channel/constants'; +} from '@/api-clients/alert-manager/user-group-channel/schema/constants'; export type UserGroupChannelStateType = typeof USER_GROUP_CHANNEL_STATE[keyof typeof USER_GROUP_CHANNEL_STATE]; export type UserGroupChannelScheduleType = typeof USER_GROUP_CHANNEL_SCHEDULE_TYPE[keyof typeof USER_GROUP_CHANNEL_SCHEDULE_TYPE]; diff --git a/apps/web/src/api-clients/alert-manager/webhook/composables/use-webhook-api.ts b/apps/web/src/api-clients/alert-manager/webhook/composables/use-webhook-api.ts new file mode 100644 index 0000000000..6d7b725828 --- /dev/null +++ b/apps/web/src/api-clients/alert-manager/webhook/composables/use-webhook-api.ts @@ -0,0 +1,36 @@ +import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; + +import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; +import type { WebhookCreateParameters } from '@/api-clients/alert-manager/webhook/schema/api-verbs/create'; +import type { WebhookDeleteParameters } from '@/api-clients/alert-manager/webhook/schema/api-verbs/delete'; +import type { WebhookDisableParameters } from '@/api-clients/alert-manager/webhook/schema/api-verbs/disable'; +import type { WebhookEnableParameters } from '@/api-clients/alert-manager/webhook/schema/api-verbs/enable'; +import type { WebhookGetParameters } from '@/api-clients/alert-manager/webhook/schema/api-verbs/get'; +import type { WebhookListParameters } from '@/api-clients/alert-manager/webhook/schema/api-verbs/list'; +import type { WebhookListErrorsParameters } from '@/api-clients/alert-manager/webhook/schema/api-verbs/list-errors'; +import type { WebhookUpdateParameters } from '@/api-clients/alert-manager/webhook/schema/api-verbs/update'; +import type { WebhookUpdateMessageFormatParameters } from '@/api-clients/alert-manager/webhook/schema/api-verbs/update-message-format'; +import type { WebhookUpdatePluginParameters } from '@/api-clients/alert-manager/webhook/schema/api-verbs/update-plugin'; +import type { WebhookVerifyPluginParameters } from '@/api-clients/alert-manager/webhook/schema/api-verbs/verify-plugin'; +import type { WebhookListErrorsModel, WebhookModel } from '@/api-clients/alert-manager/webhook/schema/model'; + +export const useWebhookApi = () => { + const actions = { + create: SpaceConnector.clientV2.alertManager.webhook.create, + delete: SpaceConnector.clientV2.alertManager.webhook.delete, + disable: SpaceConnector.clientV2.alertManager.webhook.disable, + enable: SpaceConnector.clientV2.alertManager.webhook.enable, + get: SpaceConnector.clientV2.alertManager.webhook.get, + listErrors: SpaceConnector.clientV2.alertManager.webhook.listErrors>, + list: SpaceConnector.clientV2.alertManager.webhook.list>, + updateMessageFormat: SpaceConnector.clientV2.alertManager.webhook.updateMessageFormat, + updatePlugin: SpaceConnector.clientV2.alertManager.webhook.updatePlugin, + update: SpaceConnector.clientV2.alertManager.webhook.update, + verifyPlugin: SpaceConnector.clientV2.alertManager.webhook.verifyPlugin, + }; + + return { + webhookAPI: actions, + }; +}; + diff --git a/apps/web/src/schema/alert-manager/webhook/api-verbs/create.ts b/apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/create.ts similarity index 68% rename from apps/web/src/schema/alert-manager/webhook/api-verbs/create.ts rename to apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/create.ts index 0242ea89c0..feec006c04 100644 --- a/apps/web/src/schema/alert-manager/webhook/api-verbs/create.ts +++ b/apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/create.ts @@ -1,5 +1,5 @@ import type { Tags } from '@/api-clients/_common/schema/model'; -import type { WebhookPluginInfoType } from '@/schema/alert-manager/webhook/type'; +import type { WebhookPluginInfoType } from '@/api-clients/alert-manager/webhook/schema/type'; export interface WebhookCreateParameters { name: string; diff --git a/apps/web/src/schema/alert-manager/webhook/api-verbs/delete.ts b/apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/delete.ts similarity index 100% rename from apps/web/src/schema/alert-manager/webhook/api-verbs/delete.ts rename to apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/delete.ts diff --git a/apps/web/src/schema/alert-manager/webhook/api-verbs/disable.ts b/apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/disable.ts similarity index 100% rename from apps/web/src/schema/alert-manager/webhook/api-verbs/disable.ts rename to apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/disable.ts diff --git a/apps/web/src/schema/alert-manager/webhook/api-verbs/enable.ts b/apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/enable.ts similarity index 100% rename from apps/web/src/schema/alert-manager/webhook/api-verbs/enable.ts rename to apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/enable.ts diff --git a/apps/web/src/schema/alert-manager/webhook/api-verbs/get.ts b/apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/get.ts similarity index 100% rename from apps/web/src/schema/alert-manager/webhook/api-verbs/get.ts rename to apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/get.ts diff --git a/apps/web/src/schema/alert-manager/webhook/api-verbs/list-errors.ts b/apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/list-errors.ts similarity index 75% rename from apps/web/src/schema/alert-manager/webhook/api-verbs/list-errors.ts rename to apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/list-errors.ts index e0c55dfb20..5a8d9db5de 100644 --- a/apps/web/src/schema/alert-manager/webhook/api-verbs/list-errors.ts +++ b/apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/list-errors.ts @@ -1,6 +1,6 @@ import type { Query } from '@cloudforet/core-lib/space-connector/type'; -export interface WebhookListErrorSParameters { +export interface WebhookListErrorsParameters { query?: Query; webhook_id: string; error_id?: string; diff --git a/apps/web/src/schema/alert-manager/webhook/api-verbs/list.ts b/apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/list.ts similarity index 76% rename from apps/web/src/schema/alert-manager/webhook/api-verbs/list.ts rename to apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/list.ts index d33ccc8621..4d1125df00 100644 --- a/apps/web/src/schema/alert-manager/webhook/api-verbs/list.ts +++ b/apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/list.ts @@ -1,6 +1,6 @@ import type { Query } from '@cloudforet/core-lib/space-connector/type'; -import type { WebhookStateType } from '@/schema/alert-manager/webhook/type'; +import type { WebhookStateType } from '@/api-clients/alert-manager/webhook/schema/type'; export interface WebhookListParameters { query?: Query; diff --git a/apps/web/src/schema/alert-manager/webhook/api-verbs/update-message-format.ts b/apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/update-message-format.ts similarity index 58% rename from apps/web/src/schema/alert-manager/webhook/api-verbs/update-message-format.ts rename to apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/update-message-format.ts index 20ddd80fd0..2bd6a6d426 100644 --- a/apps/web/src/schema/alert-manager/webhook/api-verbs/update-message-format.ts +++ b/apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/update-message-format.ts @@ -1,4 +1,4 @@ -import type { WebhookMessageFormatType } from '@/schema/alert-manager/webhook/type'; +import type { WebhookMessageFormatType } from '@/api-clients/alert-manager/webhook/schema/type'; export interface WebhookUpdateMessageFormatParameters { webhook_id: string; diff --git a/apps/web/src/schema/alert-manager/webhook/api-verbs/update-plugin.ts b/apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/update-plugin.ts similarity index 100% rename from apps/web/src/schema/alert-manager/webhook/api-verbs/update-plugin.ts rename to apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/update-plugin.ts diff --git a/apps/web/src/schema/alert-manager/webhook/api-verbs/update.ts b/apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/update.ts similarity index 100% rename from apps/web/src/schema/alert-manager/webhook/api-verbs/update.ts rename to apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/update.ts diff --git a/apps/web/src/schema/alert-manager/webhook/api-verbs/verify-plugin.ts b/apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/verify-plugin.ts similarity index 100% rename from apps/web/src/schema/alert-manager/webhook/api-verbs/verify-plugin.ts rename to apps/web/src/api-clients/alert-manager/webhook/schema/api-verbs/verify-plugin.ts diff --git a/apps/web/src/schema/alert-manager/webhook/constants.ts b/apps/web/src/api-clients/alert-manager/webhook/schema/constants.ts similarity index 100% rename from apps/web/src/schema/alert-manager/webhook/constants.ts rename to apps/web/src/api-clients/alert-manager/webhook/schema/constants.ts diff --git a/apps/web/src/schema/alert-manager/webhook/model.ts b/apps/web/src/api-clients/alert-manager/webhook/schema/model.ts similarity index 93% rename from apps/web/src/schema/alert-manager/webhook/model.ts rename to apps/web/src/api-clients/alert-manager/webhook/schema/model.ts index 35017a43c0..58d2ef1dbd 100644 --- a/apps/web/src/schema/alert-manager/webhook/model.ts +++ b/apps/web/src/api-clients/alert-manager/webhook/schema/model.ts @@ -1,7 +1,7 @@ import type { Tags } from '@/api-clients/_common/schema/model'; import type { WebhookPluginInfoType, WebhookRequestType, WebhookStateType, WebhookMessageFormatType, -} from '@/schema/alert-manager/webhook/type'; +} from '@/api-clients/alert-manager/webhook/schema/type'; export interface WebhookModel { webhook_id: string; diff --git a/apps/web/src/schema/alert-manager/webhook/type.ts b/apps/web/src/api-clients/alert-manager/webhook/schema/type.ts similarity index 82% rename from apps/web/src/schema/alert-manager/webhook/type.ts rename to apps/web/src/api-clients/alert-manager/webhook/schema/type.ts index 2621883d09..5e51504f8c 100644 --- a/apps/web/src/schema/alert-manager/webhook/type.ts +++ b/apps/web/src/api-clients/alert-manager/webhook/schema/type.ts @@ -1,4 +1,4 @@ -import type { WEBHOOK_STATE } from '@/schema/alert-manager/webhook/constants'; +import type { WEBHOOK_STATE } from '@/api-clients/alert-manager/webhook/schema/constants'; export type WebhookStateType = typeof WEBHOOK_STATE[keyof typeof WEBHOOK_STATE]; diff --git a/apps/web/src/api-clients/identity/user-group/schema/model.ts b/apps/web/src/api-clients/identity/user-group/schema/model.ts index 9c617c1d1d..4be86f694a 100644 --- a/apps/web/src/api-clients/identity/user-group/schema/model.ts +++ b/apps/web/src/api-clients/identity/user-group/schema/model.ts @@ -1,5 +1,5 @@ import type { Tags } from '@/api-clients/_common/schema/model'; -import type { UserGroupChannelModel } from '@/schema/alert-manager/user-group-channel/model'; +import type { UserGroupChannelModel } from '@/api-clients/alert-manager/user-group-channel/schema/model'; export interface UserGroupModel { user_group_id: string; diff --git a/apps/web/src/schema/monitoring/alert/api-verbs/assign-user.ts b/apps/web/src/api-clients/monitoring/alert/schema/api-verbs/assign-user.ts similarity index 100% rename from apps/web/src/schema/monitoring/alert/api-verbs/assign-user.ts rename to apps/web/src/api-clients/monitoring/alert/schema/api-verbs/assign-user.ts diff --git a/apps/web/src/schema/monitoring/alert/api-verbs/create.ts b/apps/web/src/api-clients/monitoring/alert/schema/api-verbs/create.ts similarity index 67% rename from apps/web/src/schema/monitoring/alert/api-verbs/create.ts rename to apps/web/src/api-clients/monitoring/alert/schema/api-verbs/create.ts index d345e5a207..6963faa0f5 100644 --- a/apps/web/src/schema/monitoring/alert/api-verbs/create.ts +++ b/apps/web/src/api-clients/monitoring/alert/schema/api-verbs/create.ts @@ -1,4 +1,4 @@ -import type { AlertUrgency } from '@/schema/monitoring/alert/type'; +import type { AlertUrgency } from '@/api-clients/monitoring/alert/schema/type'; export interface AlertCreateParameters { title: string; diff --git a/apps/web/src/schema/monitoring/alert/api-verbs/delete.ts b/apps/web/src/api-clients/monitoring/alert/schema/api-verbs/delete.ts similarity index 100% rename from apps/web/src/schema/monitoring/alert/api-verbs/delete.ts rename to apps/web/src/api-clients/monitoring/alert/schema/api-verbs/delete.ts diff --git a/apps/web/src/schema/monitoring/alert/api-verbs/get.ts b/apps/web/src/api-clients/monitoring/alert/schema/api-verbs/get.ts similarity index 100% rename from apps/web/src/schema/monitoring/alert/api-verbs/get.ts rename to apps/web/src/api-clients/monitoring/alert/schema/api-verbs/get.ts diff --git a/apps/web/src/schema/monitoring/alert/api-verbs/list.ts b/apps/web/src/api-clients/monitoring/alert/schema/api-verbs/list.ts similarity index 67% rename from apps/web/src/schema/monitoring/alert/api-verbs/list.ts rename to apps/web/src/api-clients/monitoring/alert/schema/api-verbs/list.ts index eee33ababe..b12b957f6c 100644 --- a/apps/web/src/schema/monitoring/alert/api-verbs/list.ts +++ b/apps/web/src/api-clients/monitoring/alert/schema/api-verbs/list.ts @@ -1,19 +1,19 @@ import type { Query } from '@cloudforet/core-lib/space-connector/type'; import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; -import type { AlertModel } from '@/schema/alert-manager/alert/model'; +import type { AlertModel } from '@/api-clients/alert-manager/alert/schema/model'; import type { - AlertSeverity, AlertState, AlertUrgency, -} from '@/schema/monitoring/alert/type'; + AlertSeverityType, AlertUrgencyType, AlertStatusType, +} from '@/api-clients/alert-manager/alert/schema/type'; export interface AlertListParameters { alert_number?: number; alert_id?: string; title?: string; - state?: AlertState; + state?: AlertStatusType; assignee?: string; - urgency?: AlertUrgency; - severity?: AlertSeverity; + urgency?: AlertUrgencyType; + severity?: AlertSeverityType; resource_id?: string; provider?: string; account?: string; diff --git a/apps/web/src/schema/monitoring/alert/api-verbs/update-state.ts b/apps/web/src/api-clients/monitoring/alert/schema/api-verbs/update-state.ts similarity index 60% rename from apps/web/src/schema/monitoring/alert/api-verbs/update-state.ts rename to apps/web/src/api-clients/monitoring/alert/schema/api-verbs/update-state.ts index 55a5291c90..d9ccc8aba4 100644 --- a/apps/web/src/schema/monitoring/alert/api-verbs/update-state.ts +++ b/apps/web/src/api-clients/monitoring/alert/schema/api-verbs/update-state.ts @@ -1,4 +1,4 @@ -import type { AlertState } from '@/schema/monitoring/alert/type'; +import type { AlertState } from '@/api-clients/monitoring/alert/schema/type'; export interface AlertUpdateStateParameters { alert_id: string; diff --git a/apps/web/src/schema/monitoring/alert/api-verbs/update.ts b/apps/web/src/api-clients/monitoring/alert/schema/api-verbs/update.ts similarity index 67% rename from apps/web/src/schema/monitoring/alert/api-verbs/update.ts rename to apps/web/src/api-clients/monitoring/alert/schema/api-verbs/update.ts index b3646360c9..ca22c9cb4a 100644 --- a/apps/web/src/schema/monitoring/alert/api-verbs/update.ts +++ b/apps/web/src/api-clients/monitoring/alert/schema/api-verbs/update.ts @@ -1,4 +1,4 @@ -import type { AlertState, AlertUrgency } from '@/schema/monitoring/alert/type'; +import type { AlertState, AlertUrgency } from '@/api-clients/monitoring/alert/schema/type'; export interface AlertUpdateParameters { alert_id: string; diff --git a/apps/web/src/schema/monitoring/alert/constants.ts b/apps/web/src/api-clients/monitoring/alert/schema/constants.ts similarity index 100% rename from apps/web/src/schema/monitoring/alert/constants.ts rename to apps/web/src/api-clients/monitoring/alert/schema/constants.ts diff --git a/apps/web/src/schema/monitoring/alert/model.ts b/apps/web/src/api-clients/monitoring/alert/schema/model.ts similarity index 94% rename from apps/web/src/schema/monitoring/alert/model.ts rename to apps/web/src/api-clients/monitoring/alert/schema/model.ts index 119fad4a5e..3a27286e61 100644 --- a/apps/web/src/schema/monitoring/alert/model.ts +++ b/apps/web/src/api-clients/monitoring/alert/schema/model.ts @@ -1,6 +1,6 @@ import type { AlertResource, AlertSeverity, AlertState, AlertUrgency, -} from '@/schema/monitoring/alert/type'; +} from '@/api-clients/monitoring/alert/schema/type'; export interface AlertModelV1 { alert_number: number; diff --git a/apps/web/src/schema/monitoring/alert/type.ts b/apps/web/src/api-clients/monitoring/alert/schema/type.ts similarity index 78% rename from apps/web/src/schema/monitoring/alert/type.ts rename to apps/web/src/api-clients/monitoring/alert/schema/type.ts index 9b418dcac5..2221384c81 100644 --- a/apps/web/src/schema/monitoring/alert/type.ts +++ b/apps/web/src/api-clients/monitoring/alert/schema/type.ts @@ -1,4 +1,4 @@ -import type { ALERT_STATE, ALERT_URGENCY } from '@/schema/monitoring/alert/constants'; +import type { ALERT_STATE, ALERT_URGENCY } from '@/api-clients/monitoring/alert/schema/constants'; export interface AlertResource { resource_id?: string; diff --git a/apps/web/src/schema/monitoring/data-source/api-verbs/list.ts b/apps/web/src/api-clients/monitoring/data-source/schema/api-verbs/list.ts similarity index 77% rename from apps/web/src/schema/monitoring/data-source/api-verbs/list.ts rename to apps/web/src/api-clients/monitoring/data-source/schema/api-verbs/list.ts index 3e8741fd6f..3bc34588be 100644 --- a/apps/web/src/schema/monitoring/data-source/api-verbs/list.ts +++ b/apps/web/src/api-clients/monitoring/data-source/schema/api-verbs/list.ts @@ -1,6 +1,6 @@ import type { Query } from '@cloudforet/core-lib/space-connector/type'; -import type { MonitoringType } from '@/schema/monitoring/data-source/type'; +import type { MonitoringType } from '@/api-clients/monitoring/data-source/schema/type'; export interface DataSourceListParameters { query?: Query; diff --git a/apps/web/src/schema/monitoring/data-source/constant.ts b/apps/web/src/api-clients/monitoring/data-source/schema/constants.ts similarity index 100% rename from apps/web/src/schema/monitoring/data-source/constant.ts rename to apps/web/src/api-clients/monitoring/data-source/schema/constants.ts diff --git a/apps/web/src/schema/monitoring/data-source/model.ts b/apps/web/src/api-clients/monitoring/data-source/schema/model.ts similarity index 92% rename from apps/web/src/schema/monitoring/data-source/model.ts rename to apps/web/src/api-clients/monitoring/data-source/schema/model.ts index 0630522018..3b4f439159 100644 --- a/apps/web/src/schema/monitoring/data-source/model.ts +++ b/apps/web/src/api-clients/monitoring/data-source/schema/model.ts @@ -1,7 +1,7 @@ import type { DynamicLayout } from '@cloudforet/mirinae/types/data-display/dynamic/dynamic-layout/type/layout-schema'; import type { Tags } from '@/api-clients/_common/schema/model'; -import type { MonitoringType } from '@/schema/monitoring/data-source/type'; +import type { MonitoringType } from '@/api-clients/monitoring/data-source/schema/type'; interface DataSourcePluginModel { diff --git a/apps/web/src/api-clients/monitoring/data-source/schema/type.ts b/apps/web/src/api-clients/monitoring/data-source/schema/type.ts new file mode 100644 index 0000000000..aa1b8310ff --- /dev/null +++ b/apps/web/src/api-clients/monitoring/data-source/schema/type.ts @@ -0,0 +1,3 @@ +import type { MONITORING_TYPE } from '@/api-clients/monitoring/data-source/schema/constants'; + +export type MonitoringType = typeof MONITORING_TYPE[keyof typeof MONITORING_TYPE]; diff --git a/apps/web/src/schema/monitoring/escalation-policy/api-verbs/create.ts b/apps/web/src/api-clients/monitoring/escalation-policy/schema/api-verbs/create.ts similarity index 66% rename from apps/web/src/schema/monitoring/escalation-policy/api-verbs/create.ts rename to apps/web/src/api-clients/monitoring/escalation-policy/schema/api-verbs/create.ts index e06869f302..c8125fd92b 100644 --- a/apps/web/src/schema/monitoring/escalation-policy/api-verbs/create.ts +++ b/apps/web/src/api-clients/monitoring/escalation-policy/schema/api-verbs/create.ts @@ -1,5 +1,5 @@ -import type { EscalationPolicyModel } from '@/schema/monitoring/escalation-policy/model'; -import type { EscalationPolicyRule, EscalationPolicyFinishCondition } from '@/schema/monitoring/escalation-policy/type'; +import type { EscalationPolicyModel } from '@/api-clients/monitoring/escalation-policy/schema/model'; +import type { EscalationPolicyRule, EscalationPolicyFinishCondition } from '@/api-clients/monitoring/escalation-policy/schema/type'; export interface EscalationPolicyCreateParameters { name: string; diff --git a/apps/web/src/schema/monitoring/escalation-policy/api-verbs/delete.ts b/apps/web/src/api-clients/monitoring/escalation-policy/schema/api-verbs/delete.ts similarity index 100% rename from apps/web/src/schema/monitoring/escalation-policy/api-verbs/delete.ts rename to apps/web/src/api-clients/monitoring/escalation-policy/schema/api-verbs/delete.ts diff --git a/apps/web/src/schema/monitoring/escalation-policy/api-verbs/get.ts b/apps/web/src/api-clients/monitoring/escalation-policy/schema/api-verbs/get.ts similarity index 100% rename from apps/web/src/schema/monitoring/escalation-policy/api-verbs/get.ts rename to apps/web/src/api-clients/monitoring/escalation-policy/schema/api-verbs/get.ts diff --git a/apps/web/src/schema/monitoring/escalation-policy/api-verbs/list.ts b/apps/web/src/api-clients/monitoring/escalation-policy/schema/api-verbs/list.ts similarity index 71% rename from apps/web/src/schema/monitoring/escalation-policy/api-verbs/list.ts rename to apps/web/src/api-clients/monitoring/escalation-policy/schema/api-verbs/list.ts index bb90d61493..8a99216225 100644 --- a/apps/web/src/schema/monitoring/escalation-policy/api-verbs/list.ts +++ b/apps/web/src/api-clients/monitoring/escalation-policy/schema/api-verbs/list.ts @@ -1,8 +1,8 @@ import type { Query } from '@cloudforet/core-lib/space-connector/type'; import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; -import type { EscalationPolicyModel } from '@/schema/monitoring/escalation-policy/model'; -import type { EscalationPolicyFinishCondition } from '@/schema/monitoring/escalation-policy/type'; +import type { EscalationPolicyModel } from '@/api-clients/monitoring/escalation-policy/schema/model'; +import type { EscalationPolicyFinishCondition } from '@/api-clients/monitoring/escalation-policy/schema/type'; export interface EscalationPolicyListParameters { query?: Query; diff --git a/apps/web/src/schema/monitoring/escalation-policy/api-verbs/set-default.ts b/apps/web/src/api-clients/monitoring/escalation-policy/schema/api-verbs/set-default.ts similarity index 100% rename from apps/web/src/schema/monitoring/escalation-policy/api-verbs/set-default.ts rename to apps/web/src/api-clients/monitoring/escalation-policy/schema/api-verbs/set-default.ts diff --git a/apps/web/src/schema/monitoring/escalation-policy/api-verbs/update.ts b/apps/web/src/api-clients/monitoring/escalation-policy/schema/api-verbs/update.ts similarity index 84% rename from apps/web/src/schema/monitoring/escalation-policy/api-verbs/update.ts rename to apps/web/src/api-clients/monitoring/escalation-policy/schema/api-verbs/update.ts index a8a7d0c8a4..aa397f735a 100644 --- a/apps/web/src/schema/monitoring/escalation-policy/api-verbs/update.ts +++ b/apps/web/src/api-clients/monitoring/escalation-policy/schema/api-verbs/update.ts @@ -1,5 +1,5 @@ import type { Tags } from '@/api-clients/_common/schema/model'; -import type { EscalationPolicyRule, EscalationPolicyFinishCondition } from '@/schema/monitoring/escalation-policy/type'; +import type { EscalationPolicyRule, EscalationPolicyFinishCondition } from '@/api-clients/monitoring/escalation-policy/schema/type'; export interface EscalationPolicyUpdateParameters { escalation_policy_id: string; diff --git a/apps/web/src/schema/monitoring/escalation-policy/constant.ts b/apps/web/src/api-clients/monitoring/escalation-policy/schema/constants.ts similarity index 100% rename from apps/web/src/schema/monitoring/escalation-policy/constant.ts rename to apps/web/src/api-clients/monitoring/escalation-policy/schema/constants.ts diff --git a/apps/web/src/schema/monitoring/escalation-policy/model.ts b/apps/web/src/api-clients/monitoring/escalation-policy/schema/model.ts similarity index 90% rename from apps/web/src/schema/monitoring/escalation-policy/model.ts rename to apps/web/src/api-clients/monitoring/escalation-policy/schema/model.ts index 7f19cc1290..8e9b9208bf 100644 --- a/apps/web/src/schema/monitoring/escalation-policy/model.ts +++ b/apps/web/src/api-clients/monitoring/escalation-policy/schema/model.ts @@ -1,6 +1,6 @@ import type { Tags } from '@/api-clients/_common/schema/model'; import type { ResourceGroupType } from '@/api-clients/_common/schema/type'; -import type { EscalationPolicyRule, EscalationPolicyFinishCondition } from '@/schema/monitoring/escalation-policy/type'; +import type { EscalationPolicyRule, EscalationPolicyFinishCondition } from '@/api-clients/monitoring/escalation-policy/schema/type'; export interface EscalationPolicyModel { escalation_policy_id: string; diff --git a/apps/web/src/schema/monitoring/escalation-policy/type.ts b/apps/web/src/api-clients/monitoring/escalation-policy/schema/type.ts similarity index 69% rename from apps/web/src/schema/monitoring/escalation-policy/type.ts rename to apps/web/src/api-clients/monitoring/escalation-policy/schema/type.ts index 1f876abf81..b39c939b14 100644 --- a/apps/web/src/schema/monitoring/escalation-policy/type.ts +++ b/apps/web/src/api-clients/monitoring/escalation-policy/schema/type.ts @@ -1,4 +1,4 @@ -import type { ESCALATION_POLICY_FINISH_CONDITION } from '@/schema/monitoring/escalation-policy/constant'; +import type { ESCALATION_POLICY_FINISH_CONDITION } from '@/api-clients/alert-manager/escalation-policy/schema/constants'; export interface EscalationPolicyRule { notification_level: 'ALL'|'LV1'|'LV2'|'LV3'|'LV4'|'LV5'; diff --git a/apps/web/src/schema/monitoring/event-rule/api-verbs/change-order.ts b/apps/web/src/api-clients/monitoring/event-rule/schema/api-verbs/change-order.ts similarity index 100% rename from apps/web/src/schema/monitoring/event-rule/api-verbs/change-order.ts rename to apps/web/src/api-clients/monitoring/event-rule/schema/api-verbs/change-order.ts diff --git a/apps/web/src/schema/monitoring/event-rule/api-verbs/create.ts b/apps/web/src/api-clients/monitoring/event-rule/schema/api-verbs/create.ts similarity index 76% rename from apps/web/src/schema/monitoring/event-rule/api-verbs/create.ts rename to apps/web/src/api-clients/monitoring/event-rule/schema/api-verbs/create.ts index e977caefd1..4048d0be22 100644 --- a/apps/web/src/schema/monitoring/event-rule/api-verbs/create.ts +++ b/apps/web/src/api-clients/monitoring/event-rule/schema/api-verbs/create.ts @@ -1,9 +1,9 @@ import type { Tags } from '@/api-clients/_common/schema/model'; -import type { EventRuleModel } from '@/schema/monitoring/event-rule/model'; +import type { EventRuleModel } from '@/api-clients/monitoring/event-rule/schema/model'; import type { EventRuleActions, EventRuleCondition, EventRuleConditionsPolicy, EventRuleOptions, -} from '@/schema/monitoring/event-rule/type'; +} from '@/api-clients/monitoring/event-rule/schema/type'; export interface EventRuleCreateParameters { conditions: EventRuleCondition[]; diff --git a/apps/web/src/schema/monitoring/event-rule/api-verbs/delete.ts b/apps/web/src/api-clients/monitoring/event-rule/schema/api-verbs/delete.ts similarity index 100% rename from apps/web/src/schema/monitoring/event-rule/api-verbs/delete.ts rename to apps/web/src/api-clients/monitoring/event-rule/schema/api-verbs/delete.ts diff --git a/apps/web/src/schema/monitoring/event-rule/api-verbs/get.ts b/apps/web/src/api-clients/monitoring/event-rule/schema/api-verbs/get.ts similarity index 100% rename from apps/web/src/schema/monitoring/event-rule/api-verbs/get.ts rename to apps/web/src/api-clients/monitoring/event-rule/schema/api-verbs/get.ts diff --git a/apps/web/src/schema/monitoring/event-rule/api-verbs/list.ts b/apps/web/src/api-clients/monitoring/event-rule/schema/api-verbs/list.ts similarity index 76% rename from apps/web/src/schema/monitoring/event-rule/api-verbs/list.ts rename to apps/web/src/api-clients/monitoring/event-rule/schema/api-verbs/list.ts index 23a091ae08..cfbbba44e0 100644 --- a/apps/web/src/schema/monitoring/event-rule/api-verbs/list.ts +++ b/apps/web/src/api-clients/monitoring/event-rule/schema/api-verbs/list.ts @@ -1,6 +1,6 @@ import type { Query } from '@cloudforet/core-lib/space-connector/type'; -import type { EventRuleModel } from '@/schema/monitoring/event-rule/model'; +import type { EventRuleModel } from '@/api-clients/monitoring/event-rule/schema/model'; export interface EventRuleListParameters { event_rule_id?: string; diff --git a/apps/web/src/schema/monitoring/event-rule/api-verbs/update.ts b/apps/web/src/api-clients/monitoring/event-rule/schema/api-verbs/update.ts similarity index 88% rename from apps/web/src/schema/monitoring/event-rule/api-verbs/update.ts rename to apps/web/src/api-clients/monitoring/event-rule/schema/api-verbs/update.ts index 5a09d6e157..92c72f2b59 100644 --- a/apps/web/src/schema/monitoring/event-rule/api-verbs/update.ts +++ b/apps/web/src/api-clients/monitoring/event-rule/schema/api-verbs/update.ts @@ -2,7 +2,7 @@ import type { Tags } from '@/api-clients/_common/schema/model'; import type { EventRuleActions, EventRuleCondition, EventRuleConditionsPolicy, EventRuleOptions, -} from '@/schema/monitoring/event-rule/type'; +} from '@/api-clients/monitoring/event-rule/schema/type'; export interface EventRuleUpdateParameters { event_rule_id: string; diff --git a/apps/web/src/schema/monitoring/event-rule/model.ts b/apps/web/src/api-clients/monitoring/event-rule/schema/model.ts similarity index 92% rename from apps/web/src/schema/monitoring/event-rule/model.ts rename to apps/web/src/api-clients/monitoring/event-rule/schema/model.ts index 4df071cbc8..bae0ab87cf 100644 --- a/apps/web/src/schema/monitoring/event-rule/model.ts +++ b/apps/web/src/api-clients/monitoring/event-rule/schema/model.ts @@ -2,7 +2,7 @@ import type { Tags } from '@/api-clients/_common/schema/model'; import type { ResourceGroupType } from '@/api-clients/_common/schema/type'; import type { EventRuleCondition, EventRuleActions, EventRuleConditionsPolicy, EventRuleOptions, -} from '@/schema/monitoring/event-rule/type'; +} from '@/api-clients/monitoring/event-rule/schema/type'; export interface EventRuleModel { event_rule_id: string; diff --git a/apps/web/src/schema/monitoring/event-rule/type.ts b/apps/web/src/api-clients/monitoring/event-rule/schema/type.ts similarity index 91% rename from apps/web/src/schema/monitoring/event-rule/type.ts rename to apps/web/src/api-clients/monitoring/event-rule/schema/type.ts index e00f6698f5..6fe178b24c 100644 --- a/apps/web/src/schema/monitoring/event-rule/type.ts +++ b/apps/web/src/api-clients/monitoring/event-rule/schema/type.ts @@ -1,4 +1,4 @@ -import type { AlertUrgency } from '@/schema/monitoring/alert/type'; +import type { AlertUrgency } from '@/api-clients/monitoring/alert/schema/type'; export type EventRuleConditionKey = |'title' diff --git a/apps/web/src/schema/monitoring/event/api-verbs/list.ts b/apps/web/src/api-clients/monitoring/event/schema/api-verbs/list.ts similarity index 83% rename from apps/web/src/schema/monitoring/event/api-verbs/list.ts rename to apps/web/src/api-clients/monitoring/event/schema/api-verbs/list.ts index 38f734d4c8..871c991329 100644 --- a/apps/web/src/schema/monitoring/event/api-verbs/list.ts +++ b/apps/web/src/api-clients/monitoring/event/schema/api-verbs/list.ts @@ -1,6 +1,6 @@ import type { Query } from '@cloudforet/core-lib/space-connector/type'; -import type { AlertSeverity } from '@/schema/monitoring/alert/type'; +import type { AlertSeverity } from '@/api-clients/monitoring/alert/schema/type'; export interface EventListParameters { event_id?: string; diff --git a/apps/web/src/schema/monitoring/event/model.ts b/apps/web/src/api-clients/monitoring/event/schema/model.ts similarity index 75% rename from apps/web/src/schema/monitoring/event/model.ts rename to apps/web/src/api-clients/monitoring/event/schema/model.ts index a864aa9829..2db91c0ef5 100644 --- a/apps/web/src/schema/monitoring/event/model.ts +++ b/apps/web/src/api-clients/monitoring/event/schema/model.ts @@ -1,5 +1,5 @@ -import type { AlertSeverity, AlertResource } from '@/schema/monitoring/alert/type'; -import type { EventType } from '@/schema/monitoring/event/type'; +import type { AlertSeverity, AlertResource } from '@/api-clients/monitoring/alert/schema/type'; +import type { EventType } from '@/api-clients/monitoring/event/schema/type'; export interface EventModel { event_id: string; diff --git a/apps/web/src/schema/monitoring/event/type.ts b/apps/web/src/api-clients/monitoring/event/schema/type.ts similarity index 100% rename from apps/web/src/schema/monitoring/event/type.ts rename to apps/web/src/api-clients/monitoring/event/schema/type.ts diff --git a/apps/web/src/schema/monitoring/log/api-verbs/list.ts b/apps/web/src/api-clients/monitoring/log/schema/api-verbs/list.ts similarity index 100% rename from apps/web/src/schema/monitoring/log/api-verbs/list.ts rename to apps/web/src/api-clients/monitoring/log/schema/api-verbs/list.ts diff --git a/apps/web/src/schema/monitoring/log/model.ts b/apps/web/src/api-clients/monitoring/log/schema/model.ts similarity index 100% rename from apps/web/src/schema/monitoring/log/model.ts rename to apps/web/src/api-clients/monitoring/log/schema/model.ts diff --git a/apps/web/src/schema/monitoring/note/api-verbs/create.ts b/apps/web/src/api-clients/monitoring/note/schema/api-verbs/create.ts similarity index 100% rename from apps/web/src/schema/monitoring/note/api-verbs/create.ts rename to apps/web/src/api-clients/monitoring/note/schema/api-verbs/create.ts diff --git a/apps/web/src/schema/monitoring/note/api-verbs/delete.ts b/apps/web/src/api-clients/monitoring/note/schema/api-verbs/delete.ts similarity index 100% rename from apps/web/src/schema/monitoring/note/api-verbs/delete.ts rename to apps/web/src/api-clients/monitoring/note/schema/api-verbs/delete.ts diff --git a/apps/web/src/schema/monitoring/note/api-verbs/get.ts b/apps/web/src/api-clients/monitoring/note/schema/api-verbs/get.ts similarity index 100% rename from apps/web/src/schema/monitoring/note/api-verbs/get.ts rename to apps/web/src/api-clients/monitoring/note/schema/api-verbs/get.ts diff --git a/apps/web/src/schema/monitoring/note/api-verbs/list.ts b/apps/web/src/api-clients/monitoring/note/schema/api-verbs/list.ts similarity index 100% rename from apps/web/src/schema/monitoring/note/api-verbs/list.ts rename to apps/web/src/api-clients/monitoring/note/schema/api-verbs/list.ts diff --git a/apps/web/src/schema/monitoring/note/api-verbs/update.ts b/apps/web/src/api-clients/monitoring/note/schema/api-verbs/update.ts similarity index 100% rename from apps/web/src/schema/monitoring/note/api-verbs/update.ts rename to apps/web/src/api-clients/monitoring/note/schema/api-verbs/update.ts diff --git a/apps/web/src/schema/monitoring/note/model.ts b/apps/web/src/api-clients/monitoring/note/schema/model.ts similarity index 100% rename from apps/web/src/schema/monitoring/note/model.ts rename to apps/web/src/api-clients/monitoring/note/schema/model.ts diff --git a/apps/web/src/schema/monitoring/project-alert-config/api-verbs/create.ts b/apps/web/src/api-clients/monitoring/project-alert-config/schema/api-verbs/create.ts similarity index 59% rename from apps/web/src/schema/monitoring/project-alert-config/api-verbs/create.ts rename to apps/web/src/api-clients/monitoring/project-alert-config/schema/api-verbs/create.ts index bb653bf9ea..57a2adb6a5 100644 --- a/apps/web/src/schema/monitoring/project-alert-config/api-verbs/create.ts +++ b/apps/web/src/api-clients/monitoring/project-alert-config/schema/api-verbs/create.ts @@ -1,4 +1,4 @@ -import type { ProjectAlertConfigOptions } from '@/schema/monitoring/project-alert-config/type'; +import type { ProjectAlertConfigOptions } from '@/api-clients/monitoring/project-alert-config/schema/type'; export interface ProjectAlertConfigCreateParameters { project_id: string; diff --git a/apps/web/src/schema/monitoring/project-alert-config/api-verbs/delete.ts b/apps/web/src/api-clients/monitoring/project-alert-config/schema/api-verbs/delete.ts similarity index 100% rename from apps/web/src/schema/monitoring/project-alert-config/api-verbs/delete.ts rename to apps/web/src/api-clients/monitoring/project-alert-config/schema/api-verbs/delete.ts diff --git a/apps/web/src/schema/monitoring/project-alert-config/api-verbs/get.ts b/apps/web/src/api-clients/monitoring/project-alert-config/schema/api-verbs/get.ts similarity index 100% rename from apps/web/src/schema/monitoring/project-alert-config/api-verbs/get.ts rename to apps/web/src/api-clients/monitoring/project-alert-config/schema/api-verbs/get.ts diff --git a/apps/web/src/schema/monitoring/project-alert-config/api-verbs/list.ts b/apps/web/src/api-clients/monitoring/project-alert-config/schema/api-verbs/list.ts similarity index 100% rename from apps/web/src/schema/monitoring/project-alert-config/api-verbs/list.ts rename to apps/web/src/api-clients/monitoring/project-alert-config/schema/api-verbs/list.ts diff --git a/apps/web/src/schema/monitoring/project-alert-config/api-verbs/update.ts b/apps/web/src/api-clients/monitoring/project-alert-config/schema/api-verbs/update.ts similarity index 60% rename from apps/web/src/schema/monitoring/project-alert-config/api-verbs/update.ts rename to apps/web/src/api-clients/monitoring/project-alert-config/schema/api-verbs/update.ts index e837f41895..2c491240b0 100644 --- a/apps/web/src/schema/monitoring/project-alert-config/api-verbs/update.ts +++ b/apps/web/src/api-clients/monitoring/project-alert-config/schema/api-verbs/update.ts @@ -1,4 +1,4 @@ -import type { ProjectAlertConfigOptions } from '@/schema/monitoring/project-alert-config/type'; +import type { ProjectAlertConfigOptions } from '@/api-clients/monitoring/project-alert-config/schema/type'; export interface ProjectAlertConfigUpdateParameters { project_id: string; diff --git a/apps/web/src/schema/monitoring/project-alert-config/model.ts b/apps/web/src/api-clients/monitoring/project-alert-config/schema/model.ts similarity index 68% rename from apps/web/src/schema/monitoring/project-alert-config/model.ts rename to apps/web/src/api-clients/monitoring/project-alert-config/schema/model.ts index b27aca1831..7d6a859bbf 100644 --- a/apps/web/src/schema/monitoring/project-alert-config/model.ts +++ b/apps/web/src/api-clients/monitoring/project-alert-config/schema/model.ts @@ -1,4 +1,4 @@ -import type { ProjectAlertConfigOptions } from '@/schema/monitoring/project-alert-config/type'; +import type { ProjectAlertConfigOptions } from '@/api-clients/monitoring/project-alert-config/schema/type'; export interface ProjectAlertConfigModel { project_id: string; diff --git a/apps/web/src/schema/monitoring/project-alert-config/type.ts b/apps/web/src/api-clients/monitoring/project-alert-config/schema/type.ts similarity index 100% rename from apps/web/src/schema/monitoring/project-alert-config/type.ts rename to apps/web/src/api-clients/monitoring/project-alert-config/schema/type.ts diff --git a/apps/web/src/schema/monitoring/webhook/api-verbs/create.ts b/apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/create.ts similarity index 70% rename from apps/web/src/schema/monitoring/webhook/api-verbs/create.ts rename to apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/create.ts index 13f3deaaff..22b50c5670 100644 --- a/apps/web/src/schema/monitoring/webhook/api-verbs/create.ts +++ b/apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/create.ts @@ -1,5 +1,5 @@ import type { Tags } from '@/api-clients/_common/schema/model'; -import type { WebhookPluginInfo } from '@/schema/monitoring/webhook/type'; +import type { WebhookPluginInfo } from '@/api-clients/monitoring/webhook/schema/type'; export interface WebhookCreateParameters { name: string; diff --git a/apps/web/src/schema/monitoring/webhook/api-verbs/delete.ts b/apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/delete.ts similarity index 100% rename from apps/web/src/schema/monitoring/webhook/api-verbs/delete.ts rename to apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/delete.ts diff --git a/apps/web/src/schema/monitoring/webhook/api-verbs/disable.ts b/apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/disable.ts similarity index 100% rename from apps/web/src/schema/monitoring/webhook/api-verbs/disable.ts rename to apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/disable.ts diff --git a/apps/web/src/schema/monitoring/webhook/api-verbs/enable.ts b/apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/enable.ts similarity index 100% rename from apps/web/src/schema/monitoring/webhook/api-verbs/enable.ts rename to apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/enable.ts diff --git a/apps/web/src/schema/monitoring/webhook/api-verbs/get.ts b/apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/get.ts similarity index 100% rename from apps/web/src/schema/monitoring/webhook/api-verbs/get.ts rename to apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/get.ts diff --git a/apps/web/src/schema/monitoring/webhook/api-verbs/list.ts b/apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/list.ts similarity index 77% rename from apps/web/src/schema/monitoring/webhook/api-verbs/list.ts rename to apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/list.ts index 1b9a02878c..e2b5c3b359 100644 --- a/apps/web/src/schema/monitoring/webhook/api-verbs/list.ts +++ b/apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/list.ts @@ -1,6 +1,6 @@ import type { Query } from '@cloudforet/core-lib/space-connector/type'; -import type { WebhookState } from '@/schema/monitoring/webhook/type'; +import type { WebhookState } from '@/api-clients/monitoring/webhook/schema/type'; export interface WebhookListParameters { webhook_id?: string; diff --git a/apps/web/src/schema/monitoring/webhook/api-verbs/update-plugin.ts b/apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/update-plugin.ts similarity index 68% rename from apps/web/src/schema/monitoring/webhook/api-verbs/update-plugin.ts rename to apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/update-plugin.ts index 22eb24630d..22d550d10a 100644 --- a/apps/web/src/schema/monitoring/webhook/api-verbs/update-plugin.ts +++ b/apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/update-plugin.ts @@ -1,4 +1,4 @@ -import type { WebhookPluginInfo } from '@/schema/monitoring/webhook/type'; +import type { WebhookPluginInfo } from '@/api-clients/monitoring/webhook/schema/type'; export interface WebhookUpdatePluginParameters { webhook_id: string; diff --git a/apps/web/src/schema/monitoring/webhook/api-verbs/update.ts b/apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/update.ts similarity index 100% rename from apps/web/src/schema/monitoring/webhook/api-verbs/update.ts rename to apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/update.ts diff --git a/apps/web/src/schema/monitoring/webhook/api-verbs/verify-plugin.ts b/apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/verify-plugin.ts similarity index 100% rename from apps/web/src/schema/monitoring/webhook/api-verbs/verify-plugin.ts rename to apps/web/src/api-clients/monitoring/webhook/schema/api-verbs/verify-plugin.ts diff --git a/apps/web/src/schema/monitoring/webhook/model.ts b/apps/web/src/api-clients/monitoring/webhook/schema/model.ts similarity index 83% rename from apps/web/src/schema/monitoring/webhook/model.ts rename to apps/web/src/api-clients/monitoring/webhook/schema/model.ts index e0b1484a94..af35cfc546 100644 --- a/apps/web/src/schema/monitoring/webhook/model.ts +++ b/apps/web/src/api-clients/monitoring/webhook/schema/model.ts @@ -1,5 +1,5 @@ import type { Tags } from '@/api-clients/_common/schema/model'; -import type { WebhookPluginInfo, WebhookState } from '@/schema/monitoring/webhook/type'; +import type { WebhookPluginInfo, WebhookState } from '@/api-clients/monitoring/webhook/schema/type'; type WebhookRequestsType = { total: number; diff --git a/apps/web/src/schema/monitoring/webhook/type.ts b/apps/web/src/api-clients/monitoring/webhook/schema/type.ts similarity index 100% rename from apps/web/src/schema/monitoring/webhook/type.ts rename to apps/web/src/api-clients/monitoring/webhook/schema/type.ts diff --git a/apps/web/src/api-clients/notification/protocol/composables/use-protocol-api.ts b/apps/web/src/api-clients/notification/protocol/composables/use-protocol-api.ts new file mode 100644 index 0000000000..2d34561697 --- /dev/null +++ b/apps/web/src/api-clients/notification/protocol/composables/use-protocol-api.ts @@ -0,0 +1,30 @@ +import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; + +import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; +import type { ProtocolCreateParameters } from '@/api-clients/notification/protocol/schema/api-verbs/create'; +import type { ProtocolDeleteParameters } from '@/api-clients/notification/protocol/schema/api-verbs/delete'; +import type { ProtocolDisableParameters } from '@/api-clients/notification/protocol/schema/api-verbs/disable'; +import type { ProtocolEnableParameters } from '@/api-clients/notification/protocol/schema/api-verbs/enable'; +import type { ProtocolGetParameters } from '@/api-clients/notification/protocol/schema/api-verbs/get'; +import type { ProtocolListParameters } from '@/api-clients/notification/protocol/schema/api-verbs/list'; +import type { ProtocolUpdateParameters } from '@/api-clients/notification/protocol/schema/api-verbs/update'; +import type { ProtocolUpdatePluginParameters } from '@/api-clients/notification/protocol/schema/api-verbs/update-plugin'; +import type { ProtocolModel } from '@/api-clients/notification/protocol/schema/model'; + +export const useProtocolApi = () => { + const actions = { + create: SpaceConnector.clientV2.notification.protocol.create, + delete: SpaceConnector.clientV2.notification.protocol.delete, + disable: SpaceConnector.clientV2.notification.protocol.disable, + enable: SpaceConnector.clientV2.notification.protocol.enable, + get: SpaceConnector.clientV2.notification.protocol.get, + list: SpaceConnector.clientV2.notification.protocol.list>, + updatePlugin: SpaceConnector.clientV2.notification.protocol.updatePlugin, + update: SpaceConnector.clientV2.notification.protocol.update, + }; + + return { + protocolAPI: actions, + }; +}; + diff --git a/apps/web/src/api-clients/notification/protocol/schema/api-verbs/create.ts b/apps/web/src/api-clients/notification/protocol/schema/api-verbs/create.ts new file mode 100644 index 0000000000..f3b8ecd5fb --- /dev/null +++ b/apps/web/src/api-clients/notification/protocol/schema/api-verbs/create.ts @@ -0,0 +1,8 @@ +import type { Tags } from '@/api-clients/_common/schema/model'; +import type { ProtocolPluginInfo } from '@/schema/notification/protocol/type'; + +export interface ProtocolCreateParameters { + name: string; + plugin_info: ProtocolPluginInfo; + tags?: Tags; +} diff --git a/apps/web/src/api-clients/notification/protocol/schema/api-verbs/delete.ts b/apps/web/src/api-clients/notification/protocol/schema/api-verbs/delete.ts new file mode 100644 index 0000000000..92cdfae168 --- /dev/null +++ b/apps/web/src/api-clients/notification/protocol/schema/api-verbs/delete.ts @@ -0,0 +1,3 @@ +export interface ProtocolDeleteParameters { + protocol_id: string; +} diff --git a/apps/web/src/api-clients/notification/protocol/schema/api-verbs/disable.ts b/apps/web/src/api-clients/notification/protocol/schema/api-verbs/disable.ts new file mode 100644 index 0000000000..7abf88a0c0 --- /dev/null +++ b/apps/web/src/api-clients/notification/protocol/schema/api-verbs/disable.ts @@ -0,0 +1,3 @@ +export interface ProtocolDisableParameters { + protocol_id: string; +} diff --git a/apps/web/src/api-clients/notification/protocol/schema/api-verbs/enable.ts b/apps/web/src/api-clients/notification/protocol/schema/api-verbs/enable.ts new file mode 100644 index 0000000000..e765974ba4 --- /dev/null +++ b/apps/web/src/api-clients/notification/protocol/schema/api-verbs/enable.ts @@ -0,0 +1,3 @@ +export interface ProtocolEnableParameters { + protocol_id: string; +} diff --git a/apps/web/src/api-clients/notification/protocol/schema/api-verbs/get.ts b/apps/web/src/api-clients/notification/protocol/schema/api-verbs/get.ts new file mode 100644 index 0000000000..9c9a0cb9dc --- /dev/null +++ b/apps/web/src/api-clients/notification/protocol/schema/api-verbs/get.ts @@ -0,0 +1,3 @@ +export interface ProtocolGetParameters { + protocol_id: string; +} diff --git a/apps/web/src/api-clients/notification/protocol/schema/api-verbs/list.ts b/apps/web/src/api-clients/notification/protocol/schema/api-verbs/list.ts new file mode 100644 index 0000000000..f5fe5e8139 --- /dev/null +++ b/apps/web/src/api-clients/notification/protocol/schema/api-verbs/list.ts @@ -0,0 +1,11 @@ +import type { Query } from '@cloudforet/core-lib/space-connector/type'; + +import type { ProtocolState } from '@/schema/notification/protocol/type'; + +export interface ProtocolListParameters { + protocol_id?: string; + name?: string; + state?: ProtocolState; + protocol_type?: string; + query?: Query; +} diff --git a/apps/web/src/api-clients/notification/protocol/schema/api-verbs/update-plugin.ts b/apps/web/src/api-clients/notification/protocol/schema/api-verbs/update-plugin.ts new file mode 100644 index 0000000000..1d6f7b0032 --- /dev/null +++ b/apps/web/src/api-clients/notification/protocol/schema/api-verbs/update-plugin.ts @@ -0,0 +1,5 @@ +export interface ProtocolUpdatePluginParameters { + protocol_id: string; + version?: string; + options?: Record; +} diff --git a/apps/web/src/api-clients/notification/protocol/schema/api-verbs/update.ts b/apps/web/src/api-clients/notification/protocol/schema/api-verbs/update.ts new file mode 100644 index 0000000000..0bf2f45666 --- /dev/null +++ b/apps/web/src/api-clients/notification/protocol/schema/api-verbs/update.ts @@ -0,0 +1,7 @@ +import type { Tags } from '@/api-clients/_common/schema/model'; + +export interface ProtocolUpdateParameters { + protocol_id: string; + name?: string; + tags?: Tags; +} diff --git a/apps/web/src/api-clients/notification/protocol/schema/model.ts b/apps/web/src/api-clients/notification/protocol/schema/model.ts new file mode 100644 index 0000000000..04ec782de6 --- /dev/null +++ b/apps/web/src/api-clients/notification/protocol/schema/model.ts @@ -0,0 +1,15 @@ +import type { Tags } from '@/api-clients/_common/schema/model'; +import type { ProtocolCapability, ProtocolPluginInfo, ProtocolState } from '@/schema/notification/protocol/type'; + +export interface ProtocolModel { + protocol_id: string; + name: string; + state: ProtocolState; + protocol_type: string; + resource_type: string; + capability: ProtocolCapability; + plugin_info: ProtocolPluginInfo; + tags: Tags; + domain_id: string; + created_at: string; +} diff --git a/apps/web/src/api-clients/notification/protocol/schema/type.ts b/apps/web/src/api-clients/notification/protocol/schema/type.ts new file mode 100644 index 0000000000..75d6b7fbf1 --- /dev/null +++ b/apps/web/src/api-clients/notification/protocol/schema/type.ts @@ -0,0 +1,24 @@ +import type { JsonSchema } from '@cloudforet/mirinae/types/controls/forms/json-schema-form/type'; + +export type ProtocolState = 'ENABLED'|'DISABLED'; + +export interface ProtocolCapability { + supported_schema: string[]; +} + +type ProtocolPluginMetadata = { + data_type: 'PLAIN_TEXT'|'SECRET'; + data: { + schema: JsonSchema; + } +} | Record; + +type ProtocolPluginUpgradeMode = 'AUTO'|'MANUAL'; + +export interface ProtocolPluginInfo { + plugin_id: string; + version: string; + options: Record; + metadata: ProtocolPluginMetadata; + upgrade_mode: ProtocolPluginUpgradeMode; +} diff --git a/apps/web/src/common/components/schedule-setting-form/ScheduleSettingForm.vue b/apps/web/src/common/components/schedule-setting-form/ScheduleSettingForm.vue index d77d64cb52..ec9a09123c 100644 --- a/apps/web/src/common/components/schedule-setting-form/ScheduleSettingForm.vue +++ b/apps/web/src/common/components/schedule-setting-form/ScheduleSettingForm.vue @@ -10,7 +10,7 @@ import { } from '@cloudforet/mirinae'; import type { SelectDropdownMenuItem } from '@cloudforet/mirinae/types/controls/dropdown/select-dropdown/type'; -import type { ServiceChannelScheduleType } from '@/schema/alert-manager/service-channel/type'; +import type { ServiceChannelScheduleType } from '@/api-clients/alert-manager/service-channel/schema/type'; import { i18n } from '@/translations'; import { timezoneList } from '@/store/user/constant'; diff --git a/apps/web/src/common/modules/monitoring/Monitoring.vue b/apps/web/src/common/modules/monitoring/Monitoring.vue index 63df55e5d0..8478ff4313 100644 --- a/apps/web/src/common/modules/monitoring/Monitoring.vue +++ b/apps/web/src/common/modules/monitoring/Monitoring.vue @@ -121,7 +121,7 @@ import { } from '@cloudforet/mirinae'; -import { MONITORING_TYPE } from '@/schema/monitoring/data-source/constant'; +import { MONITORING_TYPE } from '@/api-clients/monitoring/data-source/schema/constants'; import { useReferenceRouter } from '@/router/composables/use-reference-router'; diff --git a/apps/web/src/common/modules/user/UserSelectDropdown.vue b/apps/web/src/common/modules/user/UserSelectDropdown.vue index 0abee8f4d3..f4b2477605 100644 --- a/apps/web/src/common/modules/user/UserSelectDropdown.vue +++ b/apps/web/src/common/modules/user/UserSelectDropdown.vue @@ -13,7 +13,7 @@ import type { SelectDropdownMenuItem, } from '@cloudforet/mirinae/types/controls/dropdown/select-dropdown/type'; -import type { MembersType } from '@/schema/alert-manager/service/type'; +import type { MembersType } from '@/api-clients/alert-manager/service/schema/type'; import { i18n } from '@/translations'; import { useAllReferenceStore } from '@/store/reference/all-reference-store'; diff --git a/apps/web/src/common/pages/AlertPublicDetailPage.vue b/apps/web/src/common/pages/AlertPublicDetailPage.vue index 330af0aebc..2f1e076185 100644 --- a/apps/web/src/common/pages/AlertPublicDetailPage.vue +++ b/apps/web/src/common/pages/AlertPublicDetailPage.vue @@ -13,9 +13,9 @@ import { import type { TabItem } from '@cloudforet/mirinae/types/navigation/tabs/tab/type'; import { iso8601Formatter } from '@cloudforet/utils'; -import type { AlertModel } from '@/schema/alert-manager/alert/model'; -import { ALERT_STATE, ALERT_URGENCY } from '@/schema/monitoring/alert/constants'; -import type { AlertModelV1 } from '@/schema/monitoring/alert/model'; +import type { AlertModel } from '@/api-clients/alert-manager/alert/schema/model'; +import { ALERT_STATE, ALERT_URGENCY } from '@/api-clients/monitoring/alert/schema/constants'; +import type { AlertModelV1 } from '@/api-clients/monitoring/alert/schema/model'; import { i18n, setI18nLocale } from '@/translations'; import { ERROR_ROUTE } from '@/router/constant'; diff --git a/apps/web/src/lib/variable-models/managed-model/resource-model/service-variable-model.ts b/apps/web/src/lib/variable-models/managed-model/resource-model/service-variable-model.ts index acfee1cd0c..27ccc31421 100644 --- a/apps/web/src/lib/variable-models/managed-model/resource-model/service-variable-model.ts +++ b/apps/web/src/lib/variable-models/managed-model/resource-model/service-variable-model.ts @@ -1,4 +1,4 @@ -import type { ServiceModel } from '@/schema/alert-manager/service/model'; +import type { ServiceModel } from '@/api-clients/alert-manager/service/schema/model'; import ResourceVariableModel from '@/lib/variable-models/_base/resource-variable-model'; import type { VariableModelConstructorConfig } from '@/lib/variable-models/_base/types'; diff --git a/apps/web/src/lib/variable-models/managed-model/resource-model/webhook-variable-model.ts b/apps/web/src/lib/variable-models/managed-model/resource-model/webhook-variable-model.ts index 1c00886ea7..559eb3c354 100644 --- a/apps/web/src/lib/variable-models/managed-model/resource-model/webhook-variable-model.ts +++ b/apps/web/src/lib/variable-models/managed-model/resource-model/webhook-variable-model.ts @@ -1,4 +1,4 @@ -import type { WebhookModel } from '@/schema/monitoring/webhook/model'; +import type { WebhookModel } from '@/api-clients/monitoring/webhook/schema/model'; import ResourceVariableModel from '@/lib/variable-models/_base/resource-variable-model'; import type { VariableModelConstructorConfig } from '@/lib/variable-models/_base/types'; diff --git a/apps/web/src/query/pagination/use-scoped-pagination-query.ts b/apps/web/src/query/pagination/use-scoped-pagination-query.ts index a1f20731e2..6cf27a19d4 100644 --- a/apps/web/src/query/pagination/use-scoped-pagination-query.ts +++ b/apps/web/src/query/pagination/use-scoped-pagination-query.ts @@ -4,7 +4,7 @@ import { } from 'vue'; import type { InfiniteData } from '@tanstack/vue-query'; -import { type UseInfiniteQueryOptions } from '@tanstack/vue-query'; +import { useQueryClient, type UseInfiniteQueryOptions } from '@tanstack/vue-query'; import type { GrantScope } from '@/api-clients/identity/token/schema/type'; import { useScopedInfiniteQuery } from '@/query/composables/use-scoped-infinite-query'; @@ -32,7 +32,7 @@ import type { QueryKeyArray } from '@/query/query-key/_types/query-key-type'; * @param pageOptions - Pagination control: * - thisPage: current page number (1-based) * - pageSize: number of items per page - * - verb: one of 'list' | 'stat' | 'analyze' | 'load' (used to insert page info in correct param structure) + * - verb: one of 'list' | 'load' (used to insert page info in correct param structure) * * @param requiredScopes - A list of **required grant scopes** to determine if the query should execute. * @@ -53,8 +53,9 @@ type PaginatableBaseData = { type UsePaginationQueryOptions = Omit< UseInfiniteQueryOptions, TPageData, QueryKeyArray, number>, - 'initialPageParam' | 'queryFn' | 'getNextPageParam' + 'initialPageParam' | 'queryFn' | 'getNextPageParam' | 'select' > & { + queryKey: ComputedRef queryFn: (params: TParams) => Promise; params: ComputedRef; initialPageParam?: number; @@ -63,7 +64,7 @@ type UsePaginationQueryOptions = Omit interface UsePaginationQueryPageOptions { thisPage: ComputedRef; pageSize: ComputedRef; - verb: 'list' | 'stat' | 'analyze' | 'load'; + verb: 'list' | 'load'; } export const useScopedPaginationQuery = ( @@ -71,6 +72,7 @@ export const useScopedPaginationQuery = { + const queryClient = useQueryClient(); const { thisPage, pageSize, verb } = pageOptions; const { queryFn, params, initialPageParam = 1, ...restOptions @@ -103,12 +105,27 @@ export const useScopedPaginationQuery = { - const currentLength = query.data.value?.pages?.length ?? 0; - if (val > currentLength && !query.isFetchingNextPage.value) { - const calls = Array.from({ length: val - currentLength }); - await Promise.all(calls.map(() => query.fetchNextPage())); + const fetchUntilPageLoaded = (targetPage: number) => { + const current = query.data.value?.pages?.length ?? 0; + + if (current >= targetPage) return; + + if (!query.isFetchingNextPage.value) { + query.fetchNextPage().then(() => { + setTimeout(() => fetchUntilPageLoaded(targetPage), 0); + }); + } else { + setTimeout(() => fetchUntilPageLoaded(targetPage), 50); } + }; + + watch(thisPage, (val) => { + fetchUntilPageLoaded(val); + }); + + // Clear cached pages when page size changes to avoid inconsistent pagination data + watch(pageSize, () => { + queryClient.resetQueries({ queryKey: options.queryKey.value }); }); return { diff --git a/apps/web/src/schema/monitoring/data-source/type.ts b/apps/web/src/schema/monitoring/data-source/type.ts deleted file mode 100644 index ac8679ecd0..0000000000 --- a/apps/web/src/schema/monitoring/data-source/type.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { MONITORING_TYPE } from '@/schema/monitoring/data-source/constant'; - -export type MonitoringType = typeof MONITORING_TYPE[keyof typeof MONITORING_TYPE]; diff --git a/apps/web/src/schema/repository/plugin/constant.ts b/apps/web/src/schema/repository/plugin/constants.ts similarity index 100% rename from apps/web/src/schema/repository/plugin/constant.ts rename to apps/web/src/schema/repository/plugin/constants.ts diff --git a/apps/web/src/schema/repository/plugin/type.ts b/apps/web/src/schema/repository/plugin/type.ts index 535da95d76..543e0f2732 100644 --- a/apps/web/src/schema/repository/plugin/type.ts +++ b/apps/web/src/schema/repository/plugin/type.ts @@ -1,7 +1,5 @@ -import type { MonitoringType } from '@/schema/monitoring/data-source/type'; -import type { PLUGIN_STATE, REGISTRY_TYPE } from '@/schema/repository/plugin/constant'; - - +import type { MonitoringType } from '@/api-clients/monitoring/data-source/schema/type'; +import type { PLUGIN_STATE, REGISTRY_TYPE } from '@/schema/repository/plugin/constants'; export type PluginState = typeof PLUGIN_STATE[keyof typeof PLUGIN_STATE]; diff --git a/apps/web/src/services/alert-manager/v1/components/AlertDashboardAlertStateWidget.vue b/apps/web/src/services/alert-manager/v1/components/AlertDashboardAlertStateWidget.vue index e37341b751..32d9a7ad27 100644 --- a/apps/web/src/services/alert-manager/v1/components/AlertDashboardAlertStateWidget.vue +++ b/apps/web/src/services/alert-manager/v1/components/AlertDashboardAlertStateWidget.vue @@ -15,9 +15,9 @@ import { import { numberFormatter } from '@cloudforet/utils'; import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; -import type { AlertListParameters } from '@/schema/monitoring/alert/api-verbs/list'; -import { ALERT_STATE } from '@/schema/monitoring/alert/constants'; -import type { AlertModelV1 } from '@/schema/monitoring/alert/model'; +import type { AlertListParameters } from '@/api-clients/monitoring/alert/schema/api-verbs/list'; +import { ALERT_STATE } from '@/api-clients/monitoring/alert/schema/constants'; +import type { AlertModelV1 } from '@/api-clients/monitoring/alert/schema/model'; import { i18n } from '@/translations'; import { useUserWorkspaceStore } from '@/store/app-context/workspace/user-workspace-store'; diff --git a/apps/web/src/services/alert-manager/v1/components/AlertDashboardProjectSearchWidgetAlertList.vue b/apps/web/src/services/alert-manager/v1/components/AlertDashboardProjectSearchWidgetAlertList.vue index d366352a55..b7a56deb15 100644 --- a/apps/web/src/services/alert-manager/v1/components/AlertDashboardProjectSearchWidgetAlertList.vue +++ b/apps/web/src/services/alert-manager/v1/components/AlertDashboardProjectSearchWidgetAlertList.vue @@ -11,9 +11,9 @@ import { } from '@cloudforet/mirinae'; import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; -import type { AlertListParameters } from '@/schema/monitoring/alert/api-verbs/list'; -import { ALERT_STATE } from '@/schema/monitoring/alert/constants'; -import type { AlertModelV1 } from '@/schema/monitoring/alert/model'; +import type { AlertListParameters } from '@/api-clients/monitoring/alert/schema/api-verbs/list'; +import { ALERT_STATE } from '@/api-clients/monitoring/alert/schema/constants'; +import type { AlertModelV1 } from '@/api-clients/monitoring/alert/schema/model'; import { useAllReferenceStore } from '@/store/reference/all-reference-store'; import type { UserReferenceMap } from '@/store/reference/user-reference-store'; diff --git a/apps/web/src/services/alert-manager/v1/components/AlertDashboardTop5ProjectActivityWidgetTooltip.vue b/apps/web/src/services/alert-manager/v1/components/AlertDashboardTop5ProjectActivityWidgetTooltip.vue index 47359dfcd1..af4daa6e95 100644 --- a/apps/web/src/services/alert-manager/v1/components/AlertDashboardTop5ProjectActivityWidgetTooltip.vue +++ b/apps/web/src/services/alert-manager/v1/components/AlertDashboardTop5ProjectActivityWidgetTooltip.vue @@ -13,8 +13,8 @@ import { } from '@cloudforet/mirinae'; import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; -import type { AlertListParameters } from '@/schema/monitoring/alert/api-verbs/list'; -import type { AlertModelV1 } from '@/schema/monitoring/alert/model'; +import type { AlertListParameters } from '@/api-clients/monitoring/alert/schema/api-verbs/list'; +import type { AlertModelV1 } from '@/api-clients/monitoring/alert/schema/model'; import { useUserStore } from '@/store/user/user-store'; diff --git a/apps/web/src/services/alert-manager/v1/components/AlertDetailInfoTable.vue b/apps/web/src/services/alert-manager/v1/components/AlertDetailInfoTable.vue index 2feced1be7..22f9701552 100644 --- a/apps/web/src/services/alert-manager/v1/components/AlertDetailInfoTable.vue +++ b/apps/web/src/services/alert-manager/v1/components/AlertDetailInfoTable.vue @@ -7,9 +7,9 @@ import { } from '@cloudforet/mirinae'; import { iso8601Formatter } from '@cloudforet/utils'; -import type { AlertModel } from '@/schema/alert-manager/alert/model'; -import type { EscalationPolicyGetParameters } from '@/schema/monitoring/escalation-policy/api-verbs/get'; -import type { EscalationPolicyModel } from '@/schema/monitoring/escalation-policy/model'; +import type { AlertModel } from '@/api-clients/alert-manager/alert/schema/model'; +import type { EscalationPolicyGetParameters } from '@/api-clients/alert-manager/escalation-policy/schema/api-verbs/get'; +import type { EscalationPolicyModel } from '@/api-clients/alert-manager/escalation-policy/schema/model'; import { i18n } from '@/translations'; import { useUserWorkspaceStore } from '@/store/app-context/workspace/user-workspace-store'; diff --git a/apps/web/src/services/alert-manager/v1/components/AlertDetailNote.vue b/apps/web/src/services/alert-manager/v1/components/AlertDetailNote.vue index 92806f337a..ed6bf2c49d 100644 --- a/apps/web/src/services/alert-manager/v1/components/AlertDetailNote.vue +++ b/apps/web/src/services/alert-manager/v1/components/AlertDetailNote.vue @@ -10,10 +10,10 @@ import { import { iso8601Formatter } from '@cloudforet/utils'; import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; -import type { NoteCreateParameters } from '@/schema/monitoring/note/api-verbs/create'; -import type { NoteDeleteParameters } from '@/schema/monitoring/note/api-verbs/delete'; -import type { NoteListParameters } from '@/schema/monitoring/note/api-verbs/list'; -import type { NoteModel } from '@/schema/monitoring/note/model'; +import type { NoteCreateParameters } from '@/api-clients/monitoring/note/schema/api-verbs/create'; +import type { NoteDeleteParameters } from '@/api-clients/monitoring/note/schema/api-verbs/delete'; +import type { NoteListParameters } from '@/api-clients/monitoring/note/schema/api-verbs/list'; +import type { NoteModel } from '@/api-clients/monitoring/note/schema/model'; import { i18n } from '@/translations'; import { useUserStore } from '@/store/user/user-store'; diff --git a/apps/web/src/services/alert-manager/v1/components/AlertDetailResponder.vue b/apps/web/src/services/alert-manager/v1/components/AlertDetailResponder.vue index 8d28f8ab84..373d232dfd 100644 --- a/apps/web/src/services/alert-manager/v1/components/AlertDetailResponder.vue +++ b/apps/web/src/services/alert-manager/v1/components/AlertDetailResponder.vue @@ -12,10 +12,10 @@ import { } from '@cloudforet/mirinae'; import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; -import type { AlertModelV1 } from '@/schema/monitoring/alert/model'; -import type { EscalationPolicyGetParameters } from '@/schema/monitoring/escalation-policy/api-verbs/get'; -import type { EscalationPolicyModel } from '@/schema/monitoring/escalation-policy/model'; -import type { EscalationPolicyRule } from '@/schema/monitoring/escalation-policy/type'; +import type { AlertModelV1 } from '@/api-clients/monitoring/alert/schema/model'; +import type { EscalationPolicyGetParameters } from '@/api-clients/monitoring/escalation-policy/schema/api-verbs/get'; +import type { EscalationPolicyModel } from '@/api-clients/monitoring/escalation-policy/schema/model'; +import type { EscalationPolicyRule } from '@/api-clients/monitoring/escalation-policy/schema/type'; import type { ProjectChannelListParameters } from '@/schema/notification/project-channel/api-verbs/list'; import type { ProjectChannelModel } from '@/schema/notification/project-channel/model'; import { i18n } from '@/translations'; diff --git a/apps/web/src/services/alert-manager/v1/components/AlertDetailSummary.vue b/apps/web/src/services/alert-manager/v1/components/AlertDetailSummary.vue index 78d5f20eed..eea9e77fb4 100644 --- a/apps/web/src/services/alert-manager/v1/components/AlertDetailSummary.vue +++ b/apps/web/src/services/alert-manager/v1/components/AlertDetailSummary.vue @@ -8,8 +8,8 @@ import { } from '@cloudforet/mirinae'; import { iso8601Formatter } from '@cloudforet/utils'; -import { ALERT_STATE, ALERT_URGENCY } from '@/schema/monitoring/alert/constants'; -import type { AlertState, AlertUrgency } from '@/schema/monitoring/alert/type'; +import { ALERT_STATE, ALERT_URGENCY } from '@/api-clients/monitoring/alert/schema/constants'; +import type { AlertState, AlertUrgency } from '@/api-clients/monitoring/alert/schema/type'; import { i18n } from '@/translations'; import { showSuccessMessage } from '@/lib/helper/notice-alert-helper'; diff --git a/apps/web/src/services/alert-manager/v1/components/AlertDetailTabsPushedEvent.vue b/apps/web/src/services/alert-manager/v1/components/AlertDetailTabsPushedEvent.vue index 090579f6a2..a124e9853f 100644 --- a/apps/web/src/services/alert-manager/v1/components/AlertDetailTabsPushedEvent.vue +++ b/apps/web/src/services/alert-manager/v1/components/AlertDetailTabsPushedEvent.vue @@ -12,8 +12,8 @@ import { } from '@cloudforet/mirinae'; import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; -import type { EventListParameters } from '@/schema/monitoring/event/api-verbs/list'; -import type { EventModel } from '@/schema/monitoring/event/model'; +import type { EventListParameters } from '@/api-clients/monitoring/event/schema/api-verbs/list'; +import type { EventModel } from '@/api-clients/monitoring/event/schema/model'; import { useUserStore } from '@/store/user/user-store'; @@ -23,7 +23,6 @@ import AlertDetailTabsPushedEventVerticalTimeline from '@/services/alert-manager/v1/components/AlertDetailTabsPushedEventVerticalTimeline.vue'; - const PAGE_SIZE = 10; const props = defineProps<{ diff --git a/apps/web/src/services/alert-manager/v1/components/AlertListItem.vue b/apps/web/src/services/alert-manager/v1/components/AlertListItem.vue index f266673716..81197dc615 100644 --- a/apps/web/src/services/alert-manager/v1/components/AlertListItem.vue +++ b/apps/web/src/services/alert-manager/v1/components/AlertListItem.vue @@ -10,7 +10,7 @@ import { } from '@cloudforet/mirinae'; -import { ALERT_STATE } from '@/schema/monitoring/alert/constants'; +import { ALERT_STATE } from '@/api-clients/monitoring/alert/schema/constants'; import { useReferenceRouter } from '@/router/composables/use-reference-router'; diff --git a/apps/web/src/services/alert-manager/v1/components/AlertMainAcknowledgeModal.vue b/apps/web/src/services/alert-manager/v1/components/AlertMainAcknowledgeModal.vue index ee9a5e6dea..91dd953108 100644 --- a/apps/web/src/services/alert-manager/v1/components/AlertMainAcknowledgeModal.vue +++ b/apps/web/src/services/alert-manager/v1/components/AlertMainAcknowledgeModal.vue @@ -5,7 +5,7 @@ import { import { PButtonModal, PCheckbox } from '@cloudforet/mirinae'; -import type { AlertModelV1 } from '@/schema/monitoring/alert/model'; +import type { AlertModelV1 } from '@/api-clients/monitoring/alert/schema/model'; import { i18n } from '@/translations'; import { useUserStore } from '@/store/user/user-store'; diff --git a/apps/web/src/services/alert-manager/v1/components/AlertMainAlertCreateModal.vue b/apps/web/src/services/alert-manager/v1/components/AlertMainAlertCreateModal.vue index 2038e5a3ed..8f95296612 100644 --- a/apps/web/src/services/alert-manager/v1/components/AlertMainAlertCreateModal.vue +++ b/apps/web/src/services/alert-manager/v1/components/AlertMainAlertCreateModal.vue @@ -10,11 +10,11 @@ import { } from '@cloudforet/mirinae'; -import type { AlertCreateParameters } from '@/schema/monitoring/alert/api-verbs/create'; -import { ALERT_URGENCY } from '@/schema/monitoring/alert/constants'; -import type { ProjectAlertConfigCreateParameters } from '@/schema/monitoring/project-alert-config/api-verbs/create'; -import type { ProjectAlertConfigGetParameters } from '@/schema/monitoring/project-alert-config/api-verbs/get'; -import type { ProjectAlertConfigModel } from '@/schema/monitoring/project-alert-config/model'; +import type { AlertCreateParameters } from '@/api-clients/monitoring/alert/schema/api-verbs/create'; +import { ALERT_URGENCY } from '@/api-clients/monitoring/alert/schema/constants'; +import type { ProjectAlertConfigCreateParameters } from '@/api-clients/monitoring/project-alert-config/schema/api-verbs/create'; +import type { ProjectAlertConfigGetParameters } from '@/api-clients/monitoring/project-alert-config/schema/api-verbs/get'; +import type { ProjectAlertConfigModel } from '@/api-clients/monitoring/project-alert-config/schema/model'; import { i18n } from '@/translations'; import { showSuccessMessage } from '@/lib/helper/notice-alert-helper'; @@ -25,6 +25,7 @@ import type { ProjectTreeNodeData } from '@/common/modules/project/project-tree- import ProjectSelectDropdown from '@/common/modules/project/ProjectSelectDropdown.vue'; + const props = defineProps<{ visible: boolean; projectId?: string; diff --git a/apps/web/src/services/alert-manager/v1/components/AlertMainDataTable.vue b/apps/web/src/services/alert-manager/v1/components/AlertMainDataTable.vue index 61e8eb16b7..a29f52faa6 100644 --- a/apps/web/src/services/alert-manager/v1/components/AlertMainDataTable.vue +++ b/apps/web/src/services/alert-manager/v1/components/AlertMainDataTable.vue @@ -18,9 +18,9 @@ import type { ToolboxOptions } from '@cloudforet/mirinae/types/controls/toolbox/ import type { DataTableFieldType } from '@cloudforet/mirinae/types/data-display/tables/data-table/type'; import { durationFormatter, iso8601Formatter } from '@cloudforet/utils'; -import type { AlertModel } from '@/schema/alert-manager/alert/model'; -import type { AlertListParameters, AlertListResponse } from '@/schema/monitoring/alert/api-verbs/list'; -import { ALERT_STATE, ALERT_URGENCY } from '@/schema/monitoring/alert/constants'; +import type { AlertModel } from '@/api-clients/alert-manager/alert/schema/model'; +import type { AlertListParameters, AlertListResponse } from '@/api-clients/monitoring/alert/schema/api-verbs/list'; +import { ALERT_STATE, ALERT_URGENCY } from '@/api-clients/monitoring/alert/schema/constants'; import { useReferenceRouter } from '@/router/composables/use-reference-router'; diff --git a/apps/web/src/services/alert-manager/v1/components/AlertMainDataTableActions.vue b/apps/web/src/services/alert-manager/v1/components/AlertMainDataTableActions.vue index 9fa826a6de..4cb7763406 100644 --- a/apps/web/src/services/alert-manager/v1/components/AlertMainDataTableActions.vue +++ b/apps/web/src/services/alert-manager/v1/components/AlertMainDataTableActions.vue @@ -11,9 +11,9 @@ import { } from '@cloudforet/mirinae'; import { durationFormatter, iso8601Formatter } from '@cloudforet/utils'; -import type { AlertDeleteParameters } from '@/schema/monitoring/alert/api-verbs/delete'; -import { ALERT_STATE, ALERT_URGENCY } from '@/schema/monitoring/alert/constants'; -import type { AlertModelV1 } from '@/schema/monitoring/alert/model'; +import type { AlertDeleteParameters } from '@/api-clients/monitoring/alert/schema/api-verbs/delete'; +import { ALERT_STATE, ALERT_URGENCY } from '@/api-clients/monitoring/alert/schema/constants'; +import type { AlertModelV1 } from '@/api-clients/monitoring/alert/schema/model'; import { i18n } from '@/translations'; import { useAllReferenceStore } from '@/store/reference/all-reference-store'; diff --git a/apps/web/src/services/alert-manager/v1/components/AlertMainResolveModal.vue b/apps/web/src/services/alert-manager/v1/components/AlertMainResolveModal.vue index 470c9eb78b..938bfbd7a4 100644 --- a/apps/web/src/services/alert-manager/v1/components/AlertMainResolveModal.vue +++ b/apps/web/src/services/alert-manager/v1/components/AlertMainResolveModal.vue @@ -7,11 +7,11 @@ import { } from '@cloudforet/mirinae'; -import type { AlertUpdateParameters } from '@/schema/monitoring/alert/api-verbs/update'; -import { ALERT_STATE } from '@/schema/monitoring/alert/constants'; -import type { AlertModelV1 } from '@/schema/monitoring/alert/model'; -import type { NoteCreateParameters } from '@/schema/monitoring/note/api-verbs/create'; -import type { NoteModel } from '@/schema/monitoring/note/model'; +import type { AlertUpdateParameters } from '@/api-clients/monitoring/alert/schema/api-verbs/update'; +import { ALERT_STATE } from '@/api-clients/monitoring/alert/schema/constants'; +import type { AlertModelV1 } from '@/api-clients/monitoring/alert/schema/model'; +import type { NoteCreateParameters } from '@/api-clients/monitoring/note/schema/api-verbs/create'; +import type { NoteModel } from '@/api-clients/monitoring/note/schema/model'; import { i18n } from '@/translations'; import { showErrorMessage, showSuccessMessage } from '@/lib/helper/notice-alert-helper'; diff --git a/apps/web/src/services/alert-manager/v1/components/EscalationPolicyDataTable.vue b/apps/web/src/services/alert-manager/v1/components/EscalationPolicyDataTable.vue index 9348cbbe2b..dea51ffa25 100644 --- a/apps/web/src/services/alert-manager/v1/components/EscalationPolicyDataTable.vue +++ b/apps/web/src/services/alert-manager/v1/components/EscalationPolicyDataTable.vue @@ -7,11 +7,11 @@ import { } from '@cloudforet/mirinae'; import type { DataTableField } from '@cloudforet/mirinae/types/data-display/tables/data-table/type'; -import { ALERT_STATE } from '@/schema/monitoring/alert/constants'; -import type { EscalationPolicyModel } from '@/schema/monitoring/escalation-policy/model'; +import { ALERT_STATE } from '@/api-clients/monitoring/alert/schema/constants'; +import type { EscalationPolicyModel } from '@/api-clients/monitoring/escalation-policy/schema/model'; import type { EscalationPolicyFinishCondition, -} from '@/schema/monitoring/escalation-policy/type'; +} from '@/api-clients/monitoring/escalation-policy/schema/type'; import { i18n } from '@/translations'; import { useReferenceRouter } from '@/router/composables/use-reference-router'; diff --git a/apps/web/src/services/alert-manager/v1/components/EscalationPolicyForm.vue b/apps/web/src/services/alert-manager/v1/components/EscalationPolicyForm.vue index 2ccf19a949..dffcc8a7bb 100644 --- a/apps/web/src/services/alert-manager/v1/components/EscalationPolicyForm.vue +++ b/apps/web/src/services/alert-manager/v1/components/EscalationPolicyForm.vue @@ -10,9 +10,9 @@ import { import { ROLE_TYPE } from '@/api-clients/identity/role/constant'; -import { ESCALATION_POLICY_FINISH_CONDITION } from '@/schema/monitoring/escalation-policy/constant'; -import type { EscalationPolicyModel } from '@/schema/monitoring/escalation-policy/model'; -import type { EscalationPolicyFinishCondition } from '@/schema/monitoring/escalation-policy/type'; +import { ESCALATION_POLICY_FINISH_CONDITION } from '@/api-clients/monitoring/escalation-policy/schema/constants'; +import type { EscalationPolicyModel } from '@/api-clients/monitoring/escalation-policy/schema/model'; +import type { EscalationPolicyFinishCondition } from '@/api-clients/monitoring/escalation-policy/schema/type'; import { i18n } from '@/translations'; import { useReferenceRouter } from '@/router/composables/use-reference-router'; diff --git a/apps/web/src/services/alert-manager/v1/components/EscalationPolicyFormModal.vue b/apps/web/src/services/alert-manager/v1/components/EscalationPolicyFormModal.vue index 12829705bd..14f35b67d9 100644 --- a/apps/web/src/services/alert-manager/v1/components/EscalationPolicyFormModal.vue +++ b/apps/web/src/services/alert-manager/v1/components/EscalationPolicyFormModal.vue @@ -5,9 +5,9 @@ import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; import { PButtonModal } from '@cloudforet/mirinae'; -import type { EscalationPolicyCreateParameters } from '@/schema/monitoring/escalation-policy/api-verbs/create'; -import type { EscalationPolicyUpdateParameters } from '@/schema/monitoring/escalation-policy/api-verbs/update'; -import type { EscalationPolicyModel } from '@/schema/monitoring/escalation-policy/model'; +import type { EscalationPolicyCreateParameters } from '@/api-clients/monitoring/escalation-policy/schema/api-verbs/create'; +import type { EscalationPolicyUpdateParameters } from '@/api-clients/monitoring/escalation-policy/schema/api-verbs/update'; +import type { EscalationPolicyModel } from '@/api-clients/monitoring/escalation-policy/schema/model'; import { i18n } from '@/translations'; import { useAllReferenceStore } from '@/store/reference/all-reference-store'; diff --git a/apps/web/src/services/alert-manager/v1/components/EscalationPolicyFormRulesInput.vue b/apps/web/src/services/alert-manager/v1/components/EscalationPolicyFormRulesInput.vue index 6025380137..b6145d41ec 100644 --- a/apps/web/src/services/alert-manager/v1/components/EscalationPolicyFormRulesInput.vue +++ b/apps/web/src/services/alert-manager/v1/components/EscalationPolicyFormRulesInput.vue @@ -14,7 +14,7 @@ import { import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; import { RESOURCE_GROUP } from '@/api-clients/_common/schema/constant'; -import type { EscalationPolicyRule } from '@/schema/monitoring/escalation-policy/type'; +import type { EscalationPolicyRule } from '@/api-clients/monitoring/escalation-policy/schema/type'; import type { ProjectChannelListParameters } from '@/schema/notification/project-channel/api-verbs/list'; import type { ProjectChannelModel } from '@/schema/notification/project-channel/model'; diff --git a/apps/web/src/services/alert-manager/v1/composables/alert-info.ts b/apps/web/src/services/alert-manager/v1/composables/alert-info.ts index d0f21cb902..939af7f038 100644 --- a/apps/web/src/services/alert-manager/v1/composables/alert-info.ts +++ b/apps/web/src/services/alert-manager/v1/composables/alert-info.ts @@ -2,7 +2,7 @@ import { reactive } from 'vue'; import { cloneDeep } from 'lodash'; -import type { AlertUpdateParameters } from '@/schema/monitoring/alert/api-verbs/update'; +import type { AlertUpdateParameters } from '@/api-clients/monitoring/alert/schema/api-verbs/update'; import { i18n } from '@/translations'; import { showSuccessMessage } from '@/lib/helper/notice-alert-helper'; diff --git a/apps/web/src/services/alert-manager/v1/composables/alert-state-i18n.ts b/apps/web/src/services/alert-manager/v1/composables/alert-state-i18n.ts index 5d65b710e4..62141964a5 100644 --- a/apps/web/src/services/alert-manager/v1/composables/alert-state-i18n.ts +++ b/apps/web/src/services/alert-manager/v1/composables/alert-state-i18n.ts @@ -2,7 +2,7 @@ import type { ComputedRef } from 'vue'; import { computed } from 'vue'; import type { TranslateResult } from 'vue-i18n'; -import type { AlertState } from '@/schema/monitoring/alert/type'; +import type { AlertState } from '@/api-clients/monitoring/alert/schema/type'; import { i18n } from '@/translations'; diff --git a/apps/web/src/services/alert-manager/v1/composables/alert-urgency-i18n.ts b/apps/web/src/services/alert-manager/v1/composables/alert-urgency-i18n.ts index f2a2d89174..47365a4528 100644 --- a/apps/web/src/services/alert-manager/v1/composables/alert-urgency-i18n.ts +++ b/apps/web/src/services/alert-manager/v1/composables/alert-urgency-i18n.ts @@ -2,7 +2,7 @@ import type { ComputedRef } from 'vue'; import { computed } from 'vue'; import type { TranslateResult } from 'vue-i18n'; -import type { AlertUrgency } from '@/schema/monitoring/alert/type'; +import type { AlertUrgency } from '@/api-clients/monitoring/alert/schema/type'; import { i18n } from '@/translations'; diff --git a/apps/web/src/services/alert-manager/v1/constants/alert-constant.ts b/apps/web/src/services/alert-manager/v1/constants/alert-constant.ts index 15d48026b4..88dc26350c 100644 --- a/apps/web/src/services/alert-manager/v1/constants/alert-constant.ts +++ b/apps/web/src/services/alert-manager/v1/constants/alert-constant.ts @@ -1,5 +1,5 @@ -import { ALERT_STATE, ALERT_URGENCY } from '@/schema/monitoring/alert/constants'; -import type { AlertSeverity } from '@/schema/monitoring/alert/type'; +import { ALERT_STATE, ALERT_URGENCY } from '@/api-clients/monitoring/alert/schema/constants'; +import type { AlertSeverity } from '@/api-clients/monitoring/alert/schema/type'; import { blue, coral, gray, red, violet, yellow, diff --git a/apps/web/src/services/alert-manager/v1/helpers/alert-badge-helper.ts b/apps/web/src/services/alert-manager/v1/helpers/alert-badge-helper.ts index 80f00f3cdb..2fa288097d 100644 --- a/apps/web/src/services/alert-manager/v1/helpers/alert-badge-helper.ts +++ b/apps/web/src/services/alert-manager/v1/helpers/alert-badge-helper.ts @@ -1,6 +1,6 @@ import { RESOURCE_GROUP } from '@/api-clients/_common/schema/constant'; -import { ALERT_STATE } from '@/schema/monitoring/alert/constants'; -import type { EscalationPolicyModel } from '@/schema/monitoring/escalation-policy/model'; +import { ALERT_STATE } from '@/api-clients/monitoring/alert/schema/constants'; +import type { EscalationPolicyModel } from '@/api-clients/monitoring/escalation-policy/schema/model'; diff --git a/apps/web/src/services/alert-manager/v1/pages/AlertDashboardPage.vue b/apps/web/src/services/alert-manager/v1/pages/AlertDashboardPage.vue index cdebd8d775..428a000acf 100644 --- a/apps/web/src/services/alert-manager/v1/pages/AlertDashboardPage.vue +++ b/apps/web/src/services/alert-manager/v1/pages/AlertDashboardPage.vue @@ -6,8 +6,8 @@ import { PHeading } from '@cloudforet/mirinae'; import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; -import type { ProjectAlertConfigListParameters } from '@/schema/monitoring/project-alert-config/api-verbs/list'; -import type { ProjectAlertConfigModel } from '@/schema/monitoring/project-alert-config/model'; +import type { ProjectAlertConfigListParameters } from '@/api-clients/monitoring/project-alert-config/schema/api-verbs/list'; +import type { ProjectAlertConfigModel } from '@/api-clients/monitoring/project-alert-config/schema/model'; import ErrorHandler from '@/common/composables/error/errorHandler'; diff --git a/apps/web/src/services/alert-manager/v1/pages/AlertDetailPage.vue b/apps/web/src/services/alert-manager/v1/pages/AlertDetailPage.vue index 4d16e2a07e..bcc1899c75 100644 --- a/apps/web/src/services/alert-manager/v1/pages/AlertDetailPage.vue +++ b/apps/web/src/services/alert-manager/v1/pages/AlertDetailPage.vue @@ -6,7 +6,7 @@ import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; import { PIconButton, PHeading } from '@cloudforet/mirinae'; -import type { AlertDeleteParameters } from '@/schema/monitoring/alert/api-verbs/delete'; +import type { AlertDeleteParameters } from '@/api-clients/monitoring/alert/schema/api-verbs/delete'; import { i18n } from '@/translations'; import { showSuccessMessage } from '@/lib/helper/notice-alert-helper'; diff --git a/apps/web/src/services/alert-manager/v1/pages/EscalationPolicyPage.vue b/apps/web/src/services/alert-manager/v1/pages/EscalationPolicyPage.vue index ca16381f8b..2cba673f44 100644 --- a/apps/web/src/services/alert-manager/v1/pages/EscalationPolicyPage.vue +++ b/apps/web/src/services/alert-manager/v1/pages/EscalationPolicyPage.vue @@ -17,17 +17,17 @@ import type { ToolboxOptions } from '@cloudforet/mirinae/types/controls/toolbox/ import { iso8601Formatter } from '@cloudforet/utils'; import { RESOURCE_GROUP } from '@/api-clients/_common/schema/constant'; -import type { EscalationPolicyDeleteParameters } from '@/schema/monitoring/escalation-policy/api-verbs/delete'; +import type { EscalationPolicyDeleteParameters } from '@/api-clients/monitoring/escalation-policy/schema/api-verbs/delete'; import type { EscalationPolicyListParameters, EscalationPolicyListResponse, -} from '@/schema/monitoring/escalation-policy/api-verbs/list'; -import type { EscalationPolicySetDefaultParameters } from '@/schema/monitoring/escalation-policy/api-verbs/set-default'; +} from '@/api-clients/monitoring/escalation-policy/schema/api-verbs/list'; +import type { EscalationPolicySetDefaultParameters } from '@/api-clients/monitoring/escalation-policy/schema/api-verbs/set-default'; import { ESCALATION_POLICY_FINISH_CONDITION, ESCALATION_POLICY_RESOURCE_GROUP, -} from '@/schema/monitoring/escalation-policy/constant'; -import type { EscalationPolicyModel } from '@/schema/monitoring/escalation-policy/model'; +} from '@/api-clients/monitoring/escalation-policy/schema/constants'; +import type { EscalationPolicyModel } from '@/api-clients/monitoring/escalation-policy/schema/model'; import { i18n } from '@/translations'; import { useAllReferenceStore } from '@/store/reference/all-reference-store'; @@ -46,6 +46,7 @@ import EscalationPolicyFormModal from '@/services/alert-manager/v1/components/Es import { ACTION } from '@/services/alert-manager/v1/constants/alert-constant'; import type { ActionMode } from '@/services/alert-manager/v1/types/alert-type'; + interface Item extends Omit { name: { label: string; diff --git a/apps/web/src/services/alert-manager/v1/stores/alert-assign-user-store.ts b/apps/web/src/services/alert-manager/v1/stores/alert-assign-user-store.ts index 14c419ec12..d0c97b4d05 100644 --- a/apps/web/src/services/alert-manager/v1/stores/alert-assign-user-store.ts +++ b/apps/web/src/services/alert-manager/v1/stores/alert-assign-user-store.ts @@ -8,10 +8,10 @@ import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list'; import type { WorkspaceUserListParameters } from '@/api-clients/identity/workspace-user/schema/api-verbs/list'; import type { WorkspaceUserModel } from '@/api-clients/identity/workspace-user/schema/model'; -import type { AlertModel } from '@/schema/alert-manager/alert/model'; -import type { AlertAssignUserParameters } from '@/schema/monitoring/alert/api-verbs/assign-user'; -import type { AlertUpdateParameters } from '@/schema/monitoring/alert/api-verbs/update'; -import { ALERT_STATE } from '@/schema/monitoring/alert/constants'; +import type { AlertAssignUserParameters } from '@/api-clients/monitoring/alert/schema/api-verbs/assign-user'; +import type { AlertUpdateParameters } from '@/api-clients/monitoring/alert/schema/api-verbs/update'; +import { ALERT_STATE } from '@/api-clients/monitoring/alert/schema/constants'; +import type { AlertModelV1 } from '@/api-clients/monitoring/alert/schema/model'; import ErrorHandler from '@/common/composables/error/errorHandler'; @@ -42,9 +42,9 @@ export const useAlertAssignUserStore = defineStore('alert-user-assign-store', () throw new Error(alertId); } }, - async assignUserToAlert(alertId: string, assignee: string): Promise { + async assignUserToAlert(alertId: string, assignee: string): Promise { try { - const alertData = await SpaceConnector.clientV2.monitoring.alert.assignUser({ + const alertData = await SpaceConnector.clientV2.monitoring.alert.assignUser({ alert_id: alertId, assignee, }); diff --git a/apps/web/src/services/alert-manager/v1/stores/alert-page-store.ts b/apps/web/src/services/alert-manager/v1/stores/alert-page-store.ts index b926615b9d..3df287e563 100644 --- a/apps/web/src/services/alert-manager/v1/stores/alert-page-store.ts +++ b/apps/web/src/services/alert-manager/v1/stores/alert-page-store.ts @@ -4,13 +4,12 @@ import { defineStore } from 'pinia'; import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; -import type { AlertModel } from '@/schema/alert-manager/alert/model'; -import type { AlertGetParameters } from '@/schema/monitoring/alert/api-verbs/get'; -import type { AlertUpdateParameters } from '@/schema/monitoring/alert/api-verbs/update'; +import type { AlertGetParameters } from '@/api-clients/monitoring/alert/schema/api-verbs/get'; +import type { AlertUpdateParameters } from '@/api-clients/monitoring/alert/schema/api-verbs/update'; +import type { AlertModelV1 } from '@/api-clients/monitoring/alert/schema/model'; import ErrorHandler from '@/common/composables/error/errorHandler'; - interface UpdateAlertPayload { alertId: string; updateParams: Omit; @@ -18,12 +17,12 @@ interface UpdateAlertPayload { export const useAlertPageStore = defineStore('page-alert', () => { const state = reactive({ - alertData: null as Partial|null, + alertData: null as Partial|null, }); const actions = { async getAlertData(alertId: string): Promise { try { - state.alertData = await SpaceConnector.clientV2.monitoring.alert.get({ + state.alertData = await SpaceConnector.clientV2.monitoring.alert.get({ alert_id: alertId, }); } catch (e: any) { @@ -33,7 +32,7 @@ export const useAlertPageStore = defineStore('page-alert', () => { }, async updateAlertData({ alertId, updateParams }: UpdateAlertPayload): Promise { try { - state.alertData = await SpaceConnector.clientV2.monitoring.alert.update({ + state.alertData = await SpaceConnector.clientV2.monitoring.alert.update({ ...updateParams, alert_id: alertId, }); @@ -42,7 +41,7 @@ export const useAlertPageStore = defineStore('page-alert', () => { throw e; } }, - async setAlertData(alertData: AlertModel): Promise { + async setAlertData(alertData: AlertModelV1): Promise { state.alertData = alertData; }, diff --git a/apps/web/src/services/alert-manager/v1/stores/escalation-policy-form-store.ts b/apps/web/src/services/alert-manager/v1/stores/escalation-policy-form-store.ts index 5f49b211fb..af8ec16d17 100644 --- a/apps/web/src/services/alert-manager/v1/stores/escalation-policy-form-store.ts +++ b/apps/web/src/services/alert-manager/v1/stores/escalation-policy-form-store.ts @@ -1,9 +1,10 @@ import type { _GettersTree } from 'pinia'; import { defineStore } from 'pinia'; -import { ESCALATION_POLICY_FINISH_CONDITION } from '@/schema/monitoring/escalation-policy/constant'; -import type { EscalationPolicyModel } from '@/schema/monitoring/escalation-policy/model'; -import type { EscalationPolicyFinishCondition, EscalationPolicyRule } from '@/schema/monitoring/escalation-policy/type'; +import { ESCALATION_POLICY_FINISH_CONDITION } from '@/api-clients/monitoring/escalation-policy/schema/constants'; +import type { EscalationPolicyModel } from '@/api-clients/monitoring/escalation-policy/schema/model'; +import type { EscalationPolicyFinishCondition, EscalationPolicyRule } from '@/api-clients/monitoring/escalation-policy/schema/type'; + interface EscalationPolicyFormState { escalationPolicyData?: EscalationPolicyModel|undefined; diff --git a/apps/web/src/services/alert-manager/v1/types/alert-type.ts b/apps/web/src/services/alert-manager/v1/types/alert-type.ts index 218a106197..7949127f5e 100644 --- a/apps/web/src/services/alert-manager/v1/types/alert-type.ts +++ b/apps/web/src/services/alert-manager/v1/types/alert-type.ts @@ -1,6 +1,6 @@ import type { ConsoleFilter } from '@cloudforet/core-lib/query/type'; -import type { AlertState } from '@/schema/monitoring/alert/type'; +import type { AlertState } from '@/api-clients/monitoring/alert/schema/type'; import type { RouteQueryString } from '@/lib/router-query-string'; diff --git a/apps/web/src/services/alert-manager/v2/AlertContainer.vue b/apps/web/src/services/alert-manager/v2/AlertContainer.vue index 6456d68231..3d5f8e0f73 100644 --- a/apps/web/src/services/alert-manager/v2/AlertContainer.vue +++ b/apps/web/src/services/alert-manager/v2/AlertContainer.vue @@ -6,7 +6,6 @@ import { useAlertPageStore } from '@/services/alert-manager/v2/stores/alert-page const alertPageStore = useAlertPageStore(); onUnmounted(() => { - alertPageStore.init(); alertPageStore.$dispose(); }); diff --git a/apps/web/src/services/alert-manager/v2/components/AlertCreateModal.vue b/apps/web/src/services/alert-manager/v2/components/AlertCreateModal.vue index 3939e4ed6d..596a31ee79 100644 --- a/apps/web/src/services/alert-manager/v2/components/AlertCreateModal.vue +++ b/apps/web/src/services/alert-manager/v2/components/AlertCreateModal.vue @@ -2,16 +2,16 @@ import { computed, reactive } from 'vue'; import { useRoute } from 'vue-router/composables'; -import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; -import type { Query } from '@cloudforet/core-lib/space-connector/type'; +import { useMutation, useQueryClient } from '@tanstack/vue-query'; + import { PButtonModal, PFieldGroup, PTextInput, PTextarea, PSelectDropdown, PRadioGroup, PRadio, } from '@cloudforet/mirinae'; import type { SelectDropdownMenuItem } from '@cloudforet/mirinae/types/controls/dropdown/select-dropdown/type'; -import type { AlertCreateParameters } from '@/schema/alert-manager/alert/api-verbs/create'; -import { ALERT_URGENCY } from '@/schema/alert-manager/alert/constants'; -import type { AlertModel } from '@/schema/alert-manager/alert/model'; +import { useAlertApi } from '@/api-clients/alert-manager/alert/composables/use-alert-api'; +import { ALERT_URGENCY } from '@/api-clients/alert-manager/alert/schema/constants'; +import { useServiceQueryKey } from '@/query/query-key/use-service-query-key'; import { i18n } from '@/translations'; import { showSuccessMessage } from '@/lib/helper/notice-alert-helper'; @@ -35,19 +35,20 @@ const props = withDefaults(defineProps(), { }); const alertPageStore = useAlertPageStore(); -const alertPageState = alertPageStore.state; const alertPageGetters = alertPageStore.getters; const emit = defineEmits<{(e: 'update:visible'): void; }>(); const route = useRoute(); +const queryClient = useQueryClient(); +const { alertAPI } = useAlertApi(); +const { key: alertListQueryKey } = useServiceQueryKey('alert-manager', 'alert', 'list'); + const storeState = reactive({ serviceDropdownList: computed(() => alertPageGetters.serviceDropdownList), - alertListQuery: computed(() => alertPageState.alertListQuery), }); const state = reactive({ - loading: false, proxyVisible: useProxyValue('visible', props, emit), isServicePage: route.name === ALERT_MANAGER_ROUTE.SERVICE.DETAIL._NAME, @@ -64,6 +65,7 @@ const state = reactive({ ]), selectedRadioIdx: 0, }); + const { forms: { name, @@ -82,28 +84,30 @@ const { }, }); +const { mutate: createAlert, isPending } = useMutation({ + mutationFn: alertAPI.create, + onSuccess: () => { + showSuccessMessage(i18n.t('ALERT_MANAGER.ALERTS.ALT_S_CREATE'), ''); + queryClient.invalidateQueries({ queryKey: alertListQueryKey.value }); + }, + onError: (error) => { + ErrorHandler.handleError(error, true); + }, + onSettled: () => { + handleClose(); + }, +}); + const handleClose = () => { state.proxyVisible = false; }; const handleConfirm = async () => { - state.loading = true; - try { - await SpaceConnector.clientV2.alertManager.alert.create({ - title: name.value, - description: description.value, - service_id: state.selectedServiceId, - urgency: state.radioMenuList[state.selectedRadioIdx].name, - }); - showSuccessMessage(i18n.t('ALERT_MANAGER.ALERTS.ALT_S_CREATE'), ''); - await alertPageStore.fetchAlertsList({ - query: storeState.alertListQuery, - }); - } catch (e) { - ErrorHandler.handleError(e, true); - } finally { - state.loading = false; - handleClose(); - } + createAlert({ + title: name.value, + description: description.value, + service_id: state.selectedServiceId, + urgency: state.radioMenuList[state.selectedRadioIdx].name, + }); }; @@ -115,7 +119,7 @@ const handleConfirm = async () => { :backdrop="true" :visible="state.proxyVisible" :disabled="!isAllValid || !state.selectedServiceId" - :loading="state.loading" + :loading="isPending" @confirm="handleConfirm" @cancel="handleClose" @close="handleClose" diff --git a/apps/web/src/services/alert-manager/v2/components/AlertDetailDeleteModal.vue b/apps/web/src/services/alert-manager/v2/components/AlertDetailDeleteModal.vue index df59b25bba..85d00b4fff 100644 --- a/apps/web/src/services/alert-manager/v2/components/AlertDetailDeleteModal.vue +++ b/apps/web/src/services/alert-manager/v2/components/AlertDetailDeleteModal.vue @@ -1,12 +1,13 @@ @@ -75,7 +79,7 @@ const handleConfirm = async () => { :fade="true" :backdrop="true" :visible="state.proxyVisible" - :loading="state.loading" + :loading="alertDeleteLoading" @confirm="handleConfirm" @cancel="handleClose" @close="handleClose" diff --git a/apps/web/src/services/alert-manager/v2/components/AlertDetailEditModal.vue b/apps/web/src/services/alert-manager/v2/components/AlertDetailEditModal.vue index 7bfd25393a..c752ad3920 100644 --- a/apps/web/src/services/alert-manager/v2/components/AlertDetailEditModal.vue +++ b/apps/web/src/services/alert-manager/v2/components/AlertDetailEditModal.vue @@ -1,33 +1,29 @@ @@ -72,7 +68,7 @@ const handleConfirm = async () => { :backdrop="true" :visible="state.proxyVisible" :disabled="!isAllValid" - :loading="state.loading" + :loading="isPending" @confirm="handleConfirm" @cancel="handleClose" @close="handleClose" diff --git a/apps/web/src/services/alert-manager/v2/components/AlertDetailInfoTable.vue b/apps/web/src/services/alert-manager/v2/components/AlertDetailInfoTable.vue index fb675195b8..6f1bb7cfe0 100644 --- a/apps/web/src/services/alert-manager/v2/components/AlertDetailInfoTable.vue +++ b/apps/web/src/services/alert-manager/v2/components/AlertDetailInfoTable.vue @@ -1,6 +1,6 @@