@abyss-project/reflex 6.6.0 → 6.9.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/api/function-run.api.d.ts +1 -2
- package/dist/api/function-run.api.js +1 -3
- package/dist/api/function-run.api.js.map +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/reflex-admin.admin.api.d.ts +5 -0
- package/dist/api/reflex-admin.admin.api.js +18 -0
- package/dist/api/reflex-admin.admin.api.js.map +1 -0
- package/dist/discord/discord-event-filter-cases.js +11 -27
- package/dist/discord/discord-event-filter-cases.js.map +1 -1
- package/dist/discord/discord-event-filters.js +3 -7
- package/dist/discord/discord-event-filters.js.map +1 -1
- package/dist/discord/discord-event-intents.d.ts +2 -8
- package/dist/discord/discord-event-intents.js +2 -13
- package/dist/discord/discord-event-intents.js.map +1 -1
- package/dist/discord/index.d.ts +0 -1
- package/dist/discord/index.js +0 -1
- package/dist/discord/index.js.map +1 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/types/enum/discord-event-type.enum.d.ts +1 -3
- package/dist/types/enum/discord-event-type.enum.js +0 -2
- package/dist/types/enum/discord-event-type.enum.js.map +1 -1
- package/dist/types/enum/index.d.ts +2 -2
- package/dist/types/enum/index.js +2 -2
- package/dist/types/enum/index.js.map +1 -1
- package/dist/types/enum/reflex-abuse-rule.enum.d.ts +5 -0
- package/dist/types/enum/reflex-abuse-rule.enum.js +10 -0
- package/dist/types/enum/reflex-abuse-rule.enum.js.map +1 -0
- package/dist/types/enum/reflex-admin-hold-kind.enum.d.ts +4 -0
- package/dist/types/enum/reflex-admin-hold-kind.enum.js +9 -0
- package/dist/types/enum/reflex-admin-hold-kind.enum.js.map +1 -0
- package/dist/types/enum/reflex-error-code.enum.d.ts +3 -11
- package/dist/types/enum/reflex-error-code.enum.js +2 -10
- package/dist/types/enum/reflex-error-code.enum.js.map +1 -1
- package/dist/types/interface/api/requests/function-run.request.d.ts +0 -8
- package/dist/types/interface/api/requests/index.d.ts +1 -0
- package/dist/types/interface/api/requests/index.js +1 -0
- package/dist/types/interface/api/requests/index.js.map +1 -1
- package/dist/types/interface/api/requests/reflex-admin.admin.request.d.ts +21 -0
- package/dist/types/interface/api/requests/reflex-admin.admin.request.js +3 -0
- package/dist/types/interface/api/requests/reflex-admin.admin.request.js.map +1 -0
- package/dist/types/interface/api/requests/service-discord.request.d.ts +3 -7
- package/dist/types/interface/api/responses/function-run.response.d.ts +0 -8
- package/dist/types/interface/api/responses/index.d.ts +1 -0
- package/dist/types/interface/api/responses/index.js +1 -0
- package/dist/types/interface/api/responses/index.js.map +1 -1
- package/dist/types/interface/api/responses/reflex-admin.admin.response.d.ts +19 -0
- package/dist/types/interface/api/responses/reflex-admin.admin.response.js +3 -0
- package/dist/types/interface/api/responses/reflex-admin.admin.response.js.map +1 -0
- package/dist/types/interface/models/index.d.ts +1 -0
- package/dist/types/interface/models/index.js +1 -0
- package/dist/types/interface/models/index.js.map +1 -1
- package/dist/types/interface/models/reflex-admin-hold.model.d.ts +44 -0
- package/dist/types/interface/models/reflex-admin-hold.model.js +11 -0
- package/dist/types/interface/models/reflex-admin-hold.model.js.map +1 -0
- package/dist/types/interface/models/reflex-discord.model.d.ts +2 -18
- package/dist/types/interface/models/reflex-discord.model.js +0 -4
- package/dist/types/interface/models/reflex-discord.model.js.map +1 -1
- package/dist/types/interface/models/reflex-run.model.d.ts +0 -4
- package/dist/types/interface/models/reflex-run.model.js +1 -4
- package/dist/types/interface/models/reflex-run.model.js.map +1 -1
- package/dist/types/interface/models/reflex-service-deployment.model.d.ts +2 -1
- package/dist/types/interface/models/reflex-service.model.d.ts +2 -0
- package/dist/types/interface/models/reflex-service.model.js.map +1 -1
- 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.ts +30 -30
- 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 -72
- 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.ts +62 -62
- package/src/api/health.api.ts +10 -10
- package/src/api/index.ts +1 -0
- package/src/api/reflex-admin.admin.api.test.ts +52 -0
- package/src/api/reflex-admin.admin.api.ts +53 -0
- 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 +74 -74
- 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.ts +55 -55
- package/src/discord/discord-event-filter-cases.ts +261 -299
- package/src/discord/discord-event-filters.test.ts +91 -120
- package/src/discord/discord-event-filters.ts +95 -103
- package/src/discord/discord-event-intents.test.ts +112 -139
- package/src/discord/discord-event-intents.ts +55 -80
- package/src/discord/index.ts +3 -4
- package/src/index.test.ts +104 -104
- package/src/index.ts +26 -2
- 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 -11
- 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 +53 -53
- 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-abuse-rule.enum.ts +9 -0
- package/src/types/enum/reflex-admin-hold-kind.enum.ts +7 -0
- package/src/types/enum/reflex-error-code.enum.ts +7 -23
- 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-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/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/function-access.request.ts +51 -51
- package/src/types/interface/api/requests/function-run.request.ts +0 -11
- 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 +1 -0
- package/src/types/interface/api/requests/reflex-admin.admin.request.ts +26 -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 -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 -168
- 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-version.request.ts +24 -24
- 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/function-access.response.ts +45 -45
- package/src/types/interface/api/responses/function-run.response.ts +0 -12
- 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 +1 -0
- package/src/types/interface/api/responses/reflex-admin.admin.response.ts +25 -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 -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 +31 -31
- package/src/types/interface/api/responses/service-task.response.ts +57 -57
- 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/health.response.ts +7 -7
- package/src/types/interface/index.ts +3 -3
- package/src/types/interface/models/index.ts +1 -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-admin-hold.model.ts +55 -0
- 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-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 -249
- 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.model.ts +0 -8
- package/src/types/interface/models/reflex-service-deployment.model.ts +51 -48
- package/src/types/interface/models/reflex-service.model.ts +50 -47
- package/src/types/interface/models/reflex-step-stats.model.ts +35 -35
- package/src/types/interface/models/reflex-task.model.ts +97 -97
- package/tsconfig.check.json +15 -15
- package/tsconfig.json +35 -35
- package/dist/discord/discord-command-tree.d.ts +0 -5
- package/dist/discord/discord-command-tree.js +0 -38
- package/dist/discord/discord-command-tree.js.map +0 -1
- package/dist/types/enum/discord-command-node-type.enum.d.ts +0 -5
- package/dist/types/enum/discord-command-node-type.enum.js +0 -10
- package/dist/types/enum/discord-command-node-type.enum.js.map +0 -1
- package/dist/types/enum/discord-command-type.enum.d.ts +0 -5
- package/dist/types/enum/discord-command-type.enum.js +0 -10
- package/dist/types/enum/discord-command-type.enum.js.map +0 -1
- package/src/discord/discord-command-tree.test.ts +0 -47
- package/src/discord/discord-command-tree.ts +0 -60
- package/src/types/enum/discord-command-node-type.enum.ts +0 -10
- package/src/types/enum/discord-command-type.enum.ts +0 -9
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import type { IReflexDefinition } from './reflex-definition.model';
|
|
2
|
-
|
|
3
|
-
export interface IReflexFunctionVersion {
|
|
4
|
-
id: string;
|
|
5
|
-
functionId: string;
|
|
6
|
-
/** 1, 2, 3...: counted per function. */
|
|
7
|
-
number: number;
|
|
8
|
-
/** The frozen definition. */
|
|
9
|
-
definition: IReflexDefinition;
|
|
10
|
-
/** SHA-256 of the definition, lowercase hex. */
|
|
11
|
-
hash: string;
|
|
12
|
-
publishedByUserId: string;
|
|
13
|
-
publishedAt: Date;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/** A row of the version list: the version and whether a Service version running it was ever put in service. */
|
|
17
|
-
export interface IReflexFunctionVersionRow extends IReflexFunctionVersion {
|
|
18
|
-
deployed: boolean;
|
|
19
|
-
}
|
|
1
|
+
import type { IReflexDefinition } from './reflex-definition.model';
|
|
2
|
+
|
|
3
|
+
export interface IReflexFunctionVersion {
|
|
4
|
+
id: string;
|
|
5
|
+
functionId: string;
|
|
6
|
+
/** 1, 2, 3...: counted per function. */
|
|
7
|
+
number: number;
|
|
8
|
+
/** The frozen definition. */
|
|
9
|
+
definition: IReflexDefinition;
|
|
10
|
+
/** SHA-256 of the definition, lowercase hex. */
|
|
11
|
+
hash: string;
|
|
12
|
+
publishedByUserId: string;
|
|
13
|
+
publishedAt: Date;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** A row of the version list: the version and whether a Service version running it was ever put in service. */
|
|
17
|
+
export interface IReflexFunctionVersionRow extends IReflexFunctionVersion {
|
|
18
|
+
deployed: boolean;
|
|
19
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import type { IReflexDefinition } from './reflex-definition.model';
|
|
2
|
-
|
|
3
|
-
export interface IReflexFunction {
|
|
4
|
-
id: string;
|
|
5
|
-
applicationId: string;
|
|
6
|
-
/** The Service the function belongs to; deleting the Service deletes it. */
|
|
7
|
-
serviceId: string;
|
|
8
|
-
projectId: string;
|
|
9
|
-
name: string;
|
|
10
|
-
/** The definition being edited; a publication freezes a copy of it. */
|
|
11
|
-
draftDefinition: IReflexDefinition;
|
|
12
|
-
/** SHA-256 of the saved draft, computed like the hash of a version (`IReflexFunctionVersion.hash`). */
|
|
13
|
-
draftHash: string;
|
|
14
|
-
/** The newest frozen version; null when none exists. */
|
|
15
|
-
latestVersion: IReflexFunctionLatestVersion | null;
|
|
16
|
-
/** The version the draft started from (set by opening a version); null otherwise. */
|
|
17
|
-
draftBaseVersionId: string | null;
|
|
18
|
-
/** Number of `draftBaseVersionId`; null when it is. */
|
|
19
|
-
draftBaseVersionNumber: number | null;
|
|
20
|
-
createdByUserId: string;
|
|
21
|
-
updatedByUserId: string;
|
|
22
|
-
createdAt: Date;
|
|
23
|
-
updatedAt: Date;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface IReflexFunctionLatestVersion {
|
|
27
|
-
id: string;
|
|
28
|
-
number: number;
|
|
29
|
-
hash: string;
|
|
30
|
-
}
|
|
1
|
+
import type { IReflexDefinition } from './reflex-definition.model';
|
|
2
|
+
|
|
3
|
+
export interface IReflexFunction {
|
|
4
|
+
id: string;
|
|
5
|
+
applicationId: string;
|
|
6
|
+
/** The Service the function belongs to; deleting the Service deletes it. */
|
|
7
|
+
serviceId: string;
|
|
8
|
+
projectId: string;
|
|
9
|
+
name: string;
|
|
10
|
+
/** The definition being edited; a publication freezes a copy of it. */
|
|
11
|
+
draftDefinition: IReflexDefinition;
|
|
12
|
+
/** SHA-256 of the saved draft, computed like the hash of a version (`IReflexFunctionVersion.hash`). */
|
|
13
|
+
draftHash: string;
|
|
14
|
+
/** The newest frozen version; null when none exists. */
|
|
15
|
+
latestVersion: IReflexFunctionLatestVersion | null;
|
|
16
|
+
/** The version the draft started from (set by opening a version); null otherwise. */
|
|
17
|
+
draftBaseVersionId: string | null;
|
|
18
|
+
/** Number of `draftBaseVersionId`; null when it is. */
|
|
19
|
+
draftBaseVersionNumber: number | null;
|
|
20
|
+
createdByUserId: string;
|
|
21
|
+
updatedByUserId: string;
|
|
22
|
+
createdAt: Date;
|
|
23
|
+
updatedAt: Date;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface IReflexFunctionLatestVersion {
|
|
27
|
+
id: string;
|
|
28
|
+
number: number;
|
|
29
|
+
hash: string;
|
|
30
|
+
}
|
|
@@ -1,215 +1,215 @@
|
|
|
1
|
-
import { InsightsPeriod } from '../../enum';
|
|
2
|
-
import type { TriggerKind } from '../../enum';
|
|
3
|
-
|
|
4
|
-
/** The width of one point of a dashboard, by period. */
|
|
5
|
-
export const REFLEX_INSIGHTS_PERIOD_STEP_SECONDS: Record<InsightsPeriod, number> = {
|
|
6
|
-
[InsightsPeriod.HOUR_1]: 60,
|
|
7
|
-
[InsightsPeriod.HOURS_24]: 300,
|
|
8
|
-
[InsightsPeriod.DAYS_7]: 3600,
|
|
9
|
-
[InsightsPeriod.DAYS_30]: 21600,
|
|
10
|
-
[InsightsPeriod.DAYS_90]: 86400,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
/** Upper bounds, in thousandths of a credit, of the cost histogram buckets; one open bucket follows (10 in all). */
|
|
14
|
-
export const REFLEX_COST_HISTOGRAM_UPPER_BOUNDS = [
|
|
15
|
-
10, 25, 50, 100, 250, 500, 1000, 2500, 5000,
|
|
16
|
-
] as const;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Upper bounds, in milliseconds, of the duration histogram buckets of the run rollups; one open bucket follows
|
|
20
|
-
* (15 in all).
|
|
21
|
-
*/
|
|
22
|
-
export const DURATION_HISTOGRAM_BOUNDS_MS = [
|
|
23
|
-
10, 25, 50, 100, 200, 300, 500, 750, 1000, 1500, 2500, 5000, 10000, 30000,
|
|
24
|
-
] as const;
|
|
25
|
-
|
|
26
|
-
/** A trigger is labeled heavy past this multiple of the median cost per run of the Service. */
|
|
27
|
-
export const REFLEX_HEAVY_TRIGGER_FACTOR = 5;
|
|
28
|
-
|
|
29
|
-
/** A value over the period and over the one just before it; `previous` is null without data before. */
|
|
30
|
-
export interface IReflexInsightsTile {
|
|
31
|
-
value: number;
|
|
32
|
-
previous: number | null;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface IReflexInsightsTiles {
|
|
36
|
-
runs: IReflexInsightsTile;
|
|
37
|
-
failed: IReflexInsightsTile;
|
|
38
|
-
cpuMs: IReflexInsightsTile;
|
|
39
|
-
heapPeakBytesMax: IReflexInsightsTile;
|
|
40
|
-
netBytes: IReflexInsightsTile;
|
|
41
|
-
costMillicredits: IReflexInsightsTile;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** One point of the series; `at` is the start of its step. */
|
|
45
|
-
export interface IReflexInsightsPoint {
|
|
46
|
-
at: Date;
|
|
47
|
-
runs: number;
|
|
48
|
-
failed: number;
|
|
49
|
-
durationMsSum: number;
|
|
50
|
-
cpuMsSum: number;
|
|
51
|
-
netInBytes: number;
|
|
52
|
-
netOutBytes: number;
|
|
53
|
-
costMillicredits: number;
|
|
54
|
-
/** Mean cost of a run, in thousandths of a credit; null when no run. */
|
|
55
|
-
costMeanMillicredits: number | null;
|
|
56
|
-
/** 95th percentile of the cost of a run: upper bound of the histogram bucket holding it; null when no run. */
|
|
57
|
-
costP95Millicredits: number | null;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/** Runs of one kind of trigger, over the period. */
|
|
61
|
-
export interface IReflexInsightsKindShare {
|
|
62
|
-
kind: TriggerKind;
|
|
63
|
-
runs: number;
|
|
64
|
-
failed: number;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** One row of the ranking of the triggers. */
|
|
68
|
-
export interface IReflexInsightsRankingRow {
|
|
69
|
-
kind: TriggerKind;
|
|
70
|
-
triggerId: string;
|
|
71
|
-
/** `/name`, `METHOD path`, a prefix or a name; null when the trigger was deleted. */
|
|
72
|
-
label: string | null;
|
|
73
|
-
runs: number;
|
|
74
|
-
failed: number;
|
|
75
|
-
costMillicreditsTotal: number;
|
|
76
|
-
costMillicreditsPerRun: number;
|
|
77
|
-
cpuMsMean: number;
|
|
78
|
-
durationMsMean: number;
|
|
79
|
-
/** Cost per run past `REFLEX_HEAVY_TRIGGER_FACTOR` times the median of the Service. */
|
|
80
|
-
heavy: boolean;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/** The dashboard of a Service or of a function. */
|
|
84
|
-
export interface IReflexInsights {
|
|
85
|
-
period: InsightsPeriod;
|
|
86
|
-
from: Date;
|
|
87
|
-
to: Date;
|
|
88
|
-
stepSeconds: number;
|
|
89
|
-
tiles: IReflexInsightsTiles;
|
|
90
|
-
series: IReflexInsightsPoint[];
|
|
91
|
-
byKind: IReflexInsightsKindShare[];
|
|
92
|
-
/** Top 10 of the triggers, by total credits; the screen sorts the rows it holds. */
|
|
93
|
-
ranking: IReflexInsightsRankingRow[];
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/** Events received by the Gateway in one step, with the reason of each one it did not keep. */
|
|
97
|
-
export interface IReflexEventInsightsPoint {
|
|
98
|
-
at: Date;
|
|
99
|
-
received: number;
|
|
100
|
-
queued: number;
|
|
101
|
-
executed: number;
|
|
102
|
-
failed: number;
|
|
103
|
-
duplicates: number;
|
|
104
|
-
filtered: number;
|
|
105
|
-
droppedRate: number;
|
|
106
|
-
droppedMonthlyCap: number;
|
|
107
|
-
droppedCredits: number;
|
|
108
|
-
expired: number;
|
|
109
|
-
/** Events rejected by each filter, by filter name. */
|
|
110
|
-
filteredBy: Record<string, number>;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/** The dashboard of the events of a bot. */
|
|
114
|
-
export interface IReflexEventInsights {
|
|
115
|
-
period: InsightsPeriod;
|
|
116
|
-
from: Date;
|
|
117
|
-
to: Date;
|
|
118
|
-
stepSeconds: number;
|
|
119
|
-
series: IReflexEventInsightsPoint[];
|
|
120
|
-
/** The rate of the bot, for the rate line. */
|
|
121
|
-
eventsPerMinute: number;
|
|
122
|
-
peakPerMinute: number;
|
|
123
|
-
minutesAtCap: number;
|
|
124
|
-
/** Credits of the month and the spend of the month against the cap. */
|
|
125
|
-
creditsMonthMillicredits: number;
|
|
126
|
-
spendCents: number;
|
|
127
|
-
monthlySpendCapCents: number;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* A percentile of a duration read on a histogram: the upper bound of the bucket holding it. `open` when it falls in
|
|
132
|
-
* the open bucket: the duration is then past `upperBoundMs` (the last bound), shown "> 30 s".
|
|
133
|
-
*/
|
|
134
|
-
export interface IReflexDurationPercentile {
|
|
135
|
-
upperBoundMs: number;
|
|
136
|
-
open: boolean;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/** The requests of a route or a Service by class of HTTP status. */
|
|
140
|
-
export interface IReflexHttpClasses {
|
|
141
|
-
http2xx: number;
|
|
142
|
-
http3xx: number;
|
|
143
|
-
http4xx: number;
|
|
144
|
-
http5xx: number;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/** One point of the short series of a route. */
|
|
148
|
-
export interface IReflexRouteStatsPoint {
|
|
149
|
-
at: Date;
|
|
150
|
-
runs: number;
|
|
151
|
-
failed: number;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/** One row of the statistics of the routes of a Service. */
|
|
155
|
-
export interface IReflexRouteStatsRow extends IReflexHttpClasses {
|
|
156
|
-
routeId: string;
|
|
157
|
-
/** `METHOD path`; null when the route was deleted. */
|
|
158
|
-
label: string | null;
|
|
159
|
-
runs: number;
|
|
160
|
-
failed: number;
|
|
161
|
-
/** Null when no run of the period has a duration in the histogram. */
|
|
162
|
-
p50: IReflexDurationPercentile | null;
|
|
163
|
-
p95: IReflexDurationPercentile | null;
|
|
164
|
-
p99: IReflexDurationPercentile | null;
|
|
165
|
-
series: IReflexRouteStatsPoint[];
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/** One point of the dashboard of a route. */
|
|
169
|
-
export interface IReflexRouteInsightsPoint extends IReflexHttpClasses {
|
|
170
|
-
at: Date;
|
|
171
|
-
runs: number;
|
|
172
|
-
failed: number;
|
|
173
|
-
p50: IReflexDurationPercentile | null;
|
|
174
|
-
p95: IReflexDurationPercentile | null;
|
|
175
|
-
p99: IReflexDurationPercentile | null;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/** The dashboard of a route. */
|
|
179
|
-
export interface IReflexRouteInsights {
|
|
180
|
-
period: InsightsPeriod;
|
|
181
|
-
from: Date;
|
|
182
|
-
to: Date;
|
|
183
|
-
stepSeconds: number;
|
|
184
|
-
series: IReflexRouteInsightsPoint[];
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/** Runs of one Service over the period. */
|
|
188
|
-
export interface IReflexApplicationServiceShare {
|
|
189
|
-
serviceId: string;
|
|
190
|
-
runs: number;
|
|
191
|
-
failed: number;
|
|
192
|
-
costMillicredits: number;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/** The overview of an application: every Service together. */
|
|
196
|
-
export interface IReflexApplicationInsights {
|
|
197
|
-
period: InsightsPeriod;
|
|
198
|
-
from: Date;
|
|
199
|
-
to: Date;
|
|
200
|
-
stepSeconds: number;
|
|
201
|
-
tiles: IReflexInsightsTiles;
|
|
202
|
-
series: IReflexInsightsPoint[];
|
|
203
|
-
byService: IReflexApplicationServiceShare[];
|
|
204
|
-
/** Top 10 of the triggers of the application, by total credits. */
|
|
205
|
-
ranking: IReflexInsightsRankingRow[];
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/** One day of the calendar of an application. */
|
|
209
|
-
export interface IReflexCalendarDay {
|
|
210
|
-
/** The day in UTC, `YYYY-MM-DD`. */
|
|
211
|
-
day: string;
|
|
212
|
-
runs: number;
|
|
213
|
-
failed: number;
|
|
214
|
-
millicredits: number;
|
|
215
|
-
}
|
|
1
|
+
import { InsightsPeriod } from '../../enum';
|
|
2
|
+
import type { TriggerKind } from '../../enum';
|
|
3
|
+
|
|
4
|
+
/** The width of one point of a dashboard, by period. */
|
|
5
|
+
export const REFLEX_INSIGHTS_PERIOD_STEP_SECONDS: Record<InsightsPeriod, number> = {
|
|
6
|
+
[InsightsPeriod.HOUR_1]: 60,
|
|
7
|
+
[InsightsPeriod.HOURS_24]: 300,
|
|
8
|
+
[InsightsPeriod.DAYS_7]: 3600,
|
|
9
|
+
[InsightsPeriod.DAYS_30]: 21600,
|
|
10
|
+
[InsightsPeriod.DAYS_90]: 86400,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/** Upper bounds, in thousandths of a credit, of the cost histogram buckets; one open bucket follows (10 in all). */
|
|
14
|
+
export const REFLEX_COST_HISTOGRAM_UPPER_BOUNDS = [
|
|
15
|
+
10, 25, 50, 100, 250, 500, 1000, 2500, 5000,
|
|
16
|
+
] as const;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Upper bounds, in milliseconds, of the duration histogram buckets of the run rollups; one open bucket follows
|
|
20
|
+
* (15 in all).
|
|
21
|
+
*/
|
|
22
|
+
export const DURATION_HISTOGRAM_BOUNDS_MS = [
|
|
23
|
+
10, 25, 50, 100, 200, 300, 500, 750, 1000, 1500, 2500, 5000, 10000, 30000,
|
|
24
|
+
] as const;
|
|
25
|
+
|
|
26
|
+
/** A trigger is labeled heavy past this multiple of the median cost per run of the Service. */
|
|
27
|
+
export const REFLEX_HEAVY_TRIGGER_FACTOR = 5;
|
|
28
|
+
|
|
29
|
+
/** A value over the period and over the one just before it; `previous` is null without data before. */
|
|
30
|
+
export interface IReflexInsightsTile {
|
|
31
|
+
value: number;
|
|
32
|
+
previous: number | null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface IReflexInsightsTiles {
|
|
36
|
+
runs: IReflexInsightsTile;
|
|
37
|
+
failed: IReflexInsightsTile;
|
|
38
|
+
cpuMs: IReflexInsightsTile;
|
|
39
|
+
heapPeakBytesMax: IReflexInsightsTile;
|
|
40
|
+
netBytes: IReflexInsightsTile;
|
|
41
|
+
costMillicredits: IReflexInsightsTile;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** One point of the series; `at` is the start of its step. */
|
|
45
|
+
export interface IReflexInsightsPoint {
|
|
46
|
+
at: Date;
|
|
47
|
+
runs: number;
|
|
48
|
+
failed: number;
|
|
49
|
+
durationMsSum: number;
|
|
50
|
+
cpuMsSum: number;
|
|
51
|
+
netInBytes: number;
|
|
52
|
+
netOutBytes: number;
|
|
53
|
+
costMillicredits: number;
|
|
54
|
+
/** Mean cost of a run, in thousandths of a credit; null when no run. */
|
|
55
|
+
costMeanMillicredits: number | null;
|
|
56
|
+
/** 95th percentile of the cost of a run: upper bound of the histogram bucket holding it; null when no run. */
|
|
57
|
+
costP95Millicredits: number | null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Runs of one kind of trigger, over the period. */
|
|
61
|
+
export interface IReflexInsightsKindShare {
|
|
62
|
+
kind: TriggerKind;
|
|
63
|
+
runs: number;
|
|
64
|
+
failed: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** One row of the ranking of the triggers. */
|
|
68
|
+
export interface IReflexInsightsRankingRow {
|
|
69
|
+
kind: TriggerKind;
|
|
70
|
+
triggerId: string;
|
|
71
|
+
/** `/name`, `METHOD path`, a prefix or a name; null when the trigger was deleted. */
|
|
72
|
+
label: string | null;
|
|
73
|
+
runs: number;
|
|
74
|
+
failed: number;
|
|
75
|
+
costMillicreditsTotal: number;
|
|
76
|
+
costMillicreditsPerRun: number;
|
|
77
|
+
cpuMsMean: number;
|
|
78
|
+
durationMsMean: number;
|
|
79
|
+
/** Cost per run past `REFLEX_HEAVY_TRIGGER_FACTOR` times the median of the Service. */
|
|
80
|
+
heavy: boolean;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** The dashboard of a Service or of a function. */
|
|
84
|
+
export interface IReflexInsights {
|
|
85
|
+
period: InsightsPeriod;
|
|
86
|
+
from: Date;
|
|
87
|
+
to: Date;
|
|
88
|
+
stepSeconds: number;
|
|
89
|
+
tiles: IReflexInsightsTiles;
|
|
90
|
+
series: IReflexInsightsPoint[];
|
|
91
|
+
byKind: IReflexInsightsKindShare[];
|
|
92
|
+
/** Top 10 of the triggers, by total credits; the screen sorts the rows it holds. */
|
|
93
|
+
ranking: IReflexInsightsRankingRow[];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Events received by the Gateway in one step, with the reason of each one it did not keep. */
|
|
97
|
+
export interface IReflexEventInsightsPoint {
|
|
98
|
+
at: Date;
|
|
99
|
+
received: number;
|
|
100
|
+
queued: number;
|
|
101
|
+
executed: number;
|
|
102
|
+
failed: number;
|
|
103
|
+
duplicates: number;
|
|
104
|
+
filtered: number;
|
|
105
|
+
droppedRate: number;
|
|
106
|
+
droppedMonthlyCap: number;
|
|
107
|
+
droppedCredits: number;
|
|
108
|
+
expired: number;
|
|
109
|
+
/** Events rejected by each filter, by filter name. */
|
|
110
|
+
filteredBy: Record<string, number>;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** The dashboard of the events of a bot. */
|
|
114
|
+
export interface IReflexEventInsights {
|
|
115
|
+
period: InsightsPeriod;
|
|
116
|
+
from: Date;
|
|
117
|
+
to: Date;
|
|
118
|
+
stepSeconds: number;
|
|
119
|
+
series: IReflexEventInsightsPoint[];
|
|
120
|
+
/** The rate of the bot, for the rate line. */
|
|
121
|
+
eventsPerMinute: number;
|
|
122
|
+
peakPerMinute: number;
|
|
123
|
+
minutesAtCap: number;
|
|
124
|
+
/** Credits of the month and the spend of the month against the cap. */
|
|
125
|
+
creditsMonthMillicredits: number;
|
|
126
|
+
spendCents: number;
|
|
127
|
+
monthlySpendCapCents: number;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* A percentile of a duration read on a histogram: the upper bound of the bucket holding it. `open` when it falls in
|
|
132
|
+
* the open bucket: the duration is then past `upperBoundMs` (the last bound), shown "> 30 s".
|
|
133
|
+
*/
|
|
134
|
+
export interface IReflexDurationPercentile {
|
|
135
|
+
upperBoundMs: number;
|
|
136
|
+
open: boolean;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** The requests of a route or a Service by class of HTTP status. */
|
|
140
|
+
export interface IReflexHttpClasses {
|
|
141
|
+
http2xx: number;
|
|
142
|
+
http3xx: number;
|
|
143
|
+
http4xx: number;
|
|
144
|
+
http5xx: number;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** One point of the short series of a route. */
|
|
148
|
+
export interface IReflexRouteStatsPoint {
|
|
149
|
+
at: Date;
|
|
150
|
+
runs: number;
|
|
151
|
+
failed: number;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** One row of the statistics of the routes of a Service. */
|
|
155
|
+
export interface IReflexRouteStatsRow extends IReflexHttpClasses {
|
|
156
|
+
routeId: string;
|
|
157
|
+
/** `METHOD path`; null when the route was deleted. */
|
|
158
|
+
label: string | null;
|
|
159
|
+
runs: number;
|
|
160
|
+
failed: number;
|
|
161
|
+
/** Null when no run of the period has a duration in the histogram. */
|
|
162
|
+
p50: IReflexDurationPercentile | null;
|
|
163
|
+
p95: IReflexDurationPercentile | null;
|
|
164
|
+
p99: IReflexDurationPercentile | null;
|
|
165
|
+
series: IReflexRouteStatsPoint[];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/** One point of the dashboard of a route. */
|
|
169
|
+
export interface IReflexRouteInsightsPoint extends IReflexHttpClasses {
|
|
170
|
+
at: Date;
|
|
171
|
+
runs: number;
|
|
172
|
+
failed: number;
|
|
173
|
+
p50: IReflexDurationPercentile | null;
|
|
174
|
+
p95: IReflexDurationPercentile | null;
|
|
175
|
+
p99: IReflexDurationPercentile | null;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** The dashboard of a route. */
|
|
179
|
+
export interface IReflexRouteInsights {
|
|
180
|
+
period: InsightsPeriod;
|
|
181
|
+
from: Date;
|
|
182
|
+
to: Date;
|
|
183
|
+
stepSeconds: number;
|
|
184
|
+
series: IReflexRouteInsightsPoint[];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** Runs of one Service over the period. */
|
|
188
|
+
export interface IReflexApplicationServiceShare {
|
|
189
|
+
serviceId: string;
|
|
190
|
+
runs: number;
|
|
191
|
+
failed: number;
|
|
192
|
+
costMillicredits: number;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** The overview of an application: every Service together. */
|
|
196
|
+
export interface IReflexApplicationInsights {
|
|
197
|
+
period: InsightsPeriod;
|
|
198
|
+
from: Date;
|
|
199
|
+
to: Date;
|
|
200
|
+
stepSeconds: number;
|
|
201
|
+
tiles: IReflexInsightsTiles;
|
|
202
|
+
series: IReflexInsightsPoint[];
|
|
203
|
+
byService: IReflexApplicationServiceShare[];
|
|
204
|
+
/** Top 10 of the triggers of the application, by total credits. */
|
|
205
|
+
ranking: IReflexInsightsRankingRow[];
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** One day of the calendar of an application. */
|
|
209
|
+
export interface IReflexCalendarDay {
|
|
210
|
+
/** The day in UTC, `YYYY-MM-DD`. */
|
|
211
|
+
day: string;
|
|
212
|
+
runs: number;
|
|
213
|
+
failed: number;
|
|
214
|
+
millicredits: number;
|
|
215
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import type { ExecutionProfile } from '../../enum';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The price list an execution is billed with (ADR-0244), served by the API from the runtime's
|
|
5
|
-
* `COST_RATES` and `RESOURCE_PROFILES`, so that a screen that estimates a cost never holds a copy of it.
|
|
6
|
-
* Prices are in millicredits (thousandths of a credit).
|
|
7
|
-
*/
|
|
8
|
-
export interface IReflexPriceList {
|
|
9
|
-
/** Once per execution; 0 for an interrupted or refused execution. */
|
|
10
|
-
executionMillicredits: number;
|
|
11
|
-
/** Once per autocomplete execution, in place of `executionMillicredits`; its CPU and memory are not billed. */
|
|
12
|
-
autocompleteExecutionMillicredits: number;
|
|
13
|
-
cpuMillicreditsPerSecond: number;
|
|
14
|
-
/** Per GB-second of the memory the profile allocates, GB = 1024 MB. */
|
|
15
|
-
memoryMillicreditsPerGbSecond: number;
|
|
16
|
-
/** Per MB sent out, MB = 1024 x 1024 bytes. */
|
|
17
|
-
networkOutMillicreditsPerMb: number;
|
|
18
|
-
httpCallMillicredits: number;
|
|
19
|
-
storeWriteMillicredits: number;
|
|
20
|
-
/** The memory of each profile, and the coefficient its CPU part is multiplied by. */
|
|
21
|
-
profiles: Record<ExecutionProfile, { memoryMb: number; cpuCoefficient: number }>;
|
|
22
|
-
}
|
|
1
|
+
import type { ExecutionProfile } from '../../enum';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The price list an execution is billed with (ADR-0244), served by the API from the runtime's
|
|
5
|
+
* `COST_RATES` and `RESOURCE_PROFILES`, so that a screen that estimates a cost never holds a copy of it.
|
|
6
|
+
* Prices are in millicredits (thousandths of a credit).
|
|
7
|
+
*/
|
|
8
|
+
export interface IReflexPriceList {
|
|
9
|
+
/** Once per execution; 0 for an interrupted or refused execution. */
|
|
10
|
+
executionMillicredits: number;
|
|
11
|
+
/** Once per autocomplete execution, in place of `executionMillicredits`; its CPU and memory are not billed. */
|
|
12
|
+
autocompleteExecutionMillicredits: number;
|
|
13
|
+
cpuMillicreditsPerSecond: number;
|
|
14
|
+
/** Per GB-second of the memory the profile allocates, GB = 1024 MB. */
|
|
15
|
+
memoryMillicreditsPerGbSecond: number;
|
|
16
|
+
/** Per MB sent out, MB = 1024 x 1024 bytes. */
|
|
17
|
+
networkOutMillicreditsPerMb: number;
|
|
18
|
+
httpCallMillicredits: number;
|
|
19
|
+
storeWriteMillicredits: number;
|
|
20
|
+
/** The memory of each profile, and the coefficient its CPU part is multiplied by. */
|
|
21
|
+
profiles: Record<ExecutionProfile, { memoryMb: number; cpuCoefficient: number }>;
|
|
22
|
+
}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A JSON Schema of the 2020-12 dialect. Only internal references (`#/$defs/...`) are accepted; `$id`,
|
|
3
|
-
* `$dynamicRef` and a `$schema` of another dialect are refused.
|
|
4
|
-
*/
|
|
5
|
-
export interface IReflexJsonSchema {
|
|
6
|
-
[keyword: string]: unknown;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* What a route accepts and answers. The edge validates `requestBody` and `query` before anything runs
|
|
11
|
-
* (`422 REQUEST_INVALID`); `responses` only document the route, and the Tester warns on a response out of them.
|
|
12
|
-
* Frozen by the version of the Service.
|
|
13
|
-
*/
|
|
14
|
-
export interface IReflexRouteContract {
|
|
15
|
-
/** The body of the request. */
|
|
16
|
-
requestBody?: IReflexJsonSchema;
|
|
17
|
-
/** The query of the request: an `object` schema whose every property is a `string` schema. */
|
|
18
|
-
query?: IReflexJsonSchema;
|
|
19
|
-
/** One schema per HTTP status, keyed `"100"` to `"599"`. */
|
|
20
|
-
responses?: Record<string, IReflexJsonSchema>;
|
|
21
|
-
/** `REFLEX_CONTRACT_LIMITS.descriptionMaxLength` characters at most. */
|
|
22
|
-
description?: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** One fault of a contract (`CONTRACT_INVALID`) or of a request against it (`REQUEST_INVALID`). */
|
|
26
|
-
export interface IReflexContractError {
|
|
27
|
-
/** JSON pointer of the fault, `/items/0/name` for example; empty for the root. */
|
|
28
|
-
path: string;
|
|
29
|
-
message: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/** Bounds of a contract, checked by the API when the route is saved. */
|
|
33
|
-
export const REFLEX_CONTRACT_LIMITS = {
|
|
34
|
-
/** Bytes of the UTF-8 JSON of the whole contract. */
|
|
35
|
-
maxBytes: 32_768,
|
|
36
|
-
/** Nesting levels of a schema. */
|
|
37
|
-
maxDepth: 32,
|
|
38
|
-
/** Characters of a `pattern`, or of a key of `patternProperties`. */
|
|
39
|
-
patternMaxLength: 256,
|
|
40
|
-
descriptionMaxLength: 500,
|
|
41
|
-
/** Faults a refusal returns, at most. */
|
|
42
|
-
maxErrors: 20,
|
|
43
|
-
/** Bounds of the keys of `responses`. */
|
|
44
|
-
statusMin: 100,
|
|
45
|
-
statusMax: 599,
|
|
46
|
-
} as const;
|
|
1
|
+
/**
|
|
2
|
+
* A JSON Schema of the 2020-12 dialect. Only internal references (`#/$defs/...`) are accepted; `$id`,
|
|
3
|
+
* `$dynamicRef` and a `$schema` of another dialect are refused.
|
|
4
|
+
*/
|
|
5
|
+
export interface IReflexJsonSchema {
|
|
6
|
+
[keyword: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* What a route accepts and answers. The edge validates `requestBody` and `query` before anything runs
|
|
11
|
+
* (`422 REQUEST_INVALID`); `responses` only document the route, and the Tester warns on a response out of them.
|
|
12
|
+
* Frozen by the version of the Service.
|
|
13
|
+
*/
|
|
14
|
+
export interface IReflexRouteContract {
|
|
15
|
+
/** The body of the request. */
|
|
16
|
+
requestBody?: IReflexJsonSchema;
|
|
17
|
+
/** The query of the request: an `object` schema whose every property is a `string` schema. */
|
|
18
|
+
query?: IReflexJsonSchema;
|
|
19
|
+
/** One schema per HTTP status, keyed `"100"` to `"599"`. */
|
|
20
|
+
responses?: Record<string, IReflexJsonSchema>;
|
|
21
|
+
/** `REFLEX_CONTRACT_LIMITS.descriptionMaxLength` characters at most. */
|
|
22
|
+
description?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** One fault of a contract (`CONTRACT_INVALID`) or of a request against it (`REQUEST_INVALID`). */
|
|
26
|
+
export interface IReflexContractError {
|
|
27
|
+
/** JSON pointer of the fault, `/items/0/name` for example; empty for the root. */
|
|
28
|
+
path: string;
|
|
29
|
+
message: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Bounds of a contract, checked by the API when the route is saved. */
|
|
33
|
+
export const REFLEX_CONTRACT_LIMITS = {
|
|
34
|
+
/** Bytes of the UTF-8 JSON of the whole contract. */
|
|
35
|
+
maxBytes: 32_768,
|
|
36
|
+
/** Nesting levels of a schema. */
|
|
37
|
+
maxDepth: 32,
|
|
38
|
+
/** Characters of a `pattern`, or of a key of `patternProperties`. */
|
|
39
|
+
patternMaxLength: 256,
|
|
40
|
+
descriptionMaxLength: 500,
|
|
41
|
+
/** Faults a refusal returns, at most. */
|
|
42
|
+
maxErrors: 20,
|
|
43
|
+
/** Bounds of the keys of `responses`. */
|
|
44
|
+
statusMin: 100,
|
|
45
|
+
statusMax: 599,
|
|
46
|
+
} as const;
|