@abyss-project/reflex 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/function-test.api.d.ts +2 -2
- package/dist/api/function-test.api.js +2 -2
- package/dist/api/function-test.api.js.map +1 -1
- package/dist/types/interface/api/requests/function-test.request.d.ts +1 -0
- package/dist/types/interface/api/responses/function-settings.response.d.ts +2 -1
- 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-definition.model.d.ts +2 -0
- package/dist/types/interface/models/reflex-definition.model.js +3 -0
- package/dist/types/interface/models/reflex-definition.model.js.map +1 -1
- package/dist/types/interface/models/reflex-execution-settings.model.d.ts +0 -1
- package/dist/types/interface/models/reflex-execution-settings.model.js +0 -1
- package/dist/types/interface/models/reflex-execution-settings.model.js.map +1 -1
- package/dist/types/interface/models/reflex-price-list.model.d.ts +13 -0
- package/dist/types/interface/models/reflex-price-list.model.js +3 -0
- package/dist/types/interface/models/reflex-price-list.model.js.map +1 -0
- package/dist/types/interface/models/reflex-run.model.d.ts +1 -1
- package/package.json +1 -1
- package/src/api/function-promotion.api.ts +42 -42
- package/src/api/function-run.api.ts +38 -38
- package/src/api/function-settings.api.ts +59 -59
- package/src/api/function-test.api.ts +34 -33
- package/src/api/function-version.api.ts +56 -56
- package/src/api/function.api.test.ts +17 -7
- package/src/api/index.ts +9 -9
- package/src/index.ts +152 -152
- 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/index.ts +14 -14
- package/src/types/enum/reflex-error-code.enum.ts +19 -19
- package/src/types/enum/run-log-level.enum.ts +6 -6
- package/src/types/enum/run-status.enum.ts +11 -11
- package/src/types/enum/run-step-status.enum.ts +7 -7
- package/src/types/enum/trace-effect-type.enum.ts +12 -12
- package/src/types/interface/api/requests/function-promotion.request.ts +25 -25
- package/src/types/interface/api/requests/function-run.request.ts +26 -26
- package/src/types/interface/api/requests/function-settings.request.ts +1 -1
- package/src/types/interface/api/requests/function-test.request.ts +24 -19
- package/src/types/interface/api/requests/function-version.request.ts +1 -1
- package/src/types/interface/api/requests/index.ts +8 -8
- package/src/types/interface/api/responses/function-run.response.ts +18 -18
- package/src/types/interface/api/responses/function-settings.response.ts +4 -1
- package/src/types/interface/api/responses/function-version.response.ts +36 -36
- package/src/types/interface/api/responses/index.ts +8 -8
- package/src/types/interface/models/index.ts +10 -9
- package/src/types/interface/models/reflex-definition.model.ts +8 -0
- package/src/types/interface/models/reflex-environment-pointer.model.ts +18 -18
- package/src/types/interface/models/reflex-execution-settings.model.ts +3 -6
- package/src/types/interface/models/reflex-price-list.model.ts +20 -0
- package/src/types/interface/models/reflex-run.model.ts +10 -5
- package/src/types/interface/models/reflex-step-stats.model.ts +35 -35
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
export interface IListFunctionPromotionParams {
|
|
2
|
-
applicationId: string;
|
|
3
|
-
functionId: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export interface IPromoteFunctionParams {
|
|
7
|
-
applicationId: string;
|
|
8
|
-
functionId: string;
|
|
9
|
-
}
|
|
10
|
-
/** A PRODUCTION environment needs REFLEX_PUBLISH_PRODUCTION on top of REFLEX_PUBLISH. */
|
|
11
|
-
export interface IPromoteFunctionBody {
|
|
12
|
-
versionId: string;
|
|
13
|
-
/**
|
|
14
|
-
environmentId: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface IRollbackFunctionParams {
|
|
18
|
-
applicationId: string;
|
|
19
|
-
functionId: string;
|
|
20
|
-
}
|
|
21
|
-
export interface IRollbackFunctionBody {
|
|
22
|
-
environmentId: string;
|
|
23
|
-
/** A version promoted before in this environment. Absent: the one promoted just before the current one. */
|
|
24
|
-
versionId?: string;
|
|
25
|
-
}
|
|
1
|
+
export interface IListFunctionPromotionParams {
|
|
2
|
+
applicationId: string;
|
|
3
|
+
functionId: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface IPromoteFunctionParams {
|
|
7
|
+
applicationId: string;
|
|
8
|
+
functionId: string;
|
|
9
|
+
}
|
|
10
|
+
/** A PRODUCTION environment needs REFLEX_PUBLISH_PRODUCTION on top of REFLEX_PUBLISH. */
|
|
11
|
+
export interface IPromoteFunctionBody {
|
|
12
|
+
versionId: string;
|
|
13
|
+
/** An environment of the application (abyss-main's id). */
|
|
14
|
+
environmentId: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface IRollbackFunctionParams {
|
|
18
|
+
applicationId: string;
|
|
19
|
+
functionId: string;
|
|
20
|
+
}
|
|
21
|
+
export interface IRollbackFunctionBody {
|
|
22
|
+
environmentId: string;
|
|
23
|
+
/** A version promoted before in this environment. Absent: the one promoted just before the current one. */
|
|
24
|
+
versionId?: string;
|
|
25
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import type { RunMode } from '../../../enum';
|
|
2
|
-
|
|
3
|
-
export interface IListFunctionRunParams {
|
|
4
|
-
applicationId: string;
|
|
5
|
-
functionId: string;
|
|
6
|
-
}
|
|
7
|
-
export interface IListFunctionRunQuery {
|
|
8
|
-
mode?: RunMode;
|
|
9
|
-
/** 1 to 100, 50 by default. */
|
|
10
|
-
limit?: number;
|
|
11
|
-
/** Runs skipped, newest first; 0 by default. */
|
|
12
|
-
offset?: number;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface IGetFunctionRunParams {
|
|
16
|
-
applicationId: string;
|
|
17
|
-
functionId: string;
|
|
18
|
-
runId: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface IGetFunctionRunStateParams {
|
|
22
|
-
applicationId: string;
|
|
23
|
-
functionId: string;
|
|
24
|
-
/** The `executionId` an async trigger answered with: the id of the live run. */
|
|
25
|
-
runId: string;
|
|
26
|
-
}
|
|
1
|
+
import type { RunMode } from '../../../enum';
|
|
2
|
+
|
|
3
|
+
export interface IListFunctionRunParams {
|
|
4
|
+
applicationId: string;
|
|
5
|
+
functionId: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IListFunctionRunQuery {
|
|
8
|
+
mode?: RunMode;
|
|
9
|
+
/** 1 to 100, 50 by default. */
|
|
10
|
+
limit?: number;
|
|
11
|
+
/** Runs skipped, newest first; 0 by default. */
|
|
12
|
+
offset?: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface IGetFunctionRunParams {
|
|
16
|
+
applicationId: string;
|
|
17
|
+
functionId: string;
|
|
18
|
+
runId: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface IGetFunctionRunStateParams {
|
|
22
|
+
applicationId: string;
|
|
23
|
+
functionId: string;
|
|
24
|
+
/** The `executionId` an async trigger answered with: the id of the live run. */
|
|
25
|
+
runId: string;
|
|
26
|
+
}
|
|
@@ -15,7 +15,7 @@ export type ISetFunctionDefaultSettingsBody = IReflexExecutionSettingsValues;
|
|
|
15
15
|
export interface ISetFunctionEnvironmentSettingsParams {
|
|
16
16
|
applicationId: string;
|
|
17
17
|
functionId: string;
|
|
18
|
-
/**
|
|
18
|
+
/** An environment of the application (abyss-main's id). */
|
|
19
19
|
environmentId: string;
|
|
20
20
|
}
|
|
21
21
|
export type ISetFunctionEnvironmentSettingsBody = IReflexExecutionSettingsValues;
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
export interface IFunctionTestParams {
|
|
2
|
-
applicationId: string;
|
|
3
|
-
functionId: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
/** The answer an HTTP step gets in a test; nothing is sent. Defaults to `200` with no body. */
|
|
7
|
-
export interface IReflexHttpStub {
|
|
8
|
-
status: number;
|
|
9
|
-
headers?: Record<string, string>;
|
|
10
|
-
body?: unknown;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface ISimulateFunctionBody {
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
export interface IFunctionTestParams {
|
|
2
|
+
applicationId: string;
|
|
3
|
+
functionId: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/** The answer an HTTP step gets in a test; nothing is sent. Defaults to `200` with no body. */
|
|
7
|
+
export interface IReflexHttpStub {
|
|
8
|
+
status: number;
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
body?: unknown;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ISimulateFunctionBody {
|
|
14
|
+
/**
|
|
15
|
+
* The environment of the application the run takes place in (abyss-main's id): a dry run reads its
|
|
16
|
+
* Store, the run is measured with its effective settings and recorded with it.
|
|
17
|
+
*/
|
|
18
|
+
environmentId: string;
|
|
19
|
+
/** The event the function receives, as the edge builds it: `{method, path, query, headers, body}`. */
|
|
20
|
+
input?: unknown;
|
|
21
|
+
/** Simulated responses of HTTP steps, by step id. */
|
|
22
|
+
httpStubs?: Record<string, IReflexHttpStub>;
|
|
23
|
+
}
|
|
24
|
+
export type IDryRunFunctionBody = ISimulateFunctionBody;
|
|
@@ -20,6 +20,6 @@ export interface IGetFunctionVersionStepStatsParams {
|
|
|
20
20
|
versionId: string;
|
|
21
21
|
}
|
|
22
22
|
export interface IGetFunctionVersionStepStatsQuery {
|
|
23
|
-
/** Only the executions of this
|
|
23
|
+
/** Only the executions of this environment; every environment when absent. */
|
|
24
24
|
environmentId?: string;
|
|
25
25
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './function.request';
|
|
2
|
-
export * from './function-access.request';
|
|
3
|
-
export * from './function-test.request';
|
|
4
|
-
export * from './function-version.request';
|
|
5
|
-
export * from './function-promotion.request';
|
|
6
|
-
export * from './function-trigger.request';
|
|
7
|
-
export * from './function-run.request';
|
|
8
|
-
export * from './function-settings.request';
|
|
1
|
+
export * from './function.request';
|
|
2
|
+
export * from './function-access.request';
|
|
3
|
+
export * from './function-test.request';
|
|
4
|
+
export * from './function-version.request';
|
|
5
|
+
export * from './function-promotion.request';
|
|
6
|
+
export * from './function-trigger.request';
|
|
7
|
+
export * from './function-run.request';
|
|
8
|
+
export * from './function-settings.request';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type { IReflexExecutionState, IReflexRun, IReflexRunDetail } from '../../models';
|
|
2
|
-
import type { IResponse } from '../response';
|
|
3
|
-
|
|
4
|
-
export interface IListFunctionRunData {
|
|
5
|
-
/** Newest first. */
|
|
6
|
-
runs: IReflexRun[];
|
|
7
|
-
}
|
|
8
|
-
export type IListFunctionRunResponse = IResponse<IListFunctionRunData>;
|
|
9
|
-
|
|
10
|
-
export interface IGetFunctionRunData {
|
|
11
|
-
run: IReflexRunDetail;
|
|
12
|
-
}
|
|
13
|
-
export type IGetFunctionRunResponse = IResponse<IGetFunctionRunData>;
|
|
14
|
-
|
|
15
|
-
export interface IGetFunctionRunStateData {
|
|
16
|
-
state: IReflexExecutionState;
|
|
17
|
-
}
|
|
18
|
-
export type IGetFunctionRunStateResponse = IResponse<IGetFunctionRunStateData>;
|
|
1
|
+
import type { IReflexExecutionState, IReflexRun, IReflexRunDetail } from '../../models';
|
|
2
|
+
import type { IResponse } from '../response';
|
|
3
|
+
|
|
4
|
+
export interface IListFunctionRunData {
|
|
5
|
+
/** Newest first. */
|
|
6
|
+
runs: IReflexRun[];
|
|
7
|
+
}
|
|
8
|
+
export type IListFunctionRunResponse = IResponse<IListFunctionRunData>;
|
|
9
|
+
|
|
10
|
+
export interface IGetFunctionRunData {
|
|
11
|
+
run: IReflexRunDetail;
|
|
12
|
+
}
|
|
13
|
+
export type IGetFunctionRunResponse = IResponse<IGetFunctionRunData>;
|
|
14
|
+
|
|
15
|
+
export interface IGetFunctionRunStateData {
|
|
16
|
+
state: IReflexExecutionState;
|
|
17
|
+
}
|
|
18
|
+
export type IGetFunctionRunStateResponse = IResponse<IGetFunctionRunStateData>;
|
|
@@ -2,6 +2,7 @@ import type {
|
|
|
2
2
|
IReflexEffectiveExecutionSettings,
|
|
3
3
|
IReflexExecutionSettings,
|
|
4
4
|
IReflexExecutionSettingsValues,
|
|
5
|
+
IReflexPriceList,
|
|
5
6
|
} from '../../models';
|
|
6
7
|
import type { IResponse } from '../response';
|
|
7
8
|
|
|
@@ -10,10 +11,12 @@ export interface IGetFunctionSettingsData {
|
|
|
10
11
|
default: IReflexExecutionSettings | null;
|
|
11
12
|
/** The override of each environment that has one. */
|
|
12
13
|
environments: IReflexExecutionSettings[];
|
|
13
|
-
/** What each
|
|
14
|
+
/** What each environment of the application runs with. */
|
|
14
15
|
effective: IReflexEffectiveExecutionSettings[];
|
|
15
16
|
/** What applies when neither the environment nor the function sets anything. */
|
|
16
17
|
builtIn: IReflexExecutionSettingsValues;
|
|
18
|
+
/** The price list an execution is billed with, to estimate the cost of a setting. */
|
|
19
|
+
priceList: IReflexPriceList;
|
|
17
20
|
}
|
|
18
21
|
export type IGetFunctionSettingsResponse = IResponse<IGetFunctionSettingsData>;
|
|
19
22
|
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
IReflexFunctionVersion,
|
|
3
|
-
IReflexRunningVersionHeapPeaks,
|
|
4
|
-
IReflexStepStats,
|
|
5
|
-
} from '../../models';
|
|
6
|
-
import type { IResponse } from '../response';
|
|
7
|
-
|
|
8
|
-
export interface IListFunctionVersionData {
|
|
9
|
-
versions: IReflexFunctionVersion[];
|
|
10
|
-
}
|
|
11
|
-
export type IListFunctionVersionResponse = IResponse<IListFunctionVersionData>;
|
|
12
|
-
|
|
13
|
-
export interface IPublishFunctionVersionData {
|
|
14
|
-
version: IReflexFunctionVersion;
|
|
15
|
-
}
|
|
16
|
-
export type IPublishFunctionVersionResponse = IResponse<IPublishFunctionVersionData>;
|
|
17
|
-
|
|
18
|
-
export interface IGetFunctionVersionData {
|
|
19
|
-
version: IReflexFunctionVersion;
|
|
20
|
-
}
|
|
21
|
-
export type IGetFunctionVersionResponse = IResponse<IGetFunctionVersionData>;
|
|
22
|
-
|
|
23
|
-
export interface IGetFunctionVersionStepStatsData {
|
|
24
|
-
versionId: string;
|
|
25
|
-
/** The environment asked for; null for every environment. */
|
|
26
|
-
environmentId: string | null;
|
|
27
|
-
/** The window the statistics cover: the retention of the live runs. */
|
|
28
|
-
windowDays: number;
|
|
29
|
-
/** Executions of the version in the window, interrupted and running ones left out. */
|
|
30
|
-
executions: number;
|
|
31
|
-
/** One entry per step that ran, most costly first. */
|
|
32
|
-
steps: IReflexStepStats[];
|
|
33
|
-
/** The p99 heap peak per step of the version running in `environmentId`; null without an environment or when nothing runs there. */
|
|
34
|
-
runningVersion: IReflexRunningVersionHeapPeaks | null;
|
|
35
|
-
}
|
|
36
|
-
export type IGetFunctionVersionStepStatsResponse = IResponse<IGetFunctionVersionStepStatsData>;
|
|
1
|
+
import type {
|
|
2
|
+
IReflexFunctionVersion,
|
|
3
|
+
IReflexRunningVersionHeapPeaks,
|
|
4
|
+
IReflexStepStats,
|
|
5
|
+
} from '../../models';
|
|
6
|
+
import type { IResponse } from '../response';
|
|
7
|
+
|
|
8
|
+
export interface IListFunctionVersionData {
|
|
9
|
+
versions: IReflexFunctionVersion[];
|
|
10
|
+
}
|
|
11
|
+
export type IListFunctionVersionResponse = IResponse<IListFunctionVersionData>;
|
|
12
|
+
|
|
13
|
+
export interface IPublishFunctionVersionData {
|
|
14
|
+
version: IReflexFunctionVersion;
|
|
15
|
+
}
|
|
16
|
+
export type IPublishFunctionVersionResponse = IResponse<IPublishFunctionVersionData>;
|
|
17
|
+
|
|
18
|
+
export interface IGetFunctionVersionData {
|
|
19
|
+
version: IReflexFunctionVersion;
|
|
20
|
+
}
|
|
21
|
+
export type IGetFunctionVersionResponse = IResponse<IGetFunctionVersionData>;
|
|
22
|
+
|
|
23
|
+
export interface IGetFunctionVersionStepStatsData {
|
|
24
|
+
versionId: string;
|
|
25
|
+
/** The environment asked for; null for every environment. */
|
|
26
|
+
environmentId: string | null;
|
|
27
|
+
/** The window the statistics cover: the retention of the live runs. */
|
|
28
|
+
windowDays: number;
|
|
29
|
+
/** Executions of the version in the window, interrupted and running ones left out. */
|
|
30
|
+
executions: number;
|
|
31
|
+
/** One entry per step that ran, most costly first. */
|
|
32
|
+
steps: IReflexStepStats[];
|
|
33
|
+
/** The p99 heap peak per step of the version running in `environmentId`; null without an environment or when nothing runs there. */
|
|
34
|
+
runningVersion: IReflexRunningVersionHeapPeaks | null;
|
|
35
|
+
}
|
|
36
|
+
export type IGetFunctionVersionStepStatsResponse = IResponse<IGetFunctionVersionStepStatsData>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './function.response';
|
|
2
|
-
export * from './function-access.response';
|
|
3
|
-
export * from './function-test.response';
|
|
4
|
-
export * from './function-version.response';
|
|
5
|
-
export * from './function-promotion.response';
|
|
6
|
-
export * from './function-trigger.response';
|
|
7
|
-
export * from './function-run.response';
|
|
8
|
-
export * from './function-settings.response';
|
|
1
|
+
export * from './function.response';
|
|
2
|
+
export * from './function-access.response';
|
|
3
|
+
export * from './function-test.response';
|
|
4
|
+
export * from './function-version.response';
|
|
5
|
+
export * from './function-promotion.response';
|
|
6
|
+
export * from './function-trigger.response';
|
|
7
|
+
export * from './function-run.response';
|
|
8
|
+
export * from './function-settings.response';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export * from './reflex-definition.model';
|
|
2
|
-
export * from './reflex-function.model';
|
|
3
|
-
export * from './reflex-function-version.model';
|
|
4
|
-
export * from './reflex-environment-pointer.model';
|
|
5
|
-
export * from './reflex-trigger.model';
|
|
6
|
-
export * from './reflex-access-grant.model';
|
|
7
|
-
export * from './reflex-run.model';
|
|
8
|
-
export * from './reflex-execution-settings.model';
|
|
9
|
-
export * from './reflex-step-stats.model';
|
|
1
|
+
export * from './reflex-definition.model';
|
|
2
|
+
export * from './reflex-function.model';
|
|
3
|
+
export * from './reflex-function-version.model';
|
|
4
|
+
export * from './reflex-environment-pointer.model';
|
|
5
|
+
export * from './reflex-trigger.model';
|
|
6
|
+
export * from './reflex-access-grant.model';
|
|
7
|
+
export * from './reflex-run.model';
|
|
8
|
+
export * from './reflex-execution-settings.model';
|
|
9
|
+
export * from './reflex-step-stats.model';
|
|
10
|
+
export * from './reflex-price-list.model';
|
|
@@ -21,3 +21,11 @@ export interface IReflexDefinition {
|
|
|
21
21
|
accesses: IReflexAccessDeclaration[];
|
|
22
22
|
steps: Array<Record<string, unknown>>;
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Bounds of the status a RESPOND step (or `abyss.respond`) may answer with, both included: the
|
|
27
|
+
* runtime's `MIN_RESPONSE_STATUS` and `MAX_RESPONSE_STATUS`, which publication and the edge apply.
|
|
28
|
+
* The API's tests check that they are equal.
|
|
29
|
+
*/
|
|
30
|
+
export const RESPOND_STATUS_MIN = 200;
|
|
31
|
+
export const RESPOND_STATUS_MAX = 599;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type { IReflexAccessDeclaration } from './reflex-definition.model';
|
|
2
|
-
|
|
3
|
-
/** One promotion of a version into
|
|
4
|
-
export interface IReflexEnvironmentPointer {
|
|
5
|
-
id: string;
|
|
6
|
-
functionId: string;
|
|
7
|
-
/** The
|
|
8
|
-
environmentId: string;
|
|
9
|
-
/** The name of that environment, which the trigger's address carries. */
|
|
10
|
-
environmentSlug: string;
|
|
11
|
-
versionId: string;
|
|
12
|
-
versionNumber: number;
|
|
13
|
-
/** The accesses that were granted when the version was promoted. */
|
|
14
|
-
grants: IReflexAccessDeclaration[];
|
|
15
|
-
isCurrent: boolean;
|
|
16
|
-
promotedByUserId: string;
|
|
17
|
-
promotedAt: Date;
|
|
18
|
-
}
|
|
1
|
+
import type { IReflexAccessDeclaration } from './reflex-definition.model';
|
|
2
|
+
|
|
3
|
+
/** One promotion of a version into an environment of the application. The `isCurrent` one is what runs. */
|
|
4
|
+
export interface IReflexEnvironmentPointer {
|
|
5
|
+
id: string;
|
|
6
|
+
functionId: string;
|
|
7
|
+
/** The environment of the application (abyss-main's id). */
|
|
8
|
+
environmentId: string;
|
|
9
|
+
/** The name of that environment, which the trigger's address carries. */
|
|
10
|
+
environmentSlug: string;
|
|
11
|
+
versionId: string;
|
|
12
|
+
versionNumber: number;
|
|
13
|
+
/** The accesses that were granted when the version was promoted. */
|
|
14
|
+
grants: IReflexAccessDeclaration[];
|
|
15
|
+
isCurrent: boolean;
|
|
16
|
+
promotedByUserId: string;
|
|
17
|
+
promotedAt: Date;
|
|
18
|
+
}
|
|
@@ -4,8 +4,6 @@ import type { ExecutionSettingsSource } from '../../enum';
|
|
|
4
4
|
/** The execution settings of a function in an environment. */
|
|
5
5
|
export interface IReflexExecutionSettingsValues {
|
|
6
6
|
profile: ExecutionProfile;
|
|
7
|
-
/** One core reserved for the execution; the CPU part of the cost is multiplied by 1.5. */
|
|
8
|
-
guaranteedCpu: boolean;
|
|
9
7
|
/** Past this, a synchronous caller that got no answer receives 504 and the execution goes on. */
|
|
10
8
|
responseTimeoutMs: number;
|
|
11
9
|
/** Past this, the execution is stopped with TIMEOUT. */
|
|
@@ -22,7 +20,6 @@ export const REFLEX_EXECUTION_SETTINGS_LIMITS = {
|
|
|
22
20
|
/** What a function runs with when nothing is set. */
|
|
23
21
|
export const DEFAULT_REFLEX_EXECUTION_SETTINGS: Readonly<IReflexExecutionSettingsValues> = {
|
|
24
22
|
profile: ExecutionProfile.S,
|
|
25
|
-
guaranteedCpu: false,
|
|
26
23
|
responseTimeoutMs: 30_000,
|
|
27
24
|
maxDurationMs: 30_000,
|
|
28
25
|
mode: ExecutionMode.SYNC,
|
|
@@ -32,17 +29,17 @@ export const DEFAULT_REFLEX_EXECUTION_SETTINGS: Readonly<IReflexExecutionSetting
|
|
|
32
29
|
export interface IReflexExecutionSettings extends IReflexExecutionSettingsValues {
|
|
33
30
|
id: string;
|
|
34
31
|
functionId: string;
|
|
35
|
-
/**
|
|
32
|
+
/** An environment of the application (abyss-main's id); null for the default of every environment. */
|
|
36
33
|
environmentId: string | null;
|
|
37
34
|
updatedByUserId: string;
|
|
38
35
|
createdAt: Date;
|
|
39
36
|
updatedAt: Date;
|
|
40
37
|
}
|
|
41
38
|
|
|
42
|
-
/** What one
|
|
39
|
+
/** What one environment of the application runs with. */
|
|
43
40
|
export interface IReflexEffectiveExecutionSettings {
|
|
44
41
|
environmentId: string;
|
|
45
|
-
/** The name of the environment
|
|
42
|
+
/** The name of the environment (abyss-main), immutable. */
|
|
46
43
|
environmentSlug: string;
|
|
47
44
|
/** Changing what a production environment runs with needs REFLEX_PUBLISH_PRODUCTION. */
|
|
48
45
|
isProduction: boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
cpuMillicreditsPerSecond: number;
|
|
12
|
+
/** Per GB-second of the memory the profile allocates, GB = 1024 MB. */
|
|
13
|
+
memoryMillicreditsPerGbSecond: number;
|
|
14
|
+
/** Per MB sent out, MB = 1024 x 1024 bytes. */
|
|
15
|
+
networkOutMillicreditsPerMb: number;
|
|
16
|
+
httpCallMillicredits: number;
|
|
17
|
+
storeWriteMillicredits: number;
|
|
18
|
+
/** The memory of each profile, and the coefficient its CPU part is multiplied by. */
|
|
19
|
+
profiles: Record<ExecutionProfile, { memoryMb: number; cpuCoefficient: number }>;
|
|
20
|
+
}
|
|
@@ -54,6 +54,10 @@ export interface IReflexRun {
|
|
|
54
54
|
id: string;
|
|
55
55
|
functionId: string;
|
|
56
56
|
versionId: string | null;
|
|
57
|
+
/**
|
|
58
|
+
* The environment the run took place in: the promoted version's for a LIVE run, the one named in the
|
|
59
|
+
* request for a test run. Null only for a test run recorded before test runs named an environment.
|
|
60
|
+
*/
|
|
57
61
|
environmentId: string | null;
|
|
58
62
|
mode: RunMode;
|
|
59
63
|
status: RunStatus;
|
|
@@ -72,7 +76,7 @@ export interface IReflexRun {
|
|
|
72
76
|
responseSentAt: Date | null;
|
|
73
77
|
/**
|
|
74
78
|
* What the run consumed and cost: measured by the runner for a live run and for a test run (with the
|
|
75
|
-
* function's
|
|
79
|
+
* function's effective settings in the run's environment, and the network of its stubs); null for a running execution, or a run
|
|
76
80
|
* recorded before the measures.
|
|
77
81
|
*/
|
|
78
82
|
metrics: IReflexRunMetrics | null;
|
|
@@ -80,12 +84,11 @@ export interface IReflexRun {
|
|
|
80
84
|
createdAt: Date;
|
|
81
85
|
}
|
|
82
86
|
|
|
83
|
-
/** What a live execution consumed, and what it costs (ADR-
|
|
87
|
+
/** What a live execution consumed, and what it costs (ADR-0244). */
|
|
84
88
|
export interface IReflexRunMetrics {
|
|
85
|
-
/** The
|
|
89
|
+
/** The profile it ran with, and the memory that profile allocates. */
|
|
86
90
|
profile: ExecutionProfile;
|
|
87
91
|
memoryLimitMb: number;
|
|
88
|
-
guaranteedCpu: boolean;
|
|
89
92
|
/** Measured by the runner in the isolate. */
|
|
90
93
|
cpuMs: number;
|
|
91
94
|
heapPeakBytes: number;
|
|
@@ -117,7 +120,7 @@ export interface IReflexRunStep {
|
|
|
117
120
|
/**
|
|
118
121
|
* One log line a run wrote: a LOG step, `abyss.log.*` or `console.*`. Secrets masked (`***`); a message
|
|
119
122
|
* is cut at 2048 characters, and data whose JSON is longer becomes `{ truncated: true, preview }`. At most
|
|
120
|
-
* 100 lines per run
|
|
123
|
+
* 100 lines per run are kept; `IReflexRunDetail.droppedLogLines` counts the others.
|
|
121
124
|
*/
|
|
122
125
|
export interface IReflexRunLog {
|
|
123
126
|
/** 0 for the first line. */
|
|
@@ -138,6 +141,8 @@ export interface IReflexRunLog {
|
|
|
138
141
|
export interface IReflexRunDetail extends IReflexRun {
|
|
139
142
|
steps: IReflexRunStep[];
|
|
140
143
|
logs: IReflexRunLog[];
|
|
144
|
+
/** The log lines written past the 100 kept in `logs`; 0 when none was dropped. */
|
|
145
|
+
droppedLogLines: number;
|
|
141
146
|
}
|
|
142
147
|
|
|
143
148
|
/** The state of a live execution, read by its id (the `executionId` an async trigger answers with). */
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
/** Median and 95th percentile of a measure, over the executions of the window. */
|
|
2
|
-
export interface IReflexPercentiles {
|
|
3
|
-
median: number;
|
|
4
|
-
p95: number;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* The measured consumption of one step of a version, over the retention window. Interrupted and running
|
|
9
|
-
* executions are left out.
|
|
10
|
-
*/
|
|
11
|
-
export interface IReflexStepStats {
|
|
12
|
-
stepId: string;
|
|
13
|
-
/** Executions in which the step ran. */
|
|
14
|
-
executions: number;
|
|
15
|
-
durationMs: IReflexPercentiles;
|
|
16
|
-
cpuMs: IReflexPercentiles;
|
|
17
|
-
heapPeakBytes: IReflexPercentiles;
|
|
18
|
-
costMillicredits: IReflexPercentiles;
|
|
19
|
-
/** 99th percentile of the heap peak: what a smaller profile is compared to. */
|
|
20
|
-
heapPeakP99Bytes: number;
|
|
21
|
-
/** Share of the cost of the executions that this step makes, from 0 to 1; null when they cost nothing. */
|
|
22
|
-
costShare: number | null;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** The p99 heap peak of one step of the version running in an environment. */
|
|
26
|
-
export interface IReflexStepHeapPeak {
|
|
27
|
-
stepId: string;
|
|
28
|
-
heapPeakP99Bytes: number;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** What the settings screen compares a smaller profile to: the version running in the environment. */
|
|
32
|
-
export interface IReflexRunningVersionHeapPeaks {
|
|
33
|
-
versionId: string;
|
|
34
|
-
steps: IReflexStepHeapPeak[];
|
|
35
|
-
}
|
|
1
|
+
/** Median and 95th percentile of a measure, over the executions of the window. */
|
|
2
|
+
export interface IReflexPercentiles {
|
|
3
|
+
median: number;
|
|
4
|
+
p95: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The measured consumption of one step of a version, over the retention window. Interrupted and running
|
|
9
|
+
* executions are left out.
|
|
10
|
+
*/
|
|
11
|
+
export interface IReflexStepStats {
|
|
12
|
+
stepId: string;
|
|
13
|
+
/** Executions in which the step ran. */
|
|
14
|
+
executions: number;
|
|
15
|
+
durationMs: IReflexPercentiles;
|
|
16
|
+
cpuMs: IReflexPercentiles;
|
|
17
|
+
heapPeakBytes: IReflexPercentiles;
|
|
18
|
+
costMillicredits: IReflexPercentiles;
|
|
19
|
+
/** 99th percentile of the heap peak: what a smaller profile is compared to. */
|
|
20
|
+
heapPeakP99Bytes: number;
|
|
21
|
+
/** Share of the cost of the executions that this step makes, from 0 to 1; null when they cost nothing. */
|
|
22
|
+
costShare: number | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** The p99 heap peak of one step of the version running in an environment. */
|
|
26
|
+
export interface IReflexStepHeapPeak {
|
|
27
|
+
stepId: string;
|
|
28
|
+
heapPeakP99Bytes: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** What the settings screen compares a smaller profile to: the version running in the environment. */
|
|
32
|
+
export interface IReflexRunningVersionHeapPeaks {
|
|
33
|
+
versionId: string;
|
|
34
|
+
steps: IReflexStepHeapPeak[];
|
|
35
|
+
}
|