@abyss-project/reflex 3.0.0 → 5.0.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/index.d.ts +2 -1
- package/dist/api/index.js +2 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/service-configuration.api.d.ts +2 -0
- package/dist/api/service-configuration.api.js +7 -0
- package/dist/api/service-configuration.api.js.map +1 -0
- package/dist/api/service-discord.api.d.ts +14 -0
- package/dist/api/service-discord.api.js +38 -0
- package/dist/api/service-discord.api.js.map +1 -0
- package/dist/index.d.ts +25 -6
- package/dist/index.js +25 -6
- package/dist/index.js.map +1 -1
- package/dist/types/enum/configuration-read-as.enum.d.ts +4 -0
- package/dist/types/enum/configuration-read-as.enum.js +9 -0
- package/dist/types/enum/configuration-read-as.enum.js.map +1 -0
- package/dist/types/enum/discord-component-kind.enum.d.ts +4 -0
- package/dist/types/enum/discord-component-kind.enum.js +9 -0
- package/dist/types/enum/discord-component-kind.enum.js.map +1 -0
- package/dist/types/enum/discord-option-type.enum.d.ts +11 -0
- package/dist/types/enum/discord-option-type.enum.js +16 -0
- package/dist/types/enum/discord-option-type.enum.js.map +1 -0
- package/dist/types/enum/discord-sync-status.enum.d.ts +5 -0
- package/dist/types/enum/discord-sync-status.enum.js +10 -0
- package/dist/types/enum/discord-sync-status.enum.js.map +1 -0
- package/dist/types/enum/discord-token-state.enum.d.ts +6 -0
- package/dist/types/enum/discord-token-state.enum.js +11 -0
- package/dist/types/enum/discord-token-state.enum.js.map +1 -0
- package/dist/types/enum/index.d.ts +7 -1
- package/dist/types/enum/index.js +7 -1
- package/dist/types/enum/index.js.map +1 -1
- package/dist/types/enum/reflex-error-code.enum.d.ts +7 -1
- package/dist/types/enum/reflex-error-code.enum.js +6 -0
- package/dist/types/enum/reflex-error-code.enum.js.map +1 -1
- package/dist/types/enum/service-type.enum.d.ts +2 -1
- package/dist/types/enum/service-type.enum.js +1 -0
- package/dist/types/enum/service-type.enum.js.map +1 -1
- package/dist/types/enum/vault-value-source.enum.d.ts +6 -0
- package/dist/types/enum/vault-value-source.enum.js +11 -0
- package/dist/types/enum/vault-value-source.enum.js.map +1 -0
- package/dist/types/enum/vault-visibility.enum.d.ts +4 -0
- package/dist/types/enum/vault-visibility.enum.js +9 -0
- package/dist/types/enum/vault-visibility.enum.js.map +1 -0
- package/dist/types/interface/api/requests/index.d.ts +2 -1
- package/dist/types/interface/api/requests/index.js +2 -1
- package/dist/types/interface/api/requests/index.js.map +1 -1
- package/dist/types/interface/api/requests/service-configuration.request.d.ts +4 -0
- package/dist/types/interface/{models/reflex-service-variable.model.js → api/requests/service-configuration.request.js} +1 -1
- package/dist/types/interface/api/requests/service-configuration.request.js.map +1 -0
- package/dist/types/interface/api/requests/service-discord.request.d.ts +94 -0
- package/dist/types/interface/api/requests/{service-variable.request.js → service-discord.request.js} +1 -1
- package/dist/types/interface/api/requests/service-discord.request.js.map +1 -0
- package/dist/types/interface/api/requests/service.request.d.ts +2 -0
- package/dist/types/interface/api/responses/index.d.ts +2 -1
- package/dist/types/interface/api/responses/index.js +2 -1
- package/dist/types/interface/api/responses/index.js.map +1 -1
- package/dist/types/interface/api/responses/service-configuration.response.d.ts +6 -0
- package/dist/types/interface/api/responses/service-configuration.response.js +3 -0
- package/dist/types/interface/api/responses/service-configuration.response.js.map +1 -0
- package/dist/types/interface/api/responses/service-discord.response.d.ts +50 -0
- package/dist/types/interface/api/responses/{service-variable.response.js → service-discord.response.js} +1 -1
- package/dist/types/interface/api/responses/service-discord.response.js.map +1 -0
- package/dist/types/interface/api/responses/service-version.response.d.ts +15 -1
- package/dist/types/interface/models/index.d.ts +2 -1
- package/dist/types/interface/models/index.js +2 -1
- package/dist/types/interface/models/index.js.map +1 -1
- package/dist/types/interface/models/reflex-discord.model.d.ts +69 -0
- package/dist/types/interface/models/reflex-discord.model.js +13 -0
- package/dist/types/interface/models/reflex-discord.model.js.map +1 -0
- package/dist/types/interface/models/reflex-run.model.d.ts +3 -0
- package/dist/types/interface/models/reflex-service-configuration.model.d.ts +9 -0
- package/dist/types/interface/models/reflex-service-configuration.model.js +3 -0
- package/dist/types/interface/models/reflex-service-configuration.model.js.map +1 -0
- package/dist/types/interface/models/reflex-service-deployment.model.d.ts +5 -1
- package/dist/types/interface/models/reflex-service-version.model.d.ts +6 -0
- package/dist/types/interface/models/reflex-service.model.d.ts +1 -2
- package/dist/types/interface/models/reflex-service.model.js +0 -2
- package/dist/types/interface/models/reflex-service.model.js.map +1 -1
- package/package.json +1 -1
- package/src/api/function-run.api.ts +38 -38
- package/src/api/function-version.api.ts +48 -48
- package/src/api/function.api.test.ts +249 -249
- package/src/api/index.ts +13 -12
- package/src/api/service-configuration.api.ts +16 -0
- package/src/api/service-deployment.api.ts +79 -79
- package/src/api/service-discord.api.test.ts +170 -0
- package/src/api/service-discord.api.ts +203 -0
- package/src/api/service-route.api.ts +72 -72
- package/src/api/service-version.api.ts +39 -39
- package/src/api/service.api.test.ts +209 -234
- package/src/api/service.api.ts +55 -55
- package/src/index.ts +50 -11
- package/src/types/enum/configuration-read-as.enum.ts +5 -0
- package/src/types/enum/discord-component-kind.enum.ts +7 -0
- package/src/types/enum/discord-option-type.enum.ts +12 -0
- package/src/types/enum/discord-sync-status.enum.ts +6 -0
- package/src/types/enum/discord-token-state.enum.ts +11 -0
- package/src/types/enum/execution-mode.enum.ts +9 -9
- package/src/types/enum/index.ts +25 -19
- package/src/types/enum/reflex-error-code.enum.ts +37 -25
- package/src/types/enum/route-method.enum.ts +9 -9
- package/src/types/enum/service-deployment-action.enum.ts +11 -11
- package/src/types/enum/service-deployment-status.enum.ts +5 -5
- package/src/types/enum/service-type.enum.ts +9 -7
- package/src/types/enum/service-version-change-kind.enum.ts +6 -6
- package/src/types/enum/trigger-access-mode.enum.ts +12 -12
- package/src/types/enum/vault-value-source.enum.ts +12 -0
- package/src/types/enum/vault-visibility.enum.ts +5 -0
- package/src/types/interface/api/requests/function-run.request.ts +26 -26
- package/src/types/interface/api/requests/function-version.request.ts +20 -20
- package/src/types/interface/api/requests/function.request.ts +36 -36
- package/src/types/interface/api/requests/index.ts +12 -11
- package/src/types/interface/api/requests/service-configuration.request.ts +4 -0
- package/src/types/interface/api/requests/service-deployment.request.ts +49 -49
- package/src/types/interface/api/requests/service-discord.request.ts +118 -0
- package/src/types/interface/api/requests/service-route.request.ts +44 -44
- package/src/types/interface/api/requests/service-version.request.ts +19 -19
- package/src/types/interface/api/requests/service.request.ts +46 -39
- package/src/types/interface/api/responses/function-version.response.ts +31 -31
- package/src/types/interface/api/responses/index.ts +12 -11
- package/src/types/interface/api/responses/service-configuration.response.ts +8 -0
- package/src/types/interface/api/responses/service-deployment.response.ts +32 -32
- package/src/types/interface/api/responses/service-discord.response.ts +72 -0
- package/src/types/interface/api/responses/service-route.response.ts +31 -31
- package/src/types/interface/api/responses/service-version.response.ts +30 -1
- package/src/types/interface/api/responses/service.response.ts +31 -31
- package/src/types/interface/models/index.ts +14 -13
- package/src/types/interface/models/reflex-discord.model.ts +117 -0
- package/src/types/interface/models/reflex-function.model.ts +16 -16
- package/src/types/interface/models/reflex-route.model.ts +19 -19
- package/src/types/interface/models/reflex-run.model.ts +10 -1
- package/src/types/interface/models/reflex-service-configuration.model.ts +22 -0
- package/src/types/interface/models/reflex-service-deployment.model.ts +40 -29
- package/src/types/interface/models/reflex-service-version.model.ts +55 -43
- package/src/types/interface/models/reflex-service.model.ts +45 -46
- package/dist/api/service-variable.api.d.ts +0 -5
- package/dist/api/service-variable.api.js +0 -16
- package/dist/api/service-variable.api.js.map +0 -1
- package/dist/types/enum/secret-source.enum.d.ts +0 -5
- package/dist/types/enum/secret-source.enum.js +0 -10
- package/dist/types/enum/secret-source.enum.js.map +0 -1
- package/dist/types/interface/api/requests/service-variable.request.d.ts +0 -23
- package/dist/types/interface/api/requests/service-variable.request.js.map +0 -1
- package/dist/types/interface/api/responses/service-variable.response.d.ts +0 -22
- package/dist/types/interface/api/responses/service-variable.response.js.map +0 -1
- package/dist/types/interface/models/reflex-service-variable.model.d.ts +0 -10
- package/dist/types/interface/models/reflex-service-variable.model.js.map +0 -1
- package/src/api/service-variable.api.ts +0 -58
- package/src/types/enum/secret-source.enum.ts +0 -9
- package/src/types/interface/api/requests/service-variable.request.ts +0 -29
- package/src/types/interface/api/responses/service-variable.response.ts +0 -31
- package/src/types/interface/models/reflex-service-variable.model.ts +0 -16
package/src/index.ts
CHANGED
|
@@ -10,7 +10,8 @@ import * as serviceApi from './api/service.api';
|
|
|
10
10
|
import * as serviceRouteApi from './api/service-route.api';
|
|
11
11
|
import * as serviceVersionApi from './api/service-version.api';
|
|
12
12
|
import * as serviceDeploymentApi from './api/service-deployment.api';
|
|
13
|
-
import * as
|
|
13
|
+
import * as serviceConfigurationApi from './api/service-configuration.api';
|
|
14
|
+
import * as serviceDiscordApi from './api/service-discord.api';
|
|
14
15
|
|
|
15
16
|
export * from './api';
|
|
16
17
|
export * from './types';
|
|
@@ -84,12 +85,32 @@ type AbyssReflexCoreSDK = {
|
|
|
84
85
|
pause: typeof serviceDeploymentApi.pauseService;
|
|
85
86
|
resume: typeof serviceDeploymentApi.resumeService;
|
|
86
87
|
};
|
|
87
|
-
|
|
88
|
-
list: typeof
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
configuration: {
|
|
89
|
+
list: typeof serviceConfigurationApi.listServiceConfiguration;
|
|
90
|
+
};
|
|
91
|
+
/** A Discord bot Service: its commands and components, its connection, the push to Discord. */
|
|
92
|
+
discord: {
|
|
93
|
+
command: {
|
|
94
|
+
list: typeof serviceDiscordApi.listServiceDiscordCommand;
|
|
95
|
+
create: typeof serviceDiscordApi.createServiceDiscordCommand;
|
|
96
|
+
update: typeof serviceDiscordApi.updateServiceDiscordCommand;
|
|
97
|
+
delete: typeof serviceDiscordApi.deleteServiceDiscordCommand;
|
|
98
|
+
};
|
|
99
|
+
component: {
|
|
100
|
+
list: typeof serviceDiscordApi.listServiceDiscordComponent;
|
|
101
|
+
create: typeof serviceDiscordApi.createServiceDiscordComponent;
|
|
102
|
+
update: typeof serviceDiscordApi.updateServiceDiscordComponent;
|
|
103
|
+
delete: typeof serviceDiscordApi.deleteServiceDiscordComponent;
|
|
104
|
+
};
|
|
105
|
+
connection: {
|
|
106
|
+
get: typeof serviceDiscordApi.getServiceDiscordConnection;
|
|
107
|
+
setTokenSecret: typeof serviceDiscordApi.setServiceDiscordTokenSecret;
|
|
108
|
+
setEnvironment: typeof serviceDiscordApi.setServiceDiscordEnvironment;
|
|
109
|
+
check: typeof serviceDiscordApi.checkServiceDiscordConnection;
|
|
110
|
+
};
|
|
111
|
+
/** Pushes the interactions address and the commands to Discord again. */
|
|
112
|
+
sync: typeof serviceDiscordApi.retryServiceDiscordSync;
|
|
91
113
|
};
|
|
92
|
-
secretStatus: typeof serviceVariableApi.getServiceSecretStatus;
|
|
93
114
|
};
|
|
94
115
|
};
|
|
95
116
|
|
|
@@ -164,12 +185,30 @@ export class AbyssReflexCore {
|
|
|
164
185
|
pause: serviceDeploymentApi.pauseService,
|
|
165
186
|
resume: serviceDeploymentApi.resumeService,
|
|
166
187
|
},
|
|
167
|
-
|
|
168
|
-
list:
|
|
169
|
-
|
|
170
|
-
|
|
188
|
+
configuration: {
|
|
189
|
+
list: serviceConfigurationApi.listServiceConfiguration,
|
|
190
|
+
},
|
|
191
|
+
discord: {
|
|
192
|
+
command: {
|
|
193
|
+
list: serviceDiscordApi.listServiceDiscordCommand,
|
|
194
|
+
create: serviceDiscordApi.createServiceDiscordCommand,
|
|
195
|
+
update: serviceDiscordApi.updateServiceDiscordCommand,
|
|
196
|
+
delete: serviceDiscordApi.deleteServiceDiscordCommand,
|
|
197
|
+
},
|
|
198
|
+
component: {
|
|
199
|
+
list: serviceDiscordApi.listServiceDiscordComponent,
|
|
200
|
+
create: serviceDiscordApi.createServiceDiscordComponent,
|
|
201
|
+
update: serviceDiscordApi.updateServiceDiscordComponent,
|
|
202
|
+
delete: serviceDiscordApi.deleteServiceDiscordComponent,
|
|
203
|
+
},
|
|
204
|
+
connection: {
|
|
205
|
+
get: serviceDiscordApi.getServiceDiscordConnection,
|
|
206
|
+
setTokenSecret: serviceDiscordApi.setServiceDiscordTokenSecret,
|
|
207
|
+
setEnvironment: serviceDiscordApi.setServiceDiscordEnvironment,
|
|
208
|
+
check: serviceDiscordApi.checkServiceDiscordConnection,
|
|
209
|
+
},
|
|
210
|
+
sync: serviceDiscordApi.retryServiceDiscordSync,
|
|
171
211
|
},
|
|
172
|
-
secretStatus: serviceVariableApi.getServiceSecretStatus,
|
|
173
212
|
},
|
|
174
213
|
};
|
|
175
214
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** What a component prefix of a Discord bot routes. */
|
|
2
|
+
export enum DiscordComponentKind {
|
|
3
|
+
/** A button or a select menu: interactions of type MESSAGE_COMPONENT. */
|
|
4
|
+
BUTTON_OR_SELECT = 'BUTTON_OR_SELECT',
|
|
5
|
+
/** A form: interactions of type MODAL_SUBMIT. */
|
|
6
|
+
MODAL = 'MODAL',
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Type of an option of a Discord command (same names as the options Discord documents). */
|
|
2
|
+
export enum DiscordOptionType {
|
|
3
|
+
STRING = 'STRING',
|
|
4
|
+
INTEGER = 'INTEGER',
|
|
5
|
+
NUMBER = 'NUMBER',
|
|
6
|
+
BOOLEAN = 'BOOLEAN',
|
|
7
|
+
USER = 'USER',
|
|
8
|
+
CHANNEL = 'CHANNEL',
|
|
9
|
+
ROLE = 'ROLE',
|
|
10
|
+
MENTIONABLE = 'MENTIONABLE',
|
|
11
|
+
ATTACHMENT = 'ATTACHMENT',
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** What Reflex knows of the bot token of an environment. */
|
|
2
|
+
export enum DiscordTokenState {
|
|
3
|
+
/** Discord accepted the token at the last check. */
|
|
4
|
+
VALID = 'VALID',
|
|
5
|
+
/** Discord answered 401 to the token. */
|
|
6
|
+
REJECTED = 'REJECTED',
|
|
7
|
+
/** The Vault entry has no value in this environment. */
|
|
8
|
+
MISSING = 'MISSING',
|
|
9
|
+
/** The token has not been checked yet. */
|
|
10
|
+
UNCHECKED = 'UNCHECKED',
|
|
11
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* How a route answers its caller.
|
|
3
|
-
* - SYNC: the caller waits for the Respond step, or gets 504 past the response timeout.
|
|
4
|
-
* - ASYNC: the caller gets `202 {executionId}` before the execution starts, and reads its state.
|
|
5
|
-
*/
|
|
6
|
-
export enum ExecutionMode {
|
|
7
|
-
SYNC = 'SYNC',
|
|
8
|
-
ASYNC = 'ASYNC',
|
|
9
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* How a route answers its caller.
|
|
3
|
+
* - SYNC: the caller waits for the Respond step, or gets 504 past the response timeout.
|
|
4
|
+
* - ASYNC: the caller gets `202 {executionId}` before the execution starts, and reads its state.
|
|
5
|
+
*/
|
|
6
|
+
export enum ExecutionMode {
|
|
7
|
+
SYNC = 'SYNC',
|
|
8
|
+
ASYNC = 'ASYNC',
|
|
9
|
+
}
|
package/src/types/enum/index.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
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 './
|
|
19
|
-
export * from './
|
|
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';
|
|
@@ -1,25 +1,37 @@
|
|
|
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
|
-
|
|
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
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/** The HTTP method a route answers. `ANY` answers every method; a `FUNCTIONS` Service only has `ANY` routes. */
|
|
2
|
-
export enum RouteMethod {
|
|
3
|
-
GET = 'GET',
|
|
4
|
-
POST = 'POST',
|
|
5
|
-
PUT = 'PUT',
|
|
6
|
-
PATCH = 'PATCH',
|
|
7
|
-
DELETE = 'DELETE',
|
|
8
|
-
ANY = 'ANY',
|
|
9
|
-
}
|
|
1
|
+
/** The HTTP method a route answers. `ANY` answers every method; a `FUNCTIONS` Service only has `ANY` routes. */
|
|
2
|
+
export enum RouteMethod {
|
|
3
|
+
GET = 'GET',
|
|
4
|
+
POST = 'POST',
|
|
5
|
+
PUT = 'PUT',
|
|
6
|
+
PATCH = 'PATCH',
|
|
7
|
+
DELETE = 'DELETE',
|
|
8
|
+
ANY = 'ANY',
|
|
9
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/** The gesture a deployment row records, one row per gesture in an environment. */
|
|
2
|
-
export enum ServiceDeploymentAction {
|
|
3
|
-
/** A version of the Service put in service. */
|
|
4
|
-
GO_LIVE = 'GO_LIVE',
|
|
5
|
-
/** A version deployed before put back in service. */
|
|
6
|
-
ROLLBACK = 'ROLLBACK',
|
|
7
|
-
/** The Service stops answering (503 SERVICE_PAUSED), its version kept. */
|
|
8
|
-
PAUSE = 'PAUSE',
|
|
9
|
-
/** The paused Service answers again, with the same version. */
|
|
10
|
-
RESUME = 'RESUME',
|
|
11
|
-
}
|
|
1
|
+
/** The gesture a deployment row records, one row per gesture in an environment. */
|
|
2
|
+
export enum ServiceDeploymentAction {
|
|
3
|
+
/** A version of the Service put in service. */
|
|
4
|
+
GO_LIVE = 'GO_LIVE',
|
|
5
|
+
/** A version deployed before put back in service. */
|
|
6
|
+
ROLLBACK = 'ROLLBACK',
|
|
7
|
+
/** The Service stops answering (503 SERVICE_PAUSED), its version kept. */
|
|
8
|
+
PAUSE = 'PAUSE',
|
|
9
|
+
/** The paused Service answers again, with the same version. */
|
|
10
|
+
RESUME = 'RESUME',
|
|
11
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** State of the Service in an environment after a deployment gesture. */
|
|
2
|
-
export enum ServiceDeploymentStatus {
|
|
3
|
-
ACTIVE = 'ACTIVE',
|
|
4
|
-
PAUSED = 'PAUSED',
|
|
5
|
-
}
|
|
1
|
+
/** State of the Service in an environment after a deployment gesture. */
|
|
2
|
+
export enum ServiceDeploymentStatus {
|
|
3
|
+
ACTIVE = 'ACTIVE',
|
|
4
|
+
PAUSED = 'PAUSED',
|
|
5
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
/** What a Service exposes. */
|
|
2
|
-
export enum ServiceType {
|
|
3
|
-
/** Routes of a method and a path, each calling one function of the Service. */
|
|
4
|
-
HTTP_API = 'HTTP_API',
|
|
5
|
-
/** Functions, each at a path, answering every method (routes of method `ANY` only). */
|
|
6
|
-
FUNCTIONS = 'FUNCTIONS',
|
|
7
|
-
|
|
1
|
+
/** What a Service exposes. */
|
|
2
|
+
export enum ServiceType {
|
|
3
|
+
/** Routes of a method and a path, each calling one function of the Service. */
|
|
4
|
+
HTTP_API = 'HTTP_API',
|
|
5
|
+
/** Functions, each at a path, answering every method (routes of method `ANY` only). */
|
|
6
|
+
FUNCTIONS = 'FUNCTIONS',
|
|
7
|
+
/** A Discord bot: commands and components, each calling one function of the Service. No routes. */
|
|
8
|
+
DISCORD_BOT = 'DISCORD_BOT',
|
|
9
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/** How a route differs between a version of a Service and the previous one. */
|
|
2
|
-
export enum ServiceVersionChangeKind {
|
|
3
|
-
ADDED = 'ADDED',
|
|
4
|
-
REMOVED = 'REMOVED',
|
|
5
|
-
MODIFIED = 'MODIFIED',
|
|
6
|
-
}
|
|
1
|
+
/** How a route differs between a version of a Service and the previous one. */
|
|
2
|
+
export enum ServiceVersionChangeKind {
|
|
3
|
+
ADDED = 'ADDED',
|
|
4
|
+
REMOVED = 'REMOVED',
|
|
5
|
+
MODIFIED = 'MODIFIED',
|
|
6
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Who may call a route of a Service.
|
|
3
|
-
* - PUBLIC: anyone.
|
|
4
|
-
* - API_KEY: the caller sends the key in `x-api-key`.
|
|
5
|
-
* - SIGNATURE: the caller signs the raw body: `x-reflex-signature: sha256=<hex HMAC-SHA256(secret,
|
|
6
|
-
* "<timestamp>." + body)>` with `x-reflex-timestamp` in Unix seconds, within 300 s of the edge's clock.
|
|
7
|
-
*/
|
|
8
|
-
export enum TriggerAccessMode {
|
|
9
|
-
PUBLIC = 'PUBLIC',
|
|
10
|
-
API_KEY = 'API_KEY',
|
|
11
|
-
SIGNATURE = 'SIGNATURE',
|
|
12
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Who may call a route of a Service.
|
|
3
|
+
* - PUBLIC: anyone.
|
|
4
|
+
* - API_KEY: the caller sends the key in `x-api-key`.
|
|
5
|
+
* - SIGNATURE: the caller signs the raw body: `x-reflex-signature: sha256=<hex HMAC-SHA256(secret,
|
|
6
|
+
* "<timestamp>." + body)>` with `x-reflex-timestamp` in Unix seconds, within 300 s of the edge's clock.
|
|
7
|
+
*/
|
|
8
|
+
export enum TriggerAccessMode {
|
|
9
|
+
PUBLIC = 'PUBLIC',
|
|
10
|
+
API_KEY = 'API_KEY',
|
|
11
|
+
SIGNATURE = 'SIGNATURE',
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the value a Console vault entry gives to an environment comes from, in the order of the
|
|
3
|
+
* resolution: the value of the environment, the entry's default value, the value of the entry's default
|
|
4
|
+
* environment, or nothing (the entry is absent for the environment). Mirrors Console's enum of the
|
|
5
|
+
* same name, so the SDK needs no dependency on it.
|
|
6
|
+
*/
|
|
7
|
+
export enum VaultValueSource {
|
|
8
|
+
ENVIRONMENT = 'ENVIRONMENT',
|
|
9
|
+
DEFAULT = 'DEFAULT',
|
|
10
|
+
DEFAULT_ENVIRONMENT = 'DEFAULT_ENVIRONMENT',
|
|
11
|
+
ABSENT = 'ABSENT',
|
|
12
|
+
}
|
|
@@ -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,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,11 +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-
|
|
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';
|