@abyss-project/reflex 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/function-version.api.d.ts +1 -2
- package/dist/api/function-version.api.js +1 -3
- package/dist/api/function-version.api.js.map +1 -1
- package/dist/api/index.d.ts +5 -2
- package/dist/api/index.js +5 -2
- package/dist/api/index.js.map +1 -1
- package/dist/api/service-deployment.api.d.ts +6 -0
- package/dist/api/service-deployment.api.js +19 -0
- package/dist/api/service-deployment.api.js.map +1 -0
- package/dist/api/service-route.api.d.ts +6 -0
- package/dist/api/service-route.api.js +16 -0
- package/dist/api/service-route.api.js.map +1 -0
- package/dist/api/service-variable.api.d.ts +5 -0
- package/dist/api/service-variable.api.js +16 -0
- package/dist/api/service-variable.api.js.map +1 -0
- package/dist/api/service-version.api.d.ts +4 -0
- package/dist/api/service-version.api.js +12 -0
- package/dist/api/service-version.api.js.map +1 -0
- package/dist/api/service.api.d.ts +6 -0
- package/dist/api/service.api.js +17 -0
- package/dist/api/service.api.js.map +1 -0
- package/dist/index.d.ts +37 -14
- package/dist/index.js +37 -14
- package/dist/index.js.map +1 -1
- package/dist/types/enum/index.d.ts +6 -1
- package/dist/types/enum/index.js +6 -1
- package/dist/types/enum/index.js.map +1 -1
- package/dist/types/enum/reflex-error-code.enum.d.ts +5 -2
- package/dist/types/enum/reflex-error-code.enum.js +4 -1
- package/dist/types/enum/reflex-error-code.enum.js.map +1 -1
- package/dist/types/enum/route-method.enum.d.ts +8 -0
- package/dist/types/enum/route-method.enum.js +13 -0
- package/dist/types/enum/route-method.enum.js.map +1 -0
- package/dist/types/enum/secret-source.enum.d.ts +5 -0
- package/dist/types/enum/secret-source.enum.js +10 -0
- package/dist/types/enum/secret-source.enum.js.map +1 -0
- package/dist/types/enum/service-deployment-action.enum.d.ts +6 -0
- package/dist/types/enum/service-deployment-action.enum.js +11 -0
- package/dist/types/enum/service-deployment-action.enum.js.map +1 -0
- package/dist/types/enum/service-deployment-status.enum.d.ts +4 -0
- package/dist/types/enum/service-deployment-status.enum.js +9 -0
- package/dist/types/enum/service-deployment-status.enum.js.map +1 -0
- package/dist/types/enum/service-type.enum.d.ts +4 -0
- package/dist/types/enum/service-type.enum.js +9 -0
- package/dist/types/enum/service-type.enum.js.map +1 -0
- package/dist/types/enum/service-version-change-kind.enum.d.ts +5 -0
- package/dist/types/enum/service-version-change-kind.enum.js +10 -0
- package/dist/types/enum/service-version-change-kind.enum.js.map +1 -0
- package/dist/types/interface/api/requests/function-version.request.d.ts +0 -4
- package/dist/types/interface/api/requests/function.request.d.ts +1 -0
- package/dist/types/interface/api/requests/index.d.ts +5 -2
- package/dist/types/interface/api/requests/index.js +5 -2
- package/dist/types/interface/api/requests/index.js.map +1 -1
- package/dist/types/interface/api/requests/service-deployment.request.d.ts +39 -0
- package/dist/types/interface/api/requests/{function-promotion.request.js → service-deployment.request.js} +1 -1
- package/dist/types/interface/api/requests/service-deployment.request.js.map +1 -0
- package/dist/types/interface/api/requests/service-route.request.d.ts +36 -0
- package/dist/types/interface/api/requests/{function-trigger.request.js → service-route.request.js} +1 -1
- package/dist/types/interface/api/requests/service-route.request.js.map +1 -0
- package/dist/types/interface/api/requests/service-variable.request.d.ts +23 -0
- package/dist/types/interface/api/{responses/function-trigger.response.js → requests/service-variable.request.js} +1 -1
- package/dist/types/interface/api/requests/service-variable.request.js.map +1 -0
- package/dist/types/interface/api/requests/service-version.request.d.ts +16 -0
- package/dist/types/interface/api/requests/service-version.request.js +3 -0
- package/dist/types/interface/api/requests/service-version.request.js.map +1 -0
- package/dist/types/interface/api/requests/service.request.d.ts +30 -0
- package/dist/types/interface/{models/reflex-trigger.model.js → api/requests/service.request.js} +1 -1
- package/dist/types/interface/api/requests/service.request.js.map +1 -0
- package/dist/types/interface/api/responses/function-version.response.d.ts +0 -4
- package/dist/types/interface/api/responses/index.d.ts +5 -2
- package/dist/types/interface/api/responses/index.js +5 -2
- package/dist/types/interface/api/responses/index.js.map +1 -1
- package/dist/types/interface/api/responses/service-deployment.response.d.ts +24 -0
- package/dist/types/interface/api/responses/{function-promotion.response.js → service-deployment.response.js} +1 -1
- package/dist/types/interface/api/responses/service-deployment.response.js.map +1 -0
- package/dist/types/interface/api/responses/service-route.response.d.ts +23 -0
- package/dist/types/interface/api/responses/service-route.response.js +3 -0
- package/dist/types/interface/api/responses/service-route.response.js.map +1 -0
- package/dist/types/interface/api/responses/service-variable.response.d.ts +22 -0
- package/dist/types/interface/api/responses/service-variable.response.js +3 -0
- package/dist/types/interface/api/responses/service-variable.response.js.map +1 -0
- package/dist/types/interface/api/responses/service-version.response.d.ts +23 -0
- package/dist/types/interface/api/responses/service-version.response.js +3 -0
- package/dist/types/interface/api/responses/service-version.response.js.map +1 -0
- package/dist/types/interface/api/responses/service.response.d.ts +23 -0
- package/dist/types/interface/api/responses/service.response.js +3 -0
- package/dist/types/interface/api/responses/service.response.js.map +1 -0
- package/dist/types/interface/models/index.d.ts +5 -2
- package/dist/types/interface/models/index.js +5 -2
- package/dist/types/interface/models/index.js.map +1 -1
- package/dist/types/interface/models/reflex-function.model.d.ts +1 -0
- package/dist/types/interface/models/reflex-route.model.d.ts +12 -0
- package/dist/types/interface/models/reflex-route.model.js +3 -0
- package/dist/types/interface/models/reflex-route.model.js.map +1 -0
- package/dist/types/interface/models/reflex-run.model.d.ts +1 -1
- package/dist/types/interface/models/reflex-service-deployment.model.d.ts +20 -0
- package/dist/types/interface/models/reflex-service-deployment.model.js +3 -0
- package/dist/types/interface/models/reflex-service-deployment.model.js.map +1 -0
- package/dist/types/interface/models/reflex-service-variable.model.d.ts +10 -0
- package/dist/types/interface/models/reflex-service-variable.model.js +3 -0
- package/dist/types/interface/models/reflex-service-variable.model.js.map +1 -0
- package/dist/types/interface/models/reflex-service-version.model.d.ts +30 -0
- package/dist/types/interface/models/reflex-service-version.model.js +3 -0
- package/dist/types/interface/models/reflex-service-version.model.js.map +1 -0
- package/dist/types/interface/models/reflex-service.model.d.ts +33 -0
- package/dist/types/interface/models/reflex-service.model.js +15 -0
- package/dist/types/interface/models/reflex-service.model.js.map +1 -0
- package/package.json +1 -1
- package/src/api/function-run.api.ts +38 -38
- package/src/api/function-test.api.ts +34 -34
- package/src/api/function-version.api.ts +48 -56
- package/src/api/function.api.test.ts +2 -64
- package/src/api/index.ts +12 -9
- package/src/api/service-deployment.api.ts +79 -0
- package/src/api/service-route.api.ts +72 -0
- package/src/api/service-variable.api.ts +58 -0
- package/src/api/service-version.api.ts +39 -0
- package/src/api/service.api.test.ts +234 -0
- package/src/api/service.api.ts +55 -0
- package/src/index.ts +196 -152
- package/src/types/enum/execution-mode.enum.ts +9 -9
- package/src/types/enum/index.ts +19 -14
- package/src/types/enum/reflex-error-code.enum.ts +8 -2
- package/src/types/enum/route-method.enum.ts +9 -0
- package/src/types/enum/secret-source.enum.ts +9 -0
- package/src/types/enum/service-deployment-action.enum.ts +11 -0
- package/src/types/enum/service-deployment-status.enum.ts +5 -0
- package/src/types/enum/service-type.enum.ts +7 -0
- package/src/types/enum/service-version-change-kind.enum.ts +6 -0
- package/src/types/enum/trigger-access-mode.enum.ts +12 -12
- package/src/types/interface/api/requests/function-run.request.ts +26 -26
- package/src/types/interface/api/requests/function-settings.request.ts +27 -27
- package/src/types/interface/api/requests/function-test.request.ts +24 -24
- package/src/types/interface/api/requests/function-version.request.ts +0 -5
- package/src/types/interface/api/requests/function.request.ts +36 -34
- package/src/types/interface/api/requests/index.ts +11 -8
- package/src/types/interface/api/requests/service-deployment.request.ts +49 -0
- package/src/types/interface/api/requests/service-route.request.ts +44 -0
- package/src/types/interface/api/requests/service-variable.request.ts +29 -0
- package/src/types/interface/api/requests/service-version.request.ts +19 -0
- package/src/types/interface/api/requests/service.request.ts +39 -0
- package/src/types/interface/api/responses/function-settings.response.ts +36 -36
- package/src/types/interface/api/responses/function-version.response.ts +31 -36
- package/src/types/interface/api/responses/index.ts +11 -8
- package/src/types/interface/api/responses/service-deployment.response.ts +32 -0
- package/src/types/interface/api/responses/service-route.response.ts +31 -0
- package/src/types/interface/api/responses/service-variable.response.ts +31 -0
- package/src/types/interface/api/responses/service-version.response.ts +33 -0
- package/src/types/interface/api/responses/service.response.ts +31 -0
- package/src/types/interface/models/index.ts +13 -10
- package/src/types/interface/models/reflex-execution-settings.model.ts +50 -50
- package/src/types/interface/models/reflex-function.model.ts +16 -14
- package/src/types/interface/models/reflex-route.model.ts +19 -0
- package/src/types/interface/models/reflex-run.model.ts +5 -5
- package/src/types/interface/models/reflex-service-deployment.model.ts +29 -0
- package/src/types/interface/models/reflex-service-variable.model.ts +16 -0
- package/src/types/interface/models/reflex-service-version.model.ts +43 -0
- package/src/types/interface/models/reflex-service.model.ts +46 -0
- package/dist/api/function-promotion.api.d.ts +0 -4
- package/dist/api/function-promotion.api.js +0 -12
- package/dist/api/function-promotion.api.js.map +0 -1
- package/dist/api/function-trigger.api.d.ts +0 -5
- package/dist/api/function-trigger.api.js +0 -14
- package/dist/api/function-trigger.api.js.map +0 -1
- package/dist/types/enum/trigger-type.enum.d.ts +0 -3
- package/dist/types/enum/trigger-type.enum.js +0 -8
- package/dist/types/enum/trigger-type.enum.js.map +0 -1
- package/dist/types/interface/api/requests/function-promotion.request.d.ts +0 -20
- package/dist/types/interface/api/requests/function-promotion.request.js.map +0 -1
- package/dist/types/interface/api/requests/function-trigger.request.d.ts +0 -23
- package/dist/types/interface/api/requests/function-trigger.request.js.map +0 -1
- package/dist/types/interface/api/responses/function-promotion.response.d.ts +0 -14
- package/dist/types/interface/api/responses/function-promotion.response.js.map +0 -1
- package/dist/types/interface/api/responses/function-trigger.response.d.ts +0 -18
- package/dist/types/interface/api/responses/function-trigger.response.js.map +0 -1
- package/dist/types/interface/models/reflex-environment-pointer.model.d.ts +0 -13
- package/dist/types/interface/models/reflex-environment-pointer.model.js +0 -3
- package/dist/types/interface/models/reflex-environment-pointer.model.js.map +0 -1
- package/dist/types/interface/models/reflex-trigger.model.d.ts +0 -13
- package/dist/types/interface/models/reflex-trigger.model.js.map +0 -1
- package/src/api/function-promotion.api.ts +0 -42
- package/src/api/function-trigger.api.ts +0 -52
- package/src/types/enum/trigger-type.enum.ts +0 -4
- package/src/types/interface/api/requests/function-promotion.request.ts +0 -25
- package/src/types/interface/api/requests/function-trigger.request.ts +0 -28
- package/src/types/interface/api/responses/function-promotion.response.ts +0 -18
- package/src/types/interface/api/responses/function-trigger.response.ts +0 -24
- package/src/types/interface/models/reflex-environment-pointer.model.ts +0 -18
- package/src/types/interface/models/reflex-trigger.model.ts +0 -17
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
export * from './reflex-definition.model';
|
|
2
|
-
export * from './reflex-function.model';
|
|
3
|
-
export * from './reflex-function-version.model';
|
|
4
|
-
export * from './reflex-
|
|
5
|
-
export * from './reflex-
|
|
6
|
-
export * from './reflex-
|
|
7
|
-
export * from './reflex-
|
|
8
|
-
export * from './reflex-
|
|
9
|
-
export * from './reflex-
|
|
10
|
-
export * from './reflex-
|
|
1
|
+
export * from './reflex-definition.model';
|
|
2
|
+
export * from './reflex-function.model';
|
|
3
|
+
export * from './reflex-function-version.model';
|
|
4
|
+
export * from './reflex-access-grant.model';
|
|
5
|
+
export * from './reflex-run.model';
|
|
6
|
+
export * from './reflex-execution-settings.model';
|
|
7
|
+
export * from './reflex-step-stats.model';
|
|
8
|
+
export * from './reflex-price-list.model';
|
|
9
|
+
export * from './reflex-service.model';
|
|
10
|
+
export * from './reflex-route.model';
|
|
11
|
+
export * from './reflex-service-version.model';
|
|
12
|
+
export * from './reflex-service-deployment.model';
|
|
13
|
+
export * from './reflex-service-variable.model';
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { ExecutionMode, ExecutionProfile } from '../../enum';
|
|
2
|
-
import type { ExecutionSettingsSource } from '../../enum';
|
|
3
|
-
|
|
4
|
-
/** The execution settings of a function in an environment. */
|
|
5
|
-
export interface IReflexExecutionSettingsValues {
|
|
6
|
-
profile: ExecutionProfile;
|
|
7
|
-
/** Past this, a synchronous caller that got no answer receives 504 and the execution goes on. */
|
|
8
|
-
responseTimeoutMs: number;
|
|
9
|
-
/** Past this, the execution is stopped with TIMEOUT. */
|
|
10
|
-
maxDurationMs: number;
|
|
11
|
-
mode: ExecutionMode;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/** Bounds of the settings, in milliseconds. */
|
|
15
|
-
export const REFLEX_EXECUTION_SETTINGS_LIMITS = {
|
|
16
|
-
responseTimeoutMs: { min: 1_000, max: 100_000 },
|
|
17
|
-
maxDurationMs: { min: 1_000, max: 3_600_000 },
|
|
18
|
-
} as const;
|
|
19
|
-
|
|
20
|
-
/** What a function runs with when nothing is set. */
|
|
21
|
-
export const DEFAULT_REFLEX_EXECUTION_SETTINGS: Readonly<IReflexExecutionSettingsValues> = {
|
|
22
|
-
profile: ExecutionProfile.S,
|
|
23
|
-
responseTimeoutMs: 30_000,
|
|
24
|
-
maxDurationMs: 30_000,
|
|
25
|
-
mode: ExecutionMode.SYNC,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/** A row of settings: the default of the function (`environmentId` null) or the override of one environment. */
|
|
29
|
-
export interface IReflexExecutionSettings extends IReflexExecutionSettingsValues {
|
|
30
|
-
id: string;
|
|
31
|
-
functionId: string;
|
|
32
|
-
/** An environment of the application (abyss-main's id); null for the default of every environment. */
|
|
33
|
-
environmentId: string | null;
|
|
34
|
-
updatedByUserId: string;
|
|
35
|
-
createdAt: Date;
|
|
36
|
-
updatedAt: Date;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/** What one environment of the application runs with. */
|
|
40
|
-
export interface IReflexEffectiveExecutionSettings {
|
|
41
|
-
environmentId: string;
|
|
42
|
-
/** The name of the environment (abyss-main), immutable. */
|
|
43
|
-
environmentSlug: string;
|
|
44
|
-
/** Changing what a production environment runs with needs REFLEX_PUBLISH_PRODUCTION. */
|
|
45
|
-
isProduction: boolean;
|
|
46
|
-
source: ExecutionSettingsSource;
|
|
47
|
-
settings: IReflexExecutionSettingsValues;
|
|
48
|
-
/** The version promoted in this environment, whose step statistics drive the profile warning; null when none. */
|
|
49
|
-
runningVersionId: string | null;
|
|
50
|
-
}
|
|
1
|
+
import { ExecutionMode, ExecutionProfile } from '../../enum';
|
|
2
|
+
import type { ExecutionSettingsSource } from '../../enum';
|
|
3
|
+
|
|
4
|
+
/** The execution settings of a function in an environment. */
|
|
5
|
+
export interface IReflexExecutionSettingsValues {
|
|
6
|
+
profile: ExecutionProfile;
|
|
7
|
+
/** Past this, a synchronous caller that got no answer receives 504 and the execution goes on. */
|
|
8
|
+
responseTimeoutMs: number;
|
|
9
|
+
/** Past this, the execution is stopped with TIMEOUT. */
|
|
10
|
+
maxDurationMs: number;
|
|
11
|
+
mode: ExecutionMode;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Bounds of the settings, in milliseconds. */
|
|
15
|
+
export const REFLEX_EXECUTION_SETTINGS_LIMITS = {
|
|
16
|
+
responseTimeoutMs: { min: 1_000, max: 100_000 },
|
|
17
|
+
maxDurationMs: { min: 1_000, max: 3_600_000 },
|
|
18
|
+
} as const;
|
|
19
|
+
|
|
20
|
+
/** What a function runs with when nothing is set. */
|
|
21
|
+
export const DEFAULT_REFLEX_EXECUTION_SETTINGS: Readonly<IReflexExecutionSettingsValues> = {
|
|
22
|
+
profile: ExecutionProfile.S,
|
|
23
|
+
responseTimeoutMs: 30_000,
|
|
24
|
+
maxDurationMs: 30_000,
|
|
25
|
+
mode: ExecutionMode.SYNC,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** A row of settings: the default of the function (`environmentId` null) or the override of one environment. */
|
|
29
|
+
export interface IReflexExecutionSettings extends IReflexExecutionSettingsValues {
|
|
30
|
+
id: string;
|
|
31
|
+
functionId: string;
|
|
32
|
+
/** An environment of the application (abyss-main's id); null for the default of every environment. */
|
|
33
|
+
environmentId: string | null;
|
|
34
|
+
updatedByUserId: string;
|
|
35
|
+
createdAt: Date;
|
|
36
|
+
updatedAt: Date;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** What one environment of the application runs with. */
|
|
40
|
+
export interface IReflexEffectiveExecutionSettings {
|
|
41
|
+
environmentId: string;
|
|
42
|
+
/** The name of the environment (abyss-main), immutable. */
|
|
43
|
+
environmentSlug: string;
|
|
44
|
+
/** Changing what a production environment runs with needs REFLEX_PUBLISH_PRODUCTION. */
|
|
45
|
+
isProduction: boolean;
|
|
46
|
+
source: ExecutionSettingsSource;
|
|
47
|
+
settings: IReflexExecutionSettingsValues;
|
|
48
|
+
/** The version promoted in this environment, whose step statistics drive the profile warning; null when none. */
|
|
49
|
+
runningVersionId: string | null;
|
|
50
|
+
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import type { IReflexDefinition } from './reflex-definition.model';
|
|
2
|
-
|
|
3
|
-
export interface IReflexFunction {
|
|
4
|
-
id: string;
|
|
5
|
-
applicationId: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import type { IReflexDefinition } from './reflex-definition.model';
|
|
2
|
+
|
|
3
|
+
export interface IReflexFunction {
|
|
4
|
+
id: string;
|
|
5
|
+
applicationId: string;
|
|
6
|
+
/** The Service the function belongs to; deleting the Service deletes it. */
|
|
7
|
+
serviceId: string;
|
|
8
|
+
projectId: string;
|
|
9
|
+
name: string;
|
|
10
|
+
/** The definition being edited; a publication freezes a copy of it. */
|
|
11
|
+
draftDefinition: IReflexDefinition;
|
|
12
|
+
createdByUserId: string;
|
|
13
|
+
updatedByUserId: string;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { RouteMethod, TriggerAccessMode } from '../../enum';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A route of the draft of a Service: callable only once a version that holds it is in service in the
|
|
5
|
+
* environment. Never carries the key or the signing secret: they are shown once, when created or rotated.
|
|
6
|
+
*/
|
|
7
|
+
export interface IReflexRoute {
|
|
8
|
+
id: string;
|
|
9
|
+
serviceId: string;
|
|
10
|
+
/** A function of the same Service. */
|
|
11
|
+
functionId: string;
|
|
12
|
+
method: RouteMethod;
|
|
13
|
+
/** Segments of `[a-z0-9._~-]` or `:param` joined by `/`, without leading or trailing slash; 20 at most. */
|
|
14
|
+
path: string;
|
|
15
|
+
accessMode: TriggerAccessMode;
|
|
16
|
+
createdByUserId: string;
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
updatedAt: Date;
|
|
19
|
+
}
|
|
@@ -28,7 +28,7 @@ export interface IReflexTraceEntry {
|
|
|
28
28
|
recorded: boolean;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
/** What the RESPOND step (or `abyss.respond`) built: the response the caller of the
|
|
31
|
+
/** What the RESPOND step (or `abyss.respond`) built: the response the caller of the route would get. */
|
|
32
32
|
export interface IReflexTraceResponse {
|
|
33
33
|
status: number;
|
|
34
34
|
headers: Record<string, string>;
|
|
@@ -64,13 +64,13 @@ export interface IReflexRun {
|
|
|
64
64
|
durationMs: number;
|
|
65
65
|
/** The effects of a test run; null for a LIVE run, which records no trace (nothing of the caller is kept). */
|
|
66
66
|
trace: IReflexRunTrace | null;
|
|
67
|
-
/** The
|
|
68
|
-
|
|
67
|
+
/** The route that started a LIVE run; null for a test run. */
|
|
68
|
+
routeId: string | null;
|
|
69
69
|
/** The HTTP status the caller of a LIVE run got; null for a test run. */
|
|
70
70
|
httpStatus: number | null;
|
|
71
71
|
/** The code of the error a failed LIVE run answered (FUNCTION_FAILED, FUNCTION_TIMEOUT, RUNNER_UNAVAILABLE, RUNNER_SATURATED, INTERNAL_ERROR); null otherwise, an interrupted run included. */
|
|
72
72
|
errorCode: string | null;
|
|
73
|
-
/** The mode of the
|
|
73
|
+
/** The execution mode of the function when a LIVE run started; null for a test run. */
|
|
74
74
|
executionMode: ExecutionMode | null;
|
|
75
75
|
/** When the caller of a LIVE run got its answer; null for a test run, or before any answer. */
|
|
76
76
|
responseSentAt: Date | null;
|
|
@@ -145,7 +145,7 @@ export interface IReflexRunDetail extends IReflexRun {
|
|
|
145
145
|
droppedLogLines: number;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
/** The state of a live execution, read by its id (the `executionId` an async
|
|
148
|
+
/** The state of a live execution, read by its id (the `executionId` an async route answers with). */
|
|
149
149
|
export interface IReflexExecutionState {
|
|
150
150
|
id: string;
|
|
151
151
|
status: RunStatus;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ServiceDeploymentAction, ServiceDeploymentStatus } from '../../enum';
|
|
2
|
+
import type { IReflexAccessDeclaration } from './reflex-definition.model';
|
|
3
|
+
|
|
4
|
+
/** The accesses granted to one member function when the gesture was made: what the execution plane holds. */
|
|
5
|
+
export interface IReflexServiceDeploymentGrant {
|
|
6
|
+
functionId: string;
|
|
7
|
+
grants: IReflexAccessDeclaration[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* One gesture on the Service in an environment of the application. The `isCurrent` row is what runs (or
|
|
12
|
+
* is paused) there; the others are the history a rollback reads.
|
|
13
|
+
*/
|
|
14
|
+
export interface IReflexServiceDeployment {
|
|
15
|
+
id: string;
|
|
16
|
+
serviceId: string;
|
|
17
|
+
/** The environment of the application (abyss-main's id). */
|
|
18
|
+
environmentId: string;
|
|
19
|
+
/** The name of that environment, second segment of the address. */
|
|
20
|
+
environmentSlug: string;
|
|
21
|
+
serviceVersionId: string;
|
|
22
|
+
serviceVersionNumber: number;
|
|
23
|
+
action: ServiceDeploymentAction;
|
|
24
|
+
status: ServiceDeploymentStatus;
|
|
25
|
+
grants: IReflexServiceDeploymentGrant[];
|
|
26
|
+
isCurrent: boolean;
|
|
27
|
+
byUserId: string;
|
|
28
|
+
at: Date;
|
|
29
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A non-secret value of a Service in one environment, read as `{{ config.NAME }}` in a field and
|
|
3
|
+
* `config.NAME` in code. Not versioned: a change applies to the next executions.
|
|
4
|
+
*/
|
|
5
|
+
export interface IReflexServiceVariable {
|
|
6
|
+
id: string;
|
|
7
|
+
serviceId: string;
|
|
8
|
+
environmentId: string;
|
|
9
|
+
/** `^[A-Z][A-Z0-9_]{0,63}$`, unique per Service and environment. */
|
|
10
|
+
name: string;
|
|
11
|
+
/** 4096 characters at most. */
|
|
12
|
+
value: string;
|
|
13
|
+
updatedByUserId: string;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { RouteMethod, TriggerAccessMode } from '../../enum';
|
|
2
|
+
import type { IReflexServiceCors } from './reflex-service.model';
|
|
3
|
+
|
|
4
|
+
/** A route as a version of the Service froze it. */
|
|
5
|
+
export interface IReflexServiceVersionRoute {
|
|
6
|
+
routeId: string;
|
|
7
|
+
method: RouteMethod;
|
|
8
|
+
path: string;
|
|
9
|
+
functionId: string;
|
|
10
|
+
accessMode: TriggerAccessMode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** The version of a member function a version of the Service runs. */
|
|
14
|
+
export interface IReflexServiceVersionFunction {
|
|
15
|
+
functionId: string;
|
|
16
|
+
functionVersionId: string;
|
|
17
|
+
functionVersionNumber: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* What a version of the Service freezes. Routes sorted by path then method, functions by id: the same
|
|
22
|
+
* Service always gives the same snapshot, and the same `hash`.
|
|
23
|
+
*/
|
|
24
|
+
export interface IReflexServiceVersionSnapshot {
|
|
25
|
+
routes: IReflexServiceVersionRoute[];
|
|
26
|
+
functions: IReflexServiceVersionFunction[];
|
|
27
|
+
cors: IReflexServiceCors;
|
|
28
|
+
rateLimitPerIpPerMinute: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface IReflexServiceVersion {
|
|
32
|
+
id: string;
|
|
33
|
+
serviceId: string;
|
|
34
|
+
/** 1, 2, 3...: counted per Service. */
|
|
35
|
+
number: number;
|
|
36
|
+
/** 500 characters at most. */
|
|
37
|
+
message: string | null;
|
|
38
|
+
snapshot: IReflexServiceVersionSnapshot;
|
|
39
|
+
/** SHA-256 of the snapshot as canonical JSON (keys sorted), lowercase hex. */
|
|
40
|
+
hash: string;
|
|
41
|
+
publishedByUserId: string;
|
|
42
|
+
publishedAt: Date;
|
|
43
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ServiceType } from '../../enum';
|
|
2
|
+
|
|
3
|
+
/** Bounds of a Service, its routes, versions and variables; the API and its database apply the same ones. */
|
|
4
|
+
export const REFLEX_SERVICE_LIMITS = {
|
|
5
|
+
/** `^[a-z0-9][a-z0-9-]{0,39}$`: the third segment of the address, immutable. */
|
|
6
|
+
slugPattern: /^[a-z0-9][a-z0-9-]{0,39}$/,
|
|
7
|
+
nameMaxLength: 100,
|
|
8
|
+
corsAllowedOriginsMax: 20,
|
|
9
|
+
rateLimitPerIpPerMinute: { min: 1, max: 6000, default: 60 },
|
|
10
|
+
/** Segments of `[a-z0-9._~-]` or `:param`, joined by `/`, without leading or trailing slash. */
|
|
11
|
+
routePathMaxSegments: 20,
|
|
12
|
+
routePathMaxLength: 255,
|
|
13
|
+
versionMessageMaxLength: 500,
|
|
14
|
+
/** `^[A-Z][A-Z0-9_]{0,63}$`: read as `{{ config.NAME }}` in a field and `config.NAME` in code. */
|
|
15
|
+
variableNamePattern: /^[A-Z][A-Z0-9_]{0,63}$/,
|
|
16
|
+
variableValueMaxLength: 4096,
|
|
17
|
+
} as const;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Origins a browser may call the Service from. Each is `https://host` or `https://*.domain`; `*` (any
|
|
21
|
+
* origin) is refused when a route of the Service is not PUBLIC.
|
|
22
|
+
*/
|
|
23
|
+
export interface IReflexServiceCors {
|
|
24
|
+
allowedOrigins: string[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** A group of functions versioned, put in service and paused as one, in an application. */
|
|
28
|
+
export interface IReflexService {
|
|
29
|
+
id: string;
|
|
30
|
+
applicationId: string;
|
|
31
|
+
/** First segment of the address, `app-<8 hex>`, fixed for the application. */
|
|
32
|
+
applicationSlug: string;
|
|
33
|
+
/** Unique within the application. */
|
|
34
|
+
name: string;
|
|
35
|
+
/** Unique within the application, immutable: `/<application>/<environment>/<slug>/<route path>`. */
|
|
36
|
+
slug: string;
|
|
37
|
+
type: ServiceType;
|
|
38
|
+
/** Draft: frozen by the next version. */
|
|
39
|
+
cors: IReflexServiceCors;
|
|
40
|
+
/** Draft: frozen by the next version. Calls per minute and per client IP, in each environment. */
|
|
41
|
+
rateLimitPerIpPerMinute: number;
|
|
42
|
+
createdByUserId: string;
|
|
43
|
+
updatedByUserId: string;
|
|
44
|
+
createdAt: Date;
|
|
45
|
+
updatedAt: Date;
|
|
46
|
+
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { IListFunctionPromotionParams, IListFunctionPromotionResponse, IPromoteFunctionBody, IPromoteFunctionParams, IPromoteFunctionResponse, IRollbackFunctionBody, IRollbackFunctionParams, IRollbackFunctionResponse } from '../types';
|
|
2
|
-
export declare const listFunctionPromotion: (params: IListFunctionPromotionParams) => Promise<IListFunctionPromotionResponse>;
|
|
3
|
-
export declare const promoteFunction: (params: IPromoteFunctionParams, body: IPromoteFunctionBody) => Promise<IPromoteFunctionResponse>;
|
|
4
|
-
export declare const rollbackFunction: (params: IRollbackFunctionParams, body: IRollbackFunctionBody) => Promise<IRollbackFunctionResponse>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rollbackFunction = exports.promoteFunction = exports.listFunctionPromotion = void 0;
|
|
4
|
-
const __1 = require("..");
|
|
5
|
-
const promotionUrl = (params) => `api/function/${params.applicationId}/${params.functionId}/promotion`;
|
|
6
|
-
const listFunctionPromotion = async (params) => (await __1.AbyssReflexCore.axios.get(promotionUrl(params))).data;
|
|
7
|
-
exports.listFunctionPromotion = listFunctionPromotion;
|
|
8
|
-
const promoteFunction = async (params, body) => (await __1.AbyssReflexCore.axios.post(promotionUrl(params), body)).data;
|
|
9
|
-
exports.promoteFunction = promoteFunction;
|
|
10
|
-
const rollbackFunction = async (params, body) => (await __1.AbyssReflexCore.axios.post(`${promotionUrl(params)}/rollback`, body)).data;
|
|
11
|
-
exports.rollbackFunction = rollbackFunction;
|
|
12
|
-
//# sourceMappingURL=function-promotion.api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"function-promotion.api.js","sourceRoot":"","sources":["../../src/api/function-promotion.api.ts"],"names":[],"mappings":";;;AAAA,0BAAqC;AAYrC,MAAM,YAAY,GAAG,CAAC,MAAqD,EAAU,EAAE,CACrF,gBAAgB,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,UAAU,YAAY,CAAC;AAGjE,MAAM,qBAAqB,GAAG,KAAK,EACxC,MAAoC,EACK,EAAE,CAC3C,CAAC,MAAM,mBAAe,CAAC,KAAK,CAAC,GAAG,CAAiC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAHlF,QAAA,qBAAqB,yBAG6D;AAMxF,MAAM,eAAe,GAAG,KAAK,EAClC,MAA8B,EAC9B,IAA0B,EACS,EAAE,CACrC,CAAC,MAAM,mBAAe,CAAC,KAAK,CAAC,IAAI,CAA2B,YAAY,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAJnF,QAAA,eAAe,mBAIoE;AAGzF,MAAM,gBAAgB,GAAG,KAAK,EACnC,MAA+B,EAC/B,IAA2B,EACS,EAAE,CACtC,CACE,MAAM,mBAAe,CAAC,KAAK,CAAC,IAAI,CAC9B,GAAG,YAAY,CAAC,MAAM,CAAC,WAAW,EAClC,IAAI,CACL,CACF,CAAC,IAAI,CAAC;AATI,QAAA,gBAAgB,oBASpB"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ICreateFunctionTriggerBody, ICreateFunctionTriggerParams, ICreateFunctionTriggerResponse, IDeleteFunctionTriggerParams, IDeleteFunctionTriggerResponse, IListFunctionTriggerParams, IListFunctionTriggerResponse, IRotateFunctionTriggerParams, IRotateFunctionTriggerResponse } from '../types';
|
|
2
|
-
export declare const listFunctionTrigger: (params: IListFunctionTriggerParams) => Promise<IListFunctionTriggerResponse>;
|
|
3
|
-
export declare const createFunctionTrigger: (params: ICreateFunctionTriggerParams, body: ICreateFunctionTriggerBody) => Promise<ICreateFunctionTriggerResponse>;
|
|
4
|
-
export declare const rotateFunctionTrigger: (params: IRotateFunctionTriggerParams) => Promise<IRotateFunctionTriggerResponse>;
|
|
5
|
-
export declare const deleteFunctionTrigger: (params: IDeleteFunctionTriggerParams) => Promise<IDeleteFunctionTriggerResponse>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteFunctionTrigger = exports.rotateFunctionTrigger = exports.createFunctionTrigger = exports.listFunctionTrigger = void 0;
|
|
4
|
-
const __1 = require("..");
|
|
5
|
-
const triggerUrl = (params) => `api/function/${params.applicationId}/${params.functionId}/trigger`;
|
|
6
|
-
const listFunctionTrigger = async (params) => (await __1.AbyssReflexCore.axios.get(triggerUrl(params))).data;
|
|
7
|
-
exports.listFunctionTrigger = listFunctionTrigger;
|
|
8
|
-
const createFunctionTrigger = async (params, body) => (await __1.AbyssReflexCore.axios.post(triggerUrl(params), body)).data;
|
|
9
|
-
exports.createFunctionTrigger = createFunctionTrigger;
|
|
10
|
-
const rotateFunctionTrigger = async (params) => (await __1.AbyssReflexCore.axios.post(`${triggerUrl(params)}/${params.triggerId}/rotate`, {})).data;
|
|
11
|
-
exports.rotateFunctionTrigger = rotateFunctionTrigger;
|
|
12
|
-
const deleteFunctionTrigger = async (params) => (await __1.AbyssReflexCore.axios.delete(`${triggerUrl(params)}/${params.triggerId}`)).data;
|
|
13
|
-
exports.deleteFunctionTrigger = deleteFunctionTrigger;
|
|
14
|
-
//# sourceMappingURL=function-trigger.api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"function-trigger.api.js","sourceRoot":"","sources":["../../src/api/function-trigger.api.ts"],"names":[],"mappings":";;;AAAA,0BAAqC;AAarC,MAAM,UAAU,GAAG,CAAC,MAAqD,EAAU,EAAE,CACnF,gBAAgB,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,UAAU,UAAU,CAAC;AAG/D,MAAM,mBAAmB,GAAG,KAAK,EACtC,MAAkC,EACK,EAAE,CACzC,CAAC,MAAM,mBAAe,CAAC,KAAK,CAAC,GAAG,CAA+B,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAH9E,QAAA,mBAAmB,uBAG2D;AAMpF,MAAM,qBAAqB,GAAG,KAAK,EACxC,MAAoC,EACpC,IAAgC,EACS,EAAE,CAC3C,CAAC,MAAM,mBAAe,CAAC,KAAK,CAAC,IAAI,CAAiC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAJvF,QAAA,qBAAqB,yBAIkE;AAG7F,MAAM,qBAAqB,GAAG,KAAK,EACxC,MAAoC,EACK,EAAE,CAC3C,CACE,MAAM,mBAAe,CAAC,KAAK,CAAC,IAAI,CAC9B,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,SAAS,SAAS,EAClD,EAAE,CACH,CACF,CAAC,IAAI,CAAC;AARI,QAAA,qBAAqB,yBAQzB;AAGF,MAAM,qBAAqB,GAAG,KAAK,EACxC,MAAoC,EACK,EAAE,CAC3C,CACE,MAAM,mBAAe,CAAC,KAAK,CAAC,MAAM,CAChC,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,SAAS,EAAE,CAC5C,CACF,CAAC,IAAI,CAAC;AAPI,QAAA,qBAAqB,yBAOzB"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TriggerType = void 0;
|
|
4
|
-
var TriggerType;
|
|
5
|
-
(function (TriggerType) {
|
|
6
|
-
TriggerType["HTTP"] = "HTTP";
|
|
7
|
-
})(TriggerType || (exports.TriggerType = TriggerType = {}));
|
|
8
|
-
//# sourceMappingURL=trigger-type.enum.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trigger-type.enum.js","sourceRoot":"","sources":["../../../src/types/enum/trigger-type.enum.ts"],"names":[],"mappings":";;;AACA,IAAY,WAEX;AAFD,WAAY,WAAW;IACrB,4BAAa,CAAA;AACf,CAAC,EAFW,WAAW,2BAAX,WAAW,QAEtB"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface IListFunctionPromotionParams {
|
|
2
|
-
applicationId: string;
|
|
3
|
-
functionId: string;
|
|
4
|
-
}
|
|
5
|
-
export interface IPromoteFunctionParams {
|
|
6
|
-
applicationId: string;
|
|
7
|
-
functionId: string;
|
|
8
|
-
}
|
|
9
|
-
export interface IPromoteFunctionBody {
|
|
10
|
-
versionId: string;
|
|
11
|
-
environmentId: string;
|
|
12
|
-
}
|
|
13
|
-
export interface IRollbackFunctionParams {
|
|
14
|
-
applicationId: string;
|
|
15
|
-
functionId: string;
|
|
16
|
-
}
|
|
17
|
-
export interface IRollbackFunctionBody {
|
|
18
|
-
environmentId: string;
|
|
19
|
-
versionId?: string;
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"function-promotion.request.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/requests/function-promotion.request.ts"],"names":[],"mappings":""}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { TriggerAccessMode } from '../../../enum';
|
|
2
|
-
export interface IListFunctionTriggerParams {
|
|
3
|
-
applicationId: string;
|
|
4
|
-
functionId: string;
|
|
5
|
-
}
|
|
6
|
-
export interface ICreateFunctionTriggerParams {
|
|
7
|
-
applicationId: string;
|
|
8
|
-
functionId: string;
|
|
9
|
-
}
|
|
10
|
-
export interface ICreateFunctionTriggerBody {
|
|
11
|
-
path: string;
|
|
12
|
-
accessMode: TriggerAccessMode;
|
|
13
|
-
}
|
|
14
|
-
export interface IRotateFunctionTriggerParams {
|
|
15
|
-
applicationId: string;
|
|
16
|
-
functionId: string;
|
|
17
|
-
triggerId: string;
|
|
18
|
-
}
|
|
19
|
-
export interface IDeleteFunctionTriggerParams {
|
|
20
|
-
applicationId: string;
|
|
21
|
-
functionId: string;
|
|
22
|
-
triggerId: string;
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"function-trigger.request.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/requests/function-trigger.request.ts"],"names":[],"mappings":""}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { IReflexEnvironmentPointer } from '../../models';
|
|
2
|
-
import type { IResponse } from '../response';
|
|
3
|
-
export interface IListFunctionPromotionData {
|
|
4
|
-
pointers: IReflexEnvironmentPointer[];
|
|
5
|
-
}
|
|
6
|
-
export type IListFunctionPromotionResponse = IResponse<IListFunctionPromotionData>;
|
|
7
|
-
export interface IPromoteFunctionData {
|
|
8
|
-
pointer: IReflexEnvironmentPointer;
|
|
9
|
-
}
|
|
10
|
-
export type IPromoteFunctionResponse = IResponse<IPromoteFunctionData>;
|
|
11
|
-
export interface IRollbackFunctionData {
|
|
12
|
-
pointer: IReflexEnvironmentPointer;
|
|
13
|
-
}
|
|
14
|
-
export type IRollbackFunctionResponse = IResponse<IRollbackFunctionData>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"function-promotion.response.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/responses/function-promotion.response.ts"],"names":[],"mappings":""}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { IReflexTrigger } from '../../models';
|
|
2
|
-
import type { IResponse } from '../response';
|
|
3
|
-
export interface IListFunctionTriggerData {
|
|
4
|
-
triggers: IReflexTrigger[];
|
|
5
|
-
}
|
|
6
|
-
export type IListFunctionTriggerResponse = IResponse<IListFunctionTriggerData>;
|
|
7
|
-
export interface ICreateFunctionTriggerData {
|
|
8
|
-
trigger: IReflexTrigger;
|
|
9
|
-
secret: string | null;
|
|
10
|
-
}
|
|
11
|
-
export type ICreateFunctionTriggerResponse = IResponse<ICreateFunctionTriggerData>;
|
|
12
|
-
export interface IRotateFunctionTriggerData {
|
|
13
|
-
trigger: IReflexTrigger;
|
|
14
|
-
secret: string;
|
|
15
|
-
}
|
|
16
|
-
export type IRotateFunctionTriggerResponse = IResponse<IRotateFunctionTriggerData>;
|
|
17
|
-
export type IDeleteFunctionTriggerData = Record<string, never>;
|
|
18
|
-
export type IDeleteFunctionTriggerResponse = IResponse<IDeleteFunctionTriggerData>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"function-trigger.response.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/responses/function-trigger.response.ts"],"names":[],"mappings":""}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { IReflexAccessDeclaration } from './reflex-definition.model';
|
|
2
|
-
export interface IReflexEnvironmentPointer {
|
|
3
|
-
id: string;
|
|
4
|
-
functionId: string;
|
|
5
|
-
environmentId: string;
|
|
6
|
-
environmentSlug: string;
|
|
7
|
-
versionId: string;
|
|
8
|
-
versionNumber: number;
|
|
9
|
-
grants: IReflexAccessDeclaration[];
|
|
10
|
-
isCurrent: boolean;
|
|
11
|
-
promotedByUserId: string;
|
|
12
|
-
promotedAt: Date;
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reflex-environment-pointer.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/reflex-environment-pointer.model.ts"],"names":[],"mappings":""}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { TriggerAccessMode, TriggerType } from '../../enum';
|
|
2
|
-
export interface IReflexTrigger {
|
|
3
|
-
id: string;
|
|
4
|
-
functionId: string;
|
|
5
|
-
applicationId: string;
|
|
6
|
-
applicationSlug: string;
|
|
7
|
-
type: TriggerType;
|
|
8
|
-
path: string;
|
|
9
|
-
accessMode: TriggerAccessMode;
|
|
10
|
-
createdByUserId: string;
|
|
11
|
-
createdAt: Date;
|
|
12
|
-
updatedAt: Date;
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reflex-trigger.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/reflex-trigger.model.ts"],"names":[],"mappings":""}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { AbyssReflexCore } from '..';
|
|
2
|
-
import type {
|
|
3
|
-
IListFunctionPromotionParams,
|
|
4
|
-
IListFunctionPromotionResponse,
|
|
5
|
-
IPromoteFunctionBody,
|
|
6
|
-
IPromoteFunctionParams,
|
|
7
|
-
IPromoteFunctionResponse,
|
|
8
|
-
IRollbackFunctionBody,
|
|
9
|
-
IRollbackFunctionParams,
|
|
10
|
-
IRollbackFunctionResponse,
|
|
11
|
-
} from '../types';
|
|
12
|
-
|
|
13
|
-
const promotionUrl = (params: { applicationId: string; functionId: string }): string =>
|
|
14
|
-
`api/function/${params.applicationId}/${params.functionId}/promotion`;
|
|
15
|
-
|
|
16
|
-
/** `GET .../promotion`: where each version runs, and the history a rollback reads. Needs REFLEX_READ. */
|
|
17
|
-
export const listFunctionPromotion = async (
|
|
18
|
-
params: IListFunctionPromotionParams,
|
|
19
|
-
): Promise<IListFunctionPromotionResponse> =>
|
|
20
|
-
(await AbyssReflexCore.axios.get<IListFunctionPromotionResponse>(promotionUrl(params))).data;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* `POST .../promotion`: runs a version in an environment of the application (copies it, its accesses and its secrets to
|
|
24
|
-
* the execution plane). Needs REFLEX_PUBLISH, and REFLEX_PUBLISH_PRODUCTION for a PRODUCTION environment.
|
|
25
|
-
*/
|
|
26
|
-
export const promoteFunction = async (
|
|
27
|
-
params: IPromoteFunctionParams,
|
|
28
|
-
body: IPromoteFunctionBody,
|
|
29
|
-
): Promise<IPromoteFunctionResponse> =>
|
|
30
|
-
(await AbyssReflexCore.axios.post<IPromoteFunctionResponse>(promotionUrl(params), body)).data;
|
|
31
|
-
|
|
32
|
-
/** `POST .../promotion/rollback`: moves the environment back to a version it ran before. Same rights as a promotion. */
|
|
33
|
-
export const rollbackFunction = async (
|
|
34
|
-
params: IRollbackFunctionParams,
|
|
35
|
-
body: IRollbackFunctionBody,
|
|
36
|
-
): Promise<IRollbackFunctionResponse> =>
|
|
37
|
-
(
|
|
38
|
-
await AbyssReflexCore.axios.post<IRollbackFunctionResponse>(
|
|
39
|
-
`${promotionUrl(params)}/rollback`,
|
|
40
|
-
body,
|
|
41
|
-
)
|
|
42
|
-
).data;
|