@abyss-project/reflex 6.4.0 → 6.6.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/.eslintrc.js +32 -32
- package/.prettierrc +5 -5
- package/README.md +15 -15
- package/dist/api/function-run.api.d.ts +2 -1
- package/dist/api/function-run.api.js +3 -1
- package/dist/api/function-run.api.js.map +1 -1
- package/dist/discord/discord-command-tree.d.ts +5 -0
- package/dist/discord/discord-command-tree.js +38 -0
- package/dist/discord/discord-command-tree.js.map +1 -0
- package/dist/discord/discord-event-filter-cases.js +27 -11
- package/dist/discord/discord-event-filter-cases.js.map +1 -1
- package/dist/discord/discord-event-filters.js +7 -3
- package/dist/discord/discord-event-filters.js.map +1 -1
- package/dist/discord/discord-event-intents.d.ts +8 -2
- package/dist/discord/discord-event-intents.js +13 -2
- package/dist/discord/discord-event-intents.js.map +1 -1
- package/dist/discord/index.d.ts +1 -0
- package/dist/discord/index.js +1 -0
- package/dist/discord/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/types/enum/discord-command-node-type.enum.d.ts +5 -0
- package/dist/types/enum/discord-command-node-type.enum.js +10 -0
- package/dist/types/enum/discord-command-node-type.enum.js.map +1 -0
- package/dist/types/enum/discord-command-type.enum.d.ts +5 -0
- package/dist/types/enum/discord-command-type.enum.js +10 -0
- package/dist/types/enum/discord-command-type.enum.js.map +1 -0
- package/dist/types/enum/discord-event-type.enum.d.ts +3 -1
- package/dist/types/enum/discord-event-type.enum.js +2 -0
- package/dist/types/enum/discord-event-type.enum.js.map +1 -1
- package/dist/types/enum/index.d.ts +2 -0
- package/dist/types/enum/index.js +2 -0
- package/dist/types/enum/index.js.map +1 -1
- package/dist/types/enum/reflex-error-code.enum.d.ts +10 -0
- package/dist/types/enum/reflex-error-code.enum.js +10 -0
- package/dist/types/enum/reflex-error-code.enum.js.map +1 -1
- package/dist/types/interface/api/requests/function-run.request.d.ts +8 -0
- package/dist/types/interface/api/requests/service-discord.request.d.ts +7 -3
- package/dist/types/interface/api/responses/function-run.response.d.ts +8 -0
- package/dist/types/interface/models/reflex-discord.model.d.ts +18 -2
- package/dist/types/interface/models/reflex-discord.model.js +4 -0
- package/dist/types/interface/models/reflex-discord.model.js.map +1 -1
- package/dist/types/interface/models/reflex-run.model.d.ts +4 -0
- package/dist/types/interface/models/reflex-run.model.js +4 -1
- package/dist/types/interface/models/reflex-run.model.js.map +1 -1
- package/jest.config.ts +11 -11
- package/package.json +1 -1
- package/src/api/alert-rule.api.test.ts +72 -72
- package/src/api/alert-rule.api.ts +57 -57
- package/src/api/application-insights.api.test.ts +42 -42
- package/src/api/application-insights.api.ts +38 -38
- package/src/api/application-run-settings.api.test.ts +62 -62
- package/src/api/application-run-settings.api.ts +30 -30
- package/src/api/function-access.api.ts +87 -87
- package/src/api/function-insights.api.test.ts +27 -27
- package/src/api/function-insights.api.ts +18 -18
- package/src/api/function-run.api.ts +19 -0
- package/src/api/function-settings.api.ts +96 -96
- package/src/api/function-template.api.test.ts +72 -72
- package/src/api/function-template.api.ts +52 -52
- package/src/api/function-test.api.ts +34 -34
- package/src/api/function-version.api.ts +66 -66
- package/src/api/function.api.test.ts +346 -346
- package/src/api/function.api.ts +62 -62
- package/src/api/health.api.ts +10 -10
- package/src/api/route-stats.api.test.ts +45 -45
- package/src/api/route-stats.api.ts +36 -36
- package/src/api/service-completion-webhook.api.test.ts +97 -97
- package/src/api/service-completion-webhook.api.ts +39 -39
- package/src/api/service-configuration.api.ts +16 -16
- package/src/api/service-consumer.api.test.ts +104 -104
- package/src/api/service-consumer.api.ts +90 -90
- package/src/api/service-deployment.api.ts +79 -79
- 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 +178 -178
- package/src/api/service-discord.api.ts +222 -222
- package/src/api/service-insights.api.test.ts +36 -36
- package/src/api/service-insights.api.ts +42 -42
- package/src/api/service-limits.api.test.ts +100 -100
- package/src/api/service-limits.api.ts +37 -37
- package/src/api/service-openapi.api.test.ts +52 -52
- package/src/api/service-openapi.api.ts +21 -21
- package/src/api/service-route.api.ts +74 -74
- package/src/api/service-task.api.test.ts +140 -140
- package/src/api/service-task.api.ts +141 -141
- package/src/api/service-version.api.ts +54 -54
- package/src/api/service.api.test.ts +220 -220
- package/src/api/service.api.ts +55 -55
- package/src/api/storage-surplus.admin.api.test.ts +66 -66
- package/src/api/storage-surplus.admin.api.ts +45 -45
- package/src/discord/discord-command-tree.test.ts +47 -0
- package/src/discord/discord-command-tree.ts +60 -0
- package/src/discord/discord-event-filter-cases.ts +299 -261
- package/src/discord/discord-event-filters.test.ts +120 -91
- package/src/discord/discord-event-filters.ts +103 -95
- package/src/discord/discord-event-intents.test.ts +139 -112
- package/src/discord/discord-event-intents.ts +80 -55
- package/src/discord/index.ts +4 -3
- package/src/index.test.ts +104 -104
- package/src/index.ts +2 -0
- package/src/insights/index.ts +1 -1
- package/src/insights/percentiles.test.ts +75 -75
- package/src/insights/percentiles.ts +37 -37
- package/src/types/enum/discord-command-node-type.enum.ts +10 -0
- package/src/types/enum/discord-command-type.enum.ts +9 -0
- package/src/types/enum/discord-event-type.enum.ts +4 -0
- package/src/types/enum/discord-host-action.enum.ts +37 -37
- package/src/types/enum/index.ts +2 -0
- package/src/types/enum/reflex-error-code.enum.ts +112 -89
- package/src/types/interface/api/requests/application-run-settings.request.ts +13 -13
- package/src/types/interface/api/requests/function-run.request.ts +53 -42
- package/src/types/interface/api/requests/function-settings.request.ts +50 -50
- package/src/types/interface/api/requests/index.ts +25 -25
- package/src/types/interface/api/requests/service-discord.request.ts +168 -155
- package/src/types/interface/api/requests/service.request.ts +48 -48
- package/src/types/interface/api/requests/storage-surplus.admin.request.ts +12 -12
- package/src/types/interface/api/responses/function-run.response.ts +35 -23
- package/src/types/interface/api/responses/function-settings.response.ts +57 -57
- package/src/types/interface/api/responses/index.ts +25 -25
- package/src/types/interface/api/responses/storage-surplus.admin.response.ts +10 -10
- package/src/types/interface/models/index.ts +29 -29
- package/src/types/interface/models/reflex-discord.model.ts +249 -208
- package/src/types/interface/models/reflex-price-list.model.ts +22 -22
- package/src/types/interface/models/reflex-run-retention.model.ts +24 -24
- package/src/types/interface/models/reflex-run-settings.model.ts +39 -39
- package/src/types/interface/models/reflex-run.model.ts +317 -309
- package/src/types/interface/models/reflex-service-deployment.model.ts +48 -48
- package/src/types/interface/models/reflex-service.model.ts +47 -47
- package/src/types/interface/models/reflex-storage-surplus.model.ts +23 -23
- package/tsconfig.check.json +15 -15
- package/tsconfig.json +35 -35
|
@@ -1,42 +1,53 @@
|
|
|
1
|
-
import type { RunMode } from '../../../enum';
|
|
2
|
-
|
|
3
|
-
export interface
|
|
4
|
-
applicationId: string;
|
|
5
|
-
functionId: string;
|
|
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
|
-
|
|
1
|
+
import type { RunMode } from '../../../enum';
|
|
2
|
+
|
|
3
|
+
export interface IReplayFunctionRunParams {
|
|
4
|
+
applicationId: string;
|
|
5
|
+
functionId: string;
|
|
6
|
+
/** A live run started by a Discord event trigger. */
|
|
7
|
+
runId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface IReplayFunctionRunBody {
|
|
10
|
+
/** `DRY_RUN`: the draft, effects recorded not executed. `LIVE`: the version in service, as a received event. */
|
|
11
|
+
mode: RunMode.DRY_RUN | RunMode.LIVE;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface IListFunctionRunParams {
|
|
15
|
+
applicationId: string;
|
|
16
|
+
functionId: string;
|
|
17
|
+
}
|
|
18
|
+
export interface IListFunctionRunQuery {
|
|
19
|
+
mode?: RunMode;
|
|
20
|
+
/** 1 to 100, 50 by default. */
|
|
21
|
+
limit?: number;
|
|
22
|
+
/** Runs skipped, newest first; 0 by default. */
|
|
23
|
+
offset?: number;
|
|
24
|
+
/** Only the live runs this task started (a tick of its cron or a delayed run); test runs have no task. */
|
|
25
|
+
taskId?: string;
|
|
26
|
+
/** Only the runs of this environment of the application (abyss-main's id). */
|
|
27
|
+
environmentId?: string;
|
|
28
|
+
/** Only the live runs this consumer of the Service called; test runs have no consumer. */
|
|
29
|
+
consumerId?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface IGetFunctionRunParams {
|
|
33
|
+
applicationId: string;
|
|
34
|
+
functionId: string;
|
|
35
|
+
runId: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface IGetFunctionRunStateParams {
|
|
39
|
+
applicationId: string;
|
|
40
|
+
functionId: string;
|
|
41
|
+
/** The `executionId` an async route answered with: the id of the live run. */
|
|
42
|
+
runId: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface ISetFunctionRunFavoriteParams {
|
|
46
|
+
applicationId: string;
|
|
47
|
+
functionId: string;
|
|
48
|
+
runId: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ISetFunctionRunFavoriteBody {
|
|
51
|
+
/** A favorite run is never purged. */
|
|
52
|
+
isFavorite: boolean;
|
|
53
|
+
}
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import type { IReflexExecutionSettingsValues, IReflexFunctionLogCap } from '../../models';
|
|
2
|
-
|
|
3
|
-
export interface IGetFunctionSettingsParams {
|
|
4
|
-
applicationId: string;
|
|
5
|
-
functionId: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface ISetFunctionDefaultSettingsParams {
|
|
9
|
-
applicationId: string;
|
|
10
|
-
functionId: string;
|
|
11
|
-
}
|
|
12
|
-
/** Every value is required: a row of settings is whole. */
|
|
13
|
-
export type ISetFunctionDefaultSettingsBody = IReflexExecutionSettingsValues;
|
|
14
|
-
|
|
15
|
-
export interface ISetFunctionEnvironmentSettingsParams {
|
|
16
|
-
applicationId: string;
|
|
17
|
-
functionId: string;
|
|
18
|
-
/** An environment of the application (abyss-main's id). */
|
|
19
|
-
environmentId: string;
|
|
20
|
-
}
|
|
21
|
-
export type ISetFunctionEnvironmentSettingsBody = IReflexExecutionSettingsValues;
|
|
22
|
-
|
|
23
|
-
export interface IRemoveFunctionEnvironmentSettingsParams {
|
|
24
|
-
applicationId: string;
|
|
25
|
-
functionId: string;
|
|
26
|
-
environmentId: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface ISetFunctionLogCapParams {
|
|
30
|
-
applicationId: string;
|
|
31
|
-
functionId: string;
|
|
32
|
-
}
|
|
33
|
-
/** `lines` is required, 1 to 10 000, when `mode` is LIMIT, and forbidden otherwise. */
|
|
34
|
-
export type ISetFunctionLogCapBody = IReflexFunctionLogCap;
|
|
35
|
-
|
|
36
|
-
export interface IGetFunctionRunRetentionParams {
|
|
37
|
-
applicationId: string;
|
|
38
|
-
functionId: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface ISetFunctionRunRetentionParams {
|
|
42
|
-
applicationId: string;
|
|
43
|
-
functionId: string;
|
|
44
|
-
}
|
|
45
|
-
export interface ISetFunctionRunRetentionBody {
|
|
46
|
-
/** One of `REFLEX_RUN_RETENTION_TIER_DAYS`; null to follow the application. Left alone when absent. */
|
|
47
|
-
runRetentionDays?: number | null;
|
|
48
|
-
/** `REFLEX_VERSIONS_KEPT.min` to `REFLEX_VERSIONS_KEPT.max`. Left alone when absent. */
|
|
49
|
-
versionsKept?: number;
|
|
50
|
-
}
|
|
1
|
+
import type { IReflexExecutionSettingsValues, IReflexFunctionLogCap } from '../../models';
|
|
2
|
+
|
|
3
|
+
export interface IGetFunctionSettingsParams {
|
|
4
|
+
applicationId: string;
|
|
5
|
+
functionId: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ISetFunctionDefaultSettingsParams {
|
|
9
|
+
applicationId: string;
|
|
10
|
+
functionId: string;
|
|
11
|
+
}
|
|
12
|
+
/** Every value is required: a row of settings is whole. */
|
|
13
|
+
export type ISetFunctionDefaultSettingsBody = IReflexExecutionSettingsValues;
|
|
14
|
+
|
|
15
|
+
export interface ISetFunctionEnvironmentSettingsParams {
|
|
16
|
+
applicationId: string;
|
|
17
|
+
functionId: string;
|
|
18
|
+
/** An environment of the application (abyss-main's id). */
|
|
19
|
+
environmentId: string;
|
|
20
|
+
}
|
|
21
|
+
export type ISetFunctionEnvironmentSettingsBody = IReflexExecutionSettingsValues;
|
|
22
|
+
|
|
23
|
+
export interface IRemoveFunctionEnvironmentSettingsParams {
|
|
24
|
+
applicationId: string;
|
|
25
|
+
functionId: string;
|
|
26
|
+
environmentId: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ISetFunctionLogCapParams {
|
|
30
|
+
applicationId: string;
|
|
31
|
+
functionId: string;
|
|
32
|
+
}
|
|
33
|
+
/** `lines` is required, 1 to 10 000, when `mode` is LIMIT, and forbidden otherwise. */
|
|
34
|
+
export type ISetFunctionLogCapBody = IReflexFunctionLogCap;
|
|
35
|
+
|
|
36
|
+
export interface IGetFunctionRunRetentionParams {
|
|
37
|
+
applicationId: string;
|
|
38
|
+
functionId: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ISetFunctionRunRetentionParams {
|
|
42
|
+
applicationId: string;
|
|
43
|
+
functionId: string;
|
|
44
|
+
}
|
|
45
|
+
export interface ISetFunctionRunRetentionBody {
|
|
46
|
+
/** One of `REFLEX_RUN_RETENTION_TIER_DAYS`; null to follow the application. Left alone when absent. */
|
|
47
|
+
runRetentionDays?: number | null;
|
|
48
|
+
/** `REFLEX_VERSIONS_KEPT.min` to `REFLEX_VERSIONS_KEPT.max`. Left alone when absent. */
|
|
49
|
+
versionsKept?: number;
|
|
50
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
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';
|
|
16
|
-
export * from './application-run-settings.request';
|
|
17
|
-
export * from './application-insights.request';
|
|
18
|
-
export * from './alert-rule.request';
|
|
19
|
-
export * from './route-stats.request';
|
|
20
|
-
export * from './function-template.request';
|
|
21
|
-
export * from './service-consumer.request';
|
|
22
|
-
export * from './service-openapi.request';
|
|
23
|
-
export * from './service-limits.request';
|
|
24
|
-
export * from './service-completion-webhook.request';
|
|
25
|
-
export * from './storage-surplus.admin.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';
|
|
16
|
+
export * from './application-run-settings.request';
|
|
17
|
+
export * from './application-insights.request';
|
|
18
|
+
export * from './alert-rule.request';
|
|
19
|
+
export * from './route-stats.request';
|
|
20
|
+
export * from './function-template.request';
|
|
21
|
+
export * from './service-consumer.request';
|
|
22
|
+
export * from './service-openapi.request';
|
|
23
|
+
export * from './service-limits.request';
|
|
24
|
+
export * from './service-completion-webhook.request';
|
|
25
|
+
export * from './storage-surplus.admin.request';
|
|
@@ -1,155 +1,168 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
DiscordActivityType,
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface
|
|
66
|
-
applicationId: string;
|
|
67
|
-
serviceId: string;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
functionId
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export interface
|
|
89
|
-
applicationId: string;
|
|
90
|
-
serviceId: string;
|
|
91
|
-
componentId: string;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export interface
|
|
100
|
-
applicationId: string;
|
|
101
|
-
serviceId: string;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
1
|
+
import type {
|
|
2
|
+
DiscordActivityType,
|
|
3
|
+
DiscordCommandNodeType,
|
|
4
|
+
DiscordCommandType,
|
|
5
|
+
DiscordComponentKind,
|
|
6
|
+
DiscordPresenceStatus,
|
|
7
|
+
} from '../../../enum';
|
|
8
|
+
import type { IReflexDiscordCommandOption, ReflexDiscordLocalizations } from '../../models';
|
|
9
|
+
|
|
10
|
+
export interface IListServiceDiscordCommandParams {
|
|
11
|
+
applicationId: string;
|
|
12
|
+
serviceId: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface ICreateServiceDiscordCommandParams {
|
|
16
|
+
applicationId: string;
|
|
17
|
+
serviceId: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ICreateServiceDiscordCommandBody {
|
|
20
|
+
/** `CHAT_INPUT` (default), or a context menu. Not editable. */
|
|
21
|
+
type?: DiscordCommandType;
|
|
22
|
+
/** `COMMAND` (default), or a group or a subcommand under `parentId`. Not editable. */
|
|
23
|
+
nodeType?: DiscordCommandNodeType;
|
|
24
|
+
/** The command (or group) of a group or a subcommand. Not editable. */
|
|
25
|
+
parentId?: string;
|
|
26
|
+
/** See `IReflexDiscordCommand.name`: unique among the nodes of the same parent, or the menus of the same type. */
|
|
27
|
+
name: string;
|
|
28
|
+
/** 1 to 100 characters; empty (or absent) for a context menu. */
|
|
29
|
+
description?: string;
|
|
30
|
+
/** 25 at most, required options first; empty by default, and always on a command with subcommands, a group and a menu. */
|
|
31
|
+
options?: IReflexDiscordCommandOption[];
|
|
32
|
+
/**
|
|
33
|
+
* A function of the same Service. Required for a leaf; absent for a group, and for a command created to hold
|
|
34
|
+
* subcommands.
|
|
35
|
+
*/
|
|
36
|
+
functionId?: string;
|
|
37
|
+
/** Discord permission bits as a decimal string; null (default) for everyone. */
|
|
38
|
+
defaultMemberPermissions?: string | null;
|
|
39
|
+
/** `true` by default. */
|
|
40
|
+
allowedInDirectMessages?: boolean;
|
|
41
|
+
/** Null (default) for none. */
|
|
42
|
+
nameLocalizations?: ReflexDiscordLocalizations | null;
|
|
43
|
+
descriptionLocalizations?: ReflexDiscordLocalizations | null;
|
|
44
|
+
/** `false` by default. */
|
|
45
|
+
userInstallable?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface IUpdateServiceDiscordCommandParams {
|
|
49
|
+
applicationId: string;
|
|
50
|
+
serviceId: string;
|
|
51
|
+
commandId: string;
|
|
52
|
+
}
|
|
53
|
+
export interface IUpdateServiceDiscordCommandBody {
|
|
54
|
+
name?: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
options?: IReflexDiscordCommandOption[];
|
|
57
|
+
functionId?: string;
|
|
58
|
+
defaultMemberPermissions?: string | null;
|
|
59
|
+
allowedInDirectMessages?: boolean;
|
|
60
|
+
nameLocalizations?: ReflexDiscordLocalizations | null;
|
|
61
|
+
descriptionLocalizations?: ReflexDiscordLocalizations | null;
|
|
62
|
+
userInstallable?: boolean;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface IDeleteServiceDiscordCommandParams {
|
|
66
|
+
applicationId: string;
|
|
67
|
+
serviceId: string;
|
|
68
|
+
commandId: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface IListServiceDiscordComponentParams {
|
|
72
|
+
applicationId: string;
|
|
73
|
+
serviceId: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface ICreateServiceDiscordComponentParams {
|
|
77
|
+
applicationId: string;
|
|
78
|
+
serviceId: string;
|
|
79
|
+
}
|
|
80
|
+
export interface ICreateServiceDiscordComponentBody {
|
|
81
|
+
/** `^[a-z0-9_-]{1,40}$`; no prefix of the Service equals, starts or is started by another one. */
|
|
82
|
+
customIdPrefix: string;
|
|
83
|
+
kind: DiscordComponentKind;
|
|
84
|
+
/** A function of the same Service. */
|
|
85
|
+
functionId: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface IUpdateServiceDiscordComponentParams {
|
|
89
|
+
applicationId: string;
|
|
90
|
+
serviceId: string;
|
|
91
|
+
componentId: string;
|
|
92
|
+
}
|
|
93
|
+
export interface IUpdateServiceDiscordComponentBody {
|
|
94
|
+
customIdPrefix?: string;
|
|
95
|
+
kind?: DiscordComponentKind;
|
|
96
|
+
functionId?: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface IDeleteServiceDiscordComponentParams {
|
|
100
|
+
applicationId: string;
|
|
101
|
+
serviceId: string;
|
|
102
|
+
componentId: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface IGetServiceDiscordConnectionParams {
|
|
106
|
+
applicationId: string;
|
|
107
|
+
serviceId: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface ISetServiceDiscordTokenSecretParams {
|
|
111
|
+
applicationId: string;
|
|
112
|
+
serviceId: string;
|
|
113
|
+
}
|
|
114
|
+
export interface ISetServiceDiscordTokenSecretBody {
|
|
115
|
+
/** The Vault entry (a secret of the project) that holds the bot token, one value per environment. */
|
|
116
|
+
discordTokenSecretId: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface ISetServiceDiscordEnvironmentParams {
|
|
120
|
+
applicationId: string;
|
|
121
|
+
serviceId: string;
|
|
122
|
+
environmentId: string;
|
|
123
|
+
}
|
|
124
|
+
export interface ISetServiceDiscordEnvironmentBody {
|
|
125
|
+
/** Discord server (snowflake) the commands are pushed to outside production; null removes it. */
|
|
126
|
+
testGuildId?: string | null;
|
|
127
|
+
/** Discord permission bits as a decimal string, put in the invitation link. */
|
|
128
|
+
invitePermissions: string;
|
|
129
|
+
/** What the bot shows while connected. */
|
|
130
|
+
presenceStatus?: DiscordPresenceStatus;
|
|
131
|
+
/** The kind of activity; null removes it. */
|
|
132
|
+
activityType?: DiscordActivityType | null;
|
|
133
|
+
/** 1 to 128 characters, required with an `activityType`, null without. */
|
|
134
|
+
activityText?: string | null;
|
|
135
|
+
/**
|
|
136
|
+
* Largest file the bot receives or sends, in bytes, 1 to `REFLEX_DISCORD_LIMITS.attachmentMaxBytesBound`; omitted,
|
|
137
|
+
* the current size is kept (the default until one is set), unlike the other fields of this body, which an
|
|
138
|
+
* omission resets: a screen sends it only when it changed it.
|
|
139
|
+
*/
|
|
140
|
+
maxAttachmentBytes?: number;
|
|
141
|
+
/** Turns poll votes on or off; omitted, the current choice is kept (off until set), like `maxAttachmentBytes`. */
|
|
142
|
+
pollVotesEnabled?: boolean;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface ICheckServiceDiscordConnectionParams {
|
|
146
|
+
applicationId: string;
|
|
147
|
+
serviceId: string;
|
|
148
|
+
environmentId: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface IRetryServiceDiscordSyncParams {
|
|
152
|
+
applicationId: string;
|
|
153
|
+
serviceId: string;
|
|
154
|
+
environmentId: string;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface ISetServiceDiscordAllocationParams {
|
|
158
|
+
applicationId: string;
|
|
159
|
+
serviceId: string;
|
|
160
|
+
environmentId: string;
|
|
161
|
+
}
|
|
162
|
+
export interface ISetServiceDiscordAllocationBody {
|
|
163
|
+
/**
|
|
164
|
+
* Lots of 500 events per minute of the reserve of the organization this bot holds in this environment,
|
|
165
|
+
* from 0 to `rate.lotsMax`; 0 releases them. The sum over the organization cannot go past its reserve.
|
|
166
|
+
*/
|
|
167
|
+
lots: number;
|
|
168
|
+
}
|