@abyss-project/reflex 0.0.0-stage → 1.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/.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 +3 -0
- package/dist/api/function-run.api.js +12 -0
- package/dist/api/function-run.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 +4 -0
- package/dist/api/function-version.api.js +12 -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 +8 -0
- package/dist/api/index.js +25 -0
- package/dist/api/index.js.map +1 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.js +122 -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/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 +9 -0
- package/dist/types/enum/index.js +26 -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-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 +4 -0
- package/dist/types/enum/run-status.enum.js +9 -0
- package/dist/types/enum/run-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 +15 -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-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 +13 -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 +7 -0
- package/dist/types/interface/api/requests/index.js +24 -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 +10 -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-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 +14 -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 +7 -0
- package/dist/types/interface/api/responses/index.js +24 -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 +7 -0
- package/dist/types/interface/models/index.js +24 -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-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 +46 -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-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 +26 -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 +37 -0
- package/src/api/function.api.test.ts +212 -0
- package/src/api/function.api.ts +62 -0
- package/src/api/health.api.ts +10 -0
- package/src/api/index.ts +8 -0
- package/src/index.test.ts +50 -0
- package/src/index.ts +135 -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/health-status.enum.ts +4 -0
- package/src/types/enum/index.ts +9 -0
- package/src/types/enum/reflex-error-code.enum.ts +19 -0
- package/src/types/enum/run-mode.enum.ts +11 -0
- package/src/types/enum/run-status.enum.ts +4 -0
- package/src/types/enum/trace-effect-type.enum.ts +6 -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 +19 -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 +15 -0
- package/src/types/interface/api/requests/function.request.ts +34 -0
- package/src/types/interface/api/requests/index.ts +7 -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 +13 -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 +17 -0
- package/src/types/interface/api/responses/function.response.ts +25 -0
- package/src/types/interface/api/responses/index.ts +7 -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 +7 -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-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 +57 -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
|
+
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,15 @@
|
|
|
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
|
+
}
|
|
@@ -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,7 @@
|
|
|
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';
|
|
@@ -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,13 @@
|
|
|
1
|
+
import type { IReflexRun } 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: IReflexRun;
|
|
12
|
+
}
|
|
13
|
+
export type IGetFunctionRunResponse = IResponse<IGetFunctionRunData>;
|
|
@@ -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,17 @@
|
|
|
1
|
+
import type { IReflexFunctionVersion } from '../../models';
|
|
2
|
+
import type { IResponse } from '../response';
|
|
3
|
+
|
|
4
|
+
export interface IListFunctionVersionData {
|
|
5
|
+
versions: IReflexFunctionVersion[];
|
|
6
|
+
}
|
|
7
|
+
export type IListFunctionVersionResponse = IResponse<IListFunctionVersionData>;
|
|
8
|
+
|
|
9
|
+
export interface IPublishFunctionVersionData {
|
|
10
|
+
version: IReflexFunctionVersion;
|
|
11
|
+
}
|
|
12
|
+
export type IPublishFunctionVersionResponse = IResponse<IPublishFunctionVersionData>;
|
|
13
|
+
|
|
14
|
+
export interface IGetFunctionVersionData {
|
|
15
|
+
version: IReflexFunctionVersion;
|
|
16
|
+
}
|
|
17
|
+
export type IGetFunctionVersionResponse = IResponse<IGetFunctionVersionData>;
|
|
@@ -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,7 @@
|
|
|
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';
|
|
@@ -0,0 +1,7 @@
|
|
|
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';
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IReflexDefinition } from './reflex-definition.model';
|
|
2
|
+
|
|
3
|
+
export interface IReflexFunctionVersion {
|
|
4
|
+
id: string;
|
|
5
|
+
functionId: string;
|
|
6
|
+
/** 1, 2, 3...: counted per function. */
|
|
7
|
+
number: number;
|
|
8
|
+
/** The frozen definition. */
|
|
9
|
+
definition: IReflexDefinition;
|
|
10
|
+
/** SHA-256 of the definition, lowercase hex. */
|
|
11
|
+
hash: string;
|
|
12
|
+
publishedByUserId: string;
|
|
13
|
+
publishedAt: Date;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IReflexDefinition } from './reflex-definition.model';
|
|
2
|
+
|
|
3
|
+
export interface IReflexFunction {
|
|
4
|
+
id: string;
|
|
5
|
+
applicationId: string;
|
|
6
|
+
projectId: string;
|
|
7
|
+
name: string;
|
|
8
|
+
/** The definition being edited; a publication freezes a copy of it. */
|
|
9
|
+
draftDefinition: IReflexDefinition;
|
|
10
|
+
createdByUserId: string;
|
|
11
|
+
updatedByUserId: string;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
updatedAt: Date;
|
|
14
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { RunMode, RunStatus, TraceEffectType } from '../../enum';
|
|
2
|
+
|
|
3
|
+
export interface IReflexTraceError {
|
|
4
|
+
code: string;
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** One effect of the run. `recorded` is true when the effect was recorded instead of executed. */
|
|
9
|
+
export interface IReflexTraceEntry {
|
|
10
|
+
stepId: string;
|
|
11
|
+
type: TraceEffectType;
|
|
12
|
+
/** The host action, for a HOST effect. */
|
|
13
|
+
action?: string;
|
|
14
|
+
request?: unknown;
|
|
15
|
+
response?: unknown;
|
|
16
|
+
error?: IReflexTraceError;
|
|
17
|
+
recorded: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** What `http.respond` built: the response the caller of the trigger would get. */
|
|
21
|
+
export interface IReflexTraceResponse {
|
|
22
|
+
status: number;
|
|
23
|
+
headers: Record<string, string>;
|
|
24
|
+
body: unknown;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Bounded: past 100 entries, or a value of more than 4 KB, the trace is cut and says so (`truncated`). */
|
|
28
|
+
export interface IReflexRunTrace {
|
|
29
|
+
entries: IReflexTraceEntry[];
|
|
30
|
+
outcome: {
|
|
31
|
+
status: RunStatus;
|
|
32
|
+
output?: unknown;
|
|
33
|
+
error?: IReflexTraceError & { stepId?: string };
|
|
34
|
+
};
|
|
35
|
+
response?: IReflexTraceResponse;
|
|
36
|
+
truncated: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface IReflexRun {
|
|
40
|
+
id: string;
|
|
41
|
+
functionId: string;
|
|
42
|
+
versionId: string | null;
|
|
43
|
+
environmentId: string | null;
|
|
44
|
+
mode: RunMode;
|
|
45
|
+
status: RunStatus;
|
|
46
|
+
durationMs: number;
|
|
47
|
+
/** The effects of a test run; null for a LIVE run, which records no trace (nothing of the caller is kept). */
|
|
48
|
+
trace: IReflexRunTrace | null;
|
|
49
|
+
/** The trigger that started a LIVE run; null for a test run. */
|
|
50
|
+
triggerId: string | null;
|
|
51
|
+
/** The HTTP status the caller of a LIVE run got; null for a test run. */
|
|
52
|
+
httpStatus: number | null;
|
|
53
|
+
/** The code of the error a failed LIVE run answered (FUNCTION_FAILED, FUNCTION_TIMEOUT, RUNNER_UNAVAILABLE, RUNNER_SATURATED, INTERNAL_ERROR); null otherwise. */
|
|
54
|
+
errorCode: string | null;
|
|
55
|
+
createdByUserId: string | null;
|
|
56
|
+
createdAt: Date;
|
|
57
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TriggerAccessMode, TriggerType } from '../../enum';
|
|
2
|
+
|
|
3
|
+
/** Never carries the key or the signing secret: they are shown once, when created or rotated. */
|
|
4
|
+
export interface IReflexTrigger {
|
|
5
|
+
id: string;
|
|
6
|
+
functionId: string;
|
|
7
|
+
applicationId: string;
|
|
8
|
+
/** The application's slug, first segment of the address (`/<applicationSlug>/<environmentSlug>/<path>`). */
|
|
9
|
+
applicationSlug: string;
|
|
10
|
+
type: TriggerType;
|
|
11
|
+
/** Segments of `[A-Za-z0-9._~-]` joined by `/`, without leading or trailing slash. */
|
|
12
|
+
path: string;
|
|
13
|
+
accessMode: TriggerAccessMode;
|
|
14
|
+
createdByUserId: string;
|
|
15
|
+
createdAt: Date;
|
|
16
|
+
updatedAt: Date;
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Perimetre de VERIFICATION, distinct de celui du build.
|
|
3
|
+
//
|
|
4
|
+
// `tsconfig.json` exclut `src/**/*.spec.ts` parce qu'il sert a emettre `dist/`, ou une spec
|
|
5
|
+
// n'a rien a faire. Mais eslint s'appuie sur ce meme fichier via `parserOptions.project` :
|
|
6
|
+
// les cinq specs du paquet sortaient donc en « Parsing error: that TSConfig does not include
|
|
7
|
+
// this file », mesure du 2026-09-09, et n'etaient lintees par personne.
|
|
8
|
+
//
|
|
9
|
+
// Ce fichier sert uniquement a eslint. Il n'emet rien et ne change pas ce que `build` produit.
|
|
10
|
+
"extends": "./tsconfig.json",
|
|
11
|
+
"compilerOptions": {
|
|
12
|
+
"noEmit": true
|
|
13
|
+
},
|
|
14
|
+
"exclude": ["./dist/**/*"]
|
|
15
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"incremental": false,
|
|
4
|
+
"target": "es2021",
|
|
5
|
+
"lib": [
|
|
6
|
+
"dom",
|
|
7
|
+
"es2021"
|
|
8
|
+
],
|
|
9
|
+
"module": "commonjs",
|
|
10
|
+
"rootDir": "src",
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"declaration": true,
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"outDir": "./dist",
|
|
16
|
+
"removeComments": true,
|
|
17
|
+
"allowSyntheticDefaultImports": true,
|
|
18
|
+
"esModuleInterop": true,
|
|
19
|
+
"forceConsistentCasingInFileNames": true,
|
|
20
|
+
"strict": true,
|
|
21
|
+
"strictNullChecks": true,
|
|
22
|
+
"strictFunctionTypes": true,
|
|
23
|
+
"strictPropertyInitialization": false,
|
|
24
|
+
"skipLibCheck": true
|
|
25
|
+
},
|
|
26
|
+
"include": [
|
|
27
|
+
"./src"
|
|
28
|
+
],
|
|
29
|
+
"exclude": [
|
|
30
|
+
"./dist/**/*",
|
|
31
|
+
"./src/**/*.spec.ts",
|
|
32
|
+
"./src/**/*.test.ts",
|
|
33
|
+
"./src/**/__tests__/**"
|
|
34
|
+
]
|
|
35
|
+
}
|