@abyss-project/reflex 1.0.0 → 1.1.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-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 +5 -0
- package/dist/api/function-settings.api.js +15 -0
- package/dist/api/function-settings.api.js.map +1 -0
- package/dist/api/function-version.api.d.ts +2 -1
- package/dist/api/function-version.api.js +3 -1
- package/dist/api/function-version.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/index.d.ts +9 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/types/enum/execution-mode.enum.d.ts +4 -0
- package/dist/types/enum/execution-mode.enum.js +9 -0
- package/dist/types/enum/execution-mode.enum.js.map +1 -0
- package/dist/types/enum/execution-profile.enum.d.ts +8 -0
- package/dist/types/enum/execution-profile.enum.js +19 -0
- package/dist/types/enum/execution-profile.enum.js.map +1 -0
- package/dist/types/enum/execution-settings-source.enum.d.ts +5 -0
- package/dist/types/enum/execution-settings-source.enum.js +10 -0
- package/dist/types/enum/execution-settings-source.enum.js.map +1 -0
- package/dist/types/enum/index.d.ts +5 -0
- package/dist/types/enum/index.js +5 -0
- package/dist/types/enum/index.js.map +1 -1
- package/dist/types/enum/run-log-level.enum.d.ts +5 -0
- package/dist/types/enum/run-log-level.enum.js +10 -0
- package/dist/types/enum/run-log-level.enum.js.map +1 -0
- package/dist/types/enum/run-status.enum.d.ts +3 -1
- package/dist/types/enum/run-status.enum.js +2 -0
- package/dist/types/enum/run-status.enum.js.map +1 -1
- package/dist/types/enum/run-step-status.enum.d.ts +5 -0
- package/dist/types/enum/run-step-status.enum.js +10 -0
- package/dist/types/enum/run-step-status.enum.js.map +1 -0
- package/dist/types/enum/trace-effect-type.enum.js.map +1 -1
- package/dist/types/interface/api/requests/function-run.request.d.ts +5 -0
- package/dist/types/interface/api/requests/function-settings.request.d.ts +21 -0
- package/dist/types/interface/api/requests/function-settings.request.js +3 -0
- package/dist/types/interface/api/requests/function-settings.request.js.map +1 -0
- package/dist/types/interface/api/requests/function-version.request.d.ts +8 -0
- 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/responses/function-run.response.d.ts +6 -2
- package/dist/types/interface/api/responses/function-settings.response.d.ts +19 -0
- package/dist/types/interface/api/responses/function-settings.response.js +3 -0
- package/dist/types/interface/api/responses/function-settings.response.js.map +1 -0
- package/dist/types/interface/api/responses/function-version.response.d.ts +10 -1
- 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/models/index.d.ts +2 -0
- package/dist/types/interface/models/index.js +2 -0
- package/dist/types/interface/models/index.js.map +1 -1
- package/dist/types/interface/models/reflex-execution-settings.model.d.ts +36 -0
- package/dist/types/interface/models/reflex-execution-settings.model.js +16 -0
- package/dist/types/interface/models/reflex-execution-settings.model.js.map +1 -0
- package/dist/types/interface/models/reflex-run.model.d.ts +52 -1
- package/dist/types/interface/models/reflex-step-stats.model.d.ts +22 -0
- package/dist/types/interface/models/reflex-step-stats.model.js +3 -0
- package/dist/types/interface/models/reflex-step-stats.model.js.map +1 -0
- package/package.json +1 -1
- package/src/api/function-access.api.ts +36 -36
- package/src/api/function-promotion.api.ts +42 -42
- package/src/api/function-run.api.ts +13 -1
- package/src/api/function-settings.api.ts +59 -0
- package/src/api/function-test.api.ts +33 -33
- package/src/api/function-trigger.api.ts +52 -52
- package/src/api/function-version.api.ts +19 -0
- package/src/api/function.api.test.ts +90 -1
- package/src/api/function.api.ts +62 -62
- package/src/api/index.ts +1 -0
- package/src/index.ts +17 -0
- 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/execution-mode.enum.ts +9 -0
- package/src/types/enum/execution-profile.enum.ts +20 -0
- package/src/types/enum/execution-settings-source.enum.ts +9 -0
- package/src/types/enum/index.ts +5 -0
- package/src/types/enum/reflex-error-code.enum.ts +19 -19
- package/src/types/enum/run-log-level.enum.ts +6 -0
- package/src/types/enum/run-mode.enum.ts +11 -11
- package/src/types/enum/run-status.enum.ts +7 -0
- package/src/types/enum/run-step-status.enum.ts +7 -0
- package/src/types/enum/trace-effect-type.enum.ts +6 -0
- package/src/types/enum/trigger-access-mode.enum.ts +12 -12
- package/src/types/enum/trigger-type.enum.ts +4 -4
- package/src/types/interface/api/index.ts +3 -3
- package/src/types/interface/api/requests/function-access.request.ts +25 -25
- package/src/types/interface/api/requests/function-promotion.request.ts +25 -25
- package/src/types/interface/api/requests/function-run.request.ts +7 -0
- package/src/types/interface/api/requests/function-settings.request.ts +27 -0
- package/src/types/interface/api/requests/function-test.request.ts +19 -19
- package/src/types/interface/api/requests/function-trigger.request.ts +28 -28
- package/src/types/interface/api/requests/function-version.request.ts +10 -0
- package/src/types/interface/api/requests/function.request.ts +34 -34
- package/src/types/interface/api/requests/index.ts +1 -0
- package/src/types/interface/api/response.ts +4 -4
- package/src/types/interface/api/responses/function-access.response.ts +17 -17
- package/src/types/interface/api/responses/function-promotion.response.ts +18 -18
- package/src/types/interface/api/responses/function-run.response.ts +7 -2
- package/src/types/interface/api/responses/function-settings.response.ts +33 -0
- package/src/types/interface/api/responses/function-test.response.ts +12 -12
- package/src/types/interface/api/responses/function-trigger.response.ts +24 -24
- package/src/types/interface/api/responses/function-version.response.ts +20 -1
- 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/index.ts +3 -3
- package/src/types/interface/models/index.ts +2 -0
- package/src/types/interface/models/reflex-access-grant.model.ts +14 -14
- package/src/types/interface/models/reflex-definition.model.ts +23 -23
- package/src/types/interface/models/reflex-environment-pointer.model.ts +18 -18
- package/src/types/interface/models/reflex-execution-settings.model.ts +53 -0
- package/src/types/interface/models/reflex-function-version.model.ts +14 -14
- package/src/types/interface/models/reflex-function.model.ts +14 -14
- package/src/types/interface/models/reflex-run.model.ts +107 -5
- package/src/types/interface/models/reflex-step-stats.model.ts +35 -0
- package/src/types/interface/models/reflex-trigger.model.ts +17 -17
package/src/api/function.api.ts
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import { AbyssReflexCore } from '..';
|
|
2
|
-
import type {
|
|
3
|
-
ICreateFunctionBody,
|
|
4
|
-
ICreateFunctionParams,
|
|
5
|
-
ICreateFunctionResponse,
|
|
6
|
-
IDeleteFunctionParams,
|
|
7
|
-
IDeleteFunctionResponse,
|
|
8
|
-
IGetFunctionParams,
|
|
9
|
-
IGetFunctionResponse,
|
|
10
|
-
IListFunctionParams,
|
|
11
|
-
IListFunctionResponse,
|
|
12
|
-
IUpdateFunctionBody,
|
|
13
|
-
IUpdateFunctionParams,
|
|
14
|
-
IUpdateFunctionResponse,
|
|
15
|
-
} from '../types';
|
|
16
|
-
|
|
17
|
-
/** `GET /api/function/:applicationId`: needs REFLEX_READ. */
|
|
18
|
-
export const listFunction = async (params: IListFunctionParams): Promise<IListFunctionResponse> =>
|
|
19
|
-
(await AbyssReflexCore.axios.get<IListFunctionResponse>(`api/function/${params.applicationId}`))
|
|
20
|
-
.data;
|
|
21
|
-
|
|
22
|
-
/** `POST /api/function/:applicationId`: needs REFLEX_FUNCTION_CREATE. A definition that breaks the format is a `400` naming the path of each fault. */
|
|
23
|
-
export const createFunction = async (
|
|
24
|
-
params: ICreateFunctionParams,
|
|
25
|
-
body: ICreateFunctionBody,
|
|
26
|
-
): Promise<ICreateFunctionResponse> =>
|
|
27
|
-
(
|
|
28
|
-
await AbyssReflexCore.axios.post<ICreateFunctionResponse>(
|
|
29
|
-
`api/function/${params.applicationId}`,
|
|
30
|
-
body,
|
|
31
|
-
)
|
|
32
|
-
).data;
|
|
33
|
-
|
|
34
|
-
/** `GET /api/function/:applicationId/:functionId`: needs REFLEX_READ. */
|
|
35
|
-
export const getFunction = async (params: IGetFunctionParams): Promise<IGetFunctionResponse> =>
|
|
36
|
-
(
|
|
37
|
-
await AbyssReflexCore.axios.get<IGetFunctionResponse>(
|
|
38
|
-
`api/function/${params.applicationId}/${params.functionId}`,
|
|
39
|
-
)
|
|
40
|
-
).data;
|
|
41
|
-
|
|
42
|
-
/** `PUT /api/function/:applicationId/:functionId`: needs REFLEX_FUNCTION_UPDATE. */
|
|
43
|
-
export const updateFunction = async (
|
|
44
|
-
params: IUpdateFunctionParams,
|
|
45
|
-
body: IUpdateFunctionBody,
|
|
46
|
-
): Promise<IUpdateFunctionResponse> =>
|
|
47
|
-
(
|
|
48
|
-
await AbyssReflexCore.axios.put<IUpdateFunctionResponse>(
|
|
49
|
-
`api/function/${params.applicationId}/${params.functionId}`,
|
|
50
|
-
body,
|
|
51
|
-
)
|
|
52
|
-
).data;
|
|
53
|
-
|
|
54
|
-
/** `DELETE /api/function/:applicationId/:functionId`: needs REFLEX_FUNCTION_DELETE. Takes the function off every environment. */
|
|
55
|
-
export const deleteFunction = async (
|
|
56
|
-
params: IDeleteFunctionParams,
|
|
57
|
-
): Promise<IDeleteFunctionResponse> =>
|
|
58
|
-
(
|
|
59
|
-
await AbyssReflexCore.axios.delete<IDeleteFunctionResponse>(
|
|
60
|
-
`api/function/${params.applicationId}/${params.functionId}`,
|
|
61
|
-
)
|
|
62
|
-
).data;
|
|
1
|
+
import { AbyssReflexCore } from '..';
|
|
2
|
+
import type {
|
|
3
|
+
ICreateFunctionBody,
|
|
4
|
+
ICreateFunctionParams,
|
|
5
|
+
ICreateFunctionResponse,
|
|
6
|
+
IDeleteFunctionParams,
|
|
7
|
+
IDeleteFunctionResponse,
|
|
8
|
+
IGetFunctionParams,
|
|
9
|
+
IGetFunctionResponse,
|
|
10
|
+
IListFunctionParams,
|
|
11
|
+
IListFunctionResponse,
|
|
12
|
+
IUpdateFunctionBody,
|
|
13
|
+
IUpdateFunctionParams,
|
|
14
|
+
IUpdateFunctionResponse,
|
|
15
|
+
} from '../types';
|
|
16
|
+
|
|
17
|
+
/** `GET /api/function/:applicationId`: needs REFLEX_READ. */
|
|
18
|
+
export const listFunction = async (params: IListFunctionParams): Promise<IListFunctionResponse> =>
|
|
19
|
+
(await AbyssReflexCore.axios.get<IListFunctionResponse>(`api/function/${params.applicationId}`))
|
|
20
|
+
.data;
|
|
21
|
+
|
|
22
|
+
/** `POST /api/function/:applicationId`: needs REFLEX_FUNCTION_CREATE. A definition that breaks the format is a `400` naming the path of each fault. */
|
|
23
|
+
export const createFunction = async (
|
|
24
|
+
params: ICreateFunctionParams,
|
|
25
|
+
body: ICreateFunctionBody,
|
|
26
|
+
): Promise<ICreateFunctionResponse> =>
|
|
27
|
+
(
|
|
28
|
+
await AbyssReflexCore.axios.post<ICreateFunctionResponse>(
|
|
29
|
+
`api/function/${params.applicationId}`,
|
|
30
|
+
body,
|
|
31
|
+
)
|
|
32
|
+
).data;
|
|
33
|
+
|
|
34
|
+
/** `GET /api/function/:applicationId/:functionId`: needs REFLEX_READ. */
|
|
35
|
+
export const getFunction = async (params: IGetFunctionParams): Promise<IGetFunctionResponse> =>
|
|
36
|
+
(
|
|
37
|
+
await AbyssReflexCore.axios.get<IGetFunctionResponse>(
|
|
38
|
+
`api/function/${params.applicationId}/${params.functionId}`,
|
|
39
|
+
)
|
|
40
|
+
).data;
|
|
41
|
+
|
|
42
|
+
/** `PUT /api/function/:applicationId/:functionId`: needs REFLEX_FUNCTION_UPDATE. */
|
|
43
|
+
export const updateFunction = async (
|
|
44
|
+
params: IUpdateFunctionParams,
|
|
45
|
+
body: IUpdateFunctionBody,
|
|
46
|
+
): Promise<IUpdateFunctionResponse> =>
|
|
47
|
+
(
|
|
48
|
+
await AbyssReflexCore.axios.put<IUpdateFunctionResponse>(
|
|
49
|
+
`api/function/${params.applicationId}/${params.functionId}`,
|
|
50
|
+
body,
|
|
51
|
+
)
|
|
52
|
+
).data;
|
|
53
|
+
|
|
54
|
+
/** `DELETE /api/function/:applicationId/:functionId`: needs REFLEX_FUNCTION_DELETE. Takes the function off every environment. */
|
|
55
|
+
export const deleteFunction = async (
|
|
56
|
+
params: IDeleteFunctionParams,
|
|
57
|
+
): Promise<IDeleteFunctionResponse> =>
|
|
58
|
+
(
|
|
59
|
+
await AbyssReflexCore.axios.delete<IDeleteFunctionResponse>(
|
|
60
|
+
`api/function/${params.applicationId}/${params.functionId}`,
|
|
61
|
+
)
|
|
62
|
+
).data;
|
package/src/api/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ import * as functionVersionApi from './api/function-version.api';
|
|
|
7
7
|
import * as functionPromotionApi from './api/function-promotion.api';
|
|
8
8
|
import * as functionTriggerApi from './api/function-trigger.api';
|
|
9
9
|
import * as functionRunApi from './api/function-run.api';
|
|
10
|
+
import * as functionSettingsApi from './api/function-settings.api';
|
|
10
11
|
|
|
11
12
|
export * from './api';
|
|
12
13
|
export * from './types';
|
|
@@ -41,6 +42,7 @@ type AbyssReflexCoreSDK = {
|
|
|
41
42
|
list: typeof functionVersionApi.listFunctionVersion;
|
|
42
43
|
publish: typeof functionVersionApi.publishFunctionVersion;
|
|
43
44
|
get: typeof functionVersionApi.getFunctionVersion;
|
|
45
|
+
stepStats: typeof functionVersionApi.getFunctionVersionStepStats;
|
|
44
46
|
};
|
|
45
47
|
promotion: {
|
|
46
48
|
list: typeof functionPromotionApi.listFunctionPromotion;
|
|
@@ -56,6 +58,13 @@ type AbyssReflexCoreSDK = {
|
|
|
56
58
|
run: {
|
|
57
59
|
list: typeof functionRunApi.listFunctionRun;
|
|
58
60
|
get: typeof functionRunApi.getFunctionRun;
|
|
61
|
+
state: typeof functionRunApi.getFunctionRunState;
|
|
62
|
+
};
|
|
63
|
+
settings: {
|
|
64
|
+
get: typeof functionSettingsApi.getFunctionSettings;
|
|
65
|
+
setDefault: typeof functionSettingsApi.setFunctionDefaultSettings;
|
|
66
|
+
setEnvironment: typeof functionSettingsApi.setFunctionEnvironmentSettings;
|
|
67
|
+
removeEnvironment: typeof functionSettingsApi.removeFunctionEnvironmentSettings;
|
|
59
68
|
};
|
|
60
69
|
};
|
|
61
70
|
};
|
|
@@ -93,6 +102,7 @@ export class AbyssReflexCore {
|
|
|
93
102
|
list: functionVersionApi.listFunctionVersion,
|
|
94
103
|
publish: functionVersionApi.publishFunctionVersion,
|
|
95
104
|
get: functionVersionApi.getFunctionVersion,
|
|
105
|
+
stepStats: functionVersionApi.getFunctionVersionStepStats,
|
|
96
106
|
},
|
|
97
107
|
promotion: {
|
|
98
108
|
list: functionPromotionApi.listFunctionPromotion,
|
|
@@ -108,6 +118,13 @@ export class AbyssReflexCore {
|
|
|
108
118
|
run: {
|
|
109
119
|
list: functionRunApi.listFunctionRun,
|
|
110
120
|
get: functionRunApi.getFunctionRun,
|
|
121
|
+
state: functionRunApi.getFunctionRunState,
|
|
122
|
+
},
|
|
123
|
+
settings: {
|
|
124
|
+
get: functionSettingsApi.getFunctionSettings,
|
|
125
|
+
setDefault: functionSettingsApi.setFunctionDefaultSettings,
|
|
126
|
+
setEnvironment: functionSettingsApi.setFunctionEnvironmentSettings,
|
|
127
|
+
removeEnvironment: functionSettingsApi.removeFunctionEnvironmentSettings,
|
|
111
128
|
},
|
|
112
129
|
},
|
|
113
130
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* State of an access granted to a function.
|
|
3
|
-
* - ACTIVE: the grantor still holds the right the access needs.
|
|
4
|
-
* - SUSPENDED: a publication found the grantor without that right. Publishing is refused
|
|
5
|
-
* (`GRANT_SUSPENDED`) until the access is revoked and granted again; what is already promoted keeps running.
|
|
6
|
-
* - REVOKED: withdrawn on purpose; the row stays as the journal.
|
|
7
|
-
*/
|
|
8
|
-
export enum AccessGrantStatus {
|
|
9
|
-
ACTIVE = 'ACTIVE',
|
|
10
|
-
SUSPENDED = 'SUSPENDED',
|
|
11
|
-
REVOKED = 'REVOKED',
|
|
12
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* State of an access granted to a function.
|
|
3
|
+
* - ACTIVE: the grantor still holds the right the access needs.
|
|
4
|
+
* - SUSPENDED: a publication found the grantor without that right. Publishing is refused
|
|
5
|
+
* (`GRANT_SUSPENDED`) until the access is revoked and granted again; what is already promoted keeps running.
|
|
6
|
+
* - REVOKED: withdrawn on purpose; the row stays as the journal.
|
|
7
|
+
*/
|
|
8
|
+
export enum AccessGrantStatus {
|
|
9
|
+
ACTIVE = 'ACTIVE',
|
|
10
|
+
SUSPENDED = 'SUSPENDED',
|
|
11
|
+
REVOKED = 'REVOKED',
|
|
12
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** The kinds of access a definition declares and a member grants (the format of @abyss-project/runtime). */
|
|
2
|
-
export enum ReflexAccessKind {
|
|
3
|
-
/** Outbound HTTP to a list of host names (exact, or `*.domain` for any sub-domain). */
|
|
4
|
-
HTTP = 'HTTP',
|
|
5
|
-
/** One action of the host catalog (`store.get`, `store.set`, `store.increment`, `secret.get`, `http.respond`). */
|
|
6
|
-
HOST_ACTION = 'HOST_ACTION',
|
|
7
|
-
}
|
|
1
|
+
/** The kinds of access a definition declares and a member grants (the format of @abyss-project/runtime). */
|
|
2
|
+
export enum ReflexAccessKind {
|
|
3
|
+
/** Outbound HTTP to a list of host names (exact, or `*.domain` for any sub-domain). */
|
|
4
|
+
HTTP = 'HTTP',
|
|
5
|
+
/** One action of the host catalog (`store.get`, `store.set`, `store.increment`, `secret.get`, `http.respond`). */
|
|
6
|
+
HOST_ACTION = 'HOST_ACTION',
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How an HTTP trigger answers its caller.
|
|
3
|
+
* - SYNC: the caller waits for the Respond step, or gets 504 past the response timeout.
|
|
4
|
+
* - ASYNC: the caller gets `202 {executionId}` before the execution starts, and reads its state.
|
|
5
|
+
*/
|
|
6
|
+
export enum ExecutionMode {
|
|
7
|
+
SYNC = 'SYNC',
|
|
8
|
+
ASYNC = 'ASYNC',
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Memory of the isolate an execution runs in (ADR-0239). The CPU part of the cost grows with the
|
|
3
|
+
* profile: S x1, M x1.05, L x1.10, XL x1.20, XXL x1.35.
|
|
4
|
+
*/
|
|
5
|
+
export enum ExecutionProfile {
|
|
6
|
+
S = 'S',
|
|
7
|
+
M = 'M',
|
|
8
|
+
L = 'L',
|
|
9
|
+
XL = 'XL',
|
|
10
|
+
XXL = 'XXL',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Memory limit of each profile, in MB (1 GB = 1024 MB). */
|
|
14
|
+
export const EXECUTION_PROFILE_MEMORY_MB: Readonly<Record<ExecutionProfile, number>> = {
|
|
15
|
+
[ExecutionProfile.S]: 128,
|
|
16
|
+
[ExecutionProfile.M]: 256,
|
|
17
|
+
[ExecutionProfile.L]: 512,
|
|
18
|
+
[ExecutionProfile.XL]: 1024,
|
|
19
|
+
[ExecutionProfile.XXL]: 2048,
|
|
20
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Where the effective settings of an environment come from. */
|
|
2
|
+
export enum ExecutionSettingsSource {
|
|
3
|
+
/** The override of this environment. */
|
|
4
|
+
ENVIRONMENT = 'ENVIRONMENT',
|
|
5
|
+
/** The default of the function, for every environment without an override. */
|
|
6
|
+
DEFAULT = 'DEFAULT',
|
|
7
|
+
/** Nothing is set: the built-in defaults. */
|
|
8
|
+
BUILT_IN = 'BUILT_IN',
|
|
9
|
+
}
|
package/src/types/enum/index.ts
CHANGED
|
@@ -7,3 +7,8 @@ export * from './run-status.enum';
|
|
|
7
7
|
export * from './trace-effect-type.enum';
|
|
8
8
|
export * from './reflex-error-code.enum';
|
|
9
9
|
export * from './access-kind.enum';
|
|
10
|
+
export * from './execution-profile.enum';
|
|
11
|
+
export * from './execution-mode.enum';
|
|
12
|
+
export * from './execution-settings-source.enum';
|
|
13
|
+
export * from './run-step-status.enum';
|
|
14
|
+
export * from './run-log-level.enum';
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/** `error.code` of the refusals a client acts on. */
|
|
2
|
-
export enum ReflexErrorCode {
|
|
3
|
-
/** 400: the definition does not match the format; `error.details` holds the path of each fault. */
|
|
4
|
-
INVALID_DEFINITION = 'INVALID_DEFINITION',
|
|
5
|
-
/** 409: an access granted to the function is suspended; revoke it and grant it again. */
|
|
6
|
-
GRANT_SUSPENDED = 'GRANT_SUSPENDED',
|
|
7
|
-
/** 409: the function has no frozen version of its own draft yet, or none to go back to. */
|
|
8
|
-
NO_VERSION = 'NO_VERSION',
|
|
9
|
-
/** 409: the access to grant is not declared by the draft of the function. */
|
|
10
|
-
ACCESS_NOT_DECLARED = 'ACCESS_NOT_DECLARED',
|
|
11
|
-
/** 409: the draft has not changed since the last published version. */
|
|
12
|
-
NOTHING_TO_PUBLISH = 'NOTHING_TO_PUBLISH',
|
|
13
|
-
/** 404: the environment is not one of the application's Monitor environments. */
|
|
14
|
-
ENVIRONMENT_NOT_FOUND = 'ENVIRONMENT_NOT_FOUND',
|
|
15
|
-
/** 409: a name, a path or an access already exists. */
|
|
16
|
-
ALREADY_EXISTS = 'ALREADY_EXISTS',
|
|
17
|
-
/** 403: the function is promoted in a production environment and the member lacks REFLEX_PUBLISH_PRODUCTION. */
|
|
18
|
-
PUBLISH_PRODUCTION_REQUIRED = 'PUBLISH_PRODUCTION_REQUIRED',
|
|
19
|
-
}
|
|
1
|
+
/** `error.code` of the refusals a client acts on. */
|
|
2
|
+
export enum ReflexErrorCode {
|
|
3
|
+
/** 400: the definition does not match the format; `error.details` holds the path of each fault. */
|
|
4
|
+
INVALID_DEFINITION = 'INVALID_DEFINITION',
|
|
5
|
+
/** 409: an access granted to the function is suspended; revoke it and grant it again. */
|
|
6
|
+
GRANT_SUSPENDED = 'GRANT_SUSPENDED',
|
|
7
|
+
/** 409: the function has no frozen version of its own draft yet, or none to go back to. */
|
|
8
|
+
NO_VERSION = 'NO_VERSION',
|
|
9
|
+
/** 409: the access to grant is not declared by the draft of the function. */
|
|
10
|
+
ACCESS_NOT_DECLARED = 'ACCESS_NOT_DECLARED',
|
|
11
|
+
/** 409: the draft has not changed since the last published version. */
|
|
12
|
+
NOTHING_TO_PUBLISH = 'NOTHING_TO_PUBLISH',
|
|
13
|
+
/** 404: the environment is not one of the application's Monitor environments. */
|
|
14
|
+
ENVIRONMENT_NOT_FOUND = 'ENVIRONMENT_NOT_FOUND',
|
|
15
|
+
/** 409: a name, a path or an access already exists. */
|
|
16
|
+
ALREADY_EXISTS = 'ALREADY_EXISTS',
|
|
17
|
+
/** 403: the function is promoted in a production environment and the member lacks REFLEX_PUBLISH_PRODUCTION. */
|
|
18
|
+
PUBLISH_PRODUCTION_REQUIRED = 'PUBLISH_PRODUCTION_REQUIRED',
|
|
19
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* How a run was made.
|
|
3
|
-
* - SIMULATION: nothing is executed, effects are recorded, the Store is a scratch copy thrown away.
|
|
4
|
-
* - DRY_RUN: Store reads are real, writes are recorded and not executed.
|
|
5
|
-
* - LIVE: an execution of the edge on a promoted version.
|
|
6
|
-
*/
|
|
7
|
-
export enum RunMode {
|
|
8
|
-
SIMULATION = 'SIMULATION',
|
|
9
|
-
DRY_RUN = 'DRY_RUN',
|
|
10
|
-
LIVE = 'LIVE',
|
|
11
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* How a run was made.
|
|
3
|
+
* - SIMULATION: nothing is executed, effects are recorded, the Store is a scratch copy thrown away.
|
|
4
|
+
* - DRY_RUN: Store reads are real, writes are recorded and not executed.
|
|
5
|
+
* - LIVE: an execution of the edge on a promoted version.
|
|
6
|
+
*/
|
|
7
|
+
export enum RunMode {
|
|
8
|
+
SIMULATION = 'SIMULATION',
|
|
9
|
+
DRY_RUN = 'DRY_RUN',
|
|
10
|
+
LIVE = 'LIVE',
|
|
11
|
+
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
export enum RunStatus {
|
|
2
|
+
/** A live execution accepted and not finished yet (an async caller reads it by its id). */
|
|
3
|
+
RUNNING = 'RUNNING',
|
|
2
4
|
SUCCEEDED = 'SUCCEEDED',
|
|
3
5
|
FAILED = 'FAILED',
|
|
6
|
+
/**
|
|
7
|
+
* A live execution stopped by the end of a pod of the edge or of the runner: offered (cost 0), kept in
|
|
8
|
+
* the journal with its measures up to the interruption, left out of every statistic.
|
|
9
|
+
*/
|
|
10
|
+
INTERRUPTED = 'INTERRUPTED',
|
|
4
11
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/** The kind of effect one trace entry records. */
|
|
2
2
|
export enum TraceEffectType {
|
|
3
|
+
/**
|
|
4
|
+
* An evaluation of expressions or code. Only in test runs recorded before Reflex lot 0 (#773), which
|
|
5
|
+
* the retention still keeps: evaluations now happen inside the runner's isolate and are not traced.
|
|
6
|
+
*/
|
|
3
7
|
EVALUATE = 'EVALUATE',
|
|
8
|
+
/** An HTTP call: an HTTP step or `fetch()`. */
|
|
4
9
|
HTTP = 'HTTP',
|
|
10
|
+
/** A call to the host: `store.*`, `secret.get`, `http.respond`, `wait` (its `action`). */
|
|
5
11
|
HOST = 'HOST',
|
|
6
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Who may call an HTTP trigger.
|
|
3
|
-
* - PUBLIC: anyone.
|
|
4
|
-
* - API_KEY: the caller sends the key in `x-api-key`.
|
|
5
|
-
* - SIGNATURE: the caller signs the raw body: `x-reflex-signature: sha256=<hex HMAC-SHA256(secret,
|
|
6
|
-
* "<timestamp>." + body)>` with `x-reflex-timestamp` in Unix seconds, within 300 s of the edge's clock.
|
|
7
|
-
*/
|
|
8
|
-
export enum TriggerAccessMode {
|
|
9
|
-
PUBLIC = 'PUBLIC',
|
|
10
|
-
API_KEY = 'API_KEY',
|
|
11
|
-
SIGNATURE = 'SIGNATURE',
|
|
12
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Who may call an HTTP trigger.
|
|
3
|
+
* - PUBLIC: anyone.
|
|
4
|
+
* - API_KEY: the caller sends the key in `x-api-key`.
|
|
5
|
+
* - SIGNATURE: the caller signs the raw body: `x-reflex-signature: sha256=<hex HMAC-SHA256(secret,
|
|
6
|
+
* "<timestamp>." + body)>` with `x-reflex-timestamp` in Unix seconds, within 300 s of the edge's clock.
|
|
7
|
+
*/
|
|
8
|
+
export enum TriggerAccessMode {
|
|
9
|
+
PUBLIC = 'PUBLIC',
|
|
10
|
+
API_KEY = 'API_KEY',
|
|
11
|
+
SIGNATURE = 'SIGNATURE',
|
|
12
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** How a trigger is reached. L1 serves HTTP only; scheduled triggers and Discord arrive later. */
|
|
2
|
-
export enum TriggerType {
|
|
3
|
-
HTTP = 'HTTP',
|
|
4
|
-
}
|
|
1
|
+
/** How a trigger is reached. L1 serves HTTP only; scheduled triggers and Discord arrive later. */
|
|
2
|
+
export enum TriggerType {
|
|
3
|
+
HTTP = 'HTTP',
|
|
4
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './response';
|
|
2
|
-
export * from './requests';
|
|
3
|
-
export * from './responses';
|
|
1
|
+
export * from './response';
|
|
2
|
+
export * from './requests';
|
|
3
|
+
export * from './responses';
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import type { IReflexAccessDeclaration } from '../../models';
|
|
2
|
-
|
|
3
|
-
export interface IListFunctionAccessParams {
|
|
4
|
-
applicationId: string;
|
|
5
|
-
functionId: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface IGrantFunctionAccessParams {
|
|
9
|
-
applicationId: string;
|
|
10
|
-
functionId: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* The declaration must be one the draft makes. The member who grants must hold the right the access
|
|
14
|
-
* needs: REFLEX_FUNCTION_UPDATE for hosts, STORAGE_STORE_READ (`store.get`) or STORAGE_STORE_UPDATE
|
|
15
|
-
* (`store.set`, `store.increment`) for the Store, SECRET_READ on the project for `secret.get`.
|
|
16
|
-
*/
|
|
17
|
-
export interface IGrantFunctionAccessBody {
|
|
18
|
-
declaration: IReflexAccessDeclaration;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface IRevokeFunctionAccessParams {
|
|
22
|
-
applicationId: string;
|
|
23
|
-
functionId: string;
|
|
24
|
-
grantId: string;
|
|
25
|
-
}
|
|
1
|
+
import type { IReflexAccessDeclaration } from '../../models';
|
|
2
|
+
|
|
3
|
+
export interface IListFunctionAccessParams {
|
|
4
|
+
applicationId: string;
|
|
5
|
+
functionId: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface IGrantFunctionAccessParams {
|
|
9
|
+
applicationId: string;
|
|
10
|
+
functionId: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The declaration must be one the draft makes. The member who grants must hold the right the access
|
|
14
|
+
* needs: REFLEX_FUNCTION_UPDATE for hosts, STORAGE_STORE_READ (`store.get`) or STORAGE_STORE_UPDATE
|
|
15
|
+
* (`store.set`, `store.increment`) for the Store, SECRET_READ on the project for `secret.get`.
|
|
16
|
+
*/
|
|
17
|
+
export interface IGrantFunctionAccessBody {
|
|
18
|
+
declaration: IReflexAccessDeclaration;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface IRevokeFunctionAccessParams {
|
|
22
|
+
applicationId: string;
|
|
23
|
+
functionId: string;
|
|
24
|
+
grantId: string;
|
|
25
|
+
}
|
|
@@ -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
|
-
/** A Monitor environment of the application. */
|
|
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
|
+
/** A Monitor environment of the application. */
|
|
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
|
+
}
|
|
@@ -17,3 +17,10 @@ export interface IGetFunctionRunParams {
|
|
|
17
17
|
functionId: string;
|
|
18
18
|
runId: string;
|
|
19
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
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { IReflexExecutionSettingsValues } from '../../models';
|
|
2
|
+
|
|
3
|
+
export interface IGetFunctionSettingsParams {
|
|
4
|
+
applicationId: string;
|
|
5
|
+
functionId: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ISetFunctionDefaultSettingsParams {
|
|
9
|
+
applicationId: string;
|
|
10
|
+
functionId: string;
|
|
11
|
+
}
|
|
12
|
+
/** Every value is required: a row of settings is whole. */
|
|
13
|
+
export type ISetFunctionDefaultSettingsBody = IReflexExecutionSettingsValues;
|
|
14
|
+
|
|
15
|
+
export interface ISetFunctionEnvironmentSettingsParams {
|
|
16
|
+
applicationId: string;
|
|
17
|
+
functionId: string;
|
|
18
|
+
/** A Monitor environment of the application. */
|
|
19
|
+
environmentId: string;
|
|
20
|
+
}
|
|
21
|
+
export type ISetFunctionEnvironmentSettingsBody = IReflexExecutionSettingsValues;
|
|
22
|
+
|
|
23
|
+
export interface IRemoveFunctionEnvironmentSettingsParams {
|
|
24
|
+
applicationId: string;
|
|
25
|
+
functionId: string;
|
|
26
|
+
environmentId: string;
|
|
27
|
+
}
|
|
@@ -1,19 +1,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
|
-
/** The event the function receives, as the edge builds it: `{method, path, query, headers, body}`. */
|
|
15
|
-
input?: unknown;
|
|
16
|
-
/** Simulated responses of HTTP steps, by step id. */
|
|
17
|
-
httpStubs?: Record<string, IReflexHttpStub>;
|
|
18
|
-
}
|
|
19
|
-
export type IDryRunFunctionBody = ISimulateFunctionBody;
|
|
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
|
+
/** The event the function receives, as the edge builds it: `{method, path, query, headers, body}`. */
|
|
15
|
+
input?: unknown;
|
|
16
|
+
/** Simulated responses of HTTP steps, by step id. */
|
|
17
|
+
httpStubs?: Record<string, IReflexHttpStub>;
|
|
18
|
+
}
|
|
19
|
+
export type IDryRunFunctionBody = ISimulateFunctionBody;
|