@abyss-project/reflex 0.0.0-stage → 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/.eslintrc.js +32 -0
- package/.prettierrc +5 -0
- package/README.md +15 -3
- package/dist/api/function-access.api.d.ts +4 -0
- package/dist/api/function-access.api.js +12 -0
- package/dist/api/function-access.api.js.map +1 -0
- package/dist/api/function-promotion.api.d.ts +4 -0
- package/dist/api/function-promotion.api.js +12 -0
- package/dist/api/function-promotion.api.js.map +1 -0
- package/dist/api/function-run.api.d.ts +4 -0
- package/dist/api/function-run.api.js +14 -0
- package/dist/api/function-run.api.js.map +1 -0
- 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-test.api.d.ts +3 -0
- package/dist/api/function-test.api.js +12 -0
- package/dist/api/function-test.api.js.map +1 -0
- package/dist/api/function-trigger.api.d.ts +5 -0
- package/dist/api/function-trigger.api.js +14 -0
- package/dist/api/function-trigger.api.js.map +1 -0
- package/dist/api/function-version.api.d.ts +5 -0
- package/dist/api/function-version.api.js +14 -0
- package/dist/api/function-version.api.js.map +1 -0
- package/dist/api/function.api.d.ts +6 -0
- package/dist/api/function.api.js +16 -0
- package/dist/api/function.api.js.map +1 -0
- package/dist/api/health.api.d.ts +2 -0
- package/dist/api/health.api.js +7 -0
- package/dist/api/health.api.js.map +1 -0
- package/dist/api/index.d.ts +9 -0
- package/dist/api/index.js +26 -0
- package/dist/api/index.js.map +1 -0
- package/dist/index.d.ts +70 -0
- package/dist/index.js +131 -0
- package/dist/index.js.map +1 -0
- package/dist/types/enum/access-grant-status.enum.d.ts +5 -0
- package/dist/types/enum/access-grant-status.enum.js +10 -0
- package/dist/types/enum/access-grant-status.enum.js.map +1 -0
- package/dist/types/enum/access-kind.enum.d.ts +4 -0
- package/dist/types/enum/access-kind.enum.js +9 -0
- package/dist/types/enum/access-kind.enum.js.map +1 -0
- 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/health-status.enum.d.ts +4 -0
- package/dist/types/enum/health-status.enum.js +9 -0
- package/dist/types/enum/health-status.enum.js.map +1 -0
- package/dist/types/enum/index.d.ts +14 -0
- package/dist/types/enum/index.js +31 -0
- package/dist/types/enum/index.js.map +1 -0
- package/dist/types/enum/reflex-error-code.enum.d.ts +10 -0
- package/dist/types/enum/reflex-error-code.enum.js +15 -0
- package/dist/types/enum/reflex-error-code.enum.js.map +1 -0
- 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-mode.enum.d.ts +5 -0
- package/dist/types/enum/run-mode.enum.js +10 -0
- package/dist/types/enum/run-mode.enum.js.map +1 -0
- package/dist/types/enum/run-status.enum.d.ts +6 -0
- package/dist/types/enum/run-status.enum.js +11 -0
- package/dist/types/enum/run-status.enum.js.map +1 -0
- 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.d.ts +5 -0
- package/dist/types/enum/trace-effect-type.enum.js +10 -0
- package/dist/types/enum/trace-effect-type.enum.js.map +1 -0
- package/dist/types/enum/trigger-access-mode.enum.d.ts +5 -0
- package/dist/types/enum/trigger-access-mode.enum.js +10 -0
- package/dist/types/enum/trigger-access-mode.enum.js.map +1 -0
- package/dist/types/enum/trigger-type.enum.d.ts +3 -0
- package/dist/types/enum/trigger-type.enum.js +8 -0
- package/dist/types/enum/trigger-type.enum.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/interface/api/index.d.ts +3 -0
- package/dist/types/interface/api/index.js +20 -0
- package/dist/types/interface/api/index.js.map +1 -0
- package/dist/types/interface/api/requests/function-access.request.d.ts +17 -0
- package/dist/types/interface/api/requests/function-access.request.js +3 -0
- package/dist/types/interface/api/requests/function-access.request.js.map +1 -0
- package/dist/types/interface/api/requests/function-promotion.request.d.ts +20 -0
- package/dist/types/interface/api/requests/function-promotion.request.js +3 -0
- package/dist/types/interface/api/requests/function-promotion.request.js.map +1 -0
- package/dist/types/interface/api/requests/function-run.request.d.ts +20 -0
- package/dist/types/interface/api/requests/function-run.request.js +3 -0
- package/dist/types/interface/api/requests/function-run.request.js.map +1 -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-test.request.d.ts +14 -0
- package/dist/types/interface/api/requests/function-test.request.js +3 -0
- package/dist/types/interface/api/requests/function-test.request.js.map +1 -0
- package/dist/types/interface/api/requests/function-trigger.request.d.ts +23 -0
- package/dist/types/interface/api/requests/function-trigger.request.js +3 -0
- package/dist/types/interface/api/requests/function-trigger.request.js.map +1 -0
- package/dist/types/interface/api/requests/function-version.request.d.ts +21 -0
- package/dist/types/interface/api/requests/function-version.request.js +3 -0
- package/dist/types/interface/api/requests/function-version.request.js.map +1 -0
- package/dist/types/interface/api/requests/function.request.d.ts +27 -0
- package/dist/types/interface/api/requests/function.request.js +3 -0
- package/dist/types/interface/api/requests/function.request.js.map +1 -0
- package/dist/types/interface/api/requests/index.d.ts +8 -0
- package/dist/types/interface/api/requests/index.js +25 -0
- package/dist/types/interface/api/requests/index.js.map +1 -0
- package/dist/types/interface/api/response.d.ts +3 -0
- package/dist/types/interface/api/response.js +3 -0
- package/dist/types/interface/api/response.js.map +1 -0
- package/dist/types/interface/api/responses/function-access.response.d.ts +14 -0
- package/dist/types/interface/api/responses/function-access.response.js +3 -0
- package/dist/types/interface/api/responses/function-access.response.js.map +1 -0
- package/dist/types/interface/api/responses/function-promotion.response.d.ts +14 -0
- package/dist/types/interface/api/responses/function-promotion.response.js +3 -0
- package/dist/types/interface/api/responses/function-promotion.response.js.map +1 -0
- package/dist/types/interface/api/responses/function-run.response.d.ts +14 -0
- package/dist/types/interface/api/responses/function-run.response.js +3 -0
- package/dist/types/interface/api/responses/function-run.response.js.map +1 -0
- 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-test.response.d.ts +10 -0
- package/dist/types/interface/api/responses/function-test.response.js +3 -0
- package/dist/types/interface/api/responses/function-test.response.js.map +1 -0
- package/dist/types/interface/api/responses/function-trigger.response.d.ts +18 -0
- package/dist/types/interface/api/responses/function-trigger.response.js +3 -0
- package/dist/types/interface/api/responses/function-trigger.response.js.map +1 -0
- package/dist/types/interface/api/responses/function-version.response.d.ts +23 -0
- package/dist/types/interface/api/responses/function-version.response.js +3 -0
- package/dist/types/interface/api/responses/function-version.response.js.map +1 -0
- package/dist/types/interface/api/responses/function.response.d.ts +20 -0
- package/dist/types/interface/api/responses/function.response.js +3 -0
- package/dist/types/interface/api/responses/function.response.js.map +1 -0
- package/dist/types/interface/api/responses/index.d.ts +8 -0
- package/dist/types/interface/api/responses/index.js +25 -0
- package/dist/types/interface/api/responses/index.js.map +1 -0
- package/dist/types/interface/health.response.d.ts +5 -0
- package/dist/types/interface/health.response.js +3 -0
- package/dist/types/interface/health.response.js.map +1 -0
- package/dist/types/interface/index.d.ts +3 -0
- package/dist/types/interface/index.js +20 -0
- package/dist/types/interface/index.js.map +1 -0
- package/dist/types/interface/models/index.d.ts +9 -0
- package/dist/types/interface/models/index.js +26 -0
- package/dist/types/interface/models/index.js.map +1 -0
- package/dist/types/interface/models/reflex-access-grant.model.d.ts +13 -0
- package/dist/types/interface/models/reflex-access-grant.model.js +3 -0
- package/dist/types/interface/models/reflex-access-grant.model.js.map +1 -0
- package/dist/types/interface/models/reflex-definition.model.d.ts +15 -0
- package/dist/types/interface/models/reflex-definition.model.js +3 -0
- package/dist/types/interface/models/reflex-definition.model.js.map +1 -0
- package/dist/types/interface/models/reflex-environment-pointer.model.d.ts +13 -0
- package/dist/types/interface/models/reflex-environment-pointer.model.js +3 -0
- package/dist/types/interface/models/reflex-environment-pointer.model.js.map +1 -0
- 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-function-version.model.d.ts +10 -0
- package/dist/types/interface/models/reflex-function-version.model.js +3 -0
- package/dist/types/interface/models/reflex-function-version.model.js.map +1 -0
- package/dist/types/interface/models/reflex-function.model.d.ts +12 -0
- package/dist/types/interface/models/reflex-function.model.js +3 -0
- package/dist/types/interface/models/reflex-function.model.js.map +1 -0
- package/dist/types/interface/models/reflex-run.model.d.ts +97 -0
- package/dist/types/interface/models/reflex-run.model.js +3 -0
- package/dist/types/interface/models/reflex-run.model.js.map +1 -0
- 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/dist/types/interface/models/reflex-trigger.model.d.ts +13 -0
- package/dist/types/interface/models/reflex-trigger.model.js +3 -0
- package/dist/types/interface/models/reflex-trigger.model.js.map +1 -0
- package/jest.config.ts +11 -0
- package/package.json +41 -3
- package/src/api/function-access.api.ts +36 -0
- package/src/api/function-promotion.api.ts +42 -0
- package/src/api/function-run.api.ts +38 -0
- package/src/api/function-settings.api.ts +59 -0
- package/src/api/function-test.api.ts +33 -0
- package/src/api/function-trigger.api.ts +52 -0
- package/src/api/function-version.api.ts +56 -0
- package/src/api/function.api.test.ts +301 -0
- package/src/api/function.api.ts +62 -0
- package/src/api/health.api.ts +10 -0
- package/src/api/index.ts +9 -0
- package/src/index.test.ts +50 -0
- package/src/index.ts +152 -0
- package/src/types/enum/access-grant-status.enum.ts +12 -0
- package/src/types/enum/access-kind.enum.ts +7 -0
- 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/health-status.enum.ts +4 -0
- package/src/types/enum/index.ts +14 -0
- package/src/types/enum/reflex-error-code.enum.ts +19 -0
- package/src/types/enum/run-log-level.enum.ts +6 -0
- package/src/types/enum/run-mode.enum.ts +11 -0
- package/src/types/enum/run-status.enum.ts +11 -0
- package/src/types/enum/run-step-status.enum.ts +7 -0
- package/src/types/enum/trace-effect-type.enum.ts +12 -0
- package/src/types/enum/trigger-access-mode.enum.ts +12 -0
- package/src/types/enum/trigger-type.enum.ts +4 -0
- package/src/types/index.ts +2 -0
- package/src/types/interface/api/index.ts +3 -0
- package/src/types/interface/api/requests/function-access.request.ts +25 -0
- package/src/types/interface/api/requests/function-promotion.request.ts +25 -0
- package/src/types/interface/api/requests/function-run.request.ts +26 -0
- package/src/types/interface/api/requests/function-settings.request.ts +27 -0
- package/src/types/interface/api/requests/function-test.request.ts +19 -0
- package/src/types/interface/api/requests/function-trigger.request.ts +28 -0
- package/src/types/interface/api/requests/function-version.request.ts +25 -0
- package/src/types/interface/api/requests/function.request.ts +34 -0
- package/src/types/interface/api/requests/index.ts +8 -0
- package/src/types/interface/api/response.ts +4 -0
- package/src/types/interface/api/responses/function-access.response.ts +17 -0
- package/src/types/interface/api/responses/function-promotion.response.ts +18 -0
- package/src/types/interface/api/responses/function-run.response.ts +18 -0
- package/src/types/interface/api/responses/function-settings.response.ts +33 -0
- package/src/types/interface/api/responses/function-test.response.ts +12 -0
- package/src/types/interface/api/responses/function-trigger.response.ts +24 -0
- package/src/types/interface/api/responses/function-version.response.ts +36 -0
- package/src/types/interface/api/responses/function.response.ts +25 -0
- package/src/types/interface/api/responses/index.ts +8 -0
- package/src/types/interface/health.response.ts +7 -0
- package/src/types/interface/index.ts +3 -0
- package/src/types/interface/models/index.ts +9 -0
- package/src/types/interface/models/reflex-access-grant.model.ts +14 -0
- package/src/types/interface/models/reflex-definition.model.ts +23 -0
- package/src/types/interface/models/reflex-environment-pointer.model.ts +18 -0
- package/src/types/interface/models/reflex-execution-settings.model.ts +53 -0
- package/src/types/interface/models/reflex-function-version.model.ts +14 -0
- package/src/types/interface/models/reflex-function.model.ts +14 -0
- package/src/types/interface/models/reflex-run.model.ts +159 -0
- package/src/types/interface/models/reflex-step-stats.model.ts +35 -0
- package/src/types/interface/models/reflex-trigger.model.ts +17 -0
- package/tsconfig.check.json +15 -0
- package/tsconfig.json +35 -0
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export enum RunStatus {
|
|
2
|
+
/** A live execution accepted and not finished yet (an async caller reads it by its id). */
|
|
3
|
+
RUNNING = 'RUNNING',
|
|
4
|
+
SUCCEEDED = 'SUCCEEDED',
|
|
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',
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The kind of effect one trace entry records. */
|
|
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
|
+
*/
|
|
7
|
+
EVALUATE = 'EVALUATE',
|
|
8
|
+
/** An HTTP call: an HTTP step or `fetch()`. */
|
|
9
|
+
HTTP = 'HTTP',
|
|
10
|
+
/** A call to the host: `store.*`, `secret.get`, `http.respond`, `wait` (its `action`). */
|
|
11
|
+
HOST = 'HOST',
|
|
12
|
+
}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +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;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { TriggerAccessMode } from '../../../enum';
|
|
2
|
+
|
|
3
|
+
export interface IListFunctionTriggerParams {
|
|
4
|
+
applicationId: string;
|
|
5
|
+
functionId: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ICreateFunctionTriggerParams {
|
|
9
|
+
applicationId: string;
|
|
10
|
+
functionId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ICreateFunctionTriggerBody {
|
|
13
|
+
/** Segments of `[A-Za-z0-9._~-]` joined by `/`; unique within the application. */
|
|
14
|
+
path: string;
|
|
15
|
+
accessMode: TriggerAccessMode;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface IRotateFunctionTriggerParams {
|
|
19
|
+
applicationId: string;
|
|
20
|
+
functionId: string;
|
|
21
|
+
triggerId: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface IDeleteFunctionTriggerParams {
|
|
25
|
+
applicationId: string;
|
|
26
|
+
functionId: string;
|
|
27
|
+
triggerId: string;
|
|
28
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface IListFunctionVersionParams {
|
|
2
|
+
applicationId: string;
|
|
3
|
+
functionId: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface IPublishFunctionVersionParams {
|
|
7
|
+
applicationId: string;
|
|
8
|
+
functionId: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface IGetFunctionVersionParams {
|
|
12
|
+
applicationId: string;
|
|
13
|
+
functionId: string;
|
|
14
|
+
versionId: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface IGetFunctionVersionStepStatsParams {
|
|
18
|
+
applicationId: string;
|
|
19
|
+
functionId: string;
|
|
20
|
+
versionId: string;
|
|
21
|
+
}
|
|
22
|
+
export interface IGetFunctionVersionStepStatsQuery {
|
|
23
|
+
/** Only the executions of this Monitor environment; every environment when absent. */
|
|
24
|
+
environmentId?: string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { IReflexDefinition } from '../../models';
|
|
2
|
+
|
|
3
|
+
export interface IListFunctionParams {
|
|
4
|
+
applicationId: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface ICreateFunctionParams {
|
|
8
|
+
applicationId: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ICreateFunctionBody {
|
|
11
|
+
/** Unique within the application, 1 to 100 characters. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Absent: a function without access or step, to fill in. */
|
|
14
|
+
definition?: IReflexDefinition;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface IGetFunctionParams {
|
|
18
|
+
applicationId: string;
|
|
19
|
+
functionId: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface IUpdateFunctionParams {
|
|
23
|
+
applicationId: string;
|
|
24
|
+
functionId: string;
|
|
25
|
+
}
|
|
26
|
+
export interface IUpdateFunctionBody {
|
|
27
|
+
name?: string;
|
|
28
|
+
definition?: IReflexDefinition;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface IDeleteFunctionParams {
|
|
32
|
+
applicationId: string;
|
|
33
|
+
functionId: string;
|
|
34
|
+
}
|
|
@@ -0,0 +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';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IReflexAccessGrant } from '../../models';
|
|
2
|
+
import type { IResponse } from '../response';
|
|
3
|
+
|
|
4
|
+
export interface IListFunctionAccessData {
|
|
5
|
+
grants: IReflexAccessGrant[];
|
|
6
|
+
}
|
|
7
|
+
export type IListFunctionAccessResponse = IResponse<IListFunctionAccessData>;
|
|
8
|
+
|
|
9
|
+
export interface IGrantFunctionAccessData {
|
|
10
|
+
grant: IReflexAccessGrant;
|
|
11
|
+
}
|
|
12
|
+
export type IGrantFunctionAccessResponse = IResponse<IGrantFunctionAccessData>;
|
|
13
|
+
|
|
14
|
+
export interface IRevokeFunctionAccessData {
|
|
15
|
+
grant: IReflexAccessGrant;
|
|
16
|
+
}
|
|
17
|
+
export type IRevokeFunctionAccessResponse = IResponse<IRevokeFunctionAccessData>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IReflexEnvironmentPointer } from '../../models';
|
|
2
|
+
import type { IResponse } from '../response';
|
|
3
|
+
|
|
4
|
+
export interface IListFunctionPromotionData {
|
|
5
|
+
/** The 200 most recent promotions, newest first; the current ones have `isCurrent`. */
|
|
6
|
+
pointers: IReflexEnvironmentPointer[];
|
|
7
|
+
}
|
|
8
|
+
export type IListFunctionPromotionResponse = IResponse<IListFunctionPromotionData>;
|
|
9
|
+
|
|
10
|
+
export interface IPromoteFunctionData {
|
|
11
|
+
pointer: IReflexEnvironmentPointer;
|
|
12
|
+
}
|
|
13
|
+
export type IPromoteFunctionResponse = IResponse<IPromoteFunctionData>;
|
|
14
|
+
|
|
15
|
+
export interface IRollbackFunctionData {
|
|
16
|
+
pointer: IReflexEnvironmentPointer;
|
|
17
|
+
}
|
|
18
|
+
export type IRollbackFunctionResponse = IResponse<IRollbackFunctionData>;
|
|
@@ -0,0 +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>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
IReflexEffectiveExecutionSettings,
|
|
3
|
+
IReflexExecutionSettings,
|
|
4
|
+
IReflexExecutionSettingsValues,
|
|
5
|
+
} from '../../models';
|
|
6
|
+
import type { IResponse } from '../response';
|
|
7
|
+
|
|
8
|
+
export interface IGetFunctionSettingsData {
|
|
9
|
+
/** The default of the function; null when none is set. */
|
|
10
|
+
default: IReflexExecutionSettings | null;
|
|
11
|
+
/** The override of each environment that has one. */
|
|
12
|
+
environments: IReflexExecutionSettings[];
|
|
13
|
+
/** What each Monitor environment of the application runs with. */
|
|
14
|
+
effective: IReflexEffectiveExecutionSettings[];
|
|
15
|
+
/** What applies when neither the environment nor the function sets anything. */
|
|
16
|
+
builtIn: IReflexExecutionSettingsValues;
|
|
17
|
+
}
|
|
18
|
+
export type IGetFunctionSettingsResponse = IResponse<IGetFunctionSettingsData>;
|
|
19
|
+
|
|
20
|
+
export interface ISetFunctionDefaultSettingsData {
|
|
21
|
+
settings: IReflexExecutionSettings;
|
|
22
|
+
}
|
|
23
|
+
export type ISetFunctionDefaultSettingsResponse = IResponse<ISetFunctionDefaultSettingsData>;
|
|
24
|
+
|
|
25
|
+
export interface ISetFunctionEnvironmentSettingsData {
|
|
26
|
+
settings: IReflexExecutionSettings;
|
|
27
|
+
}
|
|
28
|
+
export type ISetFunctionEnvironmentSettingsResponse =
|
|
29
|
+
IResponse<ISetFunctionEnvironmentSettingsData>;
|
|
30
|
+
|
|
31
|
+
export type IRemoveFunctionEnvironmentSettingsData = Record<string, never>;
|
|
32
|
+
export type IRemoveFunctionEnvironmentSettingsResponse =
|
|
33
|
+
IResponse<IRemoveFunctionEnvironmentSettingsData>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IReflexRun } from '../../models';
|
|
2
|
+
import type { IResponse } from '../response';
|
|
3
|
+
|
|
4
|
+
export interface ISimulateFunctionData {
|
|
5
|
+
run: IReflexRun;
|
|
6
|
+
}
|
|
7
|
+
export type ISimulateFunctionResponse = IResponse<ISimulateFunctionData>;
|
|
8
|
+
|
|
9
|
+
export interface IDryRunFunctionData {
|
|
10
|
+
run: IReflexRun;
|
|
11
|
+
}
|
|
12
|
+
export type IDryRunFunctionResponse = IResponse<IDryRunFunctionData>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IReflexTrigger } from '../../models';
|
|
2
|
+
import type { IResponse } from '../response';
|
|
3
|
+
|
|
4
|
+
export interface IListFunctionTriggerData {
|
|
5
|
+
triggers: IReflexTrigger[];
|
|
6
|
+
}
|
|
7
|
+
export type IListFunctionTriggerResponse = IResponse<IListFunctionTriggerData>;
|
|
8
|
+
|
|
9
|
+
export interface ICreateFunctionTriggerData {
|
|
10
|
+
trigger: IReflexTrigger;
|
|
11
|
+
/** The API key (API_KEY) or the signing secret (SIGNATURE), in clear, ONCE. `null` for PUBLIC. */
|
|
12
|
+
secret: string | null;
|
|
13
|
+
}
|
|
14
|
+
export type ICreateFunctionTriggerResponse = IResponse<ICreateFunctionTriggerData>;
|
|
15
|
+
|
|
16
|
+
export interface IRotateFunctionTriggerData {
|
|
17
|
+
trigger: IReflexTrigger;
|
|
18
|
+
/** The new key or signing secret, in clear, ONCE; the previous one stops working at once. */
|
|
19
|
+
secret: string;
|
|
20
|
+
}
|
|
21
|
+
export type IRotateFunctionTriggerResponse = IResponse<IRotateFunctionTriggerData>;
|
|
22
|
+
|
|
23
|
+
export type IDeleteFunctionTriggerData = Record<string, never>;
|
|
24
|
+
export type IDeleteFunctionTriggerResponse = IResponse<IDeleteFunctionTriggerData>;
|
|
@@ -0,0 +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>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { IReflexFunction } from '../../models';
|
|
2
|
+
import type { IResponse } from '../response';
|
|
3
|
+
|
|
4
|
+
export interface IListFunctionData {
|
|
5
|
+
functions: IReflexFunction[];
|
|
6
|
+
}
|
|
7
|
+
export type IListFunctionResponse = IResponse<IListFunctionData>;
|
|
8
|
+
|
|
9
|
+
export interface ICreateFunctionData {
|
|
10
|
+
function: IReflexFunction;
|
|
11
|
+
}
|
|
12
|
+
export type ICreateFunctionResponse = IResponse<ICreateFunctionData>;
|
|
13
|
+
|
|
14
|
+
export interface IGetFunctionData {
|
|
15
|
+
function: IReflexFunction;
|
|
16
|
+
}
|
|
17
|
+
export type IGetFunctionResponse = IResponse<IGetFunctionData>;
|
|
18
|
+
|
|
19
|
+
export interface IUpdateFunctionData {
|
|
20
|
+
function: IReflexFunction;
|
|
21
|
+
}
|
|
22
|
+
export type IUpdateFunctionResponse = IResponse<IUpdateFunctionData>;
|
|
23
|
+
|
|
24
|
+
export type IDeleteFunctionData = Record<string, never>;
|
|
25
|
+
export type IDeleteFunctionResponse = IResponse<IDeleteFunctionData>;
|
|
@@ -0,0 +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';
|
|
@@ -0,0 +1,9 @@
|
|
|
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';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AccessGrantStatus } from '../../enum';
|
|
2
|
+
import type { IReflexAccessDeclaration } from './reflex-definition.model';
|
|
3
|
+
|
|
4
|
+
export interface IReflexAccessGrant {
|
|
5
|
+
id: string;
|
|
6
|
+
functionId: string;
|
|
7
|
+
declaration: IReflexAccessDeclaration;
|
|
8
|
+
status: AccessGrantStatus;
|
|
9
|
+
grantedByUserId: string;
|
|
10
|
+
grantedAt: Date;
|
|
11
|
+
suspendedAt: Date | null;
|
|
12
|
+
revokedByUserId: string | null;
|
|
13
|
+
revokedAt: Date | null;
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReflexAccessKind } from '../../enum';
|
|
2
|
+
|
|
3
|
+
export interface IReflexHttpAccess {
|
|
4
|
+
kind: ReflexAccessKind.HTTP;
|
|
5
|
+
hosts: string[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface IReflexHostActionAccess {
|
|
9
|
+
kind: ReflexAccessKind.HOST_ACTION;
|
|
10
|
+
action: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type IReflexAccessDeclaration = IReflexHttpAccess | IReflexHostActionAccess;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A function's definition, in the format of @abyss-project/runtime (`formatVersion` 1). The steps are
|
|
17
|
+
* the core's own and validated by the API; the SDK only carries them.
|
|
18
|
+
*/
|
|
19
|
+
export interface IReflexDefinition {
|
|
20
|
+
formatVersion: number;
|
|
21
|
+
accesses: IReflexAccessDeclaration[];
|
|
22
|
+
steps: Array<Record<string, unknown>>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IReflexAccessDeclaration } from './reflex-definition.model';
|
|
2
|
+
|
|
3
|
+
/** One promotion of a version into a Monitor environment. The `isCurrent` one is what runs. */
|
|
4
|
+
export interface IReflexEnvironmentPointer {
|
|
5
|
+
id: string;
|
|
6
|
+
functionId: string;
|
|
7
|
+
/** The Monitor environment of the application. */
|
|
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
|
+
}
|