Skip to content

Commit

Permalink
test(schemas): update schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinplemelon authored and ysfscream committed May 15, 2024
1 parent 467ae8c commit d1278ec
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/types/schemas/clients.schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ export const EmqxMgmtApiClientsRequestedClientFieldsParameterOneOfItem = {
inflight_max: 'inflight_max',
ip_address: 'ip_address',
is_bridge: 'is_bridge',
is_expired: 'is_expired',
keepalive: 'keepalive',
mailbox_len: 'mailbox_len',
mqueue_dropped: 'mqueue_dropped',
Expand Down Expand Up @@ -502,6 +503,7 @@ export interface EmqxMgmtApiClientsClient {
inflight_max?: number
ip_address?: string
is_bridge?: boolean
is_expired?: boolean
keepalive?: number
mailbox_len?: number
mqueue_dropped?: number
Expand Down
60 changes: 59 additions & 1 deletion src/types/schemas/rules.schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,45 @@ export type GetRules200 = {
meta?: PublicMeta
}

export type PostRulesIdTest412Code =
typeof PostRulesIdTest412Code[keyof typeof PostRulesIdTest412Code]

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PostRulesIdTest412Code = {
NOT_MATCH: 'NOT_MATCH',
} as const

export type PostRulesIdTest412 = {
code?: PostRulesIdTest412Code
message?: string
}

export type PostRulesIdTest404Code =
typeof PostRulesIdTest404Code[keyof typeof PostRulesIdTest404Code]

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PostRulesIdTest404Code = {
RULE_NOT_FOUND: 'RULE_NOT_FOUND',
} as const

export type PostRulesIdTest404 = {
code?: PostRulesIdTest404Code
message?: string
}

export type PostRulesIdTest400Code =
typeof PostRulesIdTest400Code[keyof typeof PostRulesIdTest400Code]

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PostRulesIdTest400Code = {
BAD_REQUEST: 'BAD_REQUEST',
} as const

export type PostRulesIdTest400 = {
code?: PostRulesIdTest400Code
message?: string
}

export type PostRuleTest412Code = typeof PostRuleTest412Code[keyof typeof PostRuleTest412Code]

// eslint-disable-next-line @typescript-eslint/no-redeclare
Expand Down Expand Up @@ -210,7 +249,7 @@ export const RuleEngineRuleEventsEvent = {
'$events/message_delivered': '$events/message_delivered',
'$events/message_acked': '$events/message_acked',
'$events/message_dropped': '$events/message_dropped',
'$events/message_validation_failed': '$events/message_validation_failed',
'$events/schema_validation_failed': '$events/schema_validation_failed',
'$events/delivery_dropped': '$events/delivery_dropped',
} as const

Expand Down Expand Up @@ -245,6 +284,11 @@ export interface RuleEngineRuleCreation {
metadata?: RuleEngineRuleCreationMetadata
}

export interface RuleEngineRuleApplyTest {
context?: RuleEngineRuleApplyTestContext
stop_action_after_template_rendering?: boolean
}

export interface RuleEngineRepublishMqttProperties {
'Payload-Format-Indicator'?: string
'Message-Expiry-Interval'?: string
Expand Down Expand Up @@ -441,6 +485,20 @@ export interface RuleEngineCtxDelivered {
qos?: number
}

export type RuleEngineRuleApplyTestContext =
| RuleEngineCtxDeliveryDropped
| RuleEngineCtxBridgeMqtt
| RuleEngineCtxCheckAuthzComplete
| RuleEngineCtxConnack
| RuleEngineCtxDisconnected
| RuleEngineCtxConnected
| RuleEngineCtxDropped
| RuleEngineCtxAcked
| RuleEngineCtxDelivered
| RuleEngineCtxUnsub
| RuleEngineCtxSub
| RuleEngineCtxPub

export type RuleEngineCtxConnectedEventType =
typeof RuleEngineCtxConnectedEventType[keyof typeof RuleEngineCtxConnectedEventType]

Expand Down

0 comments on commit d1278ec

Please sign in to comment.