@abyss-project/reflex 5.4.0 → 5.5.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/api/function-insights.api.d.ts +2 -0
- package/dist/api/function-insights.api.js +7 -0
- package/dist/api/function-insights.api.js.map +1 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +3 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/service-discord-event.api.d.ts +6 -0
- package/dist/api/service-discord-event.api.js +18 -0
- package/dist/api/service-discord-event.api.js.map +1 -0
- package/dist/api/service-discord.api.d.ts +3 -1
- package/dist/api/service-discord.api.js +5 -1
- package/dist/api/service-discord.api.js.map +1 -1
- package/dist/api/service-insights.api.d.ts +3 -0
- package/dist/api/service-insights.api.js +12 -0
- package/dist/api/service-insights.api.js.map +1 -0
- package/dist/discord/discord-event-filter-cases.d.ts +15 -0
- package/dist/discord/discord-event-filter-cases.js +77 -0
- package/dist/discord/discord-event-filter-cases.js.map +1 -0
- package/dist/discord/discord-event-filters.d.ts +20 -0
- package/dist/discord/discord-event-filters.js +50 -0
- package/dist/discord/discord-event-filters.js.map +1 -0
- package/dist/discord/discord-event-intents.d.ts +14 -0
- package/dist/discord/discord-event-intents.js +38 -0
- package/dist/discord/discord-event-intents.js.map +1 -0
- package/dist/discord/index.d.ts +3 -0
- package/dist/discord/index.js +20 -0
- package/dist/discord/index.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -1
- package/dist/types/enum/bot-event-block-reason.enum.d.ts +4 -0
- package/dist/types/enum/bot-event-block-reason.enum.js +9 -0
- package/dist/types/enum/bot-event-block-reason.enum.js.map +1 -0
- package/dist/types/enum/discord-event-drop-reason.enum.d.ts +7 -0
- package/dist/types/enum/discord-event-drop-reason.enum.js +12 -0
- package/dist/types/enum/discord-event-drop-reason.enum.js.map +1 -0
- package/dist/types/enum/discord-event-filter-name.enum.d.ts +9 -0
- package/dist/types/enum/discord-event-filter-name.enum.js +14 -0
- package/dist/types/enum/discord-event-filter-name.enum.js.map +1 -0
- package/dist/types/enum/discord-event-status.enum.d.ts +7 -0
- package/dist/types/enum/discord-event-status.enum.js +12 -0
- package/dist/types/enum/discord-event-status.enum.js.map +1 -0
- package/dist/types/enum/discord-event-type.enum.d.ts +6 -0
- package/dist/types/enum/discord-event-type.enum.js +11 -0
- package/dist/types/enum/discord-event-type.enum.js.map +1 -0
- package/dist/types/enum/discord-gateway-failure-code.enum.d.ts +2 -1
- package/dist/types/enum/discord-gateway-failure-code.enum.js +1 -0
- package/dist/types/enum/discord-gateway-failure-code.enum.js.map +1 -1
- package/dist/types/enum/index.d.ts +7 -0
- package/dist/types/enum/index.js +7 -0
- package/dist/types/enum/index.js.map +1 -1
- package/dist/types/enum/insights-period.enum.d.ts +7 -0
- package/dist/types/enum/insights-period.enum.js +12 -0
- package/dist/types/enum/insights-period.enum.js.map +1 -0
- package/dist/types/enum/scheduled-run-failure-code.enum.d.ts +2 -1
- package/dist/types/enum/scheduled-run-failure-code.enum.js +1 -0
- package/dist/types/enum/scheduled-run-failure-code.enum.js.map +1 -1
- package/dist/types/enum/trigger-kind.enum.d.ts +7 -0
- package/dist/types/enum/trigger-kind.enum.js +12 -0
- package/dist/types/enum/trigger-kind.enum.js.map +1 -0
- package/dist/types/interface/api/requests/index.d.ts +2 -0
- package/dist/types/interface/api/requests/index.js +2 -0
- package/dist/types/interface/api/requests/index.js.map +1 -1
- package/dist/types/interface/api/requests/service-discord-event.request.d.ts +51 -0
- package/dist/types/interface/api/requests/service-discord-event.request.js +3 -0
- package/dist/types/interface/api/requests/service-discord-event.request.js.map +1 -0
- package/dist/types/interface/api/requests/service-discord.request.d.ts +22 -1
- package/dist/types/interface/api/requests/service-insights.request.d.ts +25 -0
- package/dist/types/interface/api/requests/service-insights.request.js +3 -0
- package/dist/types/interface/api/requests/service-insights.request.js.map +1 -0
- package/dist/types/interface/api/responses/index.d.ts +2 -0
- package/dist/types/interface/api/responses/index.js +2 -0
- package/dist/types/interface/api/responses/index.js.map +1 -1
- package/dist/types/interface/api/responses/service-discord-event.response.d.ts +18 -0
- package/dist/types/interface/api/responses/service-discord-event.response.js +3 -0
- package/dist/types/interface/api/responses/service-discord-event.response.js.map +1 -0
- package/dist/types/interface/api/responses/service-discord.response.d.ts +30 -5
- package/dist/types/interface/api/responses/service-insights.response.d.ts +8 -0
- package/dist/types/interface/api/responses/service-insights.response.js +3 -0
- package/dist/types/interface/api/responses/service-insights.response.js.map +1 -0
- package/dist/types/interface/api/responses/service-version.response.d.ts +9 -1
- package/dist/types/interface/models/index.d.ts +4 -0
- package/dist/types/interface/models/index.js +4 -0
- package/dist/types/interface/models/index.js.map +1 -1
- package/dist/types/interface/models/reflex-bot-limits.model.d.ts +56 -0
- package/dist/types/interface/models/reflex-bot-limits.model.js +16 -0
- package/dist/types/interface/models/reflex-bot-limits.model.js.map +1 -0
- package/dist/types/interface/models/reflex-discord-event-log.model.d.ts +38 -0
- package/dist/types/interface/models/reflex-discord-event-log.model.js +3 -0
- package/dist/types/interface/models/reflex-discord-event-log.model.js.map +1 -0
- package/dist/types/interface/models/reflex-discord-event.model.d.ts +41 -0
- package/dist/types/interface/models/reflex-discord-event.model.js +23 -0
- package/dist/types/interface/models/reflex-discord-event.model.js.map +1 -0
- package/dist/types/interface/models/reflex-insights.model.d.ts +83 -0
- package/dist/types/interface/models/reflex-insights.model.js +16 -0
- package/dist/types/interface/models/reflex-insights.model.js.map +1 -0
- package/dist/types/interface/models/reflex-run.model.d.ts +2 -0
- package/dist/types/interface/models/reflex-service-version.model.d.ts +2 -0
- package/package.json +1 -1
- package/src/api/function-insights.api.test.ts +27 -0
- package/src/api/function-insights.api.ts +18 -0
- package/src/api/index.ts +17 -14
- package/src/api/service-discord-event.api.test.ts +106 -0
- package/src/api/service-discord-event.api.ts +78 -0
- package/src/api/service-discord.api.test.ts +197 -170
- package/src/api/service-discord.api.ts +241 -203
- package/src/api/service-insights.api.test.ts +36 -0
- package/src/api/service-insights.api.ts +42 -0
- package/src/api/service-task.api.test.ts +140 -140
- package/src/api/service-task.api.ts +141 -141
- package/src/discord/discord-event-filter-cases.ts +261 -0
- package/src/discord/discord-event-filters.test.ts +91 -0
- package/src/discord/discord-event-filters.ts +95 -0
- package/src/discord/discord-event-intents.test.ts +112 -0
- package/src/discord/discord-event-intents.ts +55 -0
- package/src/discord/index.ts +3 -0
- package/src/index.test.ts +75 -50
- package/src/index.ts +46 -0
- package/src/types/enum/bot-event-block-reason.enum.ts +7 -0
- package/src/types/enum/discord-event-drop-reason.enum.ts +13 -0
- package/src/types/enum/discord-event-filter-name.enum.ts +11 -0
- package/src/types/enum/discord-event-status.enum.ts +13 -0
- package/src/types/enum/discord-event-type.enum.ts +7 -0
- package/src/types/enum/discord-gateway-failure-code.enum.ts +11 -9
- package/src/types/enum/index.ts +7 -0
- package/src/types/enum/insights-period.enum.ts +8 -0
- package/src/types/enum/schedule-sync-status.enum.ts +6 -6
- package/src/types/enum/scheduled-run-failure-code.enum.ts +2 -0
- package/src/types/enum/scheduled-run-origin.enum.ts +5 -5
- package/src/types/enum/scheduled-run-status.enum.ts +17 -17
- package/src/types/enum/trigger-kind.enum.ts +8 -0
- package/src/types/interface/api/requests/index.ts +15 -13
- package/src/types/interface/api/requests/service-discord-event.request.ts +68 -0
- package/src/types/interface/api/requests/service-discord.request.ts +161 -128
- package/src/types/interface/api/requests/service-insights.request.ts +31 -0
- package/src/types/interface/api/requests/service-task.request.ts +80 -80
- package/src/types/interface/api/responses/index.ts +15 -13
- package/src/types/interface/api/responses/service-discord-event.response.ts +24 -0
- package/src/types/interface/api/responses/service-discord.response.ts +119 -72
- package/src/types/interface/api/responses/service-insights.response.ts +11 -0
- package/src/types/interface/api/responses/service-task.response.ts +57 -57
- package/src/types/interface/api/responses/service-version.response.ts +106 -91
- package/src/types/interface/models/index.ts +19 -15
- package/src/types/interface/models/reflex-bot-limits.model.ts +92 -0
- package/src/types/interface/models/reflex-discord-event-log.model.ts +58 -0
- package/src/types/interface/models/reflex-discord-event.model.ts +77 -0
- package/src/types/interface/models/reflex-insights.model.ts +120 -0
- package/src/types/interface/models/reflex-run.model.ts +183 -179
- package/src/types/interface/models/reflex-service-version.model.ts +61 -58
- package/src/types/interface/models/reflex-task.model.ts +97 -97
|
@@ -1,72 +1,119 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
export
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
1
|
+
import type {
|
|
2
|
+
IReflexBotAlerts,
|
|
3
|
+
IReflexBotBlock,
|
|
4
|
+
IReflexBotCredits,
|
|
5
|
+
IReflexBotEventRate,
|
|
6
|
+
IReflexBotMonthlySpendCap,
|
|
7
|
+
IReflexBotRateExcess,
|
|
8
|
+
IReflexDiscordCommand,
|
|
9
|
+
IReflexDiscordComponent,
|
|
10
|
+
IReflexDiscordConnection,
|
|
11
|
+
IReflexDiscordEnvironmentConnection,
|
|
12
|
+
IReflexServiceDeployment,
|
|
13
|
+
} from '../../models';
|
|
14
|
+
import type { IResponse } from '../response';
|
|
15
|
+
|
|
16
|
+
/** What a bot does with Discord events in one environment: its intents, its limits and what stops it. */
|
|
17
|
+
export interface IServiceDiscordEnvironmentEvents {
|
|
18
|
+
/** The intents (Discord bits) the version in service asks for; 0 without event triggers. */
|
|
19
|
+
activeIntents: number;
|
|
20
|
+
/** The privileged intents among them, as Discord intent bits: to switch on in the Discord portal. */
|
|
21
|
+
privilegedIntentsRequested: number[];
|
|
22
|
+
/** Since when Discord refuses the intents (`INTENTS_DISALLOWED`, close code 4014); null otherwise. */
|
|
23
|
+
intentsDisallowedSince: Date | null;
|
|
24
|
+
/** Events per minute, concurrency and the lots of the reserve. */
|
|
25
|
+
rate: IReflexBotEventRate;
|
|
26
|
+
/** Minutes above the alert percent, peak and minutes at the cap. */
|
|
27
|
+
rateExcess: IReflexBotRateExcess;
|
|
28
|
+
/** Credits of the month and the overage setting. */
|
|
29
|
+
credits: IReflexBotCredits;
|
|
30
|
+
monthlySpendCap: IReflexBotMonthlySpendCap;
|
|
31
|
+
alerts: IReflexBotAlerts;
|
|
32
|
+
/** What stops the events at the Gateway; null when nothing does. */
|
|
33
|
+
block: IReflexBotBlock | null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** The connection of one environment, with what concerns the events of the bot. */
|
|
37
|
+
export interface IServiceDiscordEnvironmentConnection extends IReflexDiscordEnvironmentConnection {
|
|
38
|
+
events: IServiceDiscordEnvironmentEvents;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** The Vault entry holding the token, and the bot of each environment with its event limits. */
|
|
42
|
+
export interface IServiceDiscordConnection extends Omit<IReflexDiscordConnection, 'environments'> {
|
|
43
|
+
environments: IServiceDiscordEnvironmentConnection[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface IListServiceDiscordCommandData {
|
|
47
|
+
/** By name. */
|
|
48
|
+
commands: IReflexDiscordCommand[];
|
|
49
|
+
}
|
|
50
|
+
export type IListServiceDiscordCommandResponse = IResponse<IListServiceDiscordCommandData>;
|
|
51
|
+
|
|
52
|
+
export interface ICreateServiceDiscordCommandData {
|
|
53
|
+
command: IReflexDiscordCommand;
|
|
54
|
+
}
|
|
55
|
+
export type ICreateServiceDiscordCommandResponse = IResponse<ICreateServiceDiscordCommandData>;
|
|
56
|
+
|
|
57
|
+
export interface IUpdateServiceDiscordCommandData {
|
|
58
|
+
command: IReflexDiscordCommand;
|
|
59
|
+
}
|
|
60
|
+
export type IUpdateServiceDiscordCommandResponse = IResponse<IUpdateServiceDiscordCommandData>;
|
|
61
|
+
|
|
62
|
+
export type IDeleteServiceDiscordCommandData = Record<string, never>;
|
|
63
|
+
export type IDeleteServiceDiscordCommandResponse = IResponse<IDeleteServiceDiscordCommandData>;
|
|
64
|
+
|
|
65
|
+
export interface IListServiceDiscordComponentData {
|
|
66
|
+
/** By prefix. */
|
|
67
|
+
components: IReflexDiscordComponent[];
|
|
68
|
+
}
|
|
69
|
+
export type IListServiceDiscordComponentResponse = IResponse<IListServiceDiscordComponentData>;
|
|
70
|
+
|
|
71
|
+
export interface ICreateServiceDiscordComponentData {
|
|
72
|
+
component: IReflexDiscordComponent;
|
|
73
|
+
}
|
|
74
|
+
export type ICreateServiceDiscordComponentResponse = IResponse<ICreateServiceDiscordComponentData>;
|
|
75
|
+
|
|
76
|
+
export interface IUpdateServiceDiscordComponentData {
|
|
77
|
+
component: IReflexDiscordComponent;
|
|
78
|
+
}
|
|
79
|
+
export type IUpdateServiceDiscordComponentResponse = IResponse<IUpdateServiceDiscordComponentData>;
|
|
80
|
+
|
|
81
|
+
export type IDeleteServiceDiscordComponentData = Record<string, never>;
|
|
82
|
+
export type IDeleteServiceDiscordComponentResponse = IResponse<IDeleteServiceDiscordComponentData>;
|
|
83
|
+
|
|
84
|
+
export interface IGetServiceDiscordConnectionData {
|
|
85
|
+
connection: IServiceDiscordConnection;
|
|
86
|
+
}
|
|
87
|
+
export type IGetServiceDiscordConnectionResponse = IResponse<IGetServiceDiscordConnectionData>;
|
|
88
|
+
|
|
89
|
+
export interface ISetServiceDiscordTokenSecretData {
|
|
90
|
+
connection: IServiceDiscordConnection;
|
|
91
|
+
}
|
|
92
|
+
export type ISetServiceDiscordTokenSecretResponse = IResponse<ISetServiceDiscordTokenSecretData>;
|
|
93
|
+
|
|
94
|
+
export interface ISetServiceDiscordEnvironmentData {
|
|
95
|
+
environment: IServiceDiscordEnvironmentConnection;
|
|
96
|
+
}
|
|
97
|
+
export type ISetServiceDiscordEnvironmentResponse = IResponse<ISetServiceDiscordEnvironmentData>;
|
|
98
|
+
|
|
99
|
+
export interface ICheckServiceDiscordConnectionData {
|
|
100
|
+
environment: IServiceDiscordEnvironmentConnection;
|
|
101
|
+
}
|
|
102
|
+
export type ICheckServiceDiscordConnectionResponse = IResponse<ICheckServiceDiscordConnectionData>;
|
|
103
|
+
|
|
104
|
+
export interface ISetServiceDiscordAllocationData {
|
|
105
|
+
/** The environment row, with the new rate and concurrency. */
|
|
106
|
+
environment: IServiceDiscordEnvironmentConnection;
|
|
107
|
+
}
|
|
108
|
+
export type ISetServiceDiscordAllocationResponse = IResponse<ISetServiceDiscordAllocationData>;
|
|
109
|
+
|
|
110
|
+
export interface ISetServiceDiscordBotSettingsData {
|
|
111
|
+
environment: IServiceDiscordEnvironmentConnection;
|
|
112
|
+
}
|
|
113
|
+
export type ISetServiceDiscordBotSettingsResponse = IResponse<ISetServiceDiscordBotSettingsData>;
|
|
114
|
+
|
|
115
|
+
export interface IRetryServiceDiscordSyncData {
|
|
116
|
+
/** The current deployment of the environment, with the new state of the synchronization. */
|
|
117
|
+
deployment: IReflexServiceDeployment;
|
|
118
|
+
}
|
|
119
|
+
export type IRetryServiceDiscordSyncResponse = IResponse<IRetryServiceDiscordSyncData>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IReflexEventInsights, IReflexInsights } from '../../models';
|
|
2
|
+
import type { IResponse } from '../response';
|
|
3
|
+
|
|
4
|
+
export type IGetServiceInsightsData = IReflexInsights;
|
|
5
|
+
export type IGetServiceInsightsResponse = IResponse<IGetServiceInsightsData>;
|
|
6
|
+
|
|
7
|
+
export type IGetServiceEventInsightsData = IReflexEventInsights;
|
|
8
|
+
export type IGetServiceEventInsightsResponse = IResponse<IGetServiceEventInsightsData>;
|
|
9
|
+
|
|
10
|
+
export type IGetFunctionInsightsData = IReflexInsights;
|
|
11
|
+
export type IGetFunctionInsightsResponse = IResponse<IGetFunctionInsightsData>;
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
IReflexDelayedRun,
|
|
3
|
-
IReflexRun,
|
|
4
|
-
IReflexScheduledRun,
|
|
5
|
-
IReflexServiceDeployment,
|
|
6
|
-
IReflexTask,
|
|
7
|
-
} from '../../models';
|
|
8
|
-
import type { IResponse } from '../response';
|
|
9
|
-
|
|
10
|
-
export interface IListServiceTaskData {
|
|
11
|
-
/** By name. */
|
|
12
|
-
tasks: IReflexTask[];
|
|
13
|
-
}
|
|
14
|
-
export type IListServiceTaskResponse = IResponse<IListServiceTaskData>;
|
|
15
|
-
|
|
16
|
-
export interface ICreateServiceTaskData {
|
|
17
|
-
task: IReflexTask;
|
|
18
|
-
}
|
|
19
|
-
export type ICreateServiceTaskResponse = IResponse<ICreateServiceTaskData>;
|
|
20
|
-
|
|
21
|
-
export interface IUpdateServiceTaskData {
|
|
22
|
-
task: IReflexTask;
|
|
23
|
-
}
|
|
24
|
-
export type IUpdateServiceTaskResponse = IResponse<IUpdateServiceTaskData>;
|
|
25
|
-
|
|
26
|
-
export type IDeleteServiceTaskData = Record<string, never>;
|
|
27
|
-
export type IDeleteServiceTaskResponse = IResponse<IDeleteServiceTaskData>;
|
|
28
|
-
|
|
29
|
-
export interface ITestRunServiceTaskData {
|
|
30
|
-
run: IReflexRun;
|
|
31
|
-
}
|
|
32
|
-
export type ITestRunServiceTaskResponse = IResponse<ITestRunServiceTaskData>;
|
|
33
|
-
|
|
34
|
-
export interface IListServiceDelayedRunData {
|
|
35
|
-
/** The first 100 pending delayed runs of the environment, soonest due first. */
|
|
36
|
-
delayedRuns: IReflexDelayedRun[];
|
|
37
|
-
/** Pending delayed runs of the environment, all of them. */
|
|
38
|
-
total: number;
|
|
39
|
-
}
|
|
40
|
-
export type IListServiceDelayedRunResponse = IResponse<IListServiceDelayedRunData>;
|
|
41
|
-
|
|
42
|
-
export type ICancelServiceDelayedRunData = Record<string, never>;
|
|
43
|
-
export type ICancelServiceDelayedRunResponse = IResponse<ICancelServiceDelayedRunData>;
|
|
44
|
-
|
|
45
|
-
export interface IRetryServiceScheduleSyncData {
|
|
46
|
-
/** The current deployment of the environment, with the new state of the synchronization. */
|
|
47
|
-
deployment: IReflexServiceDeployment;
|
|
48
|
-
}
|
|
49
|
-
export type IRetryServiceScheduleSyncResponse = IResponse<IRetryServiceScheduleSyncData>;
|
|
50
|
-
|
|
51
|
-
export interface IListServiceTaskScheduledRunData {
|
|
52
|
-
/** The runs of the task in the environment, every status, newest due first, paged by `limit`/`offset`. */
|
|
53
|
-
scheduledRuns: IReflexScheduledRun[];
|
|
54
|
-
/** Runs of the task in the environment, all of them (kept 7 days after their end). */
|
|
55
|
-
total: number;
|
|
56
|
-
}
|
|
57
|
-
export type IListServiceTaskScheduledRunResponse = IResponse<IListServiceTaskScheduledRunData>;
|
|
1
|
+
import type {
|
|
2
|
+
IReflexDelayedRun,
|
|
3
|
+
IReflexRun,
|
|
4
|
+
IReflexScheduledRun,
|
|
5
|
+
IReflexServiceDeployment,
|
|
6
|
+
IReflexTask,
|
|
7
|
+
} from '../../models';
|
|
8
|
+
import type { IResponse } from '../response';
|
|
9
|
+
|
|
10
|
+
export interface IListServiceTaskData {
|
|
11
|
+
/** By name. */
|
|
12
|
+
tasks: IReflexTask[];
|
|
13
|
+
}
|
|
14
|
+
export type IListServiceTaskResponse = IResponse<IListServiceTaskData>;
|
|
15
|
+
|
|
16
|
+
export interface ICreateServiceTaskData {
|
|
17
|
+
task: IReflexTask;
|
|
18
|
+
}
|
|
19
|
+
export type ICreateServiceTaskResponse = IResponse<ICreateServiceTaskData>;
|
|
20
|
+
|
|
21
|
+
export interface IUpdateServiceTaskData {
|
|
22
|
+
task: IReflexTask;
|
|
23
|
+
}
|
|
24
|
+
export type IUpdateServiceTaskResponse = IResponse<IUpdateServiceTaskData>;
|
|
25
|
+
|
|
26
|
+
export type IDeleteServiceTaskData = Record<string, never>;
|
|
27
|
+
export type IDeleteServiceTaskResponse = IResponse<IDeleteServiceTaskData>;
|
|
28
|
+
|
|
29
|
+
export interface ITestRunServiceTaskData {
|
|
30
|
+
run: IReflexRun;
|
|
31
|
+
}
|
|
32
|
+
export type ITestRunServiceTaskResponse = IResponse<ITestRunServiceTaskData>;
|
|
33
|
+
|
|
34
|
+
export interface IListServiceDelayedRunData {
|
|
35
|
+
/** The first 100 pending delayed runs of the environment, soonest due first. */
|
|
36
|
+
delayedRuns: IReflexDelayedRun[];
|
|
37
|
+
/** Pending delayed runs of the environment, all of them. */
|
|
38
|
+
total: number;
|
|
39
|
+
}
|
|
40
|
+
export type IListServiceDelayedRunResponse = IResponse<IListServiceDelayedRunData>;
|
|
41
|
+
|
|
42
|
+
export type ICancelServiceDelayedRunData = Record<string, never>;
|
|
43
|
+
export type ICancelServiceDelayedRunResponse = IResponse<ICancelServiceDelayedRunData>;
|
|
44
|
+
|
|
45
|
+
export interface IRetryServiceScheduleSyncData {
|
|
46
|
+
/** The current deployment of the environment, with the new state of the synchronization. */
|
|
47
|
+
deployment: IReflexServiceDeployment;
|
|
48
|
+
}
|
|
49
|
+
export type IRetryServiceScheduleSyncResponse = IResponse<IRetryServiceScheduleSyncData>;
|
|
50
|
+
|
|
51
|
+
export interface IListServiceTaskScheduledRunData {
|
|
52
|
+
/** The runs of the task in the environment, every status, newest due first, paged by `limit`/`offset`. */
|
|
53
|
+
scheduledRuns: IReflexScheduledRun[];
|
|
54
|
+
/** Runs of the task in the environment, all of them (kept 7 days after their end). */
|
|
55
|
+
total: number;
|
|
56
|
+
}
|
|
57
|
+
export type IListServiceTaskScheduledRunResponse = IResponse<IListServiceTaskScheduledRunData>;
|
|
@@ -1,91 +1,106 @@
|
|
|
1
|
-
import type { ServiceVersionChangeKind } from '../../../enum';
|
|
2
|
-
import type {
|
|
3
|
-
IReflexDiscordCommandSnapshot,
|
|
4
|
-
IReflexDiscordComponentSnapshot,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
version
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
export interface
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
export
|
|
1
|
+
import type { ServiceVersionChangeKind } from '../../../enum';
|
|
2
|
+
import type {
|
|
3
|
+
IReflexDiscordCommandSnapshot,
|
|
4
|
+
IReflexDiscordComponentSnapshot,
|
|
5
|
+
IReflexDiscordEventSnapshot,
|
|
6
|
+
IReflexServiceVersion,
|
|
7
|
+
IReflexServiceVersionRoute,
|
|
8
|
+
IReflexTaskSnapshot,
|
|
9
|
+
} from '../../models';
|
|
10
|
+
import type { IResponse } from '../response';
|
|
11
|
+
|
|
12
|
+
/** How one route differs from the previous version, matched by route id. */
|
|
13
|
+
export interface IReflexServiceVersionRouteChange {
|
|
14
|
+
routeId: string;
|
|
15
|
+
kind: ServiceVersionChangeKind;
|
|
16
|
+
/** The route in the previous version; null when ADDED. */
|
|
17
|
+
before: IReflexServiceVersionRoute | null;
|
|
18
|
+
/** The route in this version; null when REMOVED. */
|
|
19
|
+
after: IReflexServiceVersionRoute | null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** How one command of a Discord bot differs from the previous version, matched by command id. */
|
|
23
|
+
export interface IReflexServiceVersionCommandChange {
|
|
24
|
+
commandId: string;
|
|
25
|
+
kind: ServiceVersionChangeKind;
|
|
26
|
+
/** The command in the previous version; null when ADDED. */
|
|
27
|
+
before: IReflexDiscordCommandSnapshot | null;
|
|
28
|
+
/** The command in this version; null when REMOVED. */
|
|
29
|
+
after: IReflexDiscordCommandSnapshot | null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** How one component of a Discord bot differs from the previous version, matched by component id. */
|
|
33
|
+
export interface IReflexServiceVersionComponentChange {
|
|
34
|
+
componentId: string;
|
|
35
|
+
kind: ServiceVersionChangeKind;
|
|
36
|
+
/** The component in the previous version; null when ADDED. */
|
|
37
|
+
before: IReflexDiscordComponentSnapshot | null;
|
|
38
|
+
/** The component in this version; null when REMOVED. */
|
|
39
|
+
after: IReflexDiscordComponentSnapshot | null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** How one event trigger of a Discord bot differs from the previous version, matched by trigger id. */
|
|
43
|
+
export interface IReflexServiceVersionEventChange {
|
|
44
|
+
eventId: string;
|
|
45
|
+
kind: ServiceVersionChangeKind;
|
|
46
|
+
/** The trigger in the previous version; null when ADDED. */
|
|
47
|
+
before: IReflexDiscordEventSnapshot | null;
|
|
48
|
+
/** The trigger in this version; null when REMOVED. */
|
|
49
|
+
after: IReflexDiscordEventSnapshot | null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** How one task of the Service differs from the previous version, matched by task id. */
|
|
53
|
+
export interface IReflexServiceVersionTaskChange {
|
|
54
|
+
taskId: string;
|
|
55
|
+
kind: ServiceVersionChangeKind;
|
|
56
|
+
/** The task in the previous version; null when ADDED. */
|
|
57
|
+
before: IReflexTaskSnapshot | null;
|
|
58
|
+
/** The task in this version; null when REMOVED. */
|
|
59
|
+
after: IReflexTaskSnapshot | null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface IListServiceVersionData {
|
|
63
|
+
/** Newest first. */
|
|
64
|
+
versions: IReflexServiceVersion[];
|
|
65
|
+
}
|
|
66
|
+
export type IListServiceVersionResponse = IResponse<IListServiceVersionData>;
|
|
67
|
+
|
|
68
|
+
export interface ICreateServiceVersionData {
|
|
69
|
+
version: IReflexServiceVersion;
|
|
70
|
+
}
|
|
71
|
+
export type ICreateServiceVersionResponse = IResponse<ICreateServiceVersionData>;
|
|
72
|
+
|
|
73
|
+
export interface IGetServiceVersionDraftStatusData {
|
|
74
|
+
/**
|
|
75
|
+
* How many functions of the Service a version created now would freeze at a version other than the one
|
|
76
|
+
* the last Service version froze: a function new to the Service, a draft that differs from its last
|
|
77
|
+
* version (an invalid draft counts), or a function version published since. Same rule as
|
|
78
|
+
* `POST .../version`; 0 for a Service without functions.
|
|
79
|
+
*/
|
|
80
|
+
changedFunctions: number;
|
|
81
|
+
/**
|
|
82
|
+
* How many tasks of the draft differ from the last Service version: added, modified (function, name,
|
|
83
|
+
* cron or time zone) or removed. 0 for a Service without tasks.
|
|
84
|
+
*/
|
|
85
|
+
changedTasks: number;
|
|
86
|
+
/** How many event triggers of the draft differ from the last Service version: added, modified or removed. 0 for a Service that is not a Discord bot. */
|
|
87
|
+
changedEvents: number;
|
|
88
|
+
}
|
|
89
|
+
export type IGetServiceVersionDraftStatusResponse = IResponse<IGetServiceVersionDraftStatusData>;
|
|
90
|
+
|
|
91
|
+
export interface IGetServiceVersionData {
|
|
92
|
+
version: IReflexServiceVersion;
|
|
93
|
+
/** The version just before; null for the first one. */
|
|
94
|
+
previousVersion: IReflexServiceVersion | null;
|
|
95
|
+
/** The routes added, removed or modified since `previousVersion` (every route is ADDED for the first one). */
|
|
96
|
+
routeChanges: IReflexServiceVersionRouteChange[];
|
|
97
|
+
/** The commands added, removed or modified since `previousVersion`; empty for a Service that is not a Discord bot. */
|
|
98
|
+
commandChanges: IReflexServiceVersionCommandChange[];
|
|
99
|
+
/** The components added, removed or modified since `previousVersion`; empty for a Service that is not a Discord bot. */
|
|
100
|
+
componentChanges: IReflexServiceVersionComponentChange[];
|
|
101
|
+
/** The event triggers added, removed or modified since `previousVersion`; empty for a Service that is not a Discord bot. */
|
|
102
|
+
eventChanges: IReflexServiceVersionEventChange[];
|
|
103
|
+
/** The tasks added, removed or modified since `previousVersion` (every task is ADDED for the first one). */
|
|
104
|
+
taskChanges: IReflexServiceVersionTaskChange[];
|
|
105
|
+
}
|
|
106
|
+
export type IGetServiceVersionResponse = IResponse<IGetServiceVersionData>;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
export * from './reflex-definition.model';
|
|
2
|
-
export * from './reflex-function.model';
|
|
3
|
-
export * from './reflex-function-version.model';
|
|
4
|
-
export * from './reflex-access-grant.model';
|
|
5
|
-
export * from './reflex-run.model';
|
|
6
|
-
export * from './reflex-execution-settings.model';
|
|
7
|
-
export * from './reflex-step-stats.model';
|
|
8
|
-
export * from './reflex-price-list.model';
|
|
9
|
-
export * from './reflex-service.model';
|
|
10
|
-
export * from './reflex-route.model';
|
|
11
|
-
export * from './reflex-service-version.model';
|
|
12
|
-
export * from './reflex-service-deployment.model';
|
|
13
|
-
export * from './reflex-service-configuration.model';
|
|
14
|
-
export * from './reflex-discord.model';
|
|
15
|
-
export * from './reflex-task.model';
|
|
1
|
+
export * from './reflex-definition.model';
|
|
2
|
+
export * from './reflex-function.model';
|
|
3
|
+
export * from './reflex-function-version.model';
|
|
4
|
+
export * from './reflex-access-grant.model';
|
|
5
|
+
export * from './reflex-run.model';
|
|
6
|
+
export * from './reflex-execution-settings.model';
|
|
7
|
+
export * from './reflex-step-stats.model';
|
|
8
|
+
export * from './reflex-price-list.model';
|
|
9
|
+
export * from './reflex-service.model';
|
|
10
|
+
export * from './reflex-route.model';
|
|
11
|
+
export * from './reflex-service-version.model';
|
|
12
|
+
export * from './reflex-service-deployment.model';
|
|
13
|
+
export * from './reflex-service-configuration.model';
|
|
14
|
+
export * from './reflex-discord.model';
|
|
15
|
+
export * from './reflex-task.model';
|
|
16
|
+
export * from './reflex-discord-event.model';
|
|
17
|
+
export * from './reflex-bot-limits.model';
|
|
18
|
+
export * from './reflex-insights.model';
|
|
19
|
+
export * from './reflex-discord-event-log.model';
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { BotEventBlockReason } from '../../enum';
|
|
2
|
+
|
|
3
|
+
/** Bounds of the per-bot limits and of their alerts. */
|
|
4
|
+
export const REFLEX_BOT_LIMITS = {
|
|
5
|
+
/** Events per minute added by one lot of the `reflex-bot-events` module. */
|
|
6
|
+
eventsPerMinutePerLot: 500,
|
|
7
|
+
/** Monthly spend cap, in cents: 10 EUR by default, from 1 to 500 EUR. */
|
|
8
|
+
monthlySpendCapDefaultCents: 1000,
|
|
9
|
+
monthlySpendCapMinCents: 100,
|
|
10
|
+
monthlySpendCapMaxCents: 50000,
|
|
11
|
+
/** Alert thresholds: at most 5 values, each from 1 to 100 (percent). */
|
|
12
|
+
alertThresholdsMax: 5,
|
|
13
|
+
alertThresholdMin: 1,
|
|
14
|
+
alertThresholdMax: 100,
|
|
15
|
+
/** Thresholds a bot starts with, for the monthly spend cap. */
|
|
16
|
+
spendCapDefaultThresholds: [80, 100],
|
|
17
|
+
/** Rate alert: minutes of the UTC day above `rateAlertDefaultPercent` of the rate, by default. */
|
|
18
|
+
rateAlertDefaultMinutes: 5,
|
|
19
|
+
rateAlertDefaultPercent: 80,
|
|
20
|
+
} as const;
|
|
21
|
+
|
|
22
|
+
/** The events per minute of a bot in one environment: the plan base plus the lots allocated to it. */
|
|
23
|
+
export interface IReflexBotEventRate {
|
|
24
|
+
/** From the plan of the organization (100, 250 or 500). */
|
|
25
|
+
baseEventsPerMinute: number;
|
|
26
|
+
/** Lots of 500 allocated to this bot, from 0 to `lotsMax`. */
|
|
27
|
+
lots: number;
|
|
28
|
+
lotsMax: number;
|
|
29
|
+
/** `baseEventsPerMinute + 500 * lots`. */
|
|
30
|
+
eventsPerMinute: number;
|
|
31
|
+
/** Event runs at once: `min(maxConcurrencyPerBot, ceil(eventsPerMinute / runsPerSlotPerMinute))`. */
|
|
32
|
+
concurrency: number;
|
|
33
|
+
/** Lots of the reserve of the organization nobody holds yet. */
|
|
34
|
+
reserveLotsFree: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The lots of the reserve of the organization a bot holds in one environment. */
|
|
38
|
+
export interface IReflexBotEventRateAllocation {
|
|
39
|
+
serviceId: string;
|
|
40
|
+
environmentId: string;
|
|
41
|
+
lots: number;
|
|
42
|
+
updatedAt: Date;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** A bot going past its rate, as the Gateway counted it. */
|
|
46
|
+
export interface IReflexBotRateExcess {
|
|
47
|
+
/** Minutes of the UTC day spent above the alert percent of the rate. */
|
|
48
|
+
minutesAboveAlertToday: number;
|
|
49
|
+
/** Highest count of retained events in one minute, over the period. */
|
|
50
|
+
peakPerMinute: number;
|
|
51
|
+
/** Minutes in which at least one event was rejected for the rate. */
|
|
52
|
+
minutesAtCap: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** The monthly spend cap of a bot: all its consumption of the month, included credits too, at the price of the lot. */
|
|
56
|
+
export interface IReflexBotMonthlySpendCap {
|
|
57
|
+
capCents: number;
|
|
58
|
+
spentCents: number;
|
|
59
|
+
/** `spentCents / capCents`, in percent; may go past 100. */
|
|
60
|
+
usedPercent: number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Credits of the month a bot consumed, and its overage setting. */
|
|
64
|
+
export interface IReflexBotCredits {
|
|
65
|
+
/** `YYYY-MM`. */
|
|
66
|
+
month: string;
|
|
67
|
+
consumedMillicredits: number;
|
|
68
|
+
/** True when the bot bills overage past the credits of the organization. */
|
|
69
|
+
overageEnabled: boolean;
|
|
70
|
+
/** True when the organization allows overage of the credits metric at all. */
|
|
71
|
+
overageAllowedByOrganization: boolean;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Alert settings of one limit of a bot. */
|
|
75
|
+
export interface IReflexBotAlertSettings {
|
|
76
|
+
/** Percent values, at most 5, each from 1 to 100. */
|
|
77
|
+
thresholds: number[];
|
|
78
|
+
email: boolean;
|
|
79
|
+
inApp: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Alert settings of a bot in one environment. */
|
|
83
|
+
export interface IReflexBotAlerts {
|
|
84
|
+
rate: IReflexBotAlertSettings;
|
|
85
|
+
monthlySpendCap: IReflexBotAlertSettings;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** What stops the events of a bot at the Gateway. */
|
|
89
|
+
export interface IReflexBotBlock {
|
|
90
|
+
reason: BotEventBlockReason;
|
|
91
|
+
since: Date;
|
|
92
|
+
}
|