@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,299 +1,309 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ExecutionMode,
|
|
3
|
-
ExecutionProfile,
|
|
4
|
-
LogDropCause,
|
|
5
|
-
RunLogLevel,
|
|
6
|
-
RunMode,
|
|
7
|
-
RunStatus,
|
|
8
|
-
RunStepStatus,
|
|
9
|
-
ScheduledRunOrigin,
|
|
10
|
-
TraceEffectType,
|
|
11
|
-
} from '../../enum';
|
|
12
|
-
import type { IReflexCompletionDelivery } from './reflex-completion-webhook.model';
|
|
13
|
-
import type { IReflexContractError } from './reflex-route-contract.model';
|
|
14
|
-
|
|
15
|
-
export interface IReflexTraceError {
|
|
16
|
-
code: string;
|
|
17
|
-
message: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/** Where the code of a step failed: the step and the line and column of its source. */
|
|
21
|
-
export interface IReflexRunErrorLocation {
|
|
22
|
-
stepId: string;
|
|
23
|
-
line: number;
|
|
24
|
-
column: number;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** The error of a run: where it failed (`stepId`, `line`, `column`) and the frames of the client code, when known. */
|
|
28
|
-
export interface IReflexTraceOutcomeError extends IReflexTraceError {
|
|
29
|
-
stepId?: string;
|
|
30
|
-
line?: number;
|
|
31
|
-
column?: number;
|
|
32
|
-
/** Frames of the client code only, `step:<id>:<line>:<column>`, masked. */
|
|
33
|
-
stack?: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/** The HTTP request a route received, masked. */
|
|
37
|
-
export interface IReflexTraceRequest {
|
|
38
|
-
method: string;
|
|
39
|
-
path: string;
|
|
40
|
-
query: Record<string, string | string[]>;
|
|
41
|
-
headers: Record<string, string>;
|
|
42
|
-
body: unknown;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/** What one step that succeeded returned; `outputTruncated` when the runner cut its output. */
|
|
46
|
-
export interface IReflexTraceStep {
|
|
47
|
-
stepId: string;
|
|
48
|
-
output?: unknown;
|
|
49
|
-
outputTruncated: boolean;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** Bounds of the detail a LIVE run keeps, in bytes of the UTF-8 JSON after masking (the budget is spent in this order). */
|
|
53
|
-
export const REFLEX_RUN_DETAIL_LIMITS = {
|
|
54
|
-
/** The whole detail. */
|
|
55
|
-
totalBytes: 65_536,
|
|
56
|
-
/** The error: message and stack. */
|
|
57
|
-
errorBytes: 4_096,
|
|
58
|
-
/** The request without its body: method, path, query, headers. */
|
|
59
|
-
requestMetaBytes: 8_192,
|
|
60
|
-
/** The body of the request, or the input of the run. */
|
|
61
|
-
requestBodyBytes: 16_384,
|
|
62
|
-
/** The response, or the output of the run. */
|
|
63
|
-
responseBytes: 16_384,
|
|
64
|
-
/** One step output or one effect, until the rest of the budget is spent. */
|
|
65
|
-
entryBytes: 4_096,
|
|
66
|
-
} as const;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* One call the run made to the host, in the order they were served. `recorded` is true when the effect
|
|
70
|
-
* was recorded instead of executed (a stubbed HTTP call, a Store write kept aside, a wait not waited).
|
|
71
|
-
*/
|
|
72
|
-
export interface IReflexTraceEntry {
|
|
73
|
-
stepId: string;
|
|
74
|
-
type: TraceEffectType;
|
|
75
|
-
/** The host action, for a HOST effect. */
|
|
76
|
-
action?: string;
|
|
77
|
-
request?: unknown;
|
|
78
|
-
response?: unknown;
|
|
79
|
-
error?: IReflexTraceError;
|
|
80
|
-
recorded: boolean;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/** What the RESPOND step (or `abyss.respond`) built: the response the caller of the route would get. */
|
|
84
|
-
export interface IReflexTraceResponse {
|
|
85
|
-
status: number;
|
|
86
|
-
headers: Record<string, string>;
|
|
87
|
-
body: unknown;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Bounded: past 100 entries, or a value of more than 4 KB, the trace is cut and says so (`truncated`); a LIVE run
|
|
92
|
-
* keeps at most `REFLEX_RUN_DETAIL_LIMITS.totalBytes`. Every secret value the run was given or read is masked (`***`).
|
|
93
|
-
*/
|
|
94
|
-
export interface IReflexRunTrace {
|
|
95
|
-
/** The HTTP request, for a run a route started. */
|
|
96
|
-
request?: IReflexTraceRequest;
|
|
97
|
-
/** The payload the function received, for a run a command, a component, a task, a delayed run or an event started. */
|
|
98
|
-
input?: unknown;
|
|
99
|
-
/** The faults of the request against the contract of its route, for a REFUSED run; absent otherwise. */
|
|
100
|
-
requestErrors?: IReflexContractError[];
|
|
101
|
-
entries: IReflexTraceEntry[];
|
|
102
|
-
/** The output of each step that succeeded, in order. */
|
|
103
|
-
steps?: IReflexTraceStep[];
|
|
104
|
-
outcome: {
|
|
105
|
-
status: RunStatus;
|
|
106
|
-
output?: unknown;
|
|
107
|
-
error?: IReflexTraceOutcomeError;
|
|
108
|
-
};
|
|
109
|
-
response?: IReflexTraceResponse;
|
|
110
|
-
truncated: boolean;
|
|
111
|
-
/** Paths of the fields that were cut, for example `request.body` or `entries[3].response`. */
|
|
112
|
-
truncatedFields: string[];
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export interface IReflexRun {
|
|
116
|
-
id: string;
|
|
117
|
-
functionId: string;
|
|
118
|
-
versionId: string | null;
|
|
119
|
-
/**
|
|
120
|
-
* The environment the run took place in: the promoted version's for a LIVE run, the one named in the
|
|
121
|
-
* request for a test run. Null only for a test run recorded before test runs named an environment.
|
|
122
|
-
*/
|
|
123
|
-
environmentId: string | null;
|
|
124
|
-
mode: RunMode;
|
|
125
|
-
status: RunStatus;
|
|
126
|
-
durationMs: number;
|
|
127
|
-
/** The effects of a test run; null for a LIVE run, which records no trace (nothing of the caller is kept). */
|
|
128
|
-
trace: IReflexRunTrace | null;
|
|
129
|
-
/** The route that started a LIVE run; null for a test run and for a run a Discord command or component started. */
|
|
130
|
-
routeId: string | null;
|
|
131
|
-
/** The Discord command that started a LIVE run; null otherwise. */
|
|
132
|
-
commandId: string | null;
|
|
133
|
-
/** The Discord component that started a LIVE run; null otherwise. */
|
|
134
|
-
componentId: string | null;
|
|
135
|
-
/** The task that started a LIVE run, by a tick of its cron or a delayed run; null otherwise. */
|
|
136
|
-
taskId: string | null;
|
|
137
|
-
/** The event trigger that started a LIVE run; null otherwise. */
|
|
138
|
-
eventTriggerId: string | null;
|
|
139
|
-
/**
|
|
140
|
-
* Monitor trace id of the run (32 hex characters; for an event, the id of its inbox row without dashes, the same
|
|
141
|
-
* at every attempt); null when the run was not sent to Monitor (non-bot Service, HTTP route).
|
|
142
|
-
*/
|
|
143
|
-
traceId: string | null;
|
|
144
|
-
/** How the task started the run: RECURRING for a tick of its cron, DELAYED for a delayed run; null when no task did. */
|
|
145
|
-
scheduledRunOrigin: ScheduledRunOrigin | null;
|
|
146
|
-
/**
|
|
147
|
-
* What started the run, for a screen: `METHOD path` for a route, `/name` for a command, the custom id
|
|
148
|
-
* prefix for a component, the name for a task or an event trigger. Null for a test run, and when the route, command,
|
|
149
|
-
* component, task or event trigger was deleted.
|
|
150
|
-
*/
|
|
151
|
-
originLabel: string | null;
|
|
152
|
-
/** The HTTP status the caller of a LIVE run got; null for a test run. */
|
|
153
|
-
httpStatus: number | null;
|
|
154
|
-
/**
|
|
155
|
-
* The code of the error a failed LIVE run answered (FUNCTION_FAILED, FUNCTION_TIMEOUT, RUNNER_UNAVAILABLE,
|
|
156
|
-
* RUNNER_SATURATED, INTERNAL_ERROR), or REQUEST_INVALID for a REFUSED one; null otherwise, an interrupted run included.
|
|
157
|
-
*/
|
|
158
|
-
errorCode: string | null;
|
|
159
|
-
/** The message of the error of a failed run, masked, 2048 characters at most; null when none was kept. */
|
|
160
|
-
errorMessage: string | null;
|
|
161
|
-
/** Where the code of a step failed; null when the error is not one of client code, or none was kept. */
|
|
162
|
-
errorLocation: IReflexRunErrorLocation | null;
|
|
163
|
-
/** The browser session (Monitor RUM) that sent the request; null when none. */
|
|
164
|
-
rumSessionId: string | null;
|
|
165
|
-
/** Whether the application sends its runs to Monitor. */
|
|
166
|
-
monitorActivated: boolean;
|
|
167
|
-
/** The execution mode of the function when a LIVE run started; null for a test run. */
|
|
168
|
-
executionMode: ExecutionMode | null;
|
|
169
|
-
/** When the caller of a LIVE run got its answer; null for a test run, or before any answer. */
|
|
170
|
-
responseSentAt: Date | null;
|
|
171
|
-
/**
|
|
172
|
-
* What the run consumed and cost: measured by the runner for a live run and for a test run (with the
|
|
173
|
-
* function's effective settings in the run's environment, and the network of its stubs); null for a running execution, or a run
|
|
174
|
-
* recorded before the measures.
|
|
175
|
-
*/
|
|
176
|
-
metrics: IReflexRunMetrics | null;
|
|
177
|
-
/** The consumer whose key called the route; null for a test run, and for a run no `API_KEY` route started. */
|
|
178
|
-
consumer: IReflexRunConsumer | null;
|
|
179
|
-
/** The faults of the request against the contract of its route, for a REFUSED run; absent otherwise. */
|
|
180
|
-
requestErrors?: IReflexContractError[];
|
|
181
|
-
/** The answer the function built, for an async LIVE run that finished; absent otherwise. */
|
|
182
|
-
completion?: IReflexExecutionCompletion;
|
|
183
|
-
/** The completion webhook of an async LIVE run, with its attempts; absent when none was due. */
|
|
184
|
-
delivery?: IReflexCompletionDelivery;
|
|
185
|
-
createdByUserId: string | null;
|
|
186
|
-
createdAt: Date;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
*/
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
1
|
+
import type {
|
|
2
|
+
ExecutionMode,
|
|
3
|
+
ExecutionProfile,
|
|
4
|
+
LogDropCause,
|
|
5
|
+
RunLogLevel,
|
|
6
|
+
RunMode,
|
|
7
|
+
RunStatus,
|
|
8
|
+
RunStepStatus,
|
|
9
|
+
ScheduledRunOrigin,
|
|
10
|
+
TraceEffectType,
|
|
11
|
+
} from '../../enum';
|
|
12
|
+
import type { IReflexCompletionDelivery } from './reflex-completion-webhook.model';
|
|
13
|
+
import type { IReflexContractError } from './reflex-route-contract.model';
|
|
14
|
+
|
|
15
|
+
export interface IReflexTraceError {
|
|
16
|
+
code: string;
|
|
17
|
+
message: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Where the code of a step failed: the step and the line and column of its source. */
|
|
21
|
+
export interface IReflexRunErrorLocation {
|
|
22
|
+
stepId: string;
|
|
23
|
+
line: number;
|
|
24
|
+
column: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** The error of a run: where it failed (`stepId`, `line`, `column`) and the frames of the client code, when known. */
|
|
28
|
+
export interface IReflexTraceOutcomeError extends IReflexTraceError {
|
|
29
|
+
stepId?: string;
|
|
30
|
+
line?: number;
|
|
31
|
+
column?: number;
|
|
32
|
+
/** Frames of the client code only, `step:<id>:<line>:<column>`, masked. */
|
|
33
|
+
stack?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** The HTTP request a route received, masked. */
|
|
37
|
+
export interface IReflexTraceRequest {
|
|
38
|
+
method: string;
|
|
39
|
+
path: string;
|
|
40
|
+
query: Record<string, string | string[]>;
|
|
41
|
+
headers: Record<string, string>;
|
|
42
|
+
body: unknown;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** What one step that succeeded returned; `outputTruncated` when the runner cut its output. */
|
|
46
|
+
export interface IReflexTraceStep {
|
|
47
|
+
stepId: string;
|
|
48
|
+
output?: unknown;
|
|
49
|
+
outputTruncated: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Bounds of the detail a LIVE run keeps, in bytes of the UTF-8 JSON after masking (the budget is spent in this order). */
|
|
53
|
+
export const REFLEX_RUN_DETAIL_LIMITS = {
|
|
54
|
+
/** The whole detail. */
|
|
55
|
+
totalBytes: 65_536,
|
|
56
|
+
/** The error: message and stack. */
|
|
57
|
+
errorBytes: 4_096,
|
|
58
|
+
/** The request without its body: method, path, query, headers. */
|
|
59
|
+
requestMetaBytes: 8_192,
|
|
60
|
+
/** The body of the request, or the input of the run. */
|
|
61
|
+
requestBodyBytes: 16_384,
|
|
62
|
+
/** The response, or the output of the run. */
|
|
63
|
+
responseBytes: 16_384,
|
|
64
|
+
/** One step output or one effect, until the rest of the budget is spent. */
|
|
65
|
+
entryBytes: 4_096,
|
|
66
|
+
} as const;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* One call the run made to the host, in the order they were served. `recorded` is true when the effect
|
|
70
|
+
* was recorded instead of executed (a stubbed HTTP call, a Store write kept aside, a wait not waited).
|
|
71
|
+
*/
|
|
72
|
+
export interface IReflexTraceEntry {
|
|
73
|
+
stepId: string;
|
|
74
|
+
type: TraceEffectType;
|
|
75
|
+
/** The host action, for a HOST effect. */
|
|
76
|
+
action?: string;
|
|
77
|
+
request?: unknown;
|
|
78
|
+
response?: unknown;
|
|
79
|
+
error?: IReflexTraceError;
|
|
80
|
+
recorded: boolean;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** What the RESPOND step (or `abyss.respond`) built: the response the caller of the route would get. */
|
|
84
|
+
export interface IReflexTraceResponse {
|
|
85
|
+
status: number;
|
|
86
|
+
headers: Record<string, string>;
|
|
87
|
+
body: unknown;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Bounded: past 100 entries, or a value of more than 4 KB, the trace is cut and says so (`truncated`); a LIVE run
|
|
92
|
+
* keeps at most `REFLEX_RUN_DETAIL_LIMITS.totalBytes`. Every secret value the run was given or read is masked (`***`).
|
|
93
|
+
*/
|
|
94
|
+
export interface IReflexRunTrace {
|
|
95
|
+
/** The HTTP request, for a run a route started. */
|
|
96
|
+
request?: IReflexTraceRequest;
|
|
97
|
+
/** The payload the function received, for a run a command, a component, a task, a delayed run or an event started. */
|
|
98
|
+
input?: unknown;
|
|
99
|
+
/** The faults of the request against the contract of its route, for a REFUSED run; absent otherwise. */
|
|
100
|
+
requestErrors?: IReflexContractError[];
|
|
101
|
+
entries: IReflexTraceEntry[];
|
|
102
|
+
/** The output of each step that succeeded, in order. */
|
|
103
|
+
steps?: IReflexTraceStep[];
|
|
104
|
+
outcome: {
|
|
105
|
+
status: RunStatus;
|
|
106
|
+
output?: unknown;
|
|
107
|
+
error?: IReflexTraceOutcomeError;
|
|
108
|
+
};
|
|
109
|
+
response?: IReflexTraceResponse;
|
|
110
|
+
truncated: boolean;
|
|
111
|
+
/** Paths of the fields that were cut, for example `request.body` or `entries[3].response`. */
|
|
112
|
+
truncatedFields: string[];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface IReflexRun {
|
|
116
|
+
id: string;
|
|
117
|
+
functionId: string;
|
|
118
|
+
versionId: string | null;
|
|
119
|
+
/**
|
|
120
|
+
* The environment the run took place in: the promoted version's for a LIVE run, the one named in the
|
|
121
|
+
* request for a test run. Null only for a test run recorded before test runs named an environment.
|
|
122
|
+
*/
|
|
123
|
+
environmentId: string | null;
|
|
124
|
+
mode: RunMode;
|
|
125
|
+
status: RunStatus;
|
|
126
|
+
durationMs: number;
|
|
127
|
+
/** The effects of a test run; null for a LIVE run, which records no trace (nothing of the caller is kept). */
|
|
128
|
+
trace: IReflexRunTrace | null;
|
|
129
|
+
/** The route that started a LIVE run; null for a test run and for a run a Discord command or component started. */
|
|
130
|
+
routeId: string | null;
|
|
131
|
+
/** The Discord command that started a LIVE run; null otherwise. */
|
|
132
|
+
commandId: string | null;
|
|
133
|
+
/** The Discord component that started a LIVE run; null otherwise. */
|
|
134
|
+
componentId: string | null;
|
|
135
|
+
/** The task that started a LIVE run, by a tick of its cron or a delayed run; null otherwise. */
|
|
136
|
+
taskId: string | null;
|
|
137
|
+
/** The event trigger that started a LIVE run; null otherwise. */
|
|
138
|
+
eventTriggerId: string | null;
|
|
139
|
+
/**
|
|
140
|
+
* Monitor trace id of the run (32 hex characters; for an event, the id of its inbox row without dashes, the same
|
|
141
|
+
* at every attempt); null when the run was not sent to Monitor (non-bot Service, HTTP route).
|
|
142
|
+
*/
|
|
143
|
+
traceId: string | null;
|
|
144
|
+
/** How the task started the run: RECURRING for a tick of its cron, DELAYED for a delayed run; null when no task did. */
|
|
145
|
+
scheduledRunOrigin: ScheduledRunOrigin | null;
|
|
146
|
+
/**
|
|
147
|
+
* What started the run, for a screen: `METHOD path` for a route, `/name` for a command, the custom id
|
|
148
|
+
* prefix for a component, the name for a task or an event trigger. Null for a test run, and when the route, command,
|
|
149
|
+
* component, task or event trigger was deleted.
|
|
150
|
+
*/
|
|
151
|
+
originLabel: string | null;
|
|
152
|
+
/** The HTTP status the caller of a LIVE run got; null for a test run. */
|
|
153
|
+
httpStatus: number | null;
|
|
154
|
+
/**
|
|
155
|
+
* The code of the error a failed LIVE run answered (FUNCTION_FAILED, FUNCTION_TIMEOUT, RUNNER_UNAVAILABLE,
|
|
156
|
+
* RUNNER_SATURATED, INTERNAL_ERROR), or REQUEST_INVALID for a REFUSED one; null otherwise, an interrupted run included.
|
|
157
|
+
*/
|
|
158
|
+
errorCode: string | null;
|
|
159
|
+
/** The message of the error of a failed run, masked, 2048 characters at most; null when none was kept. */
|
|
160
|
+
errorMessage: string | null;
|
|
161
|
+
/** Where the code of a step failed; null when the error is not one of client code, or none was kept. */
|
|
162
|
+
errorLocation: IReflexRunErrorLocation | null;
|
|
163
|
+
/** The browser session (Monitor RUM) that sent the request; null when none. */
|
|
164
|
+
rumSessionId: string | null;
|
|
165
|
+
/** Whether the application sends its runs to Monitor. */
|
|
166
|
+
monitorActivated: boolean;
|
|
167
|
+
/** The execution mode of the function when a LIVE run started; null for a test run. */
|
|
168
|
+
executionMode: ExecutionMode | null;
|
|
169
|
+
/** When the caller of a LIVE run got its answer; null for a test run, or before any answer. */
|
|
170
|
+
responseSentAt: Date | null;
|
|
171
|
+
/**
|
|
172
|
+
* What the run consumed and cost: measured by the runner for a live run and for a test run (with the
|
|
173
|
+
* function's effective settings in the run's environment, and the network of its stubs); null for a running execution, or a run
|
|
174
|
+
* recorded before the measures.
|
|
175
|
+
*/
|
|
176
|
+
metrics: IReflexRunMetrics | null;
|
|
177
|
+
/** The consumer whose key called the route; null for a test run, and for a run no `API_KEY` route started. */
|
|
178
|
+
consumer: IReflexRunConsumer | null;
|
|
179
|
+
/** The faults of the request against the contract of its route, for a REFUSED run; absent otherwise. */
|
|
180
|
+
requestErrors?: IReflexContractError[];
|
|
181
|
+
/** The answer the function built, for an async LIVE run that finished; absent otherwise. */
|
|
182
|
+
completion?: IReflexExecutionCompletion;
|
|
183
|
+
/** The completion webhook of an async LIVE run, with its attempts; absent when none was due. */
|
|
184
|
+
delivery?: IReflexCompletionDelivery;
|
|
185
|
+
createdByUserId: string | null;
|
|
186
|
+
createdAt: Date;
|
|
187
|
+
/** When the run is purged (its start plus the retention in force); null for a test run, and while no retention is known. */
|
|
188
|
+
expiresAt: string | null;
|
|
189
|
+
/** A favorite run is never purged. */
|
|
190
|
+
isFavorite: boolean;
|
|
191
|
+
/** The run was recorded while the owner's storage was cut: no detail, steps or log lines were kept. */
|
|
192
|
+
historyMinimal: boolean;
|
|
193
|
+
/** Bytes the run holds online (detail, steps, log lines); null for a test run, and for a run whose size was never computed. */
|
|
194
|
+
storedBytes: number | null;
|
|
195
|
+
/** When the detail, steps and log lines moved to the customer's archive; null while they are online. */
|
|
196
|
+
detailArchivedAt: string | null;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** The consumer of a Service that called a route, as the edge passed it to the function. */
|
|
200
|
+
export interface IReflexRunConsumer {
|
|
201
|
+
id: string;
|
|
202
|
+
name: string;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* The answer the function of an async execution built once it finished: the caller got 202 at once, this is
|
|
207
|
+
* what the completion webhook and `_executions` give it.
|
|
208
|
+
*/
|
|
209
|
+
export interface IReflexExecutionCompletion {
|
|
210
|
+
httpStatus: number;
|
|
211
|
+
/** The body of the answer; null when none, or when it was cut. */
|
|
212
|
+
output: unknown | null;
|
|
213
|
+
/** True when the output went past `REFLEX_COMPLETION_WEBHOOK_LIMITS.outputMaxBytes`. */
|
|
214
|
+
outputTruncated: boolean;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/** What a live execution consumed, and what it costs (ADR-0244). */
|
|
218
|
+
export interface IReflexRunMetrics {
|
|
219
|
+
/** The profile it ran with, and the memory that profile allocates. */
|
|
220
|
+
profile: ExecutionProfile;
|
|
221
|
+
memoryLimitMb: number;
|
|
222
|
+
/** Measured by the runner in the isolate. */
|
|
223
|
+
cpuMs: number;
|
|
224
|
+
heapPeakBytes: number;
|
|
225
|
+
/** Measured by the host: bytes sent and received by `fetch`, plus the answer sent to the caller. */
|
|
226
|
+
netOutBytes: number;
|
|
227
|
+
netInBytes: number;
|
|
228
|
+
httpCalls: number;
|
|
229
|
+
storeWrites: number;
|
|
230
|
+
/** In thousandths of a credit; 0 for an interrupted execution, which is offered. */
|
|
231
|
+
costMillicredits: number;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/** What one step of a run consumed; its cost is its share of the run's, the fixed price aside. */
|
|
235
|
+
export interface IReflexRunStep {
|
|
236
|
+
/** 0 for the first step that ran. */
|
|
237
|
+
position: number;
|
|
238
|
+
stepId: string;
|
|
239
|
+
status: RunStepStatus;
|
|
240
|
+
durationMs: number;
|
|
241
|
+
cpuMs: number;
|
|
242
|
+
heapPeakBytes: number;
|
|
243
|
+
netOutBytes: number;
|
|
244
|
+
netInBytes: number;
|
|
245
|
+
httpCalls: number;
|
|
246
|
+
storeWrites: number;
|
|
247
|
+
costMillicredits: number;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* One log line a run wrote: a LOG step, `abyss.log.*` or `console.*`. Secrets masked (`***`); a message
|
|
252
|
+
* is cut at 2048 characters, and data whose JSON is longer becomes `{ truncated: true, preview }`. The lines
|
|
253
|
+
* past the cap in force or the technical bound are not kept; `IReflexRunDetail.droppedLogLines` counts them.
|
|
254
|
+
*/
|
|
255
|
+
export interface IReflexRunLog {
|
|
256
|
+
/** 0 for the first line. */
|
|
257
|
+
position: number;
|
|
258
|
+
/** The step that wrote it. */
|
|
259
|
+
stepId: string;
|
|
260
|
+
level: RunLogLevel;
|
|
261
|
+
message: string;
|
|
262
|
+
/** The value given with the message; null when none was. */
|
|
263
|
+
data: unknown;
|
|
264
|
+
loggedAt: Date;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* One run with the steps it ran and the lines it logged, in order. Both are empty for a run recorded
|
|
269
|
+
* before the measures (and the steps for a running execution).
|
|
270
|
+
*/
|
|
271
|
+
export interface IReflexRunDetail extends IReflexRun {
|
|
272
|
+
steps: IReflexRunStep[];
|
|
273
|
+
logs: IReflexRunLog[];
|
|
274
|
+
/** The log lines written and not kept in `logs`; 0 when none was dropped. */
|
|
275
|
+
droppedLogLines: number;
|
|
276
|
+
/** Why lines were dropped; null when none was. */
|
|
277
|
+
droppedLogCause: LogDropCause | null;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* The state of a live execution, read by its id (the `executionId` an async route answers with): by a member
|
|
282
|
+
* through the API (`function.run.state`), and by the consumer that started it through the edge
|
|
283
|
+
* (`GET .../_executions/:executionId`).
|
|
284
|
+
*/
|
|
285
|
+
export interface IReflexExecutionState {
|
|
286
|
+
id: string;
|
|
287
|
+
status: RunStatus;
|
|
288
|
+
executionMode: ExecutionMode;
|
|
289
|
+
startedAt: Date;
|
|
290
|
+
/** When the caller got its answer; for an async execution, the 202. */
|
|
291
|
+
responseSentAt: Date | null;
|
|
292
|
+
/** Null while it runs. */
|
|
293
|
+
finishedAt: Date | null;
|
|
294
|
+
/**
|
|
295
|
+
* The status the caller got; for an async execution that finished, the status of the answer the function
|
|
296
|
+
* built (202 while it runs).
|
|
297
|
+
*/
|
|
298
|
+
httpStatus: number;
|
|
299
|
+
/** Set when the execution failed. */
|
|
300
|
+
errorCode: string | null;
|
|
301
|
+
/** Null while it runs, or for an execution recorded before the measures. */
|
|
302
|
+
costMillicredits: number | null;
|
|
303
|
+
/** The body of the answer of an async execution that finished; null otherwise, or when it was cut. */
|
|
304
|
+
output: unknown | null;
|
|
305
|
+
/** True when the output went past `REFLEX_COMPLETION_WEBHOOK_LIMITS.outputMaxBytes`. */
|
|
306
|
+
outputTruncated: boolean;
|
|
307
|
+
/** Set when the execution failed. */
|
|
308
|
+
error: { code: string; message: string } | null;
|
|
309
|
+
}
|