@abyss-project/reflex 5.1.0 → 5.2.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.
Files changed (103) hide show
  1. package/dist/api/service-version.api.d.ts +2 -1
  2. package/dist/api/service-version.api.js +3 -1
  3. package/dist/api/service-version.api.js.map +1 -1
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.js +1 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/types/interface/api/requests/service-version.request.d.ts +4 -0
  8. package/dist/types/interface/api/responses/service-version.response.d.ts +4 -0
  9. package/package.json +10 -15
  10. package/src/api/function-access.api.ts +36 -36
  11. package/src/api/function-run.api.ts +38 -38
  12. package/src/api/function-settings.api.ts +59 -59
  13. package/src/api/function-test.api.ts +34 -34
  14. package/src/api/function-version.api.ts +48 -48
  15. package/src/api/function.api.test.ts +249 -249
  16. package/src/api/function.api.ts +62 -62
  17. package/src/api/health.api.ts +10 -10
  18. package/src/api/index.ts +13 -13
  19. package/src/api/service-configuration.api.ts +16 -16
  20. package/src/api/service-deployment.api.ts +79 -79
  21. package/src/api/service-discord.api.test.ts +170 -170
  22. package/src/api/service-discord.api.ts +203 -203
  23. package/src/api/service-route.api.ts +72 -72
  24. package/src/api/service-version.api.ts +54 -39
  25. package/src/api/service.api.test.ts +215 -209
  26. package/src/api/service.api.ts +55 -55
  27. package/src/index.ts +237 -235
  28. package/src/types/enum/access-grant-status.enum.ts +12 -12
  29. package/src/types/enum/access-kind.enum.ts +7 -7
  30. package/src/types/enum/configuration-read-as.enum.ts +5 -5
  31. package/src/types/enum/discord-activity-type.enum.ts +9 -9
  32. package/src/types/enum/discord-component-kind.enum.ts +7 -7
  33. package/src/types/enum/discord-gateway-failure-code.enum.ts +9 -9
  34. package/src/types/enum/discord-gateway-state.enum.ts +11 -11
  35. package/src/types/enum/discord-option-type.enum.ts +12 -12
  36. package/src/types/enum/discord-presence-status.enum.ts +8 -8
  37. package/src/types/enum/discord-sync-status.enum.ts +6 -6
  38. package/src/types/enum/discord-token-state.enum.ts +11 -11
  39. package/src/types/enum/execution-mode.enum.ts +9 -9
  40. package/src/types/enum/execution-profile.enum.ts +20 -20
  41. package/src/types/enum/execution-settings-source.enum.ts +9 -9
  42. package/src/types/enum/health-status.enum.ts +4 -4
  43. package/src/types/enum/index.ts +29 -29
  44. package/src/types/enum/reflex-error-code.enum.ts +37 -37
  45. package/src/types/enum/route-method.enum.ts +9 -9
  46. package/src/types/enum/run-log-level.enum.ts +6 -6
  47. package/src/types/enum/run-mode.enum.ts +11 -11
  48. package/src/types/enum/run-status.enum.ts +11 -11
  49. package/src/types/enum/run-step-status.enum.ts +7 -7
  50. package/src/types/enum/service-deployment-action.enum.ts +11 -11
  51. package/src/types/enum/service-deployment-status.enum.ts +5 -5
  52. package/src/types/enum/service-type.enum.ts +9 -9
  53. package/src/types/enum/service-version-change-kind.enum.ts +6 -6
  54. package/src/types/enum/trace-effect-type.enum.ts +12 -12
  55. package/src/types/enum/trigger-access-mode.enum.ts +12 -12
  56. package/src/types/enum/vault-value-source.enum.ts +12 -12
  57. package/src/types/enum/vault-visibility.enum.ts +5 -5
  58. package/src/types/index.ts +2 -2
  59. package/src/types/interface/api/index.ts +3 -3
  60. package/src/types/interface/api/requests/function-access.request.ts +25 -25
  61. package/src/types/interface/api/requests/function-run.request.ts +26 -26
  62. package/src/types/interface/api/requests/function-settings.request.ts +27 -27
  63. package/src/types/interface/api/requests/function-test.request.ts +24 -24
  64. package/src/types/interface/api/requests/function-version.request.ts +20 -20
  65. package/src/types/interface/api/requests/function.request.ts +36 -36
  66. package/src/types/interface/api/requests/index.ts +12 -12
  67. package/src/types/interface/api/requests/service-configuration.request.ts +4 -4
  68. package/src/types/interface/api/requests/service-deployment.request.ts +49 -49
  69. package/src/types/interface/api/requests/service-discord.request.ts +128 -128
  70. package/src/types/interface/api/requests/service-route.request.ts +44 -44
  71. package/src/types/interface/api/requests/service-version.request.ts +5 -0
  72. package/src/types/interface/api/requests/service.request.ts +46 -46
  73. package/src/types/interface/api/response.ts +4 -4
  74. package/src/types/interface/api/responses/function-access.response.ts +17 -17
  75. package/src/types/interface/api/responses/function-run.response.ts +18 -18
  76. package/src/types/interface/api/responses/function-settings.response.ts +36 -36
  77. package/src/types/interface/api/responses/function-test.response.ts +12 -12
  78. package/src/types/interface/api/responses/function-version.response.ts +31 -31
  79. package/src/types/interface/api/responses/function.response.ts +25 -25
  80. package/src/types/interface/api/responses/index.ts +12 -12
  81. package/src/types/interface/api/responses/service-configuration.response.ts +8 -8
  82. package/src/types/interface/api/responses/service-deployment.response.ts +32 -32
  83. package/src/types/interface/api/responses/service-discord.response.ts +72 -72
  84. package/src/types/interface/api/responses/service-route.response.ts +31 -31
  85. package/src/types/interface/api/responses/service-version.response.ts +11 -0
  86. package/src/types/interface/api/responses/service.response.ts +31 -31
  87. package/src/types/interface/health.response.ts +7 -7
  88. package/src/types/interface/index.ts +3 -3
  89. package/src/types/interface/models/index.ts +14 -14
  90. package/src/types/interface/models/reflex-access-grant.model.ts +14 -14
  91. package/src/types/interface/models/reflex-definition.model.ts +31 -31
  92. package/src/types/interface/models/reflex-discord.model.ts +146 -146
  93. package/src/types/interface/models/reflex-execution-settings.model.ts +50 -50
  94. package/src/types/interface/models/reflex-function-version.model.ts +14 -14
  95. package/src/types/interface/models/reflex-function.model.ts +16 -16
  96. package/src/types/interface/models/reflex-price-list.model.ts +20 -20
  97. package/src/types/interface/models/reflex-route.model.ts +19 -19
  98. package/src/types/interface/models/reflex-run.model.ts +173 -173
  99. package/src/types/interface/models/reflex-service-configuration.model.ts +22 -22
  100. package/src/types/interface/models/reflex-service-deployment.model.ts +40 -40
  101. package/src/types/interface/models/reflex-service-version.model.ts +55 -55
  102. package/src/types/interface/models/reflex-service.model.ts +45 -45
  103. package/src/types/interface/models/reflex-step-stats.model.ts +35 -35
@@ -1,26 +1,26 @@
1
- import type { RunMode } from '../../../enum';
2
-
3
- export interface IListFunctionRunParams {
4
- applicationId: string;
5
- functionId: string;
6
- }
7
- export interface IListFunctionRunQuery {
8
- mode?: RunMode;
9
- /** 1 to 100, 50 by default. */
10
- limit?: number;
11
- /** Runs skipped, newest first; 0 by default. */
12
- offset?: number;
13
- }
14
-
15
- export interface IGetFunctionRunParams {
16
- applicationId: string;
17
- functionId: string;
18
- runId: string;
19
- }
20
-
21
- export interface IGetFunctionRunStateParams {
22
- applicationId: string;
23
- functionId: string;
24
- /** The `executionId` an async route answered with: the id of the live run. */
25
- runId: string;
26
- }
1
+ import type { RunMode } from '../../../enum';
2
+
3
+ export interface IListFunctionRunParams {
4
+ applicationId: string;
5
+ functionId: string;
6
+ }
7
+ export interface IListFunctionRunQuery {
8
+ mode?: RunMode;
9
+ /** 1 to 100, 50 by default. */
10
+ limit?: number;
11
+ /** Runs skipped, newest first; 0 by default. */
12
+ offset?: number;
13
+ }
14
+
15
+ export interface IGetFunctionRunParams {
16
+ applicationId: string;
17
+ functionId: string;
18
+ runId: string;
19
+ }
20
+
21
+ export interface IGetFunctionRunStateParams {
22
+ applicationId: string;
23
+ functionId: string;
24
+ /** The `executionId` an async route answered with: the id of the live run. */
25
+ runId: string;
26
+ }
@@ -1,27 +1,27 @@
1
- import type { IReflexExecutionSettingsValues } 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
- }
1
+ import type { IReflexExecutionSettingsValues } 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
+ }
@@ -1,24 +1,24 @@
1
- export interface IFunctionTestParams {
2
- applicationId: string;
3
- functionId: string;
4
- }
5
-
6
- /** The answer an HTTP step gets in a test; nothing is sent. Defaults to `200` with no body. */
7
- export interface IReflexHttpStub {
8
- status: number;
9
- headers?: Record<string, string>;
10
- body?: unknown;
11
- }
12
-
13
- export interface ISimulateFunctionBody {
14
- /**
15
- * The environment of the application the run takes place in (abyss-main's id): a dry run reads its
16
- * Store, the run is measured with its effective settings and recorded with it.
17
- */
18
- environmentId: string;
19
- /** The event the function receives, as the edge builds it: `{method, path, query, headers, body}`. */
20
- input?: unknown;
21
- /** Simulated responses of HTTP steps, by step id. */
22
- httpStubs?: Record<string, IReflexHttpStub>;
23
- }
24
- export type IDryRunFunctionBody = ISimulateFunctionBody;
1
+ export interface IFunctionTestParams {
2
+ applicationId: string;
3
+ functionId: string;
4
+ }
5
+
6
+ /** The answer an HTTP step gets in a test; nothing is sent. Defaults to `200` with no body. */
7
+ export interface IReflexHttpStub {
8
+ status: number;
9
+ headers?: Record<string, string>;
10
+ body?: unknown;
11
+ }
12
+
13
+ export interface ISimulateFunctionBody {
14
+ /**
15
+ * The environment of the application the run takes place in (abyss-main's id): a dry run reads its
16
+ * Store, the run is measured with its effective settings and recorded with it.
17
+ */
18
+ environmentId: string;
19
+ /** The event the function receives, as the edge builds it: `{method, path, query, headers, body}`. */
20
+ input?: unknown;
21
+ /** Simulated responses of HTTP steps, by step id. */
22
+ httpStubs?: Record<string, IReflexHttpStub>;
23
+ }
24
+ export type IDryRunFunctionBody = ISimulateFunctionBody;
@@ -1,20 +1,20 @@
1
- export interface IListFunctionVersionParams {
2
- applicationId: string;
3
- functionId: string;
4
- }
5
-
6
- export interface IGetFunctionVersionParams {
7
- applicationId: string;
8
- functionId: string;
9
- versionId: string;
10
- }
11
-
12
- export interface IGetFunctionVersionStepStatsParams {
13
- applicationId: string;
14
- functionId: string;
15
- versionId: string;
16
- }
17
- export interface IGetFunctionVersionStepStatsQuery {
18
- /** Only the executions of this environment; every environment when absent. */
19
- environmentId?: string;
20
- }
1
+ export interface IListFunctionVersionParams {
2
+ applicationId: string;
3
+ functionId: string;
4
+ }
5
+
6
+ export interface IGetFunctionVersionParams {
7
+ applicationId: string;
8
+ functionId: string;
9
+ versionId: string;
10
+ }
11
+
12
+ export interface IGetFunctionVersionStepStatsParams {
13
+ applicationId: string;
14
+ functionId: string;
15
+ versionId: string;
16
+ }
17
+ export interface IGetFunctionVersionStepStatsQuery {
18
+ /** Only the executions of this environment; every environment when absent. */
19
+ environmentId?: string;
20
+ }
@@ -1,36 +1,36 @@
1
- import type { IReflexDefinition } from '../../models';
2
-
3
- export interface IListFunctionParams {
4
- applicationId: string;
5
- }
6
-
7
- export interface ICreateFunctionParams {
8
- applicationId: string;
9
- }
10
- export interface ICreateFunctionBody {
11
- /** A Service of the application, which the function joins. */
12
- serviceId: string;
13
- /** Unique within the application, 1 to 100 characters. */
14
- name: string;
15
- /** Absent: a function without access or step, to fill in. */
16
- definition?: IReflexDefinition;
17
- }
18
-
19
- export interface IGetFunctionParams {
20
- applicationId: string;
21
- functionId: string;
22
- }
23
-
24
- export interface IUpdateFunctionParams {
25
- applicationId: string;
26
- functionId: string;
27
- }
28
- export interface IUpdateFunctionBody {
29
- name?: string;
30
- definition?: IReflexDefinition;
31
- }
32
-
33
- export interface IDeleteFunctionParams {
34
- applicationId: string;
35
- functionId: string;
36
- }
1
+ import type { IReflexDefinition } from '../../models';
2
+
3
+ export interface IListFunctionParams {
4
+ applicationId: string;
5
+ }
6
+
7
+ export interface ICreateFunctionParams {
8
+ applicationId: string;
9
+ }
10
+ export interface ICreateFunctionBody {
11
+ /** A Service of the application, which the function joins. */
12
+ serviceId: string;
13
+ /** Unique within the application, 1 to 100 characters. */
14
+ name: string;
15
+ /** Absent: a function without access or step, to fill in. */
16
+ definition?: IReflexDefinition;
17
+ }
18
+
19
+ export interface IGetFunctionParams {
20
+ applicationId: string;
21
+ functionId: string;
22
+ }
23
+
24
+ export interface IUpdateFunctionParams {
25
+ applicationId: string;
26
+ functionId: string;
27
+ }
28
+ export interface IUpdateFunctionBody {
29
+ name?: string;
30
+ definition?: IReflexDefinition;
31
+ }
32
+
33
+ export interface IDeleteFunctionParams {
34
+ applicationId: string;
35
+ functionId: string;
36
+ }
@@ -1,12 +1,12 @@
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';
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';
@@ -1,4 +1,4 @@
1
- export interface IListServiceConfigurationParams {
2
- applicationId: string;
3
- serviceId: string;
4
- }
1
+ export interface IListServiceConfigurationParams {
2
+ applicationId: string;
3
+ serviceId: string;
4
+ }
@@ -1,49 +1,49 @@
1
- export interface IListServiceDeploymentParams {
2
- applicationId: string;
3
- serviceId: string;
4
- }
5
- export interface IListServiceDeploymentQuery {
6
- /** Only the history of this environment; every environment when absent. */
7
- environmentId?: string;
8
- /** 1 to 100, 50 by default. */
9
- limit?: number;
10
- /** Gestures skipped, newest first; 0 by default. */
11
- offset?: number;
12
- }
13
-
14
- export interface IGoLiveServiceParams {
15
- applicationId: string;
16
- serviceId: string;
17
- }
18
- /** A production environment needs REFLEX_PUBLISH_PRODUCTION, any other REFLEX_PUBLISH. */
19
- export interface IGoLiveServiceBody {
20
- /** An environment of the application (abyss-main's id). */
21
- environmentId: string;
22
- serviceVersionId: string;
23
- }
24
-
25
- export interface IRollbackServiceParams {
26
- applicationId: string;
27
- serviceId: string;
28
- }
29
- export interface IRollbackServiceBody {
30
- environmentId: string;
31
- /** A deployment of this environment, from the history: its version is put back in service. */
32
- deploymentId: string;
33
- }
34
-
35
- export interface IPauseServiceParams {
36
- applicationId: string;
37
- serviceId: string;
38
- }
39
- export interface IPauseServiceBody {
40
- environmentId: string;
41
- }
42
-
43
- export interface IResumeServiceParams {
44
- applicationId: string;
45
- serviceId: string;
46
- }
47
- export interface IResumeServiceBody {
48
- environmentId: string;
49
- }
1
+ export interface IListServiceDeploymentParams {
2
+ applicationId: string;
3
+ serviceId: string;
4
+ }
5
+ export interface IListServiceDeploymentQuery {
6
+ /** Only the history of this environment; every environment when absent. */
7
+ environmentId?: string;
8
+ /** 1 to 100, 50 by default. */
9
+ limit?: number;
10
+ /** Gestures skipped, newest first; 0 by default. */
11
+ offset?: number;
12
+ }
13
+
14
+ export interface IGoLiveServiceParams {
15
+ applicationId: string;
16
+ serviceId: string;
17
+ }
18
+ /** A production environment needs REFLEX_PUBLISH_PRODUCTION, any other REFLEX_PUBLISH. */
19
+ export interface IGoLiveServiceBody {
20
+ /** An environment of the application (abyss-main's id). */
21
+ environmentId: string;
22
+ serviceVersionId: string;
23
+ }
24
+
25
+ export interface IRollbackServiceParams {
26
+ applicationId: string;
27
+ serviceId: string;
28
+ }
29
+ export interface IRollbackServiceBody {
30
+ environmentId: string;
31
+ /** A deployment of this environment, from the history: its version is put back in service. */
32
+ deploymentId: string;
33
+ }
34
+
35
+ export interface IPauseServiceParams {
36
+ applicationId: string;
37
+ serviceId: string;
38
+ }
39
+ export interface IPauseServiceBody {
40
+ environmentId: string;
41
+ }
42
+
43
+ export interface IResumeServiceParams {
44
+ applicationId: string;
45
+ serviceId: string;
46
+ }
47
+ export interface IResumeServiceBody {
48
+ environmentId: string;
49
+ }
@@ -1,128 +1,128 @@
1
- import type {
2
- DiscordActivityType,
3
- DiscordComponentKind,
4
- DiscordPresenceStatus,
5
- } from '../../../enum';
6
- import type { IReflexDiscordCommandOption } from '../../models';
7
-
8
- export interface IListServiceDiscordCommandParams {
9
- applicationId: string;
10
- serviceId: string;
11
- }
12
-
13
- export interface ICreateServiceDiscordCommandParams {
14
- applicationId: string;
15
- serviceId: string;
16
- }
17
- export interface ICreateServiceDiscordCommandBody {
18
- /** `^[-_a-z0-9]{1,32}$`, unique within the Service. */
19
- name: string;
20
- /** 1 to 100 characters. */
21
- description: string;
22
- /** 25 at most, required options first; empty by default. */
23
- options?: IReflexDiscordCommandOption[];
24
- /** A function of the same Service. */
25
- functionId: string;
26
- /** Discord permission bits as a decimal string; null (default) for everyone. */
27
- defaultMemberPermissions?: string | null;
28
- /** `true` by default. */
29
- allowedInDirectMessages?: boolean;
30
- }
31
-
32
- export interface IUpdateServiceDiscordCommandParams {
33
- applicationId: string;
34
- serviceId: string;
35
- commandId: string;
36
- }
37
- export interface IUpdateServiceDiscordCommandBody {
38
- name?: string;
39
- description?: string;
40
- options?: IReflexDiscordCommandOption[];
41
- functionId?: string;
42
- defaultMemberPermissions?: string | null;
43
- allowedInDirectMessages?: boolean;
44
- }
45
-
46
- export interface IDeleteServiceDiscordCommandParams {
47
- applicationId: string;
48
- serviceId: string;
49
- commandId: string;
50
- }
51
-
52
- export interface IListServiceDiscordComponentParams {
53
- applicationId: string;
54
- serviceId: string;
55
- }
56
-
57
- export interface ICreateServiceDiscordComponentParams {
58
- applicationId: string;
59
- serviceId: string;
60
- }
61
- export interface ICreateServiceDiscordComponentBody {
62
- /** `^[a-z0-9_-]{1,40}$`; no prefix of the Service equals, starts or is started by another one. */
63
- customIdPrefix: string;
64
- kind: DiscordComponentKind;
65
- /** A function of the same Service. */
66
- functionId: string;
67
- }
68
-
69
- export interface IUpdateServiceDiscordComponentParams {
70
- applicationId: string;
71
- serviceId: string;
72
- componentId: string;
73
- }
74
- export interface IUpdateServiceDiscordComponentBody {
75
- customIdPrefix?: string;
76
- kind?: DiscordComponentKind;
77
- functionId?: string;
78
- }
79
-
80
- export interface IDeleteServiceDiscordComponentParams {
81
- applicationId: string;
82
- serviceId: string;
83
- componentId: string;
84
- }
85
-
86
- export interface IGetServiceDiscordConnectionParams {
87
- applicationId: string;
88
- serviceId: string;
89
- }
90
-
91
- export interface ISetServiceDiscordTokenSecretParams {
92
- applicationId: string;
93
- serviceId: string;
94
- }
95
- export interface ISetServiceDiscordTokenSecretBody {
96
- /** The Vault entry (a secret of the project) that holds the bot token, one value per environment. */
97
- discordTokenSecretId: string;
98
- }
99
-
100
- export interface ISetServiceDiscordEnvironmentParams {
101
- applicationId: string;
102
- serviceId: string;
103
- environmentId: string;
104
- }
105
- export interface ISetServiceDiscordEnvironmentBody {
106
- /** Discord server (snowflake) the commands are pushed to outside production; null removes it. */
107
- testGuildId?: string | null;
108
- /** Discord permission bits as a decimal string, put in the invitation link. */
109
- invitePermissions: string;
110
- /** What the bot shows while connected. */
111
- presenceStatus?: DiscordPresenceStatus;
112
- /** The kind of activity; null removes it. */
113
- activityType?: DiscordActivityType | null;
114
- /** 1 to 128 characters, required with an `activityType`, null without. */
115
- activityText?: string | null;
116
- }
117
-
118
- export interface ICheckServiceDiscordConnectionParams {
119
- applicationId: string;
120
- serviceId: string;
121
- environmentId: string;
122
- }
123
-
124
- export interface IRetryServiceDiscordSyncParams {
125
- applicationId: string;
126
- serviceId: string;
127
- environmentId: string;
128
- }
1
+ import type {
2
+ DiscordActivityType,
3
+ DiscordComponentKind,
4
+ DiscordPresenceStatus,
5
+ } from '../../../enum';
6
+ import type { IReflexDiscordCommandOption } from '../../models';
7
+
8
+ export interface IListServiceDiscordCommandParams {
9
+ applicationId: string;
10
+ serviceId: string;
11
+ }
12
+
13
+ export interface ICreateServiceDiscordCommandParams {
14
+ applicationId: string;
15
+ serviceId: string;
16
+ }
17
+ export interface ICreateServiceDiscordCommandBody {
18
+ /** `^[-_a-z0-9]{1,32}$`, unique within the Service. */
19
+ name: string;
20
+ /** 1 to 100 characters. */
21
+ description: string;
22
+ /** 25 at most, required options first; empty by default. */
23
+ options?: IReflexDiscordCommandOption[];
24
+ /** A function of the same Service. */
25
+ functionId: string;
26
+ /** Discord permission bits as a decimal string; null (default) for everyone. */
27
+ defaultMemberPermissions?: string | null;
28
+ /** `true` by default. */
29
+ allowedInDirectMessages?: boolean;
30
+ }
31
+
32
+ export interface IUpdateServiceDiscordCommandParams {
33
+ applicationId: string;
34
+ serviceId: string;
35
+ commandId: string;
36
+ }
37
+ export interface IUpdateServiceDiscordCommandBody {
38
+ name?: string;
39
+ description?: string;
40
+ options?: IReflexDiscordCommandOption[];
41
+ functionId?: string;
42
+ defaultMemberPermissions?: string | null;
43
+ allowedInDirectMessages?: boolean;
44
+ }
45
+
46
+ export interface IDeleteServiceDiscordCommandParams {
47
+ applicationId: string;
48
+ serviceId: string;
49
+ commandId: string;
50
+ }
51
+
52
+ export interface IListServiceDiscordComponentParams {
53
+ applicationId: string;
54
+ serviceId: string;
55
+ }
56
+
57
+ export interface ICreateServiceDiscordComponentParams {
58
+ applicationId: string;
59
+ serviceId: string;
60
+ }
61
+ export interface ICreateServiceDiscordComponentBody {
62
+ /** `^[a-z0-9_-]{1,40}$`; no prefix of the Service equals, starts or is started by another one. */
63
+ customIdPrefix: string;
64
+ kind: DiscordComponentKind;
65
+ /** A function of the same Service. */
66
+ functionId: string;
67
+ }
68
+
69
+ export interface IUpdateServiceDiscordComponentParams {
70
+ applicationId: string;
71
+ serviceId: string;
72
+ componentId: string;
73
+ }
74
+ export interface IUpdateServiceDiscordComponentBody {
75
+ customIdPrefix?: string;
76
+ kind?: DiscordComponentKind;
77
+ functionId?: string;
78
+ }
79
+
80
+ export interface IDeleteServiceDiscordComponentParams {
81
+ applicationId: string;
82
+ serviceId: string;
83
+ componentId: string;
84
+ }
85
+
86
+ export interface IGetServiceDiscordConnectionParams {
87
+ applicationId: string;
88
+ serviceId: string;
89
+ }
90
+
91
+ export interface ISetServiceDiscordTokenSecretParams {
92
+ applicationId: string;
93
+ serviceId: string;
94
+ }
95
+ export interface ISetServiceDiscordTokenSecretBody {
96
+ /** The Vault entry (a secret of the project) that holds the bot token, one value per environment. */
97
+ discordTokenSecretId: string;
98
+ }
99
+
100
+ export interface ISetServiceDiscordEnvironmentParams {
101
+ applicationId: string;
102
+ serviceId: string;
103
+ environmentId: string;
104
+ }
105
+ export interface ISetServiceDiscordEnvironmentBody {
106
+ /** Discord server (snowflake) the commands are pushed to outside production; null removes it. */
107
+ testGuildId?: string | null;
108
+ /** Discord permission bits as a decimal string, put in the invitation link. */
109
+ invitePermissions: string;
110
+ /** What the bot shows while connected. */
111
+ presenceStatus?: DiscordPresenceStatus;
112
+ /** The kind of activity; null removes it. */
113
+ activityType?: DiscordActivityType | null;
114
+ /** 1 to 128 characters, required with an `activityType`, null without. */
115
+ activityText?: string | null;
116
+ }
117
+
118
+ export interface ICheckServiceDiscordConnectionParams {
119
+ applicationId: string;
120
+ serviceId: string;
121
+ environmentId: string;
122
+ }
123
+
124
+ export interface IRetryServiceDiscordSyncParams {
125
+ applicationId: string;
126
+ serviceId: string;
127
+ environmentId: string;
128
+ }