@abyss-project/reflex 5.6.0 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/enum/discord-channel-type.enum.d.ts +7 -0
- package/dist/types/enum/discord-channel-type.enum.js +12 -0
- package/dist/types/enum/discord-channel-type.enum.js.map +1 -0
- package/dist/types/enum/discord-host-action.enum.d.ts +31 -0
- package/dist/types/enum/discord-host-action.enum.js +36 -0
- package/dist/types/enum/discord-host-action.enum.js.map +1 -0
- package/dist/types/enum/discord-locale.enum.d.ts +34 -0
- package/dist/types/enum/discord-locale.enum.js +39 -0
- package/dist/types/enum/discord-locale.enum.js.map +1 -0
- package/dist/types/enum/index.d.ts +3 -0
- package/dist/types/enum/index.js +3 -0
- package/dist/types/enum/index.js.map +1 -1
- package/dist/types/interface/api/requests/service-discord.request.d.ts +7 -1
- package/dist/types/interface/models/reflex-discord-event.model.d.ts +1 -1
- package/dist/types/interface/models/reflex-discord-event.model.js +1 -1
- package/dist/types/interface/models/reflex-discord-event.model.js.map +1 -1
- package/dist/types/interface/models/reflex-discord.model.d.ts +20 -2
- package/dist/types/interface/models/reflex-discord.model.js +2 -0
- package/dist/types/interface/models/reflex-discord.model.js.map +1 -1
- package/package.json +1 -1
- package/src/api/function-insights.api.test.ts +27 -27
- package/src/api/function-insights.api.ts +18 -18
- package/src/api/index.ts +17 -17
- package/src/api/service-discord-event.api.test.ts +106 -106
- package/src/api/service-discord-event.api.ts +78 -78
- package/src/api/service-discord.api.test.ts +197 -197
- package/src/api/service-discord.api.ts +241 -241
- package/src/api/service-insights.api.test.ts +36 -36
- package/src/api/service-insights.api.ts +42 -42
- package/src/discord/discord-event-filter-cases.ts +261 -261
- package/src/discord/discord-event-filters.test.ts +91 -91
- package/src/discord/discord-event-filters.ts +95 -95
- package/src/discord/discord-event-intents.test.ts +112 -112
- package/src/discord/discord-event-intents.ts +55 -55
- package/src/discord/index.ts +3 -3
- package/src/index.test.ts +75 -75
- package/src/index.ts +317 -317
- package/src/types/enum/bot-event-block-reason.enum.ts +7 -7
- package/src/types/enum/discord-channel-type.enum.ts +11 -0
- package/src/types/enum/discord-event-drop-reason.enum.ts +13 -13
- package/src/types/enum/discord-event-filter-name.enum.ts +11 -11
- package/src/types/enum/discord-event-status.enum.ts +13 -13
- package/src/types/enum/discord-event-type.enum.ts +7 -7
- package/src/types/enum/discord-gateway-failure-code.enum.ts +11 -11
- package/src/types/enum/discord-host-action.enum.ts +35 -0
- package/src/types/enum/discord-locale.enum.ts +35 -0
- package/src/types/enum/index.ts +43 -40
- package/src/types/enum/insights-period.enum.ts +8 -8
- package/src/types/enum/reflex-error-code.enum.ts +43 -43
- package/src/types/enum/scheduled-run-failure-code.enum.ts +12 -12
- package/src/types/enum/trigger-kind.enum.ts +8 -8
- package/src/types/interface/api/requests/index.ts +15 -15
- package/src/types/interface/api/requests/service-discord-event.request.ts +68 -68
- package/src/types/interface/api/requests/service-discord.request.ts +173 -161
- package/src/types/interface/api/requests/service-insights.request.ts +31 -31
- package/src/types/interface/api/responses/index.ts +15 -15
- package/src/types/interface/api/responses/service-discord-event.response.ts +24 -24
- package/src/types/interface/api/responses/service-discord.response.ts +122 -122
- package/src/types/interface/api/responses/service-insights.response.ts +11 -11
- package/src/types/interface/api/responses/service-version.response.ts +106 -106
- package/src/types/interface/models/index.ts +19 -19
- package/src/types/interface/models/reflex-bot-limits.model.ts +92 -92
- package/src/types/interface/models/reflex-discord-event-log.model.ts +58 -58
- package/src/types/interface/models/reflex-discord-event.model.ts +79 -77
- package/src/types/interface/models/reflex-discord.model.ts +45 -4
- package/src/types/interface/models/reflex-insights.model.ts +120 -120
- package/src/types/interface/models/reflex-run.model.ts +186 -183
- package/src/types/interface/models/reflex-service-version.model.ts +61 -61
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type of a Discord channel a CHANNEL option may be limited to (Discord's names; the API sends their
|
|
3
|
+
* numbers). Same set as the runtime's `DiscordChannelType`, which a parity test keeps equal.
|
|
4
|
+
*/
|
|
5
|
+
export enum DiscordChannelType {
|
|
6
|
+
TEXT = 'TEXT',
|
|
7
|
+
VOICE = 'VOICE',
|
|
8
|
+
CATEGORY = 'CATEGORY',
|
|
9
|
+
ANNOUNCEMENT = 'ANNOUNCEMENT',
|
|
10
|
+
FORUM = 'FORUM',
|
|
11
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/** Why a Discord event the Gateway received was not kept for execution. */
|
|
2
|
-
export enum DiscordEventDropReason {
|
|
3
|
-
/** A filter of the trigger rejected it (see `DiscordEventFilterName`). */
|
|
4
|
-
FILTERED = 'FILTERED',
|
|
5
|
-
/** The bot went past its events per minute. */
|
|
6
|
-
RATE = 'RATE',
|
|
7
|
-
/** The monthly spend cap of the bot is reached. */
|
|
8
|
-
MONTHLY_CAP = 'MONTHLY_CAP',
|
|
9
|
-
/** The credits of the organization are spent and the bot has no overage. */
|
|
10
|
-
CREDITS_EXHAUSTED = 'CREDITS_EXHAUSTED',
|
|
11
|
-
/** It waited in the inbox past the tolerance. */
|
|
12
|
-
EXPIRED = 'EXPIRED',
|
|
13
|
-
}
|
|
1
|
+
/** Why a Discord event the Gateway received was not kept for execution. */
|
|
2
|
+
export enum DiscordEventDropReason {
|
|
3
|
+
/** A filter of the trigger rejected it (see `DiscordEventFilterName`). */
|
|
4
|
+
FILTERED = 'FILTERED',
|
|
5
|
+
/** The bot went past its events per minute. */
|
|
6
|
+
RATE = 'RATE',
|
|
7
|
+
/** The monthly spend cap of the bot is reached. */
|
|
8
|
+
MONTHLY_CAP = 'MONTHLY_CAP',
|
|
9
|
+
/** The credits of the organization are spent and the bot has no overage. */
|
|
10
|
+
CREDITS_EXHAUSTED = 'CREDITS_EXHAUSTED',
|
|
11
|
+
/** It waited in the inbox past the tolerance. */
|
|
12
|
+
EXPIRED = 'EXPIRED',
|
|
13
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/** A filter of a Discord event trigger; the value is its key in `IReflexDiscordEventFilters` (and the name reported when it rejects an event), except `guildOnly`. */
|
|
2
|
-
export enum DiscordEventFilterName {
|
|
3
|
-
GUILD_IDS = 'guildIds',
|
|
4
|
-
CHANNEL_IDS = 'channelIds',
|
|
5
|
-
ROLE_IDS = 'roleIds',
|
|
6
|
-
CONTENT_PREFIX = 'contentPrefix',
|
|
7
|
-
IGNORE_BOTS = 'ignoreBots',
|
|
8
|
-
IGNORE_SELF = 'ignoreSelf',
|
|
9
|
-
/** Not a setting: events outside a server (direct messages) are always ignored. */
|
|
10
|
-
GUILD_ONLY = 'guildOnly',
|
|
11
|
-
}
|
|
1
|
+
/** A filter of a Discord event trigger; the value is its key in `IReflexDiscordEventFilters` (and the name reported when it rejects an event), except `guildOnly`. */
|
|
2
|
+
export enum DiscordEventFilterName {
|
|
3
|
+
GUILD_IDS = 'guildIds',
|
|
4
|
+
CHANNEL_IDS = 'channelIds',
|
|
5
|
+
ROLE_IDS = 'roleIds',
|
|
6
|
+
CONTENT_PREFIX = 'contentPrefix',
|
|
7
|
+
IGNORE_BOTS = 'ignoreBots',
|
|
8
|
+
IGNORE_SELF = 'ignoreSelf',
|
|
9
|
+
/** Not a setting: events outside a server (direct messages) are always ignored. */
|
|
10
|
+
GUILD_ONLY = 'guildOnly',
|
|
11
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/** Where a retained Discord event is in the inbox of the execution plane. */
|
|
2
|
-
export enum DiscordEventStatus {
|
|
3
|
-
/** Waiting to be taken by an edge. */
|
|
4
|
-
PENDING = 'PENDING',
|
|
5
|
-
/** Taken by an edge, running. */
|
|
6
|
-
CLAIMED = 'CLAIMED',
|
|
7
|
-
/** The function ran to its end. */
|
|
8
|
-
DONE = 'DONE',
|
|
9
|
-
/** The function failed, or the trigger left the version in service: never retried. */
|
|
10
|
-
FAILED = 'FAILED',
|
|
11
|
-
/** Not taken within the tolerance: never run, never billed. */
|
|
12
|
-
EXPIRED = 'EXPIRED',
|
|
13
|
-
}
|
|
1
|
+
/** Where a retained Discord event is in the inbox of the execution plane. */
|
|
2
|
+
export enum DiscordEventStatus {
|
|
3
|
+
/** Waiting to be taken by an edge. */
|
|
4
|
+
PENDING = 'PENDING',
|
|
5
|
+
/** Taken by an edge, running. */
|
|
6
|
+
CLAIMED = 'CLAIMED',
|
|
7
|
+
/** The function ran to its end. */
|
|
8
|
+
DONE = 'DONE',
|
|
9
|
+
/** The function failed, or the trigger left the version in service: never retried. */
|
|
10
|
+
FAILED = 'FAILED',
|
|
11
|
+
/** Not taken within the tolerance: never run, never billed. */
|
|
12
|
+
EXPIRED = 'EXPIRED',
|
|
13
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** A Discord Gateway event a function of a bot Service can be triggered by. */
|
|
2
|
-
export enum DiscordEventType {
|
|
3
|
-
GUILD_MEMBER_ADD = 'GUILD_MEMBER_ADD',
|
|
4
|
-
GUILD_MEMBER_REMOVE = 'GUILD_MEMBER_REMOVE',
|
|
5
|
-
MESSAGE_CREATE = 'MESSAGE_CREATE',
|
|
6
|
-
MESSAGE_REACTION_ADD = 'MESSAGE_REACTION_ADD',
|
|
7
|
-
}
|
|
1
|
+
/** A Discord Gateway event a function of a bot Service can be triggered by. */
|
|
2
|
+
export enum DiscordEventType {
|
|
3
|
+
GUILD_MEMBER_ADD = 'GUILD_MEMBER_ADD',
|
|
4
|
+
GUILD_MEMBER_REMOVE = 'GUILD_MEMBER_REMOVE',
|
|
5
|
+
MESSAGE_CREATE = 'MESSAGE_CREATE',
|
|
6
|
+
MESSAGE_REACTION_ADD = 'MESSAGE_REACTION_ADD',
|
|
7
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/** Why a Gateway connection is `FAILED`. */
|
|
2
|
-
export enum DiscordGatewayFailureCode {
|
|
3
|
-
/** Discord rejected the token (close code 4004). */
|
|
4
|
-
TOKEN_REJECTED = 'TOKEN_REJECTED',
|
|
5
|
-
/** The bot spent its identifications of the UTC day. */
|
|
6
|
-
IDENTIFY_BUDGET = 'IDENTIFY_BUDGET',
|
|
7
|
-
/** Discord refused the connection (close codes 4010 to 4013: invalid shard, sharding required, invalid API version, invalid intents). */
|
|
8
|
-
DISCORD_REFUSED = 'DISCORD_REFUSED',
|
|
9
|
-
/** Discord refused the intents the version in service asks for (close code 4014): a privileged intent is not enabled in the Discord portal. */
|
|
10
|
-
INTENTS_DISALLOWED = 'INTENTS_DISALLOWED',
|
|
11
|
-
}
|
|
1
|
+
/** Why a Gateway connection is `FAILED`. */
|
|
2
|
+
export enum DiscordGatewayFailureCode {
|
|
3
|
+
/** Discord rejected the token (close code 4004). */
|
|
4
|
+
TOKEN_REJECTED = 'TOKEN_REJECTED',
|
|
5
|
+
/** The bot spent its identifications of the UTC day. */
|
|
6
|
+
IDENTIFY_BUDGET = 'IDENTIFY_BUDGET',
|
|
7
|
+
/** Discord refused the connection (close codes 4010 to 4013: invalid shard, sharding required, invalid API version, invalid intents). */
|
|
8
|
+
DISCORD_REFUSED = 'DISCORD_REFUSED',
|
|
9
|
+
/** Discord refused the intents the version in service asks for (close code 4014): a privileged intent is not enabled in the Discord portal. */
|
|
10
|
+
INTENTS_DISALLOWED = 'INTENTS_DISALLOWED',
|
|
11
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `discord.*` actions a function of a Discord bot Service can declare in its accesses. Same values
|
|
3
|
+
* as the runtime's `DiscordCapability`, which a parity test keeps equal: the Access screen lists them all.
|
|
4
|
+
*/
|
|
5
|
+
export enum DiscordHostAction {
|
|
6
|
+
REPLY = 'discord.reply',
|
|
7
|
+
UPDATE = 'discord.update',
|
|
8
|
+
SHOW_MODAL = 'discord.showModal',
|
|
9
|
+
FOLLOW_UP = 'discord.followUp',
|
|
10
|
+
SEND_MESSAGE = 'discord.sendMessage',
|
|
11
|
+
EDIT_MESSAGE = 'discord.editMessage',
|
|
12
|
+
DELETE_MESSAGE = 'discord.deleteMessage',
|
|
13
|
+
ADD_ROLE = 'discord.addRole',
|
|
14
|
+
REMOVE_ROLE = 'discord.removeRole',
|
|
15
|
+
SEND_DIRECT_MESSAGE = 'discord.sendDirectMessage',
|
|
16
|
+
GET_MEMBER = 'discord.getMember',
|
|
17
|
+
GET_GUILD_ROLES = 'discord.getGuildRoles',
|
|
18
|
+
GET_CHANNEL = 'discord.getChannel',
|
|
19
|
+
GET_GUILD = 'discord.getGuild',
|
|
20
|
+
KICK_MEMBER = 'discord.kickMember',
|
|
21
|
+
BAN_MEMBER = 'discord.banMember',
|
|
22
|
+
UNBAN_MEMBER = 'discord.unbanMember',
|
|
23
|
+
TIMEOUT_MEMBER = 'discord.timeoutMember',
|
|
24
|
+
BULK_DELETE_MESSAGES = 'discord.bulkDeleteMessages',
|
|
25
|
+
ADD_REACTION = 'discord.addReaction',
|
|
26
|
+
REMOVE_REACTION = 'discord.removeReaction',
|
|
27
|
+
CREATE_CHANNEL = 'discord.createChannel',
|
|
28
|
+
DELETE_CHANNEL = 'discord.deleteChannel',
|
|
29
|
+
SET_CHANNEL_PERMISSION = 'discord.setChannelPermission',
|
|
30
|
+
REMOVE_CHANNEL_PERMISSION = 'discord.removeChannelPermission',
|
|
31
|
+
CREATE_ROLE = 'discord.createRole',
|
|
32
|
+
DELETE_ROLE = 'discord.deleteRole',
|
|
33
|
+
CREATE_THREAD = 'discord.createThread',
|
|
34
|
+
END_POLL = 'discord.endPoll',
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** The locales Discord translates a command, an option or a choice into (Discord's own codes). */
|
|
2
|
+
export enum DiscordLocale {
|
|
3
|
+
ID = 'id',
|
|
4
|
+
DA = 'da',
|
|
5
|
+
DE = 'de',
|
|
6
|
+
EN_GB = 'en-GB',
|
|
7
|
+
EN_US = 'en-US',
|
|
8
|
+
ES_ES = 'es-ES',
|
|
9
|
+
ES_419 = 'es-419',
|
|
10
|
+
FR = 'fr',
|
|
11
|
+
HR = 'hr',
|
|
12
|
+
IT = 'it',
|
|
13
|
+
LT = 'lt',
|
|
14
|
+
HU = 'hu',
|
|
15
|
+
NL = 'nl',
|
|
16
|
+
NO = 'no',
|
|
17
|
+
PL = 'pl',
|
|
18
|
+
PT_BR = 'pt-BR',
|
|
19
|
+
RO = 'ro',
|
|
20
|
+
FI = 'fi',
|
|
21
|
+
SV_SE = 'sv-SE',
|
|
22
|
+
VI = 'vi',
|
|
23
|
+
TR = 'tr',
|
|
24
|
+
CS = 'cs',
|
|
25
|
+
EL = 'el',
|
|
26
|
+
BG = 'bg',
|
|
27
|
+
RU = 'ru',
|
|
28
|
+
UK = 'uk',
|
|
29
|
+
HI = 'hi',
|
|
30
|
+
TH = 'th',
|
|
31
|
+
ZH_CN = 'zh-CN',
|
|
32
|
+
JA = 'ja',
|
|
33
|
+
ZH_TW = 'zh-TW',
|
|
34
|
+
KO = 'ko',
|
|
35
|
+
}
|
package/src/types/enum/index.ts
CHANGED
|
@@ -1,40 +1,43 @@
|
|
|
1
|
-
export * from './health-status.enum';
|
|
2
|
-
export * from './trigger-access-mode.enum';
|
|
3
|
-
export * from './access-grant-status.enum';
|
|
4
|
-
export * from './run-mode.enum';
|
|
5
|
-
export * from './run-status.enum';
|
|
6
|
-
export * from './trace-effect-type.enum';
|
|
7
|
-
export * from './reflex-error-code.enum';
|
|
8
|
-
export * from './access-kind.enum';
|
|
9
|
-
export * from './execution-profile.enum';
|
|
10
|
-
export * from './execution-mode.enum';
|
|
11
|
-
export * from './execution-settings-source.enum';
|
|
12
|
-
export * from './run-step-status.enum';
|
|
13
|
-
export * from './run-log-level.enum';
|
|
14
|
-
export * from './service-type.enum';
|
|
15
|
-
export * from './route-method.enum';
|
|
16
|
-
export * from './service-deployment-action.enum';
|
|
17
|
-
export * from './service-deployment-status.enum';
|
|
18
|
-
export * from './vault-value-source.enum';
|
|
19
|
-
export * from './vault-visibility.enum';
|
|
20
|
-
export * from './configuration-read-as.enum';
|
|
21
|
-
export * from './service-version-change-kind.enum';
|
|
22
|
-
export * from './discord-option-type.enum';
|
|
23
|
-
export * from './discord-component-kind.enum';
|
|
24
|
-
export * from './discord-sync-status.enum';
|
|
25
|
-
export * from './discord-token-state.enum';
|
|
26
|
-
export * from './discord-presence-status.enum';
|
|
27
|
-
export * from './discord-activity-type.enum';
|
|
28
|
-
export * from './discord-gateway-state.enum';
|
|
29
|
-
export * from './discord-gateway-failure-code.enum';
|
|
30
|
-
export * from './schedule-sync-status.enum';
|
|
31
|
-
export * from './scheduled-run-origin.enum';
|
|
32
|
-
export * from './scheduled-run-status.enum';
|
|
33
|
-
export * from './scheduled-run-failure-code.enum';
|
|
34
|
-
export * from './discord-event-type.enum';
|
|
35
|
-
export * from './discord-event-status.enum';
|
|
36
|
-
export * from './discord-event-drop-reason.enum';
|
|
37
|
-
export * from './discord-event-filter-name.enum';
|
|
38
|
-
export * from './bot-event-block-reason.enum';
|
|
39
|
-
export * from './insights-period.enum';
|
|
40
|
-
export * from './trigger-kind.enum';
|
|
1
|
+
export * from './health-status.enum';
|
|
2
|
+
export * from './trigger-access-mode.enum';
|
|
3
|
+
export * from './access-grant-status.enum';
|
|
4
|
+
export * from './run-mode.enum';
|
|
5
|
+
export * from './run-status.enum';
|
|
6
|
+
export * from './trace-effect-type.enum';
|
|
7
|
+
export * from './reflex-error-code.enum';
|
|
8
|
+
export * from './access-kind.enum';
|
|
9
|
+
export * from './execution-profile.enum';
|
|
10
|
+
export * from './execution-mode.enum';
|
|
11
|
+
export * from './execution-settings-source.enum';
|
|
12
|
+
export * from './run-step-status.enum';
|
|
13
|
+
export * from './run-log-level.enum';
|
|
14
|
+
export * from './service-type.enum';
|
|
15
|
+
export * from './route-method.enum';
|
|
16
|
+
export * from './service-deployment-action.enum';
|
|
17
|
+
export * from './service-deployment-status.enum';
|
|
18
|
+
export * from './vault-value-source.enum';
|
|
19
|
+
export * from './vault-visibility.enum';
|
|
20
|
+
export * from './configuration-read-as.enum';
|
|
21
|
+
export * from './service-version-change-kind.enum';
|
|
22
|
+
export * from './discord-option-type.enum';
|
|
23
|
+
export * from './discord-component-kind.enum';
|
|
24
|
+
export * from './discord-sync-status.enum';
|
|
25
|
+
export * from './discord-token-state.enum';
|
|
26
|
+
export * from './discord-presence-status.enum';
|
|
27
|
+
export * from './discord-activity-type.enum';
|
|
28
|
+
export * from './discord-gateway-state.enum';
|
|
29
|
+
export * from './discord-gateway-failure-code.enum';
|
|
30
|
+
export * from './schedule-sync-status.enum';
|
|
31
|
+
export * from './scheduled-run-origin.enum';
|
|
32
|
+
export * from './scheduled-run-status.enum';
|
|
33
|
+
export * from './scheduled-run-failure-code.enum';
|
|
34
|
+
export * from './discord-event-type.enum';
|
|
35
|
+
export * from './discord-event-status.enum';
|
|
36
|
+
export * from './discord-event-drop-reason.enum';
|
|
37
|
+
export * from './discord-event-filter-name.enum';
|
|
38
|
+
export * from './bot-event-block-reason.enum';
|
|
39
|
+
export * from './insights-period.enum';
|
|
40
|
+
export * from './trigger-kind.enum';
|
|
41
|
+
export * from './discord-channel-type.enum';
|
|
42
|
+
export * from './discord-locale.enum';
|
|
43
|
+
export * from './discord-host-action.enum';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/** The period a dashboard covers; the value is what the query string carries. */
|
|
2
|
-
export enum InsightsPeriod {
|
|
3
|
-
HOUR_1 = '1h',
|
|
4
|
-
HOURS_24 = '24h',
|
|
5
|
-
DAYS_7 = '7d',
|
|
6
|
-
DAYS_30 = '30d',
|
|
7
|
-
DAYS_90 = '90d',
|
|
8
|
-
}
|
|
1
|
+
/** The period a dashboard covers; the value is what the query string carries. */
|
|
2
|
+
export enum InsightsPeriod {
|
|
3
|
+
HOUR_1 = '1h',
|
|
4
|
+
HOURS_24 = '24h',
|
|
5
|
+
DAYS_7 = '7d',
|
|
6
|
+
DAYS_30 = '30d',
|
|
7
|
+
DAYS_90 = '90d',
|
|
8
|
+
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
/** `error.code` of the refusals a client acts on. */
|
|
2
|
-
export enum ReflexErrorCode {
|
|
3
|
-
/** 400: the definition does not match the format; `error.details` holds the path of each fault. */
|
|
4
|
-
INVALID_DEFINITION = 'INVALID_DEFINITION',
|
|
5
|
-
/** 409: an access granted to the function is suspended; revoke it and grant it again. */
|
|
6
|
-
GRANT_SUSPENDED = 'GRANT_SUSPENDED',
|
|
7
|
-
/** 409: the function has no frozen version of its own draft yet, or none to go back to. */
|
|
8
|
-
NO_VERSION = 'NO_VERSION',
|
|
9
|
-
/** 409: the access to grant is not declared by the draft of the function. */
|
|
10
|
-
ACCESS_NOT_DECLARED = 'ACCESS_NOT_DECLARED',
|
|
11
|
-
/** 404: the environment is not one of the application's environments (abyss-main). */
|
|
12
|
-
ENVIRONMENT_NOT_FOUND = 'ENVIRONMENT_NOT_FOUND',
|
|
13
|
-
/** 409: a name, a path or an access already exists. */
|
|
14
|
-
ALREADY_EXISTS = 'ALREADY_EXISTS',
|
|
15
|
-
/** 403: the function is promoted in a production environment and the member lacks REFLEX_PUBLISH_PRODUCTION. */
|
|
16
|
-
PUBLISH_PRODUCTION_REQUIRED = 'PUBLISH_PRODUCTION_REQUIRED',
|
|
17
|
-
/** 503 (edge): the Service is paused in this environment; nothing ran, nothing is billed. */
|
|
18
|
-
SERVICE_PAUSED = 'SERVICE_PAUSED',
|
|
19
|
-
/** 429: the caller went past the limit; `Retry-After` and `RateLimit-*` say when to come back. */
|
|
20
|
-
RATE_LIMIT_EXCEEDED = 'RATE_LIMIT_EXCEEDED',
|
|
21
|
-
/** 409: the route would hide another one of the Service (same method, paths equal but for their parameters). */
|
|
22
|
-
ROUTE_CONFLICT = 'ROUTE_CONFLICT',
|
|
23
|
-
/** 409: the Service has not changed since its last version. */
|
|
24
|
-
VERSION_UNCHANGED = 'VERSION_UNCHANGED',
|
|
25
|
-
/** 409: the Discord bot token has no value in this environment's Vault entry. */
|
|
26
|
-
DISCORD_TOKEN_MISSING = 'DISCORD_TOKEN_MISSING',
|
|
27
|
-
/** 409: Discord refused the bot token (401). */
|
|
28
|
-
DISCORD_TOKEN_REJECTED = 'DISCORD_TOKEN_REJECTED',
|
|
29
|
-
/** 409: a non-production environment needs a test server before a Discord bot goes live there. */
|
|
30
|
-
DISCORD_TEST_GUILD_REQUIRED = 'DISCORD_TEST_GUILD_REQUIRED',
|
|
31
|
-
/** 409: a command of that name already exists in the Service. */
|
|
32
|
-
DISCORD_COMMAND_CONFLICT = 'DISCORD_COMMAND_CONFLICT',
|
|
33
|
-
/** 409: the component prefix equals, starts or is started by another prefix of the Service. */
|
|
34
|
-
DISCORD_COMPONENT_PREFIX_CONFLICT = 'DISCORD_COMPONENT_PREFIX_CONFLICT',
|
|
35
|
-
/** 400: the field does not exist for this type of Service (CORS or rate limit on a Discord bot). */
|
|
36
|
-
SERVICE_TYPE_FIELD_REFUSED = 'SERVICE_TYPE_FIELD_REFUSED',
|
|
37
|
-
/** 400: a route path cannot start with `_abyss`, the segment the edge keeps for its own addresses (ticks of the cron tasks). */
|
|
38
|
-
ROUTE_SEGMENT_RESERVED = 'ROUTE_SEGMENT_RESERVED',
|
|
39
|
-
/** 409: the bot bills credit overage but the organization does not allow overage of the credits metric. */
|
|
40
|
-
CREDIT_OVERAGE_NOT_ALLOWED = 'CREDIT_OVERAGE_NOT_ALLOWED',
|
|
41
|
-
/** 409: the lots asked for do not fit in the event rate reserve of the organization (the sum of its allocations would go past it). */
|
|
42
|
-
BOT_EVENT_RESERVE_EXCEEDED = 'BOT_EVENT_RESERVE_EXCEEDED',
|
|
43
|
-
}
|
|
1
|
+
/** `error.code` of the refusals a client acts on. */
|
|
2
|
+
export enum ReflexErrorCode {
|
|
3
|
+
/** 400: the definition does not match the format; `error.details` holds the path of each fault. */
|
|
4
|
+
INVALID_DEFINITION = 'INVALID_DEFINITION',
|
|
5
|
+
/** 409: an access granted to the function is suspended; revoke it and grant it again. */
|
|
6
|
+
GRANT_SUSPENDED = 'GRANT_SUSPENDED',
|
|
7
|
+
/** 409: the function has no frozen version of its own draft yet, or none to go back to. */
|
|
8
|
+
NO_VERSION = 'NO_VERSION',
|
|
9
|
+
/** 409: the access to grant is not declared by the draft of the function. */
|
|
10
|
+
ACCESS_NOT_DECLARED = 'ACCESS_NOT_DECLARED',
|
|
11
|
+
/** 404: the environment is not one of the application's environments (abyss-main). */
|
|
12
|
+
ENVIRONMENT_NOT_FOUND = 'ENVIRONMENT_NOT_FOUND',
|
|
13
|
+
/** 409: a name, a path or an access already exists. */
|
|
14
|
+
ALREADY_EXISTS = 'ALREADY_EXISTS',
|
|
15
|
+
/** 403: the function is promoted in a production environment and the member lacks REFLEX_PUBLISH_PRODUCTION. */
|
|
16
|
+
PUBLISH_PRODUCTION_REQUIRED = 'PUBLISH_PRODUCTION_REQUIRED',
|
|
17
|
+
/** 503 (edge): the Service is paused in this environment; nothing ran, nothing is billed. */
|
|
18
|
+
SERVICE_PAUSED = 'SERVICE_PAUSED',
|
|
19
|
+
/** 429: the caller went past the limit; `Retry-After` and `RateLimit-*` say when to come back. */
|
|
20
|
+
RATE_LIMIT_EXCEEDED = 'RATE_LIMIT_EXCEEDED',
|
|
21
|
+
/** 409: the route would hide another one of the Service (same method, paths equal but for their parameters). */
|
|
22
|
+
ROUTE_CONFLICT = 'ROUTE_CONFLICT',
|
|
23
|
+
/** 409: the Service has not changed since its last version. */
|
|
24
|
+
VERSION_UNCHANGED = 'VERSION_UNCHANGED',
|
|
25
|
+
/** 409: the Discord bot token has no value in this environment's Vault entry. */
|
|
26
|
+
DISCORD_TOKEN_MISSING = 'DISCORD_TOKEN_MISSING',
|
|
27
|
+
/** 409: Discord refused the bot token (401). */
|
|
28
|
+
DISCORD_TOKEN_REJECTED = 'DISCORD_TOKEN_REJECTED',
|
|
29
|
+
/** 409: a non-production environment needs a test server before a Discord bot goes live there. */
|
|
30
|
+
DISCORD_TEST_GUILD_REQUIRED = 'DISCORD_TEST_GUILD_REQUIRED',
|
|
31
|
+
/** 409: a command of that name already exists in the Service. */
|
|
32
|
+
DISCORD_COMMAND_CONFLICT = 'DISCORD_COMMAND_CONFLICT',
|
|
33
|
+
/** 409: the component prefix equals, starts or is started by another prefix of the Service. */
|
|
34
|
+
DISCORD_COMPONENT_PREFIX_CONFLICT = 'DISCORD_COMPONENT_PREFIX_CONFLICT',
|
|
35
|
+
/** 400: the field does not exist for this type of Service (CORS or rate limit on a Discord bot). */
|
|
36
|
+
SERVICE_TYPE_FIELD_REFUSED = 'SERVICE_TYPE_FIELD_REFUSED',
|
|
37
|
+
/** 400: a route path cannot start with `_abyss`, the segment the edge keeps for its own addresses (ticks of the cron tasks). */
|
|
38
|
+
ROUTE_SEGMENT_RESERVED = 'ROUTE_SEGMENT_RESERVED',
|
|
39
|
+
/** 409: the bot bills credit overage but the organization does not allow overage of the credits metric. */
|
|
40
|
+
CREDIT_OVERAGE_NOT_ALLOWED = 'CREDIT_OVERAGE_NOT_ALLOWED',
|
|
41
|
+
/** 409: the lots asked for do not fit in the event rate reserve of the organization (the sum of its allocations would go past it). */
|
|
42
|
+
BOT_EVENT_RESERVE_EXCEEDED = 'BOT_EVENT_RESERVE_EXCEEDED',
|
|
43
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `failureCode` of a FAILED scheduled run the execution plane writes itself. Any other `failureCode` is the
|
|
3
|
-
* error code of the live run that failed (`FUNCTION_FAILED`, `FUNCTION_TIMEOUT`, `INTERNAL_ERROR`...).
|
|
4
|
-
*/
|
|
5
|
-
export enum ScheduledRunFailureCode {
|
|
6
|
-
/** The task left the version in service before the run was due: nothing ran, nothing is billed. */
|
|
7
|
-
TASK_REMOVED = 'TASK_REMOVED',
|
|
8
|
-
/** Every attempt was interrupted by the end of its edge. */
|
|
9
|
-
ATTEMPTS_EXHAUSTED = 'ATTEMPTS_EXHAUSTED',
|
|
10
|
-
/** The credits of the organization are spent and the bot has no overage: the run stopped, nothing ran, nothing is billed. */
|
|
11
|
-
CREDITS_EXHAUSTED = 'CREDITS_EXHAUSTED',
|
|
12
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* The `failureCode` of a FAILED scheduled run the execution plane writes itself. Any other `failureCode` is the
|
|
3
|
+
* error code of the live run that failed (`FUNCTION_FAILED`, `FUNCTION_TIMEOUT`, `INTERNAL_ERROR`...).
|
|
4
|
+
*/
|
|
5
|
+
export enum ScheduledRunFailureCode {
|
|
6
|
+
/** The task left the version in service before the run was due: nothing ran, nothing is billed. */
|
|
7
|
+
TASK_REMOVED = 'TASK_REMOVED',
|
|
8
|
+
/** Every attempt was interrupted by the end of its edge. */
|
|
9
|
+
ATTEMPTS_EXHAUSTED = 'ATTEMPTS_EXHAUSTED',
|
|
10
|
+
/** The credits of the organization are spent and the bot has no overage: the run stopped, nothing ran, nothing is billed. */
|
|
11
|
+
CREDITS_EXHAUSTED = 'CREDITS_EXHAUSTED',
|
|
12
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/** What started an execution of a Service. */
|
|
2
|
-
export enum TriggerKind {
|
|
3
|
-
COMMAND = 'COMMAND',
|
|
4
|
-
COMPONENT = 'COMPONENT',
|
|
5
|
-
EVENT = 'EVENT',
|
|
6
|
-
TASK = 'TASK',
|
|
7
|
-
ROUTE = 'ROUTE',
|
|
8
|
-
}
|
|
1
|
+
/** What started an execution of a Service. */
|
|
2
|
+
export enum TriggerKind {
|
|
3
|
+
COMMAND = 'COMMAND',
|
|
4
|
+
COMPONENT = 'COMPONENT',
|
|
5
|
+
EVENT = 'EVENT',
|
|
6
|
+
TASK = 'TASK',
|
|
7
|
+
ROUTE = 'ROUTE',
|
|
8
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export * from './function.request';
|
|
2
|
-
export * from './function-access.request';
|
|
3
|
-
export * from './function-test.request';
|
|
4
|
-
export * from './function-version.request';
|
|
5
|
-
export * from './function-run.request';
|
|
6
|
-
export * from './function-settings.request';
|
|
7
|
-
export * from './service.request';
|
|
8
|
-
export * from './service-route.request';
|
|
9
|
-
export * from './service-version.request';
|
|
10
|
-
export * from './service-deployment.request';
|
|
11
|
-
export * from './service-configuration.request';
|
|
12
|
-
export * from './service-discord.request';
|
|
13
|
-
export * from './service-task.request';
|
|
14
|
-
export * from './service-discord-event.request';
|
|
15
|
-
export * from './service-insights.request';
|
|
1
|
+
export * from './function.request';
|
|
2
|
+
export * from './function-access.request';
|
|
3
|
+
export * from './function-test.request';
|
|
4
|
+
export * from './function-version.request';
|
|
5
|
+
export * from './function-run.request';
|
|
6
|
+
export * from './function-settings.request';
|
|
7
|
+
export * from './service.request';
|
|
8
|
+
export * from './service-route.request';
|
|
9
|
+
export * from './service-version.request';
|
|
10
|
+
export * from './service-deployment.request';
|
|
11
|
+
export * from './service-configuration.request';
|
|
12
|
+
export * from './service-discord.request';
|
|
13
|
+
export * from './service-task.request';
|
|
14
|
+
export * from './service-discord-event.request';
|
|
15
|
+
export * from './service-insights.request';
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import type { DiscordEventDropReason, DiscordEventStatus, DiscordEventType } from '../../../enum';
|
|
2
|
-
import type { IReflexDiscordEventFilters } from '../../models';
|
|
3
|
-
|
|
4
|
-
export interface IListServiceDiscordEventParams {
|
|
5
|
-
applicationId: string;
|
|
6
|
-
serviceId: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface ICreateServiceDiscordEventParams {
|
|
10
|
-
applicationId: string;
|
|
11
|
-
serviceId: string;
|
|
12
|
-
}
|
|
13
|
-
export interface ICreateServiceDiscordEventBody {
|
|
14
|
-
/** `^[-_a-z0-9]{1,32}$`, unique within the Service. */
|
|
15
|
-
name: string;
|
|
16
|
-
eventType: DiscordEventType;
|
|
17
|
-
/** A function of the same Service. */
|
|
18
|
-
functionId: string;
|
|
19
|
-
/** Empty by default: no filter. */
|
|
20
|
-
filters?: IReflexDiscordEventFilters;
|
|
21
|
-
/** `true` by default. */
|
|
22
|
-
ordered?: boolean;
|
|
23
|
-
/** `false` by default, `MESSAGE_CREATE` only; asks for the MESSAGE_CONTENT intent. */
|
|
24
|
-
includeContent?: boolean;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface IUpdateServiceDiscordEventParams {
|
|
28
|
-
applicationId: string;
|
|
29
|
-
serviceId: string;
|
|
30
|
-
eventId: string;
|
|
31
|
-
}
|
|
32
|
-
export interface IUpdateServiceDiscordEventBody {
|
|
33
|
-
name?: string;
|
|
34
|
-
eventType?: DiscordEventType;
|
|
35
|
-
functionId?: string;
|
|
36
|
-
filters?: IReflexDiscordEventFilters;
|
|
37
|
-
ordered?: boolean;
|
|
38
|
-
includeContent?: boolean;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface IDeleteServiceDiscordEventParams {
|
|
42
|
-
applicationId: string;
|
|
43
|
-
serviceId: string;
|
|
44
|
-
eventId: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface IListServiceDiscordEventLogParams {
|
|
48
|
-
applicationId: string;
|
|
49
|
-
serviceId: string;
|
|
50
|
-
}
|
|
51
|
-
export interface IListServiceDiscordEventLogQuery {
|
|
52
|
-
/** The environment of the application (abyss-main's id). */
|
|
53
|
-
environmentId: string;
|
|
54
|
-
/** Only the retained events in this status; drops the dropped ones from the page. */
|
|
55
|
-
status?: DiscordEventStatus;
|
|
56
|
-
/** Only the dropped events for this reason; drops the retained ones from the page. */
|
|
57
|
-
reason?: DiscordEventDropReason;
|
|
58
|
-
type?: DiscordEventType;
|
|
59
|
-
triggerId?: string;
|
|
60
|
-
/** ISO 8601, included. */
|
|
61
|
-
from?: string;
|
|
62
|
-
/** ISO 8601, excluded. */
|
|
63
|
-
to?: string;
|
|
64
|
-
/** The `nextCursor` of the previous page. */
|
|
65
|
-
cursor?: string;
|
|
66
|
-
/** 1 to 100, 50 by default. */
|
|
67
|
-
limit?: number;
|
|
68
|
-
}
|
|
1
|
+
import type { DiscordEventDropReason, DiscordEventStatus, DiscordEventType } from '../../../enum';
|
|
2
|
+
import type { IReflexDiscordEventFilters } from '../../models';
|
|
3
|
+
|
|
4
|
+
export interface IListServiceDiscordEventParams {
|
|
5
|
+
applicationId: string;
|
|
6
|
+
serviceId: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ICreateServiceDiscordEventParams {
|
|
10
|
+
applicationId: string;
|
|
11
|
+
serviceId: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ICreateServiceDiscordEventBody {
|
|
14
|
+
/** `^[-_a-z0-9]{1,32}$`, unique within the Service. */
|
|
15
|
+
name: string;
|
|
16
|
+
eventType: DiscordEventType;
|
|
17
|
+
/** A function of the same Service. */
|
|
18
|
+
functionId: string;
|
|
19
|
+
/** Empty by default: no filter. */
|
|
20
|
+
filters?: IReflexDiscordEventFilters;
|
|
21
|
+
/** `true` by default. */
|
|
22
|
+
ordered?: boolean;
|
|
23
|
+
/** `false` by default, `MESSAGE_CREATE` only; asks for the MESSAGE_CONTENT intent. */
|
|
24
|
+
includeContent?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface IUpdateServiceDiscordEventParams {
|
|
28
|
+
applicationId: string;
|
|
29
|
+
serviceId: string;
|
|
30
|
+
eventId: string;
|
|
31
|
+
}
|
|
32
|
+
export interface IUpdateServiceDiscordEventBody {
|
|
33
|
+
name?: string;
|
|
34
|
+
eventType?: DiscordEventType;
|
|
35
|
+
functionId?: string;
|
|
36
|
+
filters?: IReflexDiscordEventFilters;
|
|
37
|
+
ordered?: boolean;
|
|
38
|
+
includeContent?: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface IDeleteServiceDiscordEventParams {
|
|
42
|
+
applicationId: string;
|
|
43
|
+
serviceId: string;
|
|
44
|
+
eventId: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface IListServiceDiscordEventLogParams {
|
|
48
|
+
applicationId: string;
|
|
49
|
+
serviceId: string;
|
|
50
|
+
}
|
|
51
|
+
export interface IListServiceDiscordEventLogQuery {
|
|
52
|
+
/** The environment of the application (abyss-main's id). */
|
|
53
|
+
environmentId: string;
|
|
54
|
+
/** Only the retained events in this status; drops the dropped ones from the page. */
|
|
55
|
+
status?: DiscordEventStatus;
|
|
56
|
+
/** Only the dropped events for this reason; drops the retained ones from the page. */
|
|
57
|
+
reason?: DiscordEventDropReason;
|
|
58
|
+
type?: DiscordEventType;
|
|
59
|
+
triggerId?: string;
|
|
60
|
+
/** ISO 8601, included. */
|
|
61
|
+
from?: string;
|
|
62
|
+
/** ISO 8601, excluded. */
|
|
63
|
+
to?: string;
|
|
64
|
+
/** The `nextCursor` of the previous page. */
|
|
65
|
+
cursor?: string;
|
|
66
|
+
/** 1 to 100, 50 by default. */
|
|
67
|
+
limit?: number;
|
|
68
|
+
}
|