@abyss-project/reflex 5.11.0 → 5.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +32 -32
- package/.prettierrc +5 -5
- package/README.md +15 -15
- package/dist/types/interface/api/responses/service-version.response.d.ts +1 -0
- package/jest.config.ts +11 -11
- package/package.json +15 -10
- package/src/api/alert-rule.api.test.ts +72 -72
- package/src/api/alert-rule.api.ts +57 -57
- package/src/api/application-insights.api.test.ts +42 -42
- package/src/api/application-insights.api.ts +38 -38
- package/src/api/application-run-settings.api.test.ts +51 -51
- package/src/api/application-run-settings.api.ts +30 -30
- package/src/api/function-insights.api.test.ts +27 -27
- package/src/api/function-insights.api.ts +18 -18
- package/src/api/function-run.api.ts +38 -38
- package/src/api/function-settings.api.ts +74 -74
- package/src/api/function-test.api.ts +34 -34
- package/src/api/function.api.ts +62 -62
- package/src/api/health.api.ts +10 -10
- package/src/api/route-stats.api.test.ts +45 -45
- package/src/api/route-stats.api.ts +36 -36
- package/src/api/service-configuration.api.ts +16 -16
- package/src/api/service-deployment.api.ts +79 -79
- package/src/api/service-discord-event.api.test.ts +106 -106
- package/src/api/service-discord-event.api.ts +78 -78
- package/src/api/service-discord.api.test.ts +197 -197
- package/src/api/service-discord.api.ts +241 -241
- package/src/api/service-insights.api.test.ts +36 -36
- package/src/api/service-insights.api.ts +42 -42
- package/src/api/service-route.api.ts +72 -72
- package/src/api/service-task.api.test.ts +140 -140
- package/src/api/service-task.api.ts +141 -141
- package/src/api/service-version.api.ts +54 -54
- package/src/api/service.api.test.ts +215 -215
- package/src/api/service.api.ts +55 -55
- package/src/discord/discord-event-filter-cases.ts +261 -261
- package/src/discord/discord-event-filters.test.ts +91 -91
- package/src/discord/discord-event-filters.ts +95 -95
- package/src/discord/discord-event-intents.test.ts +112 -112
- package/src/discord/discord-event-intents.ts +55 -55
- package/src/discord/index.ts +3 -3
- package/src/index.test.ts +87 -87
- package/src/insights/index.ts +1 -1
- package/src/insights/percentiles.test.ts +75 -75
- package/src/insights/percentiles.ts +37 -37
- package/src/types/enum/access-grant-status.enum.ts +12 -12
- package/src/types/enum/access-kind.enum.ts +7 -7
- package/src/types/enum/bot-event-block-reason.enum.ts +7 -7
- package/src/types/enum/configuration-read-as.enum.ts +5 -5
- package/src/types/enum/discord-activity-type.enum.ts +9 -9
- package/src/types/enum/discord-channel-type.enum.ts +11 -11
- package/src/types/enum/discord-component-kind.enum.ts +7 -7
- package/src/types/enum/discord-event-drop-reason.enum.ts +13 -13
- package/src/types/enum/discord-event-filter-name.enum.ts +11 -11
- package/src/types/enum/discord-event-status.enum.ts +13 -13
- package/src/types/enum/discord-event-type.enum.ts +7 -7
- package/src/types/enum/discord-gateway-failure-code.enum.ts +11 -11
- package/src/types/enum/discord-gateway-state.enum.ts +11 -11
- package/src/types/enum/discord-host-action.enum.ts +35 -35
- package/src/types/enum/discord-locale.enum.ts +35 -35
- package/src/types/enum/discord-option-type.enum.ts +12 -12
- package/src/types/enum/discord-presence-status.enum.ts +8 -8
- package/src/types/enum/discord-sync-status.enum.ts +6 -6
- package/src/types/enum/discord-token-state.enum.ts +11 -11
- package/src/types/enum/execution-mode.enum.ts +9 -9
- package/src/types/enum/execution-profile.enum.ts +20 -20
- package/src/types/enum/execution-settings-source.enum.ts +9 -9
- package/src/types/enum/health-status.enum.ts +4 -4
- package/src/types/enum/insights-period.enum.ts +8 -8
- package/src/types/enum/log-cap-mode.enum.ts +6 -6
- package/src/types/enum/log-drop-cause.enum.ts +8 -8
- package/src/types/enum/reflex-alert-metric.enum.ts +5 -5
- package/src/types/enum/reflex-alert-notification-state.enum.ts +6 -6
- package/src/types/enum/reflex-alert-scope.enum.ts +6 -6
- package/src/types/enum/reflex-error-code.enum.ts +43 -43
- package/src/types/enum/route-method.enum.ts +9 -9
- package/src/types/enum/run-log-level.enum.ts +6 -6
- package/src/types/enum/run-mode.enum.ts +11 -11
- package/src/types/enum/run-status.enum.ts +11 -11
- package/src/types/enum/run-step-status.enum.ts +7 -7
- package/src/types/enum/schedule-sync-status.enum.ts +6 -6
- package/src/types/enum/scheduled-run-failure-code.enum.ts +12 -12
- package/src/types/enum/scheduled-run-origin.enum.ts +5 -5
- package/src/types/enum/scheduled-run-status.enum.ts +17 -17
- package/src/types/enum/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 -9
- package/src/types/enum/service-version-change-kind.enum.ts +6 -6
- package/src/types/enum/trace-effect-type.enum.ts +12 -12
- package/src/types/enum/trigger-access-mode.enum.ts +12 -12
- package/src/types/enum/trigger-kind.enum.ts +8 -8
- package/src/types/enum/vault-value-source.enum.ts +12 -12
- package/src/types/enum/vault-visibility.enum.ts +5 -5
- package/src/types/index.ts +2 -2
- package/src/types/interface/api/index.ts +3 -3
- package/src/types/interface/api/response.ts +4 -4
- package/src/types/interface/api/responses/service-version.response.ts +6 -0
- package/src/types/interface/health.response.ts +7 -7
- package/src/types/interface/index.ts +3 -3
- package/tsconfig.check.json +15 -15
- package/tsconfig.json +35 -35
|
@@ -1,43 +1,43 @@
|
|
|
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
|
-
/** 400: a route path cannot start with `_abyss`, the segment the edge keeps for its own addresses (ticks of the cron tasks). */
|
|
38
|
-
ROUTE_SEGMENT_RESERVED = 'ROUTE_SEGMENT_RESERVED',
|
|
39
|
-
/** 409: the bot bills credit overage but the organization does not allow overage of the credits metric. */
|
|
40
|
-
CREDIT_OVERAGE_NOT_ALLOWED = 'CREDIT_OVERAGE_NOT_ALLOWED',
|
|
41
|
-
/** 409: the lots asked for do not fit in the event rate reserve of the organization (the sum of its allocations would go past it). */
|
|
42
|
-
BOT_EVENT_RESERVE_EXCEEDED = 'BOT_EVENT_RESERVE_EXCEEDED',
|
|
43
|
-
}
|
|
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
|
+
/** 400: a route path cannot start with `_abyss`, the segment the edge keeps for its own addresses (ticks of the cron tasks). */
|
|
38
|
+
ROUTE_SEGMENT_RESERVED = 'ROUTE_SEGMENT_RESERVED',
|
|
39
|
+
/** 409: the bot bills credit overage but the organization does not allow overage of the credits metric. */
|
|
40
|
+
CREDIT_OVERAGE_NOT_ALLOWED = 'CREDIT_OVERAGE_NOT_ALLOWED',
|
|
41
|
+
/** 409: the lots asked for do not fit in the event rate reserve of the organization (the sum of its allocations would go past it). */
|
|
42
|
+
BOT_EVENT_RESERVE_EXCEEDED = 'BOT_EVENT_RESERVE_EXCEEDED',
|
|
43
|
+
}
|
|
@@ -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,6 +1,6 @@
|
|
|
1
|
-
/** The level of a log line an execution wrote (LOG step, `abyss.log.*`, `console.*`). */
|
|
2
|
-
export enum RunLogLevel {
|
|
3
|
-
INFO = 'info',
|
|
4
|
-
WARN = 'warn',
|
|
5
|
-
ERROR = 'error',
|
|
6
|
-
}
|
|
1
|
+
/** The level of a log line an execution wrote (LOG step, `abyss.log.*`, `console.*`). */
|
|
2
|
+
export enum RunLogLevel {
|
|
3
|
+
INFO = 'info',
|
|
4
|
+
WARN = 'warn',
|
|
5
|
+
ERROR = 'error',
|
|
6
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* How a run was made.
|
|
3
|
-
* - SIMULATION: nothing is executed, effects are recorded, the Store is a scratch copy thrown away.
|
|
4
|
-
* - DRY_RUN: Store reads are real, writes are recorded and not executed.
|
|
5
|
-
* - LIVE: an execution of the edge on a promoted version.
|
|
6
|
-
*/
|
|
7
|
-
export enum RunMode {
|
|
8
|
-
SIMULATION = 'SIMULATION',
|
|
9
|
-
DRY_RUN = 'DRY_RUN',
|
|
10
|
-
LIVE = 'LIVE',
|
|
11
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* How a run was made.
|
|
3
|
+
* - SIMULATION: nothing is executed, effects are recorded, the Store is a scratch copy thrown away.
|
|
4
|
+
* - DRY_RUN: Store reads are real, writes are recorded and not executed.
|
|
5
|
+
* - LIVE: an execution of the edge on a promoted version.
|
|
6
|
+
*/
|
|
7
|
+
export enum RunMode {
|
|
8
|
+
SIMULATION = 'SIMULATION',
|
|
9
|
+
DRY_RUN = 'DRY_RUN',
|
|
10
|
+
LIVE = 'LIVE',
|
|
11
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export enum RunStatus {
|
|
2
|
-
/** A live execution accepted and not finished yet (an async caller reads it by its id). */
|
|
3
|
-
RUNNING = 'RUNNING',
|
|
4
|
-
SUCCEEDED = 'SUCCEEDED',
|
|
5
|
-
FAILED = 'FAILED',
|
|
6
|
-
/**
|
|
7
|
-
* A live execution stopped by the end of a pod of the edge or of the runner: offered (cost 0), kept in
|
|
8
|
-
* the journal with its measures up to the interruption, left out of every statistic.
|
|
9
|
-
*/
|
|
10
|
-
INTERRUPTED = 'INTERRUPTED',
|
|
11
|
-
}
|
|
1
|
+
export enum RunStatus {
|
|
2
|
+
/** A live execution accepted and not finished yet (an async caller reads it by its id). */
|
|
3
|
+
RUNNING = 'RUNNING',
|
|
4
|
+
SUCCEEDED = 'SUCCEEDED',
|
|
5
|
+
FAILED = 'FAILED',
|
|
6
|
+
/**
|
|
7
|
+
* A live execution stopped by the end of a pod of the edge or of the runner: offered (cost 0), kept in
|
|
8
|
+
* the journal with its measures up to the interruption, left out of every statistic.
|
|
9
|
+
*/
|
|
10
|
+
INTERRUPTED = 'INTERRUPTED',
|
|
11
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** How one step of a live execution ended. */
|
|
2
|
-
export enum RunStepStatus {
|
|
3
|
-
SUCCEEDED = 'SUCCEEDED',
|
|
4
|
-
FAILED = 'FAILED',
|
|
5
|
-
/** The step was running when the pod of the edge or of the runner stopped. */
|
|
6
|
-
INTERRUPTED = 'INTERRUPTED',
|
|
7
|
-
}
|
|
1
|
+
/** How one step of a live execution ended. */
|
|
2
|
+
export enum RunStepStatus {
|
|
3
|
+
SUCCEEDED = 'SUCCEEDED',
|
|
4
|
+
FAILED = 'FAILED',
|
|
5
|
+
/** The step was running when the pod of the edge or of the runner stopped. */
|
|
6
|
+
INTERRUPTED = 'INTERRUPTED',
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/** State of the synchronization of the cron tasks of the version in service with Flow, per environment. */
|
|
2
|
-
export enum ScheduleSyncStatus {
|
|
3
|
-
PENDING = 'PENDING',
|
|
4
|
-
SYNCED = 'SYNCED',
|
|
5
|
-
FAILED = 'FAILED',
|
|
6
|
-
}
|
|
1
|
+
/** State of the synchronization of the cron tasks of the version in service with Flow, per environment. */
|
|
2
|
+
export enum ScheduleSyncStatus {
|
|
3
|
+
PENDING = 'PENDING',
|
|
4
|
+
SYNCED = 'SYNCED',
|
|
5
|
+
FAILED = 'FAILED',
|
|
6
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `failureCode` of a FAILED scheduled run the execution plane writes itself. Any other `failureCode` is the
|
|
3
|
-
* error code of the live run that failed (`FUNCTION_FAILED`, `FUNCTION_TIMEOUT`, `INTERNAL_ERROR`...).
|
|
4
|
-
*/
|
|
5
|
-
export enum ScheduledRunFailureCode {
|
|
6
|
-
/** The task left the version in service before the run was due: nothing ran, nothing is billed. */
|
|
7
|
-
TASK_REMOVED = 'TASK_REMOVED',
|
|
8
|
-
/** Every attempt was interrupted by the end of its edge. */
|
|
9
|
-
ATTEMPTS_EXHAUSTED = 'ATTEMPTS_EXHAUSTED',
|
|
10
|
-
/** The credits of the organization are spent and the bot has no overage: the run stopped, nothing ran, nothing is billed. */
|
|
11
|
-
CREDITS_EXHAUSTED = 'CREDITS_EXHAUSTED',
|
|
12
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* The `failureCode` of a FAILED scheduled run the execution plane writes itself. Any other `failureCode` is the
|
|
3
|
+
* error code of the live run that failed (`FUNCTION_FAILED`, `FUNCTION_TIMEOUT`, `INTERNAL_ERROR`...).
|
|
4
|
+
*/
|
|
5
|
+
export enum ScheduledRunFailureCode {
|
|
6
|
+
/** The task left the version in service before the run was due: nothing ran, nothing is billed. */
|
|
7
|
+
TASK_REMOVED = 'TASK_REMOVED',
|
|
8
|
+
/** Every attempt was interrupted by the end of its edge. */
|
|
9
|
+
ATTEMPTS_EXHAUSTED = 'ATTEMPTS_EXHAUSTED',
|
|
10
|
+
/** The credits of the organization are spent and the bot has no overage: the run stopped, nothing ran, nothing is billed. */
|
|
11
|
+
CREDITS_EXHAUSTED = 'CREDITS_EXHAUSTED',
|
|
12
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** What queued a scheduled run of a task: a tick of its cron (sent by Flow), or a delayed run the code scheduled. */
|
|
2
|
-
export enum ScheduledRunOrigin {
|
|
3
|
-
RECURRING = 'RECURRING',
|
|
4
|
-
DELAYED = 'DELAYED',
|
|
5
|
-
}
|
|
1
|
+
/** What queued a scheduled run of a task: a tick of its cron (sent by Flow), or a delayed run the code scheduled. */
|
|
2
|
+
export enum ScheduledRunOrigin {
|
|
3
|
+
RECURRING = 'RECURRING',
|
|
4
|
+
DELAYED = 'DELAYED',
|
|
5
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/** Where a scheduled run of a task stands (`scheduled_runs.status` of the execution plane). */
|
|
2
|
-
export enum ScheduledRunStatus {
|
|
3
|
-
/** Waiting for its due date, or due and not yet taken by an edge. */
|
|
4
|
-
PENDING = 'PENDING',
|
|
5
|
-
/** An edge runs it. */
|
|
6
|
-
CLAIMED = 'CLAIMED',
|
|
7
|
-
/** Ran to its end. */
|
|
8
|
-
DONE = 'DONE',
|
|
9
|
-
/** Did not run to its end: `failureCode` says why. */
|
|
10
|
-
FAILED = 'FAILED',
|
|
11
|
-
/** Cancelled before it ran (`abyss.schedule.cancel` or the screen). */
|
|
12
|
-
CANCELLED = 'CANCELLED',
|
|
13
|
-
/** Taken too late, past the tolerance (after a pause or an outage): ran nothing, cost nothing. */
|
|
14
|
-
EXPIRED = 'EXPIRED',
|
|
15
|
-
/** A tick of a cron that came while the previous one still ran: ran nothing, cost nothing. */
|
|
16
|
-
SKIPPED = 'SKIPPED',
|
|
17
|
-
}
|
|
1
|
+
/** Where a scheduled run of a task stands (`scheduled_runs.status` of the execution plane). */
|
|
2
|
+
export enum ScheduledRunStatus {
|
|
3
|
+
/** Waiting for its due date, or due and not yet taken by an edge. */
|
|
4
|
+
PENDING = 'PENDING',
|
|
5
|
+
/** An edge runs it. */
|
|
6
|
+
CLAIMED = 'CLAIMED',
|
|
7
|
+
/** Ran to its end. */
|
|
8
|
+
DONE = 'DONE',
|
|
9
|
+
/** Did not run to its end: `failureCode` says why. */
|
|
10
|
+
FAILED = 'FAILED',
|
|
11
|
+
/** Cancelled before it ran (`abyss.schedule.cancel` or the screen). */
|
|
12
|
+
CANCELLED = 'CANCELLED',
|
|
13
|
+
/** Taken too late, past the tolerance (after a pause or an outage): ran nothing, cost nothing. */
|
|
14
|
+
EXPIRED = 'EXPIRED',
|
|
15
|
+
/** A tick of a cron that came while the previous one still ran: ran nothing, cost nothing. */
|
|
16
|
+
SKIPPED = 'SKIPPED',
|
|
17
|
+
}
|
|
@@ -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,9 +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
|
-
/** A Discord bot: commands and components, each calling one function of the Service. No routes. */
|
|
8
|
-
DISCORD_BOT = 'DISCORD_BOT',
|
|
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
|
+
/** 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
|
-
/** The kind of effect one trace entry records. */
|
|
2
|
-
export enum TraceEffectType {
|
|
3
|
-
/**
|
|
4
|
-
* An evaluation of expressions or code. Only in test runs recorded before Reflex lot 0 (#773), which
|
|
5
|
-
* the retention still keeps: evaluations now happen inside the runner's isolate and are not traced.
|
|
6
|
-
*/
|
|
7
|
-
EVALUATE = 'EVALUATE',
|
|
8
|
-
/** An HTTP call: an HTTP step or `fetch()`. */
|
|
9
|
-
HTTP = 'HTTP',
|
|
10
|
-
/** A call to the host: `store.*`, `secret.get`, `http.respond`, `wait` (its `action`). */
|
|
11
|
-
HOST = 'HOST',
|
|
12
|
-
}
|
|
1
|
+
/** The kind of effect one trace entry records. */
|
|
2
|
+
export enum TraceEffectType {
|
|
3
|
+
/**
|
|
4
|
+
* An evaluation of expressions or code. Only in test runs recorded before Reflex lot 0 (#773), which
|
|
5
|
+
* the retention still keeps: evaluations now happen inside the runner's isolate and are not traced.
|
|
6
|
+
*/
|
|
7
|
+
EVALUATE = 'EVALUATE',
|
|
8
|
+
/** An HTTP call: an HTTP step or `fetch()`. */
|
|
9
|
+
HTTP = 'HTTP',
|
|
10
|
+
/** A call to the host: `store.*`, `secret.get`, `http.respond`, `wait` (its `action`). */
|
|
11
|
+
HOST = 'HOST',
|
|
12
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/** What started an execution of a Service. */
|
|
2
|
-
export enum TriggerKind {
|
|
3
|
-
COMMAND = 'COMMAND',
|
|
4
|
-
COMPONENT = 'COMPONENT',
|
|
5
|
-
EVENT = 'EVENT',
|
|
6
|
-
TASK = 'TASK',
|
|
7
|
-
ROUTE = 'ROUTE',
|
|
8
|
-
}
|
|
1
|
+
/** What started an execution of a Service. */
|
|
2
|
+
export enum TriggerKind {
|
|
3
|
+
COMMAND = 'COMMAND',
|
|
4
|
+
COMPONENT = 'COMPONENT',
|
|
5
|
+
EVENT = 'EVENT',
|
|
6
|
+
TASK = 'TASK',
|
|
7
|
+
ROUTE = 'ROUTE',
|
|
8
|
+
}
|
|
@@ -1,12 +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
|
+
/**
|
|
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,5 +1,5 @@
|
|
|
1
|
-
/** Whether a Console vault entry hides its value. Mirrors Console's `SecretVisibility`. */
|
|
2
|
-
export enum VaultVisibility {
|
|
3
|
-
SECRET = 'SECRET',
|
|
4
|
-
VISIBLE = 'VISIBLE',
|
|
5
|
-
}
|
|
1
|
+
/** Whether a Console vault entry hides its value. Mirrors Console's `SecretVisibility`. */
|
|
2
|
+
export enum VaultVisibility {
|
|
3
|
+
SECRET = 'SECRET',
|
|
4
|
+
VISIBLE = 'VISIBLE',
|
|
5
|
+
}
|
package/src/types/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './enum';
|
|
2
|
-
export * from './interface';
|
|
1
|
+
export * from './enum';
|
|
2
|
+
export * from './interface';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './response';
|
|
2
|
-
export * from './requests';
|
|
3
|
-
export * from './responses';
|
|
1
|
+
export * from './response';
|
|
2
|
+
export * from './requests';
|
|
3
|
+
export * from './responses';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Every success of the API wraps its payload in `data`. */
|
|
2
|
-
export interface IResponse<T> {
|
|
3
|
-
data: T;
|
|
4
|
-
}
|
|
1
|
+
/** Every success of the API wraps its payload in `data`. */
|
|
2
|
+
export interface IResponse<T> {
|
|
3
|
+
data: T;
|
|
4
|
+
}
|
|
@@ -85,6 +85,12 @@ export interface IGetServiceVersionDraftStatusData {
|
|
|
85
85
|
changedTasks: number;
|
|
86
86
|
/** How many event triggers of the draft differ from the last Service version: added, modified or removed. 0 for a Service that is not a Discord bot. */
|
|
87
87
|
changedEvents: number;
|
|
88
|
+
/**
|
|
89
|
+
* True exactly when `POST .../version` now would be refused with `VERSION_UNCHANGED`: no function
|
|
90
|
+
* changed and the whole snapshot (routes, CORS, rate limit, Discord commands and components, tasks)
|
|
91
|
+
* is the one of the last version. False for a Service without a version.
|
|
92
|
+
*/
|
|
93
|
+
unchanged: boolean;
|
|
88
94
|
}
|
|
89
95
|
export type IGetServiceVersionDraftStatusResponse = IResponse<IGetServiceVersionDraftStatusData>;
|
|
90
96
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { HealthStatus } from '../enum';
|
|
2
|
-
|
|
3
|
-
/** Body of `GET /health`: `200` when both components are up, `503` with the same shape otherwise. */
|
|
4
|
-
export interface IHealthResponse {
|
|
5
|
-
database: HealthStatus;
|
|
6
|
-
redis: HealthStatus;
|
|
7
|
-
}
|
|
1
|
+
import type { HealthStatus } from '../enum';
|
|
2
|
+
|
|
3
|
+
/** Body of `GET /health`: `200` when both components are up, `503` with the same shape otherwise. */
|
|
4
|
+
export interface IHealthResponse {
|
|
5
|
+
database: HealthStatus;
|
|
6
|
+
redis: HealthStatus;
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './health.response';
|
|
2
|
-
export * from './models';
|
|
3
|
-
export * from './api';
|
|
1
|
+
export * from './health.response';
|
|
2
|
+
export * from './models';
|
|
3
|
+
export * from './api';
|
package/tsconfig.check.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Perimetre de VERIFICATION, distinct de celui du build.
|
|
3
|
-
//
|
|
4
|
-
// `tsconfig.json` exclut `src/**/*.spec.ts` parce qu'il sert a emettre `dist/`, ou une spec
|
|
5
|
-
// n'a rien a faire. Mais eslint s'appuie sur ce meme fichier via `parserOptions.project` :
|
|
6
|
-
// les cinq specs du paquet sortaient donc en « Parsing error: that TSConfig does not include
|
|
7
|
-
// this file », mesure du 2026-09-09, et n'etaient lintees par personne.
|
|
8
|
-
//
|
|
9
|
-
// Ce fichier sert uniquement a eslint. Il n'emet rien et ne change pas ce que `build` produit.
|
|
10
|
-
"extends": "./tsconfig.json",
|
|
11
|
-
"compilerOptions": {
|
|
12
|
-
"noEmit": true
|
|
13
|
-
},
|
|
14
|
-
"exclude": ["./dist/**/*"]
|
|
15
|
-
}
|
|
1
|
+
{
|
|
2
|
+
// Perimetre de VERIFICATION, distinct de celui du build.
|
|
3
|
+
//
|
|
4
|
+
// `tsconfig.json` exclut `src/**/*.spec.ts` parce qu'il sert a emettre `dist/`, ou une spec
|
|
5
|
+
// n'a rien a faire. Mais eslint s'appuie sur ce meme fichier via `parserOptions.project` :
|
|
6
|
+
// les cinq specs du paquet sortaient donc en « Parsing error: that TSConfig does not include
|
|
7
|
+
// this file », mesure du 2026-09-09, et n'etaient lintees par personne.
|
|
8
|
+
//
|
|
9
|
+
// Ce fichier sert uniquement a eslint. Il n'emet rien et ne change pas ce que `build` produit.
|
|
10
|
+
"extends": "./tsconfig.json",
|
|
11
|
+
"compilerOptions": {
|
|
12
|
+
"noEmit": true
|
|
13
|
+
},
|
|
14
|
+
"exclude": ["./dist/**/*"]
|
|
15
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"incremental": false,
|
|
4
|
-
"target": "es2021",
|
|
5
|
-
"lib": [
|
|
6
|
-
"dom",
|
|
7
|
-
"es2021"
|
|
8
|
-
],
|
|
9
|
-
"module": "commonjs",
|
|
10
|
-
"rootDir": "src",
|
|
11
|
-
"moduleResolution": "node",
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"declaration": true,
|
|
14
|
-
"sourceMap": true,
|
|
15
|
-
"outDir": "./dist",
|
|
16
|
-
"removeComments": true,
|
|
17
|
-
"allowSyntheticDefaultImports": true,
|
|
18
|
-
"esModuleInterop": true,
|
|
19
|
-
"forceConsistentCasingInFileNames": true,
|
|
20
|
-
"strict": true,
|
|
21
|
-
"strictNullChecks": true,
|
|
22
|
-
"strictFunctionTypes": true,
|
|
23
|
-
"strictPropertyInitialization": false,
|
|
24
|
-
"skipLibCheck": true
|
|
25
|
-
},
|
|
26
|
-
"include": [
|
|
27
|
-
"./src"
|
|
28
|
-
],
|
|
29
|
-
"exclude": [
|
|
30
|
-
"./dist/**/*",
|
|
31
|
-
"./src/**/*.spec.ts",
|
|
32
|
-
"./src/**/*.test.ts",
|
|
33
|
-
"./src/**/__tests__/**"
|
|
34
|
-
]
|
|
35
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"incremental": false,
|
|
4
|
+
"target": "es2021",
|
|
5
|
+
"lib": [
|
|
6
|
+
"dom",
|
|
7
|
+
"es2021"
|
|
8
|
+
],
|
|
9
|
+
"module": "commonjs",
|
|
10
|
+
"rootDir": "src",
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"declaration": true,
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"outDir": "./dist",
|
|
16
|
+
"removeComments": true,
|
|
17
|
+
"allowSyntheticDefaultImports": true,
|
|
18
|
+
"esModuleInterop": true,
|
|
19
|
+
"forceConsistentCasingInFileNames": true,
|
|
20
|
+
"strict": true,
|
|
21
|
+
"strictNullChecks": true,
|
|
22
|
+
"strictFunctionTypes": true,
|
|
23
|
+
"strictPropertyInitialization": false,
|
|
24
|
+
"skipLibCheck": true
|
|
25
|
+
},
|
|
26
|
+
"include": [
|
|
27
|
+
"./src"
|
|
28
|
+
],
|
|
29
|
+
"exclude": [
|
|
30
|
+
"./dist/**/*",
|
|
31
|
+
"./src/**/*.spec.ts",
|
|
32
|
+
"./src/**/*.test.ts",
|
|
33
|
+
"./src/**/__tests__/**"
|
|
34
|
+
]
|
|
35
|
+
}
|