@abyss-project/reflex 5.11.0 → 6.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 +4 -0
- package/dist/api/index.js +4 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/service-completion-webhook.api.d.ts +3 -0
- package/dist/api/service-completion-webhook.api.js +10 -0
- package/dist/api/service-completion-webhook.api.js.map +1 -0
- package/dist/api/service-consumer.api.d.ts +7 -0
- package/dist/api/service-consumer.api.js +19 -0
- package/dist/api/service-consumer.api.js.map +1 -0
- package/dist/api/service-discord.api.d.ts +1 -2
- package/dist/api/service-discord.api.js +1 -3
- package/dist/api/service-discord.api.js.map +1 -1
- package/dist/api/service-limits.api.d.ts +3 -0
- package/dist/api/service-limits.api.js +10 -0
- package/dist/api/service-limits.api.js.map +1 -0
- package/dist/api/service-openapi.api.d.ts +2 -0
- package/dist/api/service-openapi.api.js +7 -0
- package/dist/api/service-openapi.api.js.map +1 -0
- package/dist/api/service-route.api.js.map +1 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +23 -1
- package/dist/index.js.map +1 -1
- package/dist/types/enum/completion-delivery-status.enum.d.ts +5 -0
- package/dist/types/enum/completion-delivery-status.enum.js +10 -0
- package/dist/types/enum/completion-delivery-status.enum.js.map +1 -0
- 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 +8 -1
- package/dist/types/enum/reflex-error-code.enum.js +7 -0
- package/dist/types/enum/reflex-error-code.enum.js.map +1 -1
- package/dist/types/enum/run-status.enum.d.ts +2 -1
- package/dist/types/enum/run-status.enum.js +1 -0
- package/dist/types/enum/run-status.enum.js.map +1 -1
- 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/service-block-reason.enum.d.ts +4 -0
- package/dist/types/enum/service-block-reason.enum.js +9 -0
- package/dist/types/enum/service-block-reason.enum.js.map +1 -0
- package/dist/types/interface/api/requests/function-run.request.d.ts +1 -0
- package/dist/types/interface/api/requests/function-test.request.d.ts +1 -0
- package/dist/types/interface/api/requests/index.d.ts +4 -0
- package/dist/types/interface/api/requests/index.js +4 -0
- package/dist/types/interface/api/requests/index.js.map +1 -1
- package/dist/types/interface/api/requests/service-completion-webhook.request.d.ts +9 -0
- package/dist/types/interface/api/requests/service-completion-webhook.request.js +3 -0
- package/dist/types/interface/api/requests/service-completion-webhook.request.js.map +1 -0
- package/dist/types/interface/api/requests/service-consumer.request.d.ts +41 -0
- package/dist/types/interface/api/requests/service-consumer.request.js +3 -0
- package/dist/types/interface/api/requests/service-consumer.request.js.map +1 -0
- package/dist/types/interface/api/requests/service-discord.request.d.ts +1 -14
- package/dist/types/interface/api/requests/service-limits.request.d.ts +18 -0
- package/dist/types/interface/api/requests/service-limits.request.js +3 -0
- package/dist/types/interface/api/requests/service-limits.request.js.map +1 -0
- package/dist/types/interface/api/requests/service-openapi.request.d.ts +8 -0
- package/dist/types/interface/api/requests/service-openapi.request.js +3 -0
- package/dist/types/interface/api/requests/service-openapi.request.js.map +1 -0
- package/dist/types/interface/api/requests/service-route.request.d.ts +3 -0
- package/dist/types/interface/api/responses/function-settings.response.d.ts +3 -1
- package/dist/types/interface/api/responses/function-test.response.d.ts +3 -1
- package/dist/types/interface/api/responses/index.d.ts +4 -0
- package/dist/types/interface/api/responses/index.js +4 -0
- package/dist/types/interface/api/responses/index.js.map +1 -1
- package/dist/types/interface/api/responses/service-completion-webhook.response.d.ts +8 -0
- package/dist/types/interface/api/responses/service-completion-webhook.response.js +3 -0
- package/dist/types/interface/api/responses/service-completion-webhook.response.js.map +1 -0
- package/dist/types/interface/api/responses/service-consumer.response.d.ts +25 -0
- package/dist/types/interface/api/responses/service-consumer.response.js +3 -0
- package/dist/types/interface/api/responses/service-consumer.response.js.map +1 -0
- package/dist/types/interface/api/responses/service-discord.response.d.ts +1 -9
- package/dist/types/interface/api/responses/service-limits.response.d.ts +10 -0
- package/dist/types/interface/api/responses/service-limits.response.js +3 -0
- package/dist/types/interface/api/responses/service-limits.response.js.map +1 -0
- package/dist/types/interface/api/responses/service-openapi.response.d.ts +5 -0
- package/dist/types/interface/api/responses/service-openapi.response.js +3 -0
- package/dist/types/interface/api/responses/service-openapi.response.js.map +1 -0
- package/dist/types/interface/api/responses/service-version.response.d.ts +1 -0
- 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 +0 -25
- package/dist/types/interface/models/reflex-bot-limits.model.js +8 -7
- package/dist/types/interface/models/reflex-bot-limits.model.js.map +1 -1
- package/dist/types/interface/models/reflex-completion-webhook.model.d.ts +48 -0
- package/dist/types/interface/models/reflex-completion-webhook.model.js +12 -0
- package/dist/types/interface/models/reflex-completion-webhook.model.js.map +1 -0
- package/dist/types/interface/models/reflex-consumer.model.d.ts +30 -0
- package/dist/types/interface/models/reflex-consumer.model.js +11 -0
- package/dist/types/interface/models/reflex-consumer.model.js.map +1 -0
- package/dist/types/interface/models/reflex-execution-settings.model.d.ts +1 -0
- package/dist/types/interface/models/reflex-execution-settings.model.js +1 -0
- package/dist/types/interface/models/reflex-execution-settings.model.js.map +1 -1
- package/dist/types/interface/models/reflex-route-contract.model.d.ts +22 -0
- package/dist/types/interface/models/reflex-route-contract.model.js +13 -0
- package/dist/types/interface/models/reflex-route-contract.model.js.map +1 -0
- package/dist/types/interface/models/reflex-route.model.d.ts +2 -0
- package/dist/types/interface/models/reflex-run.model.d.ts +21 -0
- package/dist/types/interface/models/reflex-run.model.js.map +1 -1
- package/dist/types/interface/models/reflex-service-limits.model.d.ts +41 -0
- package/dist/types/interface/models/reflex-service-limits.model.js +13 -0
- package/dist/types/interface/models/reflex-service-limits.model.js.map +1 -0
- package/dist/types/interface/models/reflex-service-version.model.d.ts +2 -0
- package/package.json +15 -10
- package/src/api/function-access.api.ts +87 -87
- package/src/api/function-template.api.test.ts +72 -72
- package/src/api/function-template.api.ts +52 -52
- package/src/api/function-version.api.ts +66 -66
- package/src/api/function.api.test.ts +2 -1
- package/src/api/index.ts +4 -0
- package/src/api/service-completion-webhook.api.test.ts +87 -0
- package/src/api/service-completion-webhook.api.ts +37 -0
- package/src/api/service-consumer.api.test.ts +104 -0
- package/src/api/service-consumer.api.ts +88 -0
- package/src/api/service-discord.api.test.ts +178 -197
- package/src/api/service-discord.api.ts +222 -241
- package/src/api/service-limits.api.test.ts +100 -0
- package/src/api/service-limits.api.ts +37 -0
- package/src/api/service-openapi.api.test.ts +52 -0
- package/src/api/service-openapi.api.ts +21 -0
- package/src/api/service-route.api.ts +74 -72
- package/src/index.test.ts +104 -87
- package/src/index.ts +46 -3
- package/src/types/enum/access-request-status.enum.ts +11 -11
- package/src/types/enum/completion-delivery-status.enum.ts +9 -0
- package/src/types/enum/index.ts +2 -0
- package/src/types/enum/reflex-error-code.enum.ts +73 -43
- package/src/types/enum/run-status.enum.ts +16 -11
- package/src/types/enum/scheduled-run-failure-code.enum.ts +14 -12
- package/src/types/enum/service-block-reason.enum.ts +13 -0
- package/src/types/interface/api/requests/alert-rule.request.ts +53 -53
- package/src/types/interface/api/requests/application-insights.request.ts +18 -18
- package/src/types/interface/api/requests/application-run-settings.request.ts +11 -11
- package/src/types/interface/api/requests/function-access.request.ts +51 -51
- package/src/types/interface/api/requests/function-run.request.ts +2 -0
- package/src/types/interface/api/requests/function-settings.request.ts +34 -34
- package/src/types/interface/api/requests/function-template.request.ts +29 -29
- package/src/types/interface/api/requests/function-test.request.ts +5 -0
- package/src/types/interface/api/requests/function-version.request.ts +38 -38
- package/src/types/interface/api/requests/function.request.ts +36 -36
- package/src/types/interface/api/requests/index.ts +4 -0
- package/src/types/interface/api/requests/route-stats.request.ts +22 -22
- package/src/types/interface/api/requests/service-completion-webhook.request.ts +11 -0
- package/src/types/interface/api/requests/service-configuration.request.ts +4 -4
- package/src/types/interface/api/requests/service-consumer.request.ts +51 -0
- package/src/types/interface/api/requests/service-deployment.request.ts +49 -49
- package/src/types/interface/api/requests/service-discord-event.request.ts +68 -68
- package/src/types/interface/api/requests/service-discord.request.ts +1 -25
- package/src/types/interface/api/requests/service-insights.request.ts +31 -31
- package/src/types/interface/api/requests/service-limits.request.ts +28 -0
- package/src/types/interface/api/requests/service-openapi.request.ts +10 -0
- package/src/types/interface/api/requests/service-route.request.ts +8 -0
- package/src/types/interface/api/requests/service-task.request.ts +80 -80
- package/src/types/interface/api/requests/service-version.request.ts +24 -24
- package/src/types/interface/api/requests/service.request.ts +46 -46
- package/src/types/interface/api/responses/alert-rule.response.ts +24 -24
- package/src/types/interface/api/responses/application-insights.response.ts +11 -11
- package/src/types/interface/api/responses/application-run-settings.response.ts +8 -8
- package/src/types/interface/api/responses/function-access.response.ts +45 -45
- package/src/types/interface/api/responses/function-run.response.ts +18 -18
- package/src/types/interface/api/responses/function-settings.response.ts +8 -0
- package/src/types/interface/api/responses/function-template.response.ts +21 -21
- package/src/types/interface/api/responses/function-test.response.ts +8 -1
- package/src/types/interface/api/responses/function-version.response.ts +42 -42
- package/src/types/interface/api/responses/function.response.ts +25 -25
- package/src/types/interface/api/responses/index.ts +4 -0
- package/src/types/interface/api/responses/route-stats.response.ts +15 -15
- package/src/types/interface/api/responses/service-completion-webhook.response.ts +13 -0
- package/src/types/interface/api/responses/service-configuration.response.ts +8 -8
- package/src/types/interface/api/responses/service-consumer.response.ts +33 -0
- package/src/types/interface/api/responses/service-deployment.response.ts +32 -32
- package/src/types/interface/api/responses/service-discord-event.response.ts +24 -24
- package/src/types/interface/api/responses/service-discord.response.ts +4 -16
- package/src/types/interface/api/responses/service-insights.response.ts +11 -11
- package/src/types/interface/api/responses/service-limits.response.ts +13 -0
- package/src/types/interface/api/responses/service-openapi.response.ts +7 -0
- package/src/types/interface/api/responses/service-route.response.ts +3 -3
- package/src/types/interface/api/responses/service-task.response.ts +57 -57
- package/src/types/interface/api/responses/service-version.response.ts +112 -106
- package/src/types/interface/api/responses/service.response.ts +31 -31
- package/src/types/interface/models/index.ts +4 -0
- package/src/types/interface/models/reflex-access-grant.model.ts +14 -14
- package/src/types/interface/models/reflex-access-request.model.ts +15 -15
- package/src/types/interface/models/reflex-alert-rule.model.ts +56 -56
- package/src/types/interface/models/reflex-bot-limits.model.ts +12 -51
- package/src/types/interface/models/reflex-completion-webhook.model.ts +85 -0
- package/src/types/interface/models/reflex-consumer.model.ts +50 -0
- package/src/types/interface/models/reflex-definition.model.ts +31 -31
- package/src/types/interface/models/reflex-discord-event-log.model.ts +58 -58
- package/src/types/interface/models/reflex-discord-event.model.ts +79 -79
- package/src/types/interface/models/reflex-discord.model.ts +196 -196
- package/src/types/interface/models/reflex-execution-settings.model.ts +7 -0
- package/src/types/interface/models/reflex-function-template.model.ts +18 -18
- package/src/types/interface/models/reflex-function-version.model.ts +19 -19
- package/src/types/interface/models/reflex-function.model.ts +30 -30
- package/src/types/interface/models/reflex-insights.model.ts +215 -215
- package/src/types/interface/models/reflex-price-list.model.ts +20 -20
- package/src/types/interface/models/reflex-route-contract.model.ts +46 -0
- package/src/types/interface/models/reflex-route.model.ts +5 -1
- package/src/types/interface/models/reflex-run-settings.model.ts +28 -28
- package/src/types/interface/models/reflex-run.model.ts +47 -3
- package/src/types/interface/models/reflex-service-configuration.model.ts +22 -22
- package/src/types/interface/models/reflex-service-deployment.model.ts +46 -46
- package/src/types/interface/models/reflex-service-limits.model.ts +73 -0
- package/src/types/interface/models/reflex-service-version.model.ts +3 -0
- package/src/types/interface/models/reflex-service.model.ts +45 -45
- package/src/types/interface/models/reflex-step-stats.model.ts +35 -35
- package/src/types/interface/models/reflex-task.model.ts +97 -97
|
@@ -9,6 +9,8 @@ import type {
|
|
|
9
9
|
ScheduledRunOrigin,
|
|
10
10
|
TraceEffectType,
|
|
11
11
|
} from '../../enum';
|
|
12
|
+
import type { IReflexCompletionDelivery } from './reflex-completion-webhook.model';
|
|
13
|
+
import type { IReflexContractError } from './reflex-route-contract.model';
|
|
12
14
|
|
|
13
15
|
export interface IReflexTraceError {
|
|
14
16
|
code: string;
|
|
@@ -147,7 +149,10 @@ export interface IReflexRun {
|
|
|
147
149
|
originLabel: string | null;
|
|
148
150
|
/** The HTTP status the caller of a LIVE run got; null for a test run. */
|
|
149
151
|
httpStatus: number | null;
|
|
150
|
-
/**
|
|
152
|
+
/**
|
|
153
|
+
* The code of the error a failed LIVE run answered (FUNCTION_FAILED, FUNCTION_TIMEOUT, RUNNER_UNAVAILABLE,
|
|
154
|
+
* RUNNER_SATURATED, INTERNAL_ERROR), or REQUEST_INVALID for a REFUSED one; null otherwise, an interrupted run included.
|
|
155
|
+
*/
|
|
151
156
|
errorCode: string | null;
|
|
152
157
|
/** The message of the error of a failed run, masked, 2048 characters at most; null when none was kept. */
|
|
153
158
|
errorMessage: string | null;
|
|
@@ -167,10 +172,36 @@ export interface IReflexRun {
|
|
|
167
172
|
* recorded before the measures.
|
|
168
173
|
*/
|
|
169
174
|
metrics: IReflexRunMetrics | null;
|
|
175
|
+
/** The consumer whose key called the route; null for a test run, and for a run no `API_KEY` route started. */
|
|
176
|
+
consumer: IReflexRunConsumer | null;
|
|
177
|
+
/** The faults of the request against the contract of its route, for a REFUSED run; absent otherwise. */
|
|
178
|
+
requestErrors?: IReflexContractError[];
|
|
179
|
+
/** The answer the function built, for an async LIVE run that finished; absent otherwise. */
|
|
180
|
+
completion?: IReflexExecutionCompletion;
|
|
181
|
+
/** The completion webhook of an async LIVE run, with its attempts; absent when none was due. */
|
|
182
|
+
delivery?: IReflexCompletionDelivery;
|
|
170
183
|
createdByUserId: string | null;
|
|
171
184
|
createdAt: Date;
|
|
172
185
|
}
|
|
173
186
|
|
|
187
|
+
/** The consumer of a Service that called a route, as the edge passed it to the function. */
|
|
188
|
+
export interface IReflexRunConsumer {
|
|
189
|
+
id: string;
|
|
190
|
+
name: string;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The answer the function of an async execution built once it finished: the caller got 202 at once, this is
|
|
195
|
+
* what the completion webhook and `_executions` give it.
|
|
196
|
+
*/
|
|
197
|
+
export interface IReflexExecutionCompletion {
|
|
198
|
+
httpStatus: number;
|
|
199
|
+
/** The body of the answer; null when none, or when it was cut. */
|
|
200
|
+
output: unknown | null;
|
|
201
|
+
/** True when the output went past `REFLEX_COMPLETION_WEBHOOK_LIMITS.outputMaxBytes`. */
|
|
202
|
+
outputTruncated: boolean;
|
|
203
|
+
}
|
|
204
|
+
|
|
174
205
|
/** What a live execution consumed, and what it costs (ADR-0244). */
|
|
175
206
|
export interface IReflexRunMetrics {
|
|
176
207
|
/** The profile it ran with, and the memory that profile allocates. */
|
|
@@ -234,7 +265,11 @@ export interface IReflexRunDetail extends IReflexRun {
|
|
|
234
265
|
droppedLogCause: LogDropCause | null;
|
|
235
266
|
}
|
|
236
267
|
|
|
237
|
-
/**
|
|
268
|
+
/**
|
|
269
|
+
* The state of a live execution, read by its id (the `executionId` an async route answers with): by a member
|
|
270
|
+
* through the API (`function.run.state`), and by the consumer that started it through the edge
|
|
271
|
+
* (`GET .../_executions/:executionId`).
|
|
272
|
+
*/
|
|
238
273
|
export interface IReflexExecutionState {
|
|
239
274
|
id: string;
|
|
240
275
|
status: RunStatus;
|
|
@@ -244,10 +279,19 @@ export interface IReflexExecutionState {
|
|
|
244
279
|
responseSentAt: Date | null;
|
|
245
280
|
/** Null while it runs. */
|
|
246
281
|
finishedAt: Date | null;
|
|
247
|
-
/**
|
|
282
|
+
/**
|
|
283
|
+
* The status the caller got; for an async execution that finished, the status of the answer the function
|
|
284
|
+
* built (202 while it runs).
|
|
285
|
+
*/
|
|
248
286
|
httpStatus: number;
|
|
249
287
|
/** Set when the execution failed. */
|
|
250
288
|
errorCode: string | null;
|
|
251
289
|
/** Null while it runs, or for an execution recorded before the measures. */
|
|
252
290
|
costMillicredits: number | null;
|
|
291
|
+
/** The body of the answer of an async execution that finished; null otherwise, or when it was cut. */
|
|
292
|
+
output: unknown | null;
|
|
293
|
+
/** True when the output went past `REFLEX_COMPLETION_WEBHOOK_LIMITS.outputMaxBytes`. */
|
|
294
|
+
outputTruncated: boolean;
|
|
295
|
+
/** Set when the execution failed. */
|
|
296
|
+
error: { code: string; message: string } | null;
|
|
253
297
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import type { ConfigurationReadAs, VaultValueSource, VaultVisibility } from '../../enum';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A key the functions of a Service read (its draft and its versions in service), and what the Console
|
|
5
|
-
* vault gives it in each environment of the application. Never a value.
|
|
6
|
-
*/
|
|
7
|
-
export interface IReflexServiceConfigurationEntry {
|
|
8
|
-
key: string;
|
|
9
|
-
/** `config` for `config.KEY` / `{{ config.KEY }}`, `secrets` for `secrets.KEY` / `{{ secrets.KEY }}`. */
|
|
10
|
-
readAs: ConfigurationReadAs;
|
|
11
|
-
/** The Console vault entry of that key in the project; null when there is none. */
|
|
12
|
-
secretId: string | null;
|
|
13
|
-
/** The visibility of that entry; null when there is none. */
|
|
14
|
-
visibility: VaultVisibility | null;
|
|
15
|
-
/**
|
|
16
|
-
* True when the entry cannot answer this read: a `config` key bound to a SECRET entry, or a `secrets`
|
|
17
|
-
* key bound to a VISIBLE one. Every source is then ABSENT, the key never resolves.
|
|
18
|
-
*/
|
|
19
|
-
mismatch: boolean;
|
|
20
|
-
/** By environment id of the application. */
|
|
21
|
-
sources: Record<string, VaultValueSource>;
|
|
22
|
-
}
|
|
1
|
+
import type { ConfigurationReadAs, VaultValueSource, VaultVisibility } from '../../enum';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A key the functions of a Service read (its draft and its versions in service), and what the Console
|
|
5
|
+
* vault gives it in each environment of the application. Never a value.
|
|
6
|
+
*/
|
|
7
|
+
export interface IReflexServiceConfigurationEntry {
|
|
8
|
+
key: string;
|
|
9
|
+
/** `config` for `config.KEY` / `{{ config.KEY }}`, `secrets` for `secrets.KEY` / `{{ secrets.KEY }}`. */
|
|
10
|
+
readAs: ConfigurationReadAs;
|
|
11
|
+
/** The Console vault entry of that key in the project; null when there is none. */
|
|
12
|
+
secretId: string | null;
|
|
13
|
+
/** The visibility of that entry; null when there is none. */
|
|
14
|
+
visibility: VaultVisibility | null;
|
|
15
|
+
/**
|
|
16
|
+
* True when the entry cannot answer this read: a `config` key bound to a SECRET entry, or a `secrets`
|
|
17
|
+
* key bound to a VISIBLE one. Every source is then ABSENT, the key never resolves.
|
|
18
|
+
*/
|
|
19
|
+
mismatch: boolean;
|
|
20
|
+
/** By environment id of the application. */
|
|
21
|
+
sources: Record<string, VaultValueSource>;
|
|
22
|
+
}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
DiscordSyncStatus,
|
|
3
|
-
ScheduleSyncStatus,
|
|
4
|
-
ServiceDeploymentAction,
|
|
5
|
-
ServiceDeploymentStatus,
|
|
6
|
-
} from '../../enum';
|
|
7
|
-
import type { IReflexAccessDeclaration } from './reflex-definition.model';
|
|
8
|
-
|
|
9
|
-
/** The accesses granted to one member function when the gesture was made: what the execution plane holds. */
|
|
10
|
-
export interface IReflexServiceDeploymentGrant {
|
|
11
|
-
functionId: string;
|
|
12
|
-
grants: IReflexAccessDeclaration[];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* One gesture on the Service in an environment of the application. The `isCurrent` row is what runs (or
|
|
17
|
-
* is paused) there; the others are the history a rollback reads.
|
|
18
|
-
*/
|
|
19
|
-
export interface IReflexServiceDeployment {
|
|
20
|
-
id: string;
|
|
21
|
-
serviceId: string;
|
|
22
|
-
/** The environment of the application (abyss-main's id). */
|
|
23
|
-
environmentId: string;
|
|
24
|
-
/** The name of that environment, second segment of the address. */
|
|
25
|
-
environmentSlug: string;
|
|
26
|
-
serviceVersionId: string;
|
|
27
|
-
serviceVersionNumber: number;
|
|
28
|
-
action: ServiceDeploymentAction;
|
|
29
|
-
status: ServiceDeploymentStatus;
|
|
30
|
-
grants: IReflexServiceDeploymentGrant[];
|
|
31
|
-
/** Push of the interactions address and the commands to Discord; null for a Service that is not a Discord bot. */
|
|
32
|
-
discordSync: DiscordSyncStatus | null;
|
|
33
|
-
/** Code and message of the Discord refusal when `discordSync` is FAILED (500 characters at most). */
|
|
34
|
-
discordSyncError: string | null;
|
|
35
|
-
discordSyncedAt: Date | null;
|
|
36
|
-
/** Synchronization of the cron tasks of the version with Flow; null when the version has no cron task. */
|
|
37
|
-
scheduleSync: ScheduleSyncStatus | null;
|
|
38
|
-
/** Code and message of the failure when `scheduleSync` is FAILED (500 characters at most). */
|
|
39
|
-
scheduleSyncError: string | null;
|
|
40
|
-
scheduleSyncedAt: Date | null;
|
|
41
|
-
/** The bot was paused by the plan quota (ADR-0277), not by a member: only those resume with the plan. */
|
|
42
|
-
pausedForQuota: boolean;
|
|
43
|
-
isCurrent: boolean;
|
|
44
|
-
byUserId: string;
|
|
45
|
-
at: Date;
|
|
46
|
-
}
|
|
1
|
+
import type {
|
|
2
|
+
DiscordSyncStatus,
|
|
3
|
+
ScheduleSyncStatus,
|
|
4
|
+
ServiceDeploymentAction,
|
|
5
|
+
ServiceDeploymentStatus,
|
|
6
|
+
} from '../../enum';
|
|
7
|
+
import type { IReflexAccessDeclaration } from './reflex-definition.model';
|
|
8
|
+
|
|
9
|
+
/** The accesses granted to one member function when the gesture was made: what the execution plane holds. */
|
|
10
|
+
export interface IReflexServiceDeploymentGrant {
|
|
11
|
+
functionId: string;
|
|
12
|
+
grants: IReflexAccessDeclaration[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* One gesture on the Service in an environment of the application. The `isCurrent` row is what runs (or
|
|
17
|
+
* is paused) there; the others are the history a rollback reads.
|
|
18
|
+
*/
|
|
19
|
+
export interface IReflexServiceDeployment {
|
|
20
|
+
id: string;
|
|
21
|
+
serviceId: string;
|
|
22
|
+
/** The environment of the application (abyss-main's id). */
|
|
23
|
+
environmentId: string;
|
|
24
|
+
/** The name of that environment, second segment of the address. */
|
|
25
|
+
environmentSlug: string;
|
|
26
|
+
serviceVersionId: string;
|
|
27
|
+
serviceVersionNumber: number;
|
|
28
|
+
action: ServiceDeploymentAction;
|
|
29
|
+
status: ServiceDeploymentStatus;
|
|
30
|
+
grants: IReflexServiceDeploymentGrant[];
|
|
31
|
+
/** Push of the interactions address and the commands to Discord; null for a Service that is not a Discord bot. */
|
|
32
|
+
discordSync: DiscordSyncStatus | null;
|
|
33
|
+
/** Code and message of the Discord refusal when `discordSync` is FAILED (500 characters at most). */
|
|
34
|
+
discordSyncError: string | null;
|
|
35
|
+
discordSyncedAt: Date | null;
|
|
36
|
+
/** Synchronization of the cron tasks of the version with Flow; null when the version has no cron task. */
|
|
37
|
+
scheduleSync: ScheduleSyncStatus | null;
|
|
38
|
+
/** Code and message of the failure when `scheduleSync` is FAILED (500 characters at most). */
|
|
39
|
+
scheduleSyncError: string | null;
|
|
40
|
+
scheduleSyncedAt: Date | null;
|
|
41
|
+
/** The bot was paused by the plan quota (ADR-0277), not by a member: only those resume with the plan. */
|
|
42
|
+
pausedForQuota: boolean;
|
|
43
|
+
isCurrent: boolean;
|
|
44
|
+
byUserId: string;
|
|
45
|
+
at: Date;
|
|
46
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { ServiceBlockReason } from '../../enum';
|
|
2
|
+
|
|
3
|
+
/** Bounds of the monthly spend cap of a Service and of its alerts, whatever its type. */
|
|
4
|
+
export const REFLEX_SERVICE_SPEND_LIMITS = {
|
|
5
|
+
/** Monthly spend cap, in cents: 10 EUR by default, from 1 to 500 EUR. */
|
|
6
|
+
monthlySpendCapDefaultCents: 1000,
|
|
7
|
+
monthlySpendCapMinCents: 100,
|
|
8
|
+
monthlySpendCapMaxCents: 50000,
|
|
9
|
+
/** Alert thresholds: at most 5 values, each from 1 to 100 (percent). */
|
|
10
|
+
alertThresholdsMax: 5,
|
|
11
|
+
alertThresholdMin: 1,
|
|
12
|
+
alertThresholdMax: 100,
|
|
13
|
+
/** Thresholds a Service starts with, for the monthly spend cap. */
|
|
14
|
+
spendCapDefaultThresholds: [80, 100],
|
|
15
|
+
} as const;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The monthly spend cap of a Service: all its consumption of the month, included credits too, at the price of
|
|
19
|
+
* the lot.
|
|
20
|
+
*/
|
|
21
|
+
export interface IReflexServiceMonthlySpendCap {
|
|
22
|
+
capCents: number;
|
|
23
|
+
spentCents: number;
|
|
24
|
+
/** `spentCents / capCents`, in percent; may go past 100. */
|
|
25
|
+
usedPercent: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Credits of the month a Service consumed, and its overage setting. */
|
|
29
|
+
export interface IReflexServiceCredits {
|
|
30
|
+
/** `YYYY-MM`. */
|
|
31
|
+
month: string;
|
|
32
|
+
consumedMillicredits: number;
|
|
33
|
+
/** True when the Service bills overage past the credits of the organization. */
|
|
34
|
+
overageEnabled: boolean;
|
|
35
|
+
/** True when the organization allows overage of the credits metric at all. */
|
|
36
|
+
overageAllowedByOrganization: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Alert settings of one limit of a Service. */
|
|
40
|
+
export interface IReflexServiceAlertSettings {
|
|
41
|
+
/** Percent values, at most 5, each from 1 to 100. */
|
|
42
|
+
thresholds: number[];
|
|
43
|
+
email: boolean;
|
|
44
|
+
inApp: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Alert settings of a Service in one environment. */
|
|
48
|
+
export interface IReflexServiceAlerts {
|
|
49
|
+
monthlySpendCap: IReflexServiceAlertSettings;
|
|
50
|
+
/** The event rate of a bot; absent for any other type of Service. */
|
|
51
|
+
rate?: IReflexServiceAlertSettings;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** What stops a Service in one environment, by its limits. */
|
|
55
|
+
export interface IReflexServiceBlock {
|
|
56
|
+
/**
|
|
57
|
+
* `CREDITS_EXHAUSTED` stops a bot entirely, and every route and task of an HTTP Service. `BUDGET_REACHED` stops
|
|
58
|
+
* every route and task of an HTTP Service; for a bot, only its events stop.
|
|
59
|
+
*/
|
|
60
|
+
reason: ServiceBlockReason;
|
|
61
|
+
since: Date;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** The credits, the monthly spend cap, the alerts and the stop of a Service in one environment. */
|
|
65
|
+
export interface IReflexServiceEnvironmentLimits {
|
|
66
|
+
environmentId: string;
|
|
67
|
+
/** Credits of the month and the overage setting; null while abyss-main, which holds the credits, does not answer. */
|
|
68
|
+
credits: IReflexServiceCredits | null;
|
|
69
|
+
monthlySpendCap: IReflexServiceMonthlySpendCap;
|
|
70
|
+
alerts: IReflexServiceAlerts;
|
|
71
|
+
/** Null when nothing stops the Service there. */
|
|
72
|
+
block: IReflexServiceBlock | null;
|
|
73
|
+
}
|
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
IReflexDiscordComponentSnapshot,
|
|
5
5
|
} from './reflex-discord.model';
|
|
6
6
|
import type { IReflexDiscordEventSnapshot } from './reflex-discord-event.model';
|
|
7
|
+
import type { IReflexRouteContract } from './reflex-route-contract.model';
|
|
7
8
|
import type { IReflexServiceCors } from './reflex-service.model';
|
|
8
9
|
import type { IReflexTaskSnapshot } from './reflex-task.model';
|
|
9
10
|
|
|
@@ -14,6 +15,8 @@ export interface IReflexServiceVersionRoute {
|
|
|
14
15
|
path: string;
|
|
15
16
|
functionId: string;
|
|
16
17
|
accessMode: TriggerAccessMode;
|
|
18
|
+
/** The contract of the route; absent for a route without contract, so the hash of other versions is unchanged. */
|
|
19
|
+
contract?: IReflexRouteContract;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
/** The version of a member function a version of the Service runs. */
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import type { ServiceType } from '../../enum';
|
|
2
|
-
|
|
3
|
-
/** Bounds of a Service, its routes and versions; the API and its database apply the same ones. */
|
|
4
|
-
export const REFLEX_SERVICE_LIMITS = {
|
|
5
|
-
/** `^[a-z0-9][a-z0-9-]{0,39}$`: the third segment of the address, immutable. */
|
|
6
|
-
slugPattern: /^[a-z0-9][a-z0-9-]{0,39}$/,
|
|
7
|
-
nameMaxLength: 100,
|
|
8
|
-
corsAllowedOriginsMax: 20,
|
|
9
|
-
rateLimitPerIpPerMinute: { min: 1, max: 6000, default: 60 },
|
|
10
|
-
/** Segments of `[a-z0-9._~-]` or `:param`, joined by `/`, without leading or trailing slash. */
|
|
11
|
-
routePathMaxSegments: 20,
|
|
12
|
-
routePathMaxLength: 255,
|
|
13
|
-
versionMessageMaxLength: 500,
|
|
14
|
-
} as const;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Origins a browser may call the Service from. Each is `https://host` or `https://*.domain`; `*` (any
|
|
18
|
-
* origin) is refused when a route of the Service is not PUBLIC.
|
|
19
|
-
*/
|
|
20
|
-
export interface IReflexServiceCors {
|
|
21
|
-
allowedOrigins: string[];
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** A group of functions versioned, put in service and paused as one, in an application. */
|
|
25
|
-
export interface IReflexService {
|
|
26
|
-
id: string;
|
|
27
|
-
applicationId: string;
|
|
28
|
-
/** First segment of the address, `app-<8 hex>`, fixed for the application. */
|
|
29
|
-
applicationSlug: string;
|
|
30
|
-
/** Unique within the application. */
|
|
31
|
-
name: string;
|
|
32
|
-
/** Unique within the application, immutable: `/<application>/<environment>/<slug>/<route path>`. */
|
|
33
|
-
slug: string;
|
|
34
|
-
type: ServiceType;
|
|
35
|
-
/** Vault entry (secret) holding the Discord bot token, one value per environment; null for other types and until chosen. */
|
|
36
|
-
discordTokenSecretId: string | null;
|
|
37
|
-
/** Draft: frozen by the next version. */
|
|
38
|
-
cors: IReflexServiceCors;
|
|
39
|
-
/** Draft: frozen by the next version. Calls per minute and per client IP, in each environment. */
|
|
40
|
-
rateLimitPerIpPerMinute: number;
|
|
41
|
-
createdByUserId: string;
|
|
42
|
-
updatedByUserId: string;
|
|
43
|
-
createdAt: Date;
|
|
44
|
-
updatedAt: Date;
|
|
45
|
-
}
|
|
1
|
+
import type { ServiceType } from '../../enum';
|
|
2
|
+
|
|
3
|
+
/** Bounds of a Service, its routes and versions; the API and its database apply the same ones. */
|
|
4
|
+
export const REFLEX_SERVICE_LIMITS = {
|
|
5
|
+
/** `^[a-z0-9][a-z0-9-]{0,39}$`: the third segment of the address, immutable. */
|
|
6
|
+
slugPattern: /^[a-z0-9][a-z0-9-]{0,39}$/,
|
|
7
|
+
nameMaxLength: 100,
|
|
8
|
+
corsAllowedOriginsMax: 20,
|
|
9
|
+
rateLimitPerIpPerMinute: { min: 1, max: 6000, default: 60 },
|
|
10
|
+
/** Segments of `[a-z0-9._~-]` or `:param`, joined by `/`, without leading or trailing slash. */
|
|
11
|
+
routePathMaxSegments: 20,
|
|
12
|
+
routePathMaxLength: 255,
|
|
13
|
+
versionMessageMaxLength: 500,
|
|
14
|
+
} as const;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Origins a browser may call the Service from. Each is `https://host` or `https://*.domain`; `*` (any
|
|
18
|
+
* origin) is refused when a route of the Service is not PUBLIC.
|
|
19
|
+
*/
|
|
20
|
+
export interface IReflexServiceCors {
|
|
21
|
+
allowedOrigins: string[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** A group of functions versioned, put in service and paused as one, in an application. */
|
|
25
|
+
export interface IReflexService {
|
|
26
|
+
id: string;
|
|
27
|
+
applicationId: string;
|
|
28
|
+
/** First segment of the address, `app-<8 hex>`, fixed for the application. */
|
|
29
|
+
applicationSlug: string;
|
|
30
|
+
/** Unique within the application. */
|
|
31
|
+
name: string;
|
|
32
|
+
/** Unique within the application, immutable: `/<application>/<environment>/<slug>/<route path>`. */
|
|
33
|
+
slug: string;
|
|
34
|
+
type: ServiceType;
|
|
35
|
+
/** Vault entry (secret) holding the Discord bot token, one value per environment; null for other types and until chosen. */
|
|
36
|
+
discordTokenSecretId: string | null;
|
|
37
|
+
/** Draft: frozen by the next version. */
|
|
38
|
+
cors: IReflexServiceCors;
|
|
39
|
+
/** Draft: frozen by the next version. Calls per minute and per client IP, in each environment. */
|
|
40
|
+
rateLimitPerIpPerMinute: number;
|
|
41
|
+
createdByUserId: string;
|
|
42
|
+
updatedByUserId: string;
|
|
43
|
+
createdAt: Date;
|
|
44
|
+
updatedAt: Date;
|
|
45
|
+
}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
/** Median and 95th percentile of a measure, over the executions of the window. */
|
|
2
|
-
export interface IReflexPercentiles {
|
|
3
|
-
median: number;
|
|
4
|
-
p95: number;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* The measured consumption of one step of a version, over the retention window. Interrupted and running
|
|
9
|
-
* executions are left out.
|
|
10
|
-
*/
|
|
11
|
-
export interface IReflexStepStats {
|
|
12
|
-
stepId: string;
|
|
13
|
-
/** Executions in which the step ran. */
|
|
14
|
-
executions: number;
|
|
15
|
-
durationMs: IReflexPercentiles;
|
|
16
|
-
cpuMs: IReflexPercentiles;
|
|
17
|
-
heapPeakBytes: IReflexPercentiles;
|
|
18
|
-
costMillicredits: IReflexPercentiles;
|
|
19
|
-
/** 99th percentile of the heap peak: what a smaller profile is compared to. */
|
|
20
|
-
heapPeakP99Bytes: number;
|
|
21
|
-
/** Share of the cost of the executions that this step makes, from 0 to 1; null when they cost nothing. */
|
|
22
|
-
costShare: number | null;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** The p99 heap peak of one step of the version running in an environment. */
|
|
26
|
-
export interface IReflexStepHeapPeak {
|
|
27
|
-
stepId: string;
|
|
28
|
-
heapPeakP99Bytes: number;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** What the settings screen compares a smaller profile to: the version running in the environment. */
|
|
32
|
-
export interface IReflexRunningVersionHeapPeaks {
|
|
33
|
-
versionId: string;
|
|
34
|
-
steps: IReflexStepHeapPeak[];
|
|
35
|
-
}
|
|
1
|
+
/** Median and 95th percentile of a measure, over the executions of the window. */
|
|
2
|
+
export interface IReflexPercentiles {
|
|
3
|
+
median: number;
|
|
4
|
+
p95: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The measured consumption of one step of a version, over the retention window. Interrupted and running
|
|
9
|
+
* executions are left out.
|
|
10
|
+
*/
|
|
11
|
+
export interface IReflexStepStats {
|
|
12
|
+
stepId: string;
|
|
13
|
+
/** Executions in which the step ran. */
|
|
14
|
+
executions: number;
|
|
15
|
+
durationMs: IReflexPercentiles;
|
|
16
|
+
cpuMs: IReflexPercentiles;
|
|
17
|
+
heapPeakBytes: IReflexPercentiles;
|
|
18
|
+
costMillicredits: IReflexPercentiles;
|
|
19
|
+
/** 99th percentile of the heap peak: what a smaller profile is compared to. */
|
|
20
|
+
heapPeakP99Bytes: number;
|
|
21
|
+
/** Share of the cost of the executions that this step makes, from 0 to 1; null when they cost nothing. */
|
|
22
|
+
costShare: number | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** The p99 heap peak of one step of the version running in an environment. */
|
|
26
|
+
export interface IReflexStepHeapPeak {
|
|
27
|
+
stepId: string;
|
|
28
|
+
heapPeakP99Bytes: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** What the settings screen compares a smaller profile to: the version running in the environment. */
|
|
32
|
+
export interface IReflexRunningVersionHeapPeaks {
|
|
33
|
+
versionId: string;
|
|
34
|
+
steps: IReflexStepHeapPeak[];
|
|
35
|
+
}
|