@abyss-project/reflex 6.3.0 → 6.5.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/README.md +15 -15
- package/dist/api/code-environment.api.d.ts +2 -0
- package/dist/api/code-environment.api.js +7 -0
- package/dist/api/code-environment.api.js.map +1 -0
- package/dist/api/function-run.api.d.ts +2 -1
- package/dist/api/function-run.api.js +3 -1
- package/dist/api/function-run.api.js.map +1 -1
- package/dist/api/function-settings.api.d.ts +3 -1
- package/dist/api/function-settings.api.js +7 -1
- package/dist/api/function-settings.api.js.map +1 -1
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +3 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/service-template.api.d.ts +2 -0
- package/dist/api/service-template.api.js +7 -0
- package/dist/api/service-template.api.js.map +1 -0
- package/dist/api/storage-surplus.admin.api.d.ts +5 -0
- package/dist/api/storage-surplus.admin.api.js +17 -0
- package/dist/api/storage-surplus.admin.api.js.map +1 -0
- package/dist/code/index.d.ts +1 -0
- package/dist/code/index.js +18 -0
- package/dist/code/index.js.map +1 -0
- package/dist/code/reflex-code-declarations.d.ts +1 -0
- package/dist/code/reflex-code-declarations.js +644 -0
- package/dist/code/reflex-code-declarations.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +28 -1
- package/dist/index.js.map +1 -1
- package/dist/types/enum/index.d.ts +4 -0
- package/dist/types/enum/index.js +4 -0
- package/dist/types/enum/index.js.map +1 -1
- package/dist/types/enum/reflex-code-diagnostic-category.enum.d.ts +6 -0
- package/dist/types/enum/reflex-code-diagnostic-category.enum.js +11 -0
- package/dist/types/enum/reflex-code-diagnostic-category.enum.js.map +1 -0
- package/dist/types/enum/reflex-error-code.enum.d.ts +5 -1
- package/dist/types/enum/reflex-error-code.enum.js +4 -0
- package/dist/types/enum/reflex-error-code.enum.js.map +1 -1
- package/dist/types/enum/service-template-follow-up-kind.enum.d.ts +10 -0
- package/dist/types/enum/service-template-follow-up-kind.enum.js +15 -0
- package/dist/types/enum/service-template-follow-up-kind.enum.js.map +1 -0
- package/dist/types/enum/service-template-id.enum.d.ts +10 -0
- package/dist/types/enum/service-template-id.enum.js +15 -0
- package/dist/types/enum/service-template-id.enum.js.map +1 -0
- package/dist/types/enum/service-template-parameter-kind.enum.d.ts +4 -0
- package/dist/types/enum/service-template-parameter-kind.enum.js +9 -0
- package/dist/types/enum/service-template-parameter-kind.enum.js.map +1 -0
- package/dist/types/enum/trigger-access-mode.enum.d.ts +2 -1
- package/dist/types/enum/trigger-access-mode.enum.js +1 -0
- package/dist/types/enum/trigger-access-mode.enum.js.map +1 -1
- package/dist/types/interface/api/requests/application-run-settings.request.d.ts +1 -0
- package/dist/types/interface/api/requests/code-environment.request.d.ts +3 -0
- package/dist/types/interface/api/requests/code-environment.request.js +3 -0
- package/dist/types/interface/api/requests/code-environment.request.js.map +1 -0
- package/dist/types/interface/api/requests/function-run.request.d.ts +8 -0
- package/dist/types/interface/api/requests/function-settings.request.d.ts +12 -0
- package/dist/types/interface/api/requests/index.d.ts +3 -0
- package/dist/types/interface/api/requests/index.js +3 -0
- package/dist/types/interface/api/requests/index.js.map +1 -1
- package/dist/types/interface/api/requests/service-template.request.d.ts +3 -0
- package/dist/types/interface/api/requests/service-template.request.js +3 -0
- package/dist/types/interface/api/requests/service-template.request.js.map +1 -0
- package/dist/types/interface/api/requests/service.request.d.ts +3 -1
- package/dist/types/interface/api/requests/storage-surplus.admin.request.d.ts +8 -0
- package/dist/types/interface/api/requests/storage-surplus.admin.request.js +3 -0
- package/dist/types/interface/api/requests/storage-surplus.admin.request.js.map +1 -0
- package/dist/types/interface/api/responses/code-environment.response.d.ts +6 -0
- package/dist/types/interface/api/responses/code-environment.response.js +3 -0
- package/dist/types/interface/api/responses/code-environment.response.js.map +1 -0
- package/dist/types/interface/api/responses/function-run.response.d.ts +4 -0
- package/dist/types/interface/api/responses/function-settings.response.d.ts +5 -1
- package/dist/types/interface/api/responses/index.d.ts +3 -0
- package/dist/types/interface/api/responses/index.js +3 -0
- package/dist/types/interface/api/responses/index.js.map +1 -1
- package/dist/types/interface/api/responses/service-template.response.d.ts +6 -0
- package/dist/types/interface/api/responses/service-template.response.js +3 -0
- package/dist/types/interface/api/responses/service-template.response.js.map +1 -0
- package/dist/types/interface/api/responses/storage-surplus.admin.response.d.ts +8 -0
- package/dist/types/interface/api/responses/storage-surplus.admin.response.js +3 -0
- package/dist/types/interface/api/responses/storage-surplus.admin.response.js.map +1 -0
- package/dist/types/interface/models/index.d.ts +5 -0
- package/dist/types/interface/models/index.js +5 -0
- package/dist/types/interface/models/index.js.map +1 -1
- package/dist/types/interface/models/reflex-code-diagnostic.model.d.ts +10 -0
- package/dist/types/interface/models/reflex-code-diagnostic.model.js +5 -0
- package/dist/types/interface/models/reflex-code-diagnostic.model.js.map +1 -0
- package/dist/types/interface/models/reflex-code-environment.model.d.ts +9 -0
- package/dist/types/interface/models/reflex-code-environment.model.js +3 -0
- package/dist/types/interface/models/reflex-code-environment.model.js.map +1 -0
- package/dist/types/interface/models/reflex-run-retention.model.d.ts +13 -0
- package/dist/types/interface/models/reflex-run-retention.model.js +8 -0
- package/dist/types/interface/models/reflex-run-retention.model.js.map +1 -0
- package/dist/types/interface/models/reflex-run-settings.model.d.ts +4 -0
- package/dist/types/interface/models/reflex-run.model.d.ts +5 -0
- package/dist/types/interface/models/reflex-service-deployment.model.d.ts +2 -2
- package/dist/types/interface/models/reflex-service-template.model.d.ts +33 -0
- package/dist/types/interface/models/reflex-service-template.model.js +3 -0
- package/dist/types/interface/models/reflex-service-template.model.js.map +1 -0
- package/dist/types/interface/models/reflex-service.model.d.ts +1 -0
- package/dist/types/interface/models/reflex-storage-surplus.model.d.ts +11 -0
- package/dist/types/interface/models/reflex-storage-surplus.model.js +3 -0
- package/dist/types/interface/models/reflex-storage-surplus.model.js.map +1 -0
- package/jest.config.ts +11 -11
- package/package.json +1 -1
- package/src/api/alert-rule.api.test.ts +72 -72
- package/src/api/alert-rule.api.ts +57 -57
- package/src/api/application-insights.api.test.ts +42 -42
- package/src/api/application-insights.api.ts +38 -38
- package/src/api/application-run-settings.api.test.ts +62 -51
- package/src/api/application-run-settings.api.ts +30 -30
- package/src/api/code-environment.api.ts +15 -0
- package/src/api/function-access.api.ts +87 -87
- package/src/api/function-insights.api.test.ts +27 -27
- package/src/api/function-insights.api.ts +18 -18
- package/src/api/function-run.api.ts +53 -38
- package/src/api/function-settings.api.ts +96 -74
- package/src/api/function-template.api.test.ts +72 -72
- package/src/api/function-template.api.ts +52 -52
- package/src/api/function-test.api.ts +34 -34
- package/src/api/function-version.api.ts +66 -66
- package/src/api/function.api.test.ts +346 -291
- package/src/api/function.api.ts +62 -62
- package/src/api/health.api.ts +10 -10
- package/src/api/index.ts +29 -26
- package/src/api/route-stats.api.test.ts +45 -45
- package/src/api/route-stats.api.ts +36 -36
- package/src/api/service-completion-webhook.api.test.ts +97 -97
- package/src/api/service-completion-webhook.api.ts +39 -39
- package/src/api/service-configuration.api.ts +16 -16
- package/src/api/service-consumer.api.test.ts +104 -104
- package/src/api/service-consumer.api.ts +90 -90
- package/src/api/service-deployment.api.ts +79 -79
- package/src/api/service-discord-event.api.test.ts +106 -106
- package/src/api/service-discord-event.api.ts +78 -78
- package/src/api/service-discord.api.test.ts +178 -178
- package/src/api/service-discord.api.ts +222 -222
- package/src/api/service-insights.api.test.ts +36 -36
- package/src/api/service-insights.api.ts +42 -42
- package/src/api/service-limits.api.test.ts +100 -100
- package/src/api/service-limits.api.ts +37 -37
- package/src/api/service-openapi.api.test.ts +52 -52
- package/src/api/service-openapi.api.ts +21 -21
- package/src/api/service-route.api.ts +2 -2
- package/src/api/service-task.api.test.ts +140 -140
- package/src/api/service-task.api.ts +141 -141
- package/src/api/service-template.api.test.ts +41 -0
- package/src/api/service-template.api.ts +12 -0
- package/src/api/service-version.api.ts +54 -54
- package/src/api/service.api.test.ts +220 -215
- package/src/api/service.api.ts +55 -55
- package/src/api/storage-surplus.admin.api.test.ts +66 -0
- package/src/api/storage-surplus.admin.api.ts +45 -0
- package/src/code/index.ts +1 -0
- package/src/code/reflex-code-declarations.ts +646 -0
- 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 +104 -104
- package/src/index.ts +497 -438
- 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/access-request-status.enum.ts +11 -11
- package/src/types/enum/bot-event-block-reason.enum.ts +7 -7
- package/src/types/enum/completion-delivery-status.enum.ts +9 -9
- 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 +37 -37
- 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/index.ts +55 -51
- 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-code-diagnostic-category.enum.ts +11 -0
- package/src/types/enum/reflex-error-code.enum.ts +93 -72
- 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 +16 -16
- 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 +14 -14
- 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-block-reason.enum.ts +13 -13
- 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-template-follow-up-kind.enum.ts +19 -0
- package/src/types/enum/service-template-id.enum.ts +19 -0
- package/src/types/enum/service-template-parameter-kind.enum.ts +7 -0
- 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 +4 -0
- 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/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 +13 -11
- package/src/types/interface/api/requests/code-environment.request.ts +3 -0
- package/src/types/interface/api/requests/function-access.request.ts +51 -51
- package/src/types/interface/api/requests/function-run.request.ts +42 -32
- package/src/types/interface/api/requests/function-settings.request.ts +50 -34
- package/src/types/interface/api/requests/function-template.request.ts +29 -29
- package/src/types/interface/api/requests/function-test.request.ts +44 -44
- 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 +27 -24
- package/src/types/interface/api/requests/route-stats.request.ts +22 -22
- package/src/types/interface/api/requests/service-completion-webhook.request.ts +11 -11
- package/src/types/interface/api/requests/service-configuration.request.ts +4 -4
- package/src/types/interface/api/requests/service-consumer.request.ts +51 -51
- 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 +155 -155
- package/src/types/interface/api/requests/service-insights.request.ts +31 -31
- package/src/types/interface/api/requests/service-limits.request.ts +28 -28
- package/src/types/interface/api/requests/service-openapi.request.ts +10 -10
- package/src/types/interface/api/requests/service-route.request.ts +52 -52
- package/src/types/interface/api/requests/service-task.request.ts +80 -80
- package/src/types/interface/api/requests/service-template.request.ts +3 -0
- package/src/types/interface/api/requests/service-version.request.ts +24 -24
- package/src/types/interface/api/requests/service.request.ts +54 -46
- package/src/types/interface/api/requests/storage-surplus.admin.request.ts +12 -0
- package/src/types/interface/api/response.ts +4 -4
- 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/code-environment.response.ts +7 -0
- package/src/types/interface/api/responses/function-access.response.ts +45 -45
- package/src/types/interface/api/responses/function-run.response.ts +23 -18
- package/src/types/interface/api/responses/function-settings.response.ts +57 -50
- package/src/types/interface/api/responses/function-template.response.ts +21 -21
- package/src/types/interface/api/responses/function-test.response.ts +19 -19
- 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 +27 -24
- package/src/types/interface/api/responses/route-stats.response.ts +15 -15
- package/src/types/interface/api/responses/service-completion-webhook.response.ts +13 -13
- package/src/types/interface/api/responses/service-configuration.response.ts +8 -8
- package/src/types/interface/api/responses/service-consumer.response.ts +33 -33
- 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 +110 -110
- package/src/types/interface/api/responses/service-insights.response.ts +11 -11
- package/src/types/interface/api/responses/service-limits.response.ts +13 -13
- package/src/types/interface/api/responses/service-openapi.response.ts +7 -7
- package/src/types/interface/api/responses/service-route.response.ts +2 -2
- package/src/types/interface/api/responses/service-task.response.ts +57 -57
- package/src/types/interface/api/responses/service-template.response.ts +8 -0
- package/src/types/interface/api/responses/service-version.response.ts +112 -112
- package/src/types/interface/api/responses/service.response.ts +31 -31
- package/src/types/interface/api/responses/storage-surplus.admin.response.ts +10 -0
- package/src/types/interface/health.response.ts +7 -7
- package/src/types/interface/index.ts +3 -3
- package/src/types/interface/models/index.ts +32 -27
- 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 +53 -53
- package/src/types/interface/models/reflex-code-diagnostic.model.ts +15 -0
- package/src/types/interface/models/reflex-code-environment.model.ts +17 -0
- package/src/types/interface/models/reflex-completion-webhook.model.ts +111 -111
- package/src/types/interface/models/reflex-consumer.model.ts +50 -50
- 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 +208 -208
- package/src/types/interface/models/reflex-execution-settings.model.ts +57 -57
- 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 +22 -22
- package/src/types/interface/models/reflex-route-contract.model.ts +46 -46
- package/src/types/interface/models/reflex-route.model.ts +23 -23
- package/src/types/interface/models/reflex-run-retention.model.ts +24 -0
- package/src/types/interface/models/reflex-run-settings.model.ts +39 -28
- package/src/types/interface/models/reflex-run.model.ts +309 -299
- package/src/types/interface/models/reflex-service-configuration.model.ts +22 -22
- package/src/types/interface/models/reflex-service-deployment.model.ts +48 -46
- package/src/types/interface/models/reflex-service-limits.model.ts +92 -92
- package/src/types/interface/models/reflex-service-template.model.ts +55 -0
- package/src/types/interface/models/reflex-service-version.model.ts +64 -64
- package/src/types/interface/models/reflex-service.model.ts +47 -45
- package/src/types/interface/models/reflex-step-stats.model.ts +35 -35
- package/src/types/interface/models/reflex-storage-surplus.model.ts +23 -0
- package/src/types/interface/models/reflex-task.model.ts +97 -97
- package/tsconfig.check.json +15 -15
- package/tsconfig.json +35 -35
|
@@ -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,48 @@
|
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
+
/** The version this gesture put in service; null once the purge deleted it (the row stays in the history, no way back to it). */
|
|
27
|
+
serviceVersionId: string | null;
|
|
28
|
+
/** Number of that version; null with `serviceVersionId`. */
|
|
29
|
+
serviceVersionNumber: number | null;
|
|
30
|
+
action: ServiceDeploymentAction;
|
|
31
|
+
status: ServiceDeploymentStatus;
|
|
32
|
+
grants: IReflexServiceDeploymentGrant[];
|
|
33
|
+
/** Push of the interactions address and the commands to Discord; null for a Service that is not a Discord bot. */
|
|
34
|
+
discordSync: DiscordSyncStatus | null;
|
|
35
|
+
/** Code and message of the Discord refusal when `discordSync` is FAILED (500 characters at most). */
|
|
36
|
+
discordSyncError: string | null;
|
|
37
|
+
discordSyncedAt: Date | null;
|
|
38
|
+
/** Synchronization of the cron tasks of the version with Flow; null when the version has no cron task. */
|
|
39
|
+
scheduleSync: ScheduleSyncStatus | null;
|
|
40
|
+
/** Code and message of the failure when `scheduleSync` is FAILED (500 characters at most). */
|
|
41
|
+
scheduleSyncError: string | null;
|
|
42
|
+
scheduleSyncedAt: Date | null;
|
|
43
|
+
/** The bot was paused by the plan quota (ADR-0277), not by a member: only those resume with the plan. */
|
|
44
|
+
pausedForQuota: boolean;
|
|
45
|
+
isCurrent: boolean;
|
|
46
|
+
byUserId: string;
|
|
47
|
+
at: Date;
|
|
48
|
+
}
|
|
@@ -1,92 +1,92 @@
|
|
|
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
|
-
/** The credits of the month of a whole organization: billing data, only for a member who may read the billing. */
|
|
29
|
-
export interface IReflexOrganizationCredits {
|
|
30
|
-
/**
|
|
31
|
-
* The credits the plan of the organization includes this month (effective limit, packs included), in
|
|
32
|
-
* millicredits: the same threshold that stops the Services. `null` for an unlimited plan.
|
|
33
|
-
*/
|
|
34
|
-
includedMillicredits: number | null;
|
|
35
|
-
/**
|
|
36
|
-
* What all the Services of the organization consumed this month, in millicredits: what abyss-main holds plus what
|
|
37
|
-
* the Reflex report has not declared yet. The stop compares this total to `includedMillicredits`.
|
|
38
|
-
*/
|
|
39
|
-
consumedMillicredits: number;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/** Credits of the month a Service consumed, and its overage setting. */
|
|
43
|
-
export interface IReflexServiceCredits {
|
|
44
|
-
/** `YYYY-MM`. */
|
|
45
|
-
month: string;
|
|
46
|
-
consumedMillicredits: number;
|
|
47
|
-
/**
|
|
48
|
-
* The credits of the whole organization. `null` when the reader may not see the billing of the organization
|
|
49
|
-
* (no `ORG_BILLING_READ`), or when abyss-main cannot say whether they may.
|
|
50
|
-
*/
|
|
51
|
-
organizationCredits: IReflexOrganizationCredits | null;
|
|
52
|
-
/** True when the Service bills overage past the credits of the organization. */
|
|
53
|
-
overageEnabled: boolean;
|
|
54
|
-
/** True when the organization allows overage of the credits metric at all. */
|
|
55
|
-
overageAllowedByOrganization: boolean;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** Alert settings of one limit of a Service. */
|
|
59
|
-
export interface IReflexServiceAlertSettings {
|
|
60
|
-
/** Percent values, at most 5, each from 1 to 100. */
|
|
61
|
-
thresholds: number[];
|
|
62
|
-
email: boolean;
|
|
63
|
-
inApp: boolean;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/** Alert settings of a Service in one environment. */
|
|
67
|
-
export interface IReflexServiceAlerts {
|
|
68
|
-
monthlySpendCap: IReflexServiceAlertSettings;
|
|
69
|
-
/** The event rate of a bot; absent for any other type of Service. */
|
|
70
|
-
rate?: IReflexServiceAlertSettings;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/** What stops a Service in one environment, by its limits. */
|
|
74
|
-
export interface IReflexServiceBlock {
|
|
75
|
-
/**
|
|
76
|
-
* `CREDITS_EXHAUSTED` stops a bot entirely, and every route and task of an HTTP Service. `BUDGET_REACHED` stops
|
|
77
|
-
* every route and task of an HTTP Service; for a bot, only its events stop.
|
|
78
|
-
*/
|
|
79
|
-
reason: ServiceBlockReason;
|
|
80
|
-
since: Date;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/** The credits, the monthly spend cap, the alerts and the stop of a Service in one environment. */
|
|
84
|
-
export interface IReflexServiceEnvironmentLimits {
|
|
85
|
-
environmentId: string;
|
|
86
|
-
/** Credits of the month and the overage setting; null while abyss-main, which holds the credits, does not answer. */
|
|
87
|
-
credits: IReflexServiceCredits | null;
|
|
88
|
-
monthlySpendCap: IReflexServiceMonthlySpendCap;
|
|
89
|
-
alerts: IReflexServiceAlerts;
|
|
90
|
-
/** Null when nothing stops the Service there. */
|
|
91
|
-
block: IReflexServiceBlock | null;
|
|
92
|
-
}
|
|
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
|
+
/** The credits of the month of a whole organization: billing data, only for a member who may read the billing. */
|
|
29
|
+
export interface IReflexOrganizationCredits {
|
|
30
|
+
/**
|
|
31
|
+
* The credits the plan of the organization includes this month (effective limit, packs included), in
|
|
32
|
+
* millicredits: the same threshold that stops the Services. `null` for an unlimited plan.
|
|
33
|
+
*/
|
|
34
|
+
includedMillicredits: number | null;
|
|
35
|
+
/**
|
|
36
|
+
* What all the Services of the organization consumed this month, in millicredits: what abyss-main holds plus what
|
|
37
|
+
* the Reflex report has not declared yet. The stop compares this total to `includedMillicredits`.
|
|
38
|
+
*/
|
|
39
|
+
consumedMillicredits: number;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Credits of the month a Service consumed, and its overage setting. */
|
|
43
|
+
export interface IReflexServiceCredits {
|
|
44
|
+
/** `YYYY-MM`. */
|
|
45
|
+
month: string;
|
|
46
|
+
consumedMillicredits: number;
|
|
47
|
+
/**
|
|
48
|
+
* The credits of the whole organization. `null` when the reader may not see the billing of the organization
|
|
49
|
+
* (no `ORG_BILLING_READ`), or when abyss-main cannot say whether they may.
|
|
50
|
+
*/
|
|
51
|
+
organizationCredits: IReflexOrganizationCredits | null;
|
|
52
|
+
/** True when the Service bills overage past the credits of the organization. */
|
|
53
|
+
overageEnabled: boolean;
|
|
54
|
+
/** True when the organization allows overage of the credits metric at all. */
|
|
55
|
+
overageAllowedByOrganization: boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Alert settings of one limit of a Service. */
|
|
59
|
+
export interface IReflexServiceAlertSettings {
|
|
60
|
+
/** Percent values, at most 5, each from 1 to 100. */
|
|
61
|
+
thresholds: number[];
|
|
62
|
+
email: boolean;
|
|
63
|
+
inApp: boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Alert settings of a Service in one environment. */
|
|
67
|
+
export interface IReflexServiceAlerts {
|
|
68
|
+
monthlySpendCap: IReflexServiceAlertSettings;
|
|
69
|
+
/** The event rate of a bot; absent for any other type of Service. */
|
|
70
|
+
rate?: IReflexServiceAlertSettings;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** What stops a Service in one environment, by its limits. */
|
|
74
|
+
export interface IReflexServiceBlock {
|
|
75
|
+
/**
|
|
76
|
+
* `CREDITS_EXHAUSTED` stops a bot entirely, and every route and task of an HTTP Service. `BUDGET_REACHED` stops
|
|
77
|
+
* every route and task of an HTTP Service; for a bot, only its events stop.
|
|
78
|
+
*/
|
|
79
|
+
reason: ServiceBlockReason;
|
|
80
|
+
since: Date;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** The credits, the monthly spend cap, the alerts and the stop of a Service in one environment. */
|
|
84
|
+
export interface IReflexServiceEnvironmentLimits {
|
|
85
|
+
environmentId: string;
|
|
86
|
+
/** Credits of the month and the overage setting; null while abyss-main, which holds the credits, does not answer. */
|
|
87
|
+
credits: IReflexServiceCredits | null;
|
|
88
|
+
monthlySpendCap: IReflexServiceMonthlySpendCap;
|
|
89
|
+
alerts: IReflexServiceAlerts;
|
|
90
|
+
/** Null when nothing stops the Service there. */
|
|
91
|
+
block: IReflexServiceBlock | null;
|
|
92
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ServiceTemplateFollowUpKind,
|
|
3
|
+
ServiceTemplateId,
|
|
4
|
+
ServiceTemplateParameterKind,
|
|
5
|
+
ServiceType,
|
|
6
|
+
} from '../../enum';
|
|
7
|
+
|
|
8
|
+
/** A value the member gives when creating a Service from the template. */
|
|
9
|
+
export interface IReflexServiceTemplateParameter {
|
|
10
|
+
name: string;
|
|
11
|
+
kind: ServiceTemplateParameterKind;
|
|
12
|
+
required: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** What a template creates of one kind: how many, and their names. */
|
|
16
|
+
export interface IReflexServiceTemplateCreated {
|
|
17
|
+
count: number;
|
|
18
|
+
names: string[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* What a template creates, in one transaction. A function is named `<slug of the Service>-<name>` (a
|
|
23
|
+
* function name is unique within the application); the names listed here are the part after the slug.
|
|
24
|
+
* A route is listed as `<METHOD> /<path>`, a component by its custom-id prefix.
|
|
25
|
+
*/
|
|
26
|
+
export interface IReflexServiceTemplateCreates {
|
|
27
|
+
functions: IReflexServiceTemplateCreated;
|
|
28
|
+
routes: IReflexServiceTemplateCreated;
|
|
29
|
+
commands: IReflexServiceTemplateCreated;
|
|
30
|
+
components: IReflexServiceTemplateCreated;
|
|
31
|
+
events: IReflexServiceTemplateCreated;
|
|
32
|
+
tasks: IReflexServiceTemplateCreated;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** One thing left to do after creation; `key` names the value for CONFIG_VALUE and SECRET_VALUE. */
|
|
36
|
+
export interface IReflexServiceTemplateFollowUp {
|
|
37
|
+
kind: ServiceTemplateFollowUpKind;
|
|
38
|
+
key?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** A starter template of a Service, without the definitions of its functions. */
|
|
42
|
+
export interface IReflexServiceTemplate {
|
|
43
|
+
id: ServiceTemplateId;
|
|
44
|
+
/** The type of Service the template creates: the Service requested must have this type. */
|
|
45
|
+
serviceType: ServiceType;
|
|
46
|
+
parameters: IReflexServiceTemplateParameter[];
|
|
47
|
+
creates: IReflexServiceTemplateCreates;
|
|
48
|
+
afterCreation: IReflexServiceTemplateFollowUp[];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** The template a Service is created from, with the value of each of its parameters. */
|
|
52
|
+
export interface IReflexServiceTemplateChoice {
|
|
53
|
+
id: ServiceTemplateId;
|
|
54
|
+
parameters: Record<string, string>;
|
|
55
|
+
}
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import type { RouteMethod, TriggerAccessMode } from '../../enum';
|
|
2
|
-
import type {
|
|
3
|
-
IReflexDiscordCommandSnapshot,
|
|
4
|
-
IReflexDiscordComponentSnapshot,
|
|
5
|
-
} from './reflex-discord.model';
|
|
6
|
-
import type { IReflexDiscordEventSnapshot } from './reflex-discord-event.model';
|
|
7
|
-
import type { IReflexRouteContract } from './reflex-route-contract.model';
|
|
8
|
-
import type { IReflexServiceCors } from './reflex-service.model';
|
|
9
|
-
import type { IReflexTaskSnapshot } from './reflex-task.model';
|
|
10
|
-
|
|
11
|
-
/** A route as a version of the Service froze it. */
|
|
12
|
-
export interface IReflexServiceVersionRoute {
|
|
13
|
-
routeId: string;
|
|
14
|
-
method: RouteMethod;
|
|
15
|
-
path: string;
|
|
16
|
-
functionId: string;
|
|
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;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** The version of a member function a version of the Service runs. */
|
|
23
|
-
export interface IReflexServiceVersionFunction {
|
|
24
|
-
functionId: string;
|
|
25
|
-
functionVersionId: string;
|
|
26
|
-
functionVersionNumber: number;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** What a version of a Discord bot freezes: its commands and components, identifiers included. */
|
|
30
|
-
export interface IReflexServiceVersionDiscord {
|
|
31
|
-
commands: IReflexDiscordCommandSnapshot[];
|
|
32
|
-
components: IReflexDiscordComponentSnapshot[];
|
|
33
|
-
/** The event triggers; absent when the bot has none, so the hash of other versions is unchanged. */
|
|
34
|
-
events?: IReflexDiscordEventSnapshot[];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* What a version of the Service freezes. Routes sorted by path then method, functions by id: the same
|
|
39
|
-
* Service always gives the same snapshot, and the same `hash`.
|
|
40
|
-
*/
|
|
41
|
-
export interface IReflexServiceVersionSnapshot {
|
|
42
|
-
routes: IReflexServiceVersionRoute[];
|
|
43
|
-
functions: IReflexServiceVersionFunction[];
|
|
44
|
-
cors: IReflexServiceCors;
|
|
45
|
-
rateLimitPerIpPerMinute: number;
|
|
46
|
-
/** Only a `DISCORD_BOT` Service has it (its `routes` are then empty); absent otherwise, so the hash of other versions is unchanged. */
|
|
47
|
-
discord?: IReflexServiceVersionDiscord;
|
|
48
|
-
/** The tasks of the Service, by name; absent when it has none, so the hash of other versions is unchanged. */
|
|
49
|
-
tasks?: IReflexTaskSnapshot[];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface IReflexServiceVersion {
|
|
53
|
-
id: string;
|
|
54
|
-
serviceId: string;
|
|
55
|
-
/** 1, 2, 3...: counted per Service. */
|
|
56
|
-
number: number;
|
|
57
|
-
/** 500 characters at most. */
|
|
58
|
-
message: string | null;
|
|
59
|
-
snapshot: IReflexServiceVersionSnapshot;
|
|
60
|
-
/** SHA-256 of the snapshot as canonical JSON (keys sorted), lowercase hex. */
|
|
61
|
-
hash: string;
|
|
62
|
-
publishedByUserId: string;
|
|
63
|
-
publishedAt: Date;
|
|
64
|
-
}
|
|
1
|
+
import type { RouteMethod, TriggerAccessMode } from '../../enum';
|
|
2
|
+
import type {
|
|
3
|
+
IReflexDiscordCommandSnapshot,
|
|
4
|
+
IReflexDiscordComponentSnapshot,
|
|
5
|
+
} from './reflex-discord.model';
|
|
6
|
+
import type { IReflexDiscordEventSnapshot } from './reflex-discord-event.model';
|
|
7
|
+
import type { IReflexRouteContract } from './reflex-route-contract.model';
|
|
8
|
+
import type { IReflexServiceCors } from './reflex-service.model';
|
|
9
|
+
import type { IReflexTaskSnapshot } from './reflex-task.model';
|
|
10
|
+
|
|
11
|
+
/** A route as a version of the Service froze it. */
|
|
12
|
+
export interface IReflexServiceVersionRoute {
|
|
13
|
+
routeId: string;
|
|
14
|
+
method: RouteMethod;
|
|
15
|
+
path: string;
|
|
16
|
+
functionId: string;
|
|
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;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** The version of a member function a version of the Service runs. */
|
|
23
|
+
export interface IReflexServiceVersionFunction {
|
|
24
|
+
functionId: string;
|
|
25
|
+
functionVersionId: string;
|
|
26
|
+
functionVersionNumber: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** What a version of a Discord bot freezes: its commands and components, identifiers included. */
|
|
30
|
+
export interface IReflexServiceVersionDiscord {
|
|
31
|
+
commands: IReflexDiscordCommandSnapshot[];
|
|
32
|
+
components: IReflexDiscordComponentSnapshot[];
|
|
33
|
+
/** The event triggers; absent when the bot has none, so the hash of other versions is unchanged. */
|
|
34
|
+
events?: IReflexDiscordEventSnapshot[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* What a version of the Service freezes. Routes sorted by path then method, functions by id: the same
|
|
39
|
+
* Service always gives the same snapshot, and the same `hash`.
|
|
40
|
+
*/
|
|
41
|
+
export interface IReflexServiceVersionSnapshot {
|
|
42
|
+
routes: IReflexServiceVersionRoute[];
|
|
43
|
+
functions: IReflexServiceVersionFunction[];
|
|
44
|
+
cors: IReflexServiceCors;
|
|
45
|
+
rateLimitPerIpPerMinute: number;
|
|
46
|
+
/** Only a `DISCORD_BOT` Service has it (its `routes` are then empty); absent otherwise, so the hash of other versions is unchanged. */
|
|
47
|
+
discord?: IReflexServiceVersionDiscord;
|
|
48
|
+
/** The tasks of the Service, by name; absent when it has none, so the hash of other versions is unchanged. */
|
|
49
|
+
tasks?: IReflexTaskSnapshot[];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface IReflexServiceVersion {
|
|
53
|
+
id: string;
|
|
54
|
+
serviceId: string;
|
|
55
|
+
/** 1, 2, 3...: counted per Service. */
|
|
56
|
+
number: number;
|
|
57
|
+
/** 500 characters at most. */
|
|
58
|
+
message: string | null;
|
|
59
|
+
snapshot: IReflexServiceVersionSnapshot;
|
|
60
|
+
/** SHA-256 of the snapshot as canonical JSON (keys sorted), lowercase hex. */
|
|
61
|
+
hash: string;
|
|
62
|
+
publishedByUserId: string;
|
|
63
|
+
publishedAt: Date;
|
|
64
|
+
}
|
|
@@ -1,45 +1,47 @@
|
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
+
/** How many versions of the Service the purge keeps, `REFLEX_VERSIONS_KEPT.min` to `REFLEX_VERSIONS_KEPT.max`. */
|
|
42
|
+
versionsKept: number;
|
|
43
|
+
createdByUserId: string;
|
|
44
|
+
updatedByUserId: string;
|
|
45
|
+
createdAt: Date;
|
|
46
|
+
updatedAt: Date;
|
|
47
|
+
}
|