@abyss-project/reflex 5.1.0 → 5.2.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/service-version.api.d.ts +2 -1
- package/dist/api/service-version.api.js +3 -1
- package/dist/api/service-version.api.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/types/interface/api/requests/service-version.request.d.ts +4 -0
- package/dist/types/interface/api/responses/service-version.response.d.ts +4 -0
- package/package.json +10 -15
- package/src/api/function-access.api.ts +36 -36
- package/src/api/function-run.api.ts +38 -38
- package/src/api/function-settings.api.ts +59 -59
- package/src/api/function-test.api.ts +34 -34
- package/src/api/function-version.api.ts +48 -48
- package/src/api/function.api.test.ts +249 -249
- package/src/api/function.api.ts +62 -62
- package/src/api/health.api.ts +10 -10
- package/src/api/index.ts +13 -13
- package/src/api/service-configuration.api.ts +16 -16
- package/src/api/service-deployment.api.ts +79 -79
- package/src/api/service-discord.api.test.ts +170 -170
- package/src/api/service-discord.api.ts +203 -203
- package/src/api/service-route.api.ts +72 -72
- package/src/api/service-version.api.ts +54 -39
- package/src/api/service.api.test.ts +215 -209
- package/src/api/service.api.ts +55 -55
- package/src/index.ts +237 -235
- package/src/types/enum/access-grant-status.enum.ts +12 -12
- package/src/types/enum/access-kind.enum.ts +7 -7
- package/src/types/enum/configuration-read-as.enum.ts +5 -5
- package/src/types/enum/discord-activity-type.enum.ts +9 -9
- package/src/types/enum/discord-component-kind.enum.ts +7 -7
- package/src/types/enum/discord-gateway-failure-code.enum.ts +9 -9
- package/src/types/enum/discord-gateway-state.enum.ts +11 -11
- package/src/types/enum/discord-option-type.enum.ts +12 -12
- package/src/types/enum/discord-presence-status.enum.ts +8 -8
- package/src/types/enum/discord-sync-status.enum.ts +6 -6
- package/src/types/enum/discord-token-state.enum.ts +11 -11
- package/src/types/enum/execution-mode.enum.ts +9 -9
- package/src/types/enum/execution-profile.enum.ts +20 -20
- package/src/types/enum/execution-settings-source.enum.ts +9 -9
- package/src/types/enum/health-status.enum.ts +4 -4
- package/src/types/enum/index.ts +29 -29
- package/src/types/enum/reflex-error-code.enum.ts +37 -37
- package/src/types/enum/route-method.enum.ts +9 -9
- package/src/types/enum/run-log-level.enum.ts +6 -6
- package/src/types/enum/run-mode.enum.ts +11 -11
- package/src/types/enum/run-status.enum.ts +11 -11
- package/src/types/enum/run-step-status.enum.ts +7 -7
- package/src/types/enum/service-deployment-action.enum.ts +11 -11
- package/src/types/enum/service-deployment-status.enum.ts +5 -5
- package/src/types/enum/service-type.enum.ts +9 -9
- package/src/types/enum/service-version-change-kind.enum.ts +6 -6
- package/src/types/enum/trace-effect-type.enum.ts +12 -12
- package/src/types/enum/trigger-access-mode.enum.ts +12 -12
- package/src/types/enum/vault-value-source.enum.ts +12 -12
- package/src/types/enum/vault-visibility.enum.ts +5 -5
- package/src/types/index.ts +2 -2
- package/src/types/interface/api/index.ts +3 -3
- package/src/types/interface/api/requests/function-access.request.ts +25 -25
- package/src/types/interface/api/requests/function-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 +20 -20
- package/src/types/interface/api/requests/function.request.ts +36 -36
- package/src/types/interface/api/requests/index.ts +12 -12
- package/src/types/interface/api/requests/service-configuration.request.ts +4 -4
- package/src/types/interface/api/requests/service-deployment.request.ts +49 -49
- package/src/types/interface/api/requests/service-discord.request.ts +128 -128
- package/src/types/interface/api/requests/service-route.request.ts +44 -44
- package/src/types/interface/api/requests/service-version.request.ts +5 -0
- package/src/types/interface/api/requests/service.request.ts +46 -46
- package/src/types/interface/api/response.ts +4 -4
- package/src/types/interface/api/responses/function-access.response.ts +17 -17
- package/src/types/interface/api/responses/function-run.response.ts +18 -18
- package/src/types/interface/api/responses/function-settings.response.ts +36 -36
- package/src/types/interface/api/responses/function-test.response.ts +12 -12
- package/src/types/interface/api/responses/function-version.response.ts +31 -31
- package/src/types/interface/api/responses/function.response.ts +25 -25
- package/src/types/interface/api/responses/index.ts +12 -12
- package/src/types/interface/api/responses/service-configuration.response.ts +8 -8
- package/src/types/interface/api/responses/service-deployment.response.ts +32 -32
- package/src/types/interface/api/responses/service-discord.response.ts +72 -72
- package/src/types/interface/api/responses/service-route.response.ts +31 -31
- package/src/types/interface/api/responses/service-version.response.ts +11 -0
- package/src/types/interface/api/responses/service.response.ts +31 -31
- package/src/types/interface/health.response.ts +7 -7
- package/src/types/interface/index.ts +3 -3
- package/src/types/interface/models/index.ts +14 -14
- package/src/types/interface/models/reflex-access-grant.model.ts +14 -14
- package/src/types/interface/models/reflex-definition.model.ts +31 -31
- package/src/types/interface/models/reflex-discord.model.ts +146 -146
- package/src/types/interface/models/reflex-execution-settings.model.ts +50 -50
- package/src/types/interface/models/reflex-function-version.model.ts +14 -14
- package/src/types/interface/models/reflex-function.model.ts +16 -16
- package/src/types/interface/models/reflex-price-list.model.ts +20 -20
- package/src/types/interface/models/reflex-route.model.ts +19 -19
- package/src/types/interface/models/reflex-run.model.ts +173 -173
- package/src/types/interface/models/reflex-service-configuration.model.ts +22 -22
- package/src/types/interface/models/reflex-service-deployment.model.ts +40 -40
- package/src/types/interface/models/reflex-service-version.model.ts +55 -55
- package/src/types/interface/models/reflex-service.model.ts +45 -45
- package/src/types/interface/models/reflex-step-stats.model.ts +35 -35
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ICreateServiceVersionBody, ICreateServiceVersionParams, ICreateServiceVersionResponse, IGetServiceVersionParams, IGetServiceVersionResponse, IListServiceVersionParams, IListServiceVersionResponse } from '../types';
|
|
1
|
+
import type { ICreateServiceVersionBody, ICreateServiceVersionParams, ICreateServiceVersionResponse, IGetServiceVersionDraftStatusParams, IGetServiceVersionDraftStatusResponse, IGetServiceVersionParams, IGetServiceVersionResponse, IListServiceVersionParams, IListServiceVersionResponse } from '../types';
|
|
2
2
|
export declare const listServiceVersion: (params: IListServiceVersionParams) => Promise<IListServiceVersionResponse>;
|
|
3
3
|
export declare const createServiceVersion: (params: ICreateServiceVersionParams, body?: ICreateServiceVersionBody) => Promise<ICreateServiceVersionResponse>;
|
|
4
|
+
export declare const getServiceVersionDraftStatus: (params: IGetServiceVersionDraftStatusParams) => Promise<IGetServiceVersionDraftStatusResponse>;
|
|
4
5
|
export declare const getServiceVersion: (params: IGetServiceVersionParams) => Promise<IGetServiceVersionResponse>;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getServiceVersion = exports.createServiceVersion = exports.listServiceVersion = void 0;
|
|
3
|
+
exports.getServiceVersion = exports.getServiceVersionDraftStatus = exports.createServiceVersion = exports.listServiceVersion = void 0;
|
|
4
4
|
const __1 = require("..");
|
|
5
5
|
const versionUrl = (params) => `api/service/${params.applicationId}/${params.serviceId}/version`;
|
|
6
6
|
const listServiceVersion = async (params) => (await __1.AbyssReflexCore.axios.get(versionUrl(params))).data;
|
|
7
7
|
exports.listServiceVersion = listServiceVersion;
|
|
8
8
|
const createServiceVersion = async (params, body = {}) => (await __1.AbyssReflexCore.axios.post(versionUrl(params), body)).data;
|
|
9
9
|
exports.createServiceVersion = createServiceVersion;
|
|
10
|
+
const getServiceVersionDraftStatus = async (params) => (await __1.AbyssReflexCore.axios.get(`${versionUrl(params)}/draft-status`)).data;
|
|
11
|
+
exports.getServiceVersionDraftStatus = getServiceVersionDraftStatus;
|
|
10
12
|
const getServiceVersion = async (params) => (await __1.AbyssReflexCore.axios.get(`${versionUrl(params)}/${params.versionId}`)).data;
|
|
11
13
|
exports.getServiceVersion = getServiceVersion;
|
|
12
14
|
//# sourceMappingURL=service-version.api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-version.api.js","sourceRoot":"","sources":["../../src/api/service-version.api.ts"],"names":[],"mappings":";;;AAAA,0BAAqC;
|
|
1
|
+
{"version":3,"file":"service-version.api.js","sourceRoot":"","sources":["../../src/api/service-version.api.ts"],"names":[],"mappings":";;;AAAA,0BAAqC;AAarC,MAAM,UAAU,GAAG,CAAC,MAAoD,EAAU,EAAE,CAClF,eAAe,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,SAAS,UAAU,CAAC;AAG7D,MAAM,kBAAkB,GAAG,KAAK,EACrC,MAAiC,EACK,EAAE,CACxC,CAAC,MAAM,mBAAe,CAAC,KAAK,CAAC,GAAG,CAA8B,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAH7E,QAAA,kBAAkB,sBAG2D;AAMnF,MAAM,oBAAoB,GAAG,KAAK,EACvC,MAAmC,EACnC,OAAkC,EAAE,EACI,EAAE,CAC1C,CAAC,MAAM,mBAAe,CAAC,KAAK,CAAC,IAAI,CAAgC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAJtF,QAAA,oBAAoB,wBAIkE;AAM5F,MAAM,4BAA4B,GAAG,KAAK,EAC/C,MAA2C,EACK,EAAE,CAClD,CACE,MAAM,mBAAe,CAAC,KAAK,CAAC,GAAG,CAC7B,GAAG,UAAU,CAAC,MAAM,CAAC,eAAe,CACrC,CACF,CAAC,IAAI,CAAC;AAPI,QAAA,4BAA4B,gCAOhC;AAGF,MAAM,iBAAiB,GAAG,KAAK,EACpC,MAAgC,EACK,EAAE,CACvC,CACE,MAAM,mBAAe,CAAC,KAAK,CAAC,GAAG,CAC7B,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,SAAS,EAAE,CAC5C,CACF,CAAC,IAAI,CAAC;AAPI,QAAA,iBAAiB,qBAOrB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -68,6 +68,7 @@ type AbyssReflexCoreSDK = {
|
|
|
68
68
|
list: typeof serviceVersionApi.listServiceVersion;
|
|
69
69
|
create: typeof serviceVersionApi.createServiceVersion;
|
|
70
70
|
get: typeof serviceVersionApi.getServiceVersion;
|
|
71
|
+
draftStatus: typeof serviceVersionApi.getServiceVersionDraftStatus;
|
|
71
72
|
};
|
|
72
73
|
deployment: {
|
|
73
74
|
list: typeof serviceDeploymentApi.listServiceDeployment;
|
package/dist/index.js
CHANGED
|
@@ -111,6 +111,7 @@ class AbyssReflexCore {
|
|
|
111
111
|
list: serviceVersionApi.listServiceVersion,
|
|
112
112
|
create: serviceVersionApi.createServiceVersion,
|
|
113
113
|
get: serviceVersionApi.getServiceVersion,
|
|
114
|
+
draftStatus: serviceVersionApi.getServiceVersionDraftStatus,
|
|
114
115
|
},
|
|
115
116
|
deployment: {
|
|
116
117
|
list: serviceDeploymentApi.listServiceDeployment,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,4DAA8C;AAC9C,gEAAkD;AAClD,6EAA+D;AAC/D,yEAA2D;AAC3D,+EAAiE;AACjE,uEAAyD;AACzD,iFAAmE;AACnE,8DAAgD;AAChD,yEAA2D;AAC3D,6EAA+D;AAC/D,mFAAqE;AACrE,yFAA2E;AAC3E,6EAA+D;AAE/D,wCAAsB;AACtB,0CAAwB;AAExB,MAAM,gBAAgB,GAAG,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,4DAA8C;AAC9C,gEAAkD;AAClD,6EAA+D;AAC/D,yEAA2D;AAC3D,+EAAiE;AACjE,uEAAyD;AACzD,iFAAmE;AACnE,8DAAgD;AAChD,yEAA2D;AAC3D,6EAA+D;AAC/D,mFAAqE;AACrE,yFAA2E;AAC3E,6EAA+D;AAE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message?: string;
|
|
11
11
|
}
|
|
12
|
+
export interface IGetServiceVersionDraftStatusParams {
|
|
13
|
+
applicationId: string;
|
|
14
|
+
serviceId: string;
|
|
15
|
+
}
|
|
12
16
|
export interface IGetServiceVersionParams {
|
|
13
17
|
applicationId: string;
|
|
14
18
|
serviceId: string;
|
|
@@ -27,6 +27,10 @@ export interface ICreateServiceVersionData {
|
|
|
27
27
|
version: IReflexServiceVersion;
|
|
28
28
|
}
|
|
29
29
|
export type ICreateServiceVersionResponse = IResponse<ICreateServiceVersionData>;
|
|
30
|
+
export interface IGetServiceVersionDraftStatusData {
|
|
31
|
+
changedFunctions: number;
|
|
32
|
+
}
|
|
33
|
+
export type IGetServiceVersionDraftStatusResponse = IResponse<IGetServiceVersionDraftStatusData>;
|
|
30
34
|
export interface IGetServiceVersionData {
|
|
31
35
|
version: IReflexServiceVersion;
|
|
32
36
|
previousVersion: IReflexServiceVersion | null;
|
package/package.json
CHANGED
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abyss-project/reflex",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "Core package to interact with AbyssReflex",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
"main": "dist/index.js",
|
|
9
|
-
"types": "dist/index.d.ts"
|
|
10
|
-
},
|
|
11
|
-
"scripts": {
|
|
12
|
-
"lint": "eslint \"{src,apps,libs,test,core}/**/*.ts\" --fix",
|
|
13
|
-
"lint:check": "eslint \"{src,apps,libs,test,core}/**/*.ts\" --max-warnings 0",
|
|
14
|
-
"tsc": "tsc",
|
|
15
|
-
"build": "tsc",
|
|
16
|
-
"test": "jest",
|
|
17
|
-
"prepublishOnly": "tsc && node ../../scripts/check-sdk-surface.cjs",
|
|
18
|
-
"dev": "tsc --watch"
|
|
19
|
-
},
|
|
20
7
|
"repository": {
|
|
21
8
|
"type": "git",
|
|
22
9
|
"url": "https://gitlab.com/abyss-group/abyss-reflex.git"
|
|
@@ -45,5 +32,13 @@
|
|
|
45
32
|
"ts-jest": "^29.1.0",
|
|
46
33
|
"ts-node": "^10.4.0",
|
|
47
34
|
"typescript": "5.9.3"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"lint": "eslint \"{src,apps,libs,test,core}/**/*.ts\" --fix",
|
|
38
|
+
"lint:check": "eslint \"{src,apps,libs,test,core}/**/*.ts\" --max-warnings 0",
|
|
39
|
+
"tsc": "tsc",
|
|
40
|
+
"build": "tsc",
|
|
41
|
+
"test": "jest",
|
|
42
|
+
"dev": "tsc --watch"
|
|
48
43
|
}
|
|
49
|
-
}
|
|
44
|
+
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { AbyssReflexCore } from '..';
|
|
2
|
-
import type {
|
|
3
|
-
IGrantFunctionAccessBody,
|
|
4
|
-
IGrantFunctionAccessParams,
|
|
5
|
-
IGrantFunctionAccessResponse,
|
|
6
|
-
IListFunctionAccessParams,
|
|
7
|
-
IListFunctionAccessResponse,
|
|
8
|
-
IRevokeFunctionAccessParams,
|
|
9
|
-
IRevokeFunctionAccessResponse,
|
|
10
|
-
} from '../types';
|
|
11
|
-
|
|
12
|
-
const accessUrl = (params: { applicationId: string; functionId: string }): string =>
|
|
13
|
-
`api/function/${params.applicationId}/${params.functionId}/access`;
|
|
14
|
-
|
|
15
|
-
/** `GET .../access`: every access granted to the function, revoked ones included (the journal). Needs REFLEX_READ. */
|
|
16
|
-
export const listFunctionAccess = async (
|
|
17
|
-
params: IListFunctionAccessParams,
|
|
18
|
-
): Promise<IListFunctionAccessResponse> =>
|
|
19
|
-
(await AbyssReflexCore.axios.get<IListFunctionAccessResponse>(accessUrl(params))).data;
|
|
20
|
-
|
|
21
|
-
/** `POST .../access`: grants an access the draft declares. The caller must hold the right it needs (`403` otherwise). */
|
|
22
|
-
export const grantFunctionAccess = async (
|
|
23
|
-
params: IGrantFunctionAccessParams,
|
|
24
|
-
body: IGrantFunctionAccessBody,
|
|
25
|
-
): Promise<IGrantFunctionAccessResponse> =>
|
|
26
|
-
(await AbyssReflexCore.axios.post<IGrantFunctionAccessResponse>(accessUrl(params), body)).data;
|
|
27
|
-
|
|
28
|
-
/** `DELETE .../access/:grantId`: withdraws the access, at once, from what is already promoted. Needs REFLEX_FUNCTION_UPDATE. */
|
|
29
|
-
export const revokeFunctionAccess = async (
|
|
30
|
-
params: IRevokeFunctionAccessParams,
|
|
31
|
-
): Promise<IRevokeFunctionAccessResponse> =>
|
|
32
|
-
(
|
|
33
|
-
await AbyssReflexCore.axios.delete<IRevokeFunctionAccessResponse>(
|
|
34
|
-
`${accessUrl(params)}/${params.grantId}`,
|
|
35
|
-
)
|
|
36
|
-
).data;
|
|
1
|
+
import { AbyssReflexCore } from '..';
|
|
2
|
+
import type {
|
|
3
|
+
IGrantFunctionAccessBody,
|
|
4
|
+
IGrantFunctionAccessParams,
|
|
5
|
+
IGrantFunctionAccessResponse,
|
|
6
|
+
IListFunctionAccessParams,
|
|
7
|
+
IListFunctionAccessResponse,
|
|
8
|
+
IRevokeFunctionAccessParams,
|
|
9
|
+
IRevokeFunctionAccessResponse,
|
|
10
|
+
} from '../types';
|
|
11
|
+
|
|
12
|
+
const accessUrl = (params: { applicationId: string; functionId: string }): string =>
|
|
13
|
+
`api/function/${params.applicationId}/${params.functionId}/access`;
|
|
14
|
+
|
|
15
|
+
/** `GET .../access`: every access granted to the function, revoked ones included (the journal). Needs REFLEX_READ. */
|
|
16
|
+
export const listFunctionAccess = async (
|
|
17
|
+
params: IListFunctionAccessParams,
|
|
18
|
+
): Promise<IListFunctionAccessResponse> =>
|
|
19
|
+
(await AbyssReflexCore.axios.get<IListFunctionAccessResponse>(accessUrl(params))).data;
|
|
20
|
+
|
|
21
|
+
/** `POST .../access`: grants an access the draft declares. The caller must hold the right it needs (`403` otherwise). */
|
|
22
|
+
export const grantFunctionAccess = async (
|
|
23
|
+
params: IGrantFunctionAccessParams,
|
|
24
|
+
body: IGrantFunctionAccessBody,
|
|
25
|
+
): Promise<IGrantFunctionAccessResponse> =>
|
|
26
|
+
(await AbyssReflexCore.axios.post<IGrantFunctionAccessResponse>(accessUrl(params), body)).data;
|
|
27
|
+
|
|
28
|
+
/** `DELETE .../access/:grantId`: withdraws the access, at once, from what is already promoted. Needs REFLEX_FUNCTION_UPDATE. */
|
|
29
|
+
export const revokeFunctionAccess = async (
|
|
30
|
+
params: IRevokeFunctionAccessParams,
|
|
31
|
+
): Promise<IRevokeFunctionAccessResponse> =>
|
|
32
|
+
(
|
|
33
|
+
await AbyssReflexCore.axios.delete<IRevokeFunctionAccessResponse>(
|
|
34
|
+
`${accessUrl(params)}/${params.grantId}`,
|
|
35
|
+
)
|
|
36
|
+
).data;
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { AbyssReflexCore } from '..';
|
|
2
|
-
import type {
|
|
3
|
-
IGetFunctionRunParams,
|
|
4
|
-
IGetFunctionRunResponse,
|
|
5
|
-
IGetFunctionRunStateParams,
|
|
6
|
-
IGetFunctionRunStateResponse,
|
|
7
|
-
IListFunctionRunParams,
|
|
8
|
-
IListFunctionRunQuery,
|
|
9
|
-
IListFunctionRunResponse,
|
|
10
|
-
} from '../types';
|
|
11
|
-
|
|
12
|
-
const runUrl = (params: { applicationId: string; functionId: string }): string =>
|
|
13
|
-
`api/function/${params.applicationId}/${params.functionId}/run`;
|
|
14
|
-
|
|
15
|
-
/** `GET .../run`: the test runs (kept: the last 10, then 7 days) and the live executions of the edge (7 days), merged, newest first, paged by `limit`/`offset`. Needs REFLEX_LOG_READ. */
|
|
16
|
-
export const listFunctionRun = async (
|
|
17
|
-
params: IListFunctionRunParams,
|
|
18
|
-
query: IListFunctionRunQuery = {},
|
|
19
|
-
): Promise<IListFunctionRunResponse> =>
|
|
20
|
-
(await AbyssReflexCore.axios.get<IListFunctionRunResponse>(runUrl(params), { params: query }))
|
|
21
|
-
.data;
|
|
22
|
-
|
|
23
|
-
/** `GET .../run/:runId`: one run; a live one with its measures and its steps. Needs REFLEX_LOG_READ. */
|
|
24
|
-
export const getFunctionRun = async (
|
|
25
|
-
params: IGetFunctionRunParams,
|
|
26
|
-
): Promise<IGetFunctionRunResponse> =>
|
|
27
|
-
(await AbyssReflexCore.axios.get<IGetFunctionRunResponse>(`${runUrl(params)}/${params.runId}`))
|
|
28
|
-
.data;
|
|
29
|
-
|
|
30
|
-
/** `GET .../run/:runId/state`: the state of a live execution, the one an async route answered with. Needs REFLEX_LOG_READ. */
|
|
31
|
-
export const getFunctionRunState = async (
|
|
32
|
-
params: IGetFunctionRunStateParams,
|
|
33
|
-
): Promise<IGetFunctionRunStateResponse> =>
|
|
34
|
-
(
|
|
35
|
-
await AbyssReflexCore.axios.get<IGetFunctionRunStateResponse>(
|
|
36
|
-
`${runUrl(params)}/${params.runId}/state`,
|
|
37
|
-
)
|
|
38
|
-
).data;
|
|
1
|
+
import { AbyssReflexCore } from '..';
|
|
2
|
+
import type {
|
|
3
|
+
IGetFunctionRunParams,
|
|
4
|
+
IGetFunctionRunResponse,
|
|
5
|
+
IGetFunctionRunStateParams,
|
|
6
|
+
IGetFunctionRunStateResponse,
|
|
7
|
+
IListFunctionRunParams,
|
|
8
|
+
IListFunctionRunQuery,
|
|
9
|
+
IListFunctionRunResponse,
|
|
10
|
+
} from '../types';
|
|
11
|
+
|
|
12
|
+
const runUrl = (params: { applicationId: string; functionId: string }): string =>
|
|
13
|
+
`api/function/${params.applicationId}/${params.functionId}/run`;
|
|
14
|
+
|
|
15
|
+
/** `GET .../run`: the test runs (kept: the last 10, then 7 days) and the live executions of the edge (7 days), merged, newest first, paged by `limit`/`offset`. Needs REFLEX_LOG_READ. */
|
|
16
|
+
export const listFunctionRun = async (
|
|
17
|
+
params: IListFunctionRunParams,
|
|
18
|
+
query: IListFunctionRunQuery = {},
|
|
19
|
+
): Promise<IListFunctionRunResponse> =>
|
|
20
|
+
(await AbyssReflexCore.axios.get<IListFunctionRunResponse>(runUrl(params), { params: query }))
|
|
21
|
+
.data;
|
|
22
|
+
|
|
23
|
+
/** `GET .../run/:runId`: one run; a live one with its measures and its steps. Needs REFLEX_LOG_READ. */
|
|
24
|
+
export const getFunctionRun = async (
|
|
25
|
+
params: IGetFunctionRunParams,
|
|
26
|
+
): Promise<IGetFunctionRunResponse> =>
|
|
27
|
+
(await AbyssReflexCore.axios.get<IGetFunctionRunResponse>(`${runUrl(params)}/${params.runId}`))
|
|
28
|
+
.data;
|
|
29
|
+
|
|
30
|
+
/** `GET .../run/:runId/state`: the state of a live execution, the one an async route answered with. Needs REFLEX_LOG_READ. */
|
|
31
|
+
export const getFunctionRunState = async (
|
|
32
|
+
params: IGetFunctionRunStateParams,
|
|
33
|
+
): Promise<IGetFunctionRunStateResponse> =>
|
|
34
|
+
(
|
|
35
|
+
await AbyssReflexCore.axios.get<IGetFunctionRunStateResponse>(
|
|
36
|
+
`${runUrl(params)}/${params.runId}/state`,
|
|
37
|
+
)
|
|
38
|
+
).data;
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { AbyssReflexCore } from '..';
|
|
2
|
-
import type {
|
|
3
|
-
IGetFunctionSettingsParams,
|
|
4
|
-
IGetFunctionSettingsResponse,
|
|
5
|
-
IRemoveFunctionEnvironmentSettingsParams,
|
|
6
|
-
IRemoveFunctionEnvironmentSettingsResponse,
|
|
7
|
-
ISetFunctionDefaultSettingsBody,
|
|
8
|
-
ISetFunctionDefaultSettingsParams,
|
|
9
|
-
ISetFunctionDefaultSettingsResponse,
|
|
10
|
-
ISetFunctionEnvironmentSettingsBody,
|
|
11
|
-
ISetFunctionEnvironmentSettingsParams,
|
|
12
|
-
ISetFunctionEnvironmentSettingsResponse,
|
|
13
|
-
} from '../types';
|
|
14
|
-
|
|
15
|
-
const settingsUrl = (params: { applicationId: string; functionId: string }): string =>
|
|
16
|
-
`api/function/${params.applicationId}/${params.functionId}/settings`;
|
|
17
|
-
|
|
18
|
-
/** `GET .../settings`: the default, the overrides, and what each environment runs with. Needs REFLEX_READ. */
|
|
19
|
-
export const getFunctionSettings = async (
|
|
20
|
-
params: IGetFunctionSettingsParams,
|
|
21
|
-
): Promise<IGetFunctionSettingsResponse> =>
|
|
22
|
-
(await AbyssReflexCore.axios.get<IGetFunctionSettingsResponse>(settingsUrl(params))).data;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* `PUT .../settings`: sets the default of every environment without an override, applied at once where the
|
|
26
|
-
* function runs. Needs REFLEX_FUNCTION_UPDATE, and REFLEX_PUBLISH_PRODUCTION when the default applies to a
|
|
27
|
-
* production environment where the function runs.
|
|
28
|
-
*/
|
|
29
|
-
export const setFunctionDefaultSettings = async (
|
|
30
|
-
params: ISetFunctionDefaultSettingsParams,
|
|
31
|
-
body: ISetFunctionDefaultSettingsBody,
|
|
32
|
-
): Promise<ISetFunctionDefaultSettingsResponse> =>
|
|
33
|
-
(await AbyssReflexCore.axios.put<ISetFunctionDefaultSettingsResponse>(settingsUrl(params), body))
|
|
34
|
-
.data;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* `PUT .../settings/:environmentId`: sets the override of one environment. Needs REFLEX_FUNCTION_UPDATE, and
|
|
38
|
-
* REFLEX_PUBLISH_PRODUCTION for a production environment.
|
|
39
|
-
*/
|
|
40
|
-
export const setFunctionEnvironmentSettings = async (
|
|
41
|
-
params: ISetFunctionEnvironmentSettingsParams,
|
|
42
|
-
body: ISetFunctionEnvironmentSettingsBody,
|
|
43
|
-
): Promise<ISetFunctionEnvironmentSettingsResponse> =>
|
|
44
|
-
(
|
|
45
|
-
await AbyssReflexCore.axios.put<ISetFunctionEnvironmentSettingsResponse>(
|
|
46
|
-
`${settingsUrl(params)}/${params.environmentId}`,
|
|
47
|
-
body,
|
|
48
|
-
)
|
|
49
|
-
).data;
|
|
50
|
-
|
|
51
|
-
/** `DELETE .../settings/:environmentId`: the environment falls back on the default. Same rights as setting it. */
|
|
52
|
-
export const removeFunctionEnvironmentSettings = async (
|
|
53
|
-
params: IRemoveFunctionEnvironmentSettingsParams,
|
|
54
|
-
): Promise<IRemoveFunctionEnvironmentSettingsResponse> =>
|
|
55
|
-
(
|
|
56
|
-
await AbyssReflexCore.axios.delete<IRemoveFunctionEnvironmentSettingsResponse>(
|
|
57
|
-
`${settingsUrl(params)}/${params.environmentId}`,
|
|
58
|
-
)
|
|
59
|
-
).data;
|
|
1
|
+
import { AbyssReflexCore } from '..';
|
|
2
|
+
import type {
|
|
3
|
+
IGetFunctionSettingsParams,
|
|
4
|
+
IGetFunctionSettingsResponse,
|
|
5
|
+
IRemoveFunctionEnvironmentSettingsParams,
|
|
6
|
+
IRemoveFunctionEnvironmentSettingsResponse,
|
|
7
|
+
ISetFunctionDefaultSettingsBody,
|
|
8
|
+
ISetFunctionDefaultSettingsParams,
|
|
9
|
+
ISetFunctionDefaultSettingsResponse,
|
|
10
|
+
ISetFunctionEnvironmentSettingsBody,
|
|
11
|
+
ISetFunctionEnvironmentSettingsParams,
|
|
12
|
+
ISetFunctionEnvironmentSettingsResponse,
|
|
13
|
+
} from '../types';
|
|
14
|
+
|
|
15
|
+
const settingsUrl = (params: { applicationId: string; functionId: string }): string =>
|
|
16
|
+
`api/function/${params.applicationId}/${params.functionId}/settings`;
|
|
17
|
+
|
|
18
|
+
/** `GET .../settings`: the default, the overrides, and what each environment runs with. Needs REFLEX_READ. */
|
|
19
|
+
export const getFunctionSettings = async (
|
|
20
|
+
params: IGetFunctionSettingsParams,
|
|
21
|
+
): Promise<IGetFunctionSettingsResponse> =>
|
|
22
|
+
(await AbyssReflexCore.axios.get<IGetFunctionSettingsResponse>(settingsUrl(params))).data;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* `PUT .../settings`: sets the default of every environment without an override, applied at once where the
|
|
26
|
+
* function runs. Needs REFLEX_FUNCTION_UPDATE, and REFLEX_PUBLISH_PRODUCTION when the default applies to a
|
|
27
|
+
* production environment where the function runs.
|
|
28
|
+
*/
|
|
29
|
+
export const setFunctionDefaultSettings = async (
|
|
30
|
+
params: ISetFunctionDefaultSettingsParams,
|
|
31
|
+
body: ISetFunctionDefaultSettingsBody,
|
|
32
|
+
): Promise<ISetFunctionDefaultSettingsResponse> =>
|
|
33
|
+
(await AbyssReflexCore.axios.put<ISetFunctionDefaultSettingsResponse>(settingsUrl(params), body))
|
|
34
|
+
.data;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* `PUT .../settings/:environmentId`: sets the override of one environment. Needs REFLEX_FUNCTION_UPDATE, and
|
|
38
|
+
* REFLEX_PUBLISH_PRODUCTION for a production environment.
|
|
39
|
+
*/
|
|
40
|
+
export const setFunctionEnvironmentSettings = async (
|
|
41
|
+
params: ISetFunctionEnvironmentSettingsParams,
|
|
42
|
+
body: ISetFunctionEnvironmentSettingsBody,
|
|
43
|
+
): Promise<ISetFunctionEnvironmentSettingsResponse> =>
|
|
44
|
+
(
|
|
45
|
+
await AbyssReflexCore.axios.put<ISetFunctionEnvironmentSettingsResponse>(
|
|
46
|
+
`${settingsUrl(params)}/${params.environmentId}`,
|
|
47
|
+
body,
|
|
48
|
+
)
|
|
49
|
+
).data;
|
|
50
|
+
|
|
51
|
+
/** `DELETE .../settings/:environmentId`: the environment falls back on the default. Same rights as setting it. */
|
|
52
|
+
export const removeFunctionEnvironmentSettings = async (
|
|
53
|
+
params: IRemoveFunctionEnvironmentSettingsParams,
|
|
54
|
+
): Promise<IRemoveFunctionEnvironmentSettingsResponse> =>
|
|
55
|
+
(
|
|
56
|
+
await AbyssReflexCore.axios.delete<IRemoveFunctionEnvironmentSettingsResponse>(
|
|
57
|
+
`${settingsUrl(params)}/${params.environmentId}`,
|
|
58
|
+
)
|
|
59
|
+
).data;
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { AbyssReflexCore } from '..';
|
|
2
|
-
import type {
|
|
3
|
-
IDryRunFunctionBody,
|
|
4
|
-
IDryRunFunctionResponse,
|
|
5
|
-
IFunctionTestParams,
|
|
6
|
-
ISimulateFunctionBody,
|
|
7
|
-
ISimulateFunctionResponse,
|
|
8
|
-
} from '../types';
|
|
9
|
-
|
|
10
|
-
const testUrl = (params: IFunctionTestParams): string =>
|
|
11
|
-
`api/function/${params.applicationId}/${params.functionId}/test`;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* `POST .../test/simulate`: runs the draft on a made-up event, in the environment `body.environmentId`.
|
|
15
|
-
* Nothing is executed: HTTP steps get the stub they are given, the Store is a scratch copy thrown away.
|
|
16
|
-
* Needs REFLEX_TEST_RUN.
|
|
17
|
-
*/
|
|
18
|
-
export const simulateFunction = async (
|
|
19
|
-
params: IFunctionTestParams,
|
|
20
|
-
body: ISimulateFunctionBody,
|
|
21
|
-
): Promise<ISimulateFunctionResponse> =>
|
|
22
|
-
(await AbyssReflexCore.axios.post<ISimulateFunctionResponse>(`${testUrl(params)}/simulate`, body))
|
|
23
|
-
.data;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* `POST .../test/dry-run`: like a simulation, but the Store of the environment `body.environmentId` is
|
|
27
|
-
* read for real; writes are recorded and not done. Needs REFLEX_TEST_RUN.
|
|
28
|
-
*/
|
|
29
|
-
export const dryRunFunction = async (
|
|
30
|
-
params: IFunctionTestParams,
|
|
31
|
-
body: IDryRunFunctionBody,
|
|
32
|
-
): Promise<IDryRunFunctionResponse> =>
|
|
33
|
-
(await AbyssReflexCore.axios.post<IDryRunFunctionResponse>(`${testUrl(params)}/dry-run`, body))
|
|
34
|
-
.data;
|
|
1
|
+
import { AbyssReflexCore } from '..';
|
|
2
|
+
import type {
|
|
3
|
+
IDryRunFunctionBody,
|
|
4
|
+
IDryRunFunctionResponse,
|
|
5
|
+
IFunctionTestParams,
|
|
6
|
+
ISimulateFunctionBody,
|
|
7
|
+
ISimulateFunctionResponse,
|
|
8
|
+
} from '../types';
|
|
9
|
+
|
|
10
|
+
const testUrl = (params: IFunctionTestParams): string =>
|
|
11
|
+
`api/function/${params.applicationId}/${params.functionId}/test`;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* `POST .../test/simulate`: runs the draft on a made-up event, in the environment `body.environmentId`.
|
|
15
|
+
* Nothing is executed: HTTP steps get the stub they are given, the Store is a scratch copy thrown away.
|
|
16
|
+
* Needs REFLEX_TEST_RUN.
|
|
17
|
+
*/
|
|
18
|
+
export const simulateFunction = async (
|
|
19
|
+
params: IFunctionTestParams,
|
|
20
|
+
body: ISimulateFunctionBody,
|
|
21
|
+
): Promise<ISimulateFunctionResponse> =>
|
|
22
|
+
(await AbyssReflexCore.axios.post<ISimulateFunctionResponse>(`${testUrl(params)}/simulate`, body))
|
|
23
|
+
.data;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* `POST .../test/dry-run`: like a simulation, but the Store of the environment `body.environmentId` is
|
|
27
|
+
* read for real; writes are recorded and not done. Needs REFLEX_TEST_RUN.
|
|
28
|
+
*/
|
|
29
|
+
export const dryRunFunction = async (
|
|
30
|
+
params: IFunctionTestParams,
|
|
31
|
+
body: IDryRunFunctionBody,
|
|
32
|
+
): Promise<IDryRunFunctionResponse> =>
|
|
33
|
+
(await AbyssReflexCore.axios.post<IDryRunFunctionResponse>(`${testUrl(params)}/dry-run`, body))
|
|
34
|
+
.data;
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { AbyssReflexCore } from '..';
|
|
2
|
-
import type {
|
|
3
|
-
IGetFunctionVersionParams,
|
|
4
|
-
IGetFunctionVersionResponse,
|
|
5
|
-
IGetFunctionVersionStepStatsParams,
|
|
6
|
-
IGetFunctionVersionStepStatsQuery,
|
|
7
|
-
IGetFunctionVersionStepStatsResponse,
|
|
8
|
-
IListFunctionVersionParams,
|
|
9
|
-
IListFunctionVersionResponse,
|
|
10
|
-
} from '../types';
|
|
11
|
-
|
|
12
|
-
const versionUrl = (params: { applicationId: string; functionId: string }): string =>
|
|
13
|
-
`api/function/${params.applicationId}/${params.functionId}/version`;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* `GET .../version`: the frozen versions, newest first. Needs REFLEX_READ. A version of the function's
|
|
17
|
-
* Service publishes its draft when it changed (`service.version.create`).
|
|
18
|
-
*/
|
|
19
|
-
export const listFunctionVersion = async (
|
|
20
|
-
params: IListFunctionVersionParams,
|
|
21
|
-
): Promise<IListFunctionVersionResponse> =>
|
|
22
|
-
(await AbyssReflexCore.axios.get<IListFunctionVersionResponse>(versionUrl(params))).data;
|
|
23
|
-
|
|
24
|
-
/** `GET .../version/:versionId`. Needs REFLEX_READ. */
|
|
25
|
-
export const getFunctionVersion = async (
|
|
26
|
-
params: IGetFunctionVersionParams,
|
|
27
|
-
): Promise<IGetFunctionVersionResponse> =>
|
|
28
|
-
(
|
|
29
|
-
await AbyssReflexCore.axios.get<IGetFunctionVersionResponse>(
|
|
30
|
-
`${versionUrl(params)}/${params.versionId}`,
|
|
31
|
-
)
|
|
32
|
-
).data;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* `GET .../version/:versionId/step-stats`: per step, over the retention window, the executions, the median
|
|
36
|
-
* and p95 of duration, CPU, heap peak and cost, and the share of the cost; interrupted executions left
|
|
37
|
-
* out. With `environmentId`, also the p99 heap peak per step of the version running there. Needs REFLEX_LOG_READ.
|
|
38
|
-
*/
|
|
39
|
-
export const getFunctionVersionStepStats = async (
|
|
40
|
-
params: IGetFunctionVersionStepStatsParams,
|
|
41
|
-
query: IGetFunctionVersionStepStatsQuery = {},
|
|
42
|
-
): Promise<IGetFunctionVersionStepStatsResponse> =>
|
|
43
|
-
(
|
|
44
|
-
await AbyssReflexCore.axios.get<IGetFunctionVersionStepStatsResponse>(
|
|
45
|
-
`${versionUrl(params)}/${params.versionId}/step-stats`,
|
|
46
|
-
{ params: query },
|
|
47
|
-
)
|
|
48
|
-
).data;
|
|
1
|
+
import { AbyssReflexCore } from '..';
|
|
2
|
+
import type {
|
|
3
|
+
IGetFunctionVersionParams,
|
|
4
|
+
IGetFunctionVersionResponse,
|
|
5
|
+
IGetFunctionVersionStepStatsParams,
|
|
6
|
+
IGetFunctionVersionStepStatsQuery,
|
|
7
|
+
IGetFunctionVersionStepStatsResponse,
|
|
8
|
+
IListFunctionVersionParams,
|
|
9
|
+
IListFunctionVersionResponse,
|
|
10
|
+
} from '../types';
|
|
11
|
+
|
|
12
|
+
const versionUrl = (params: { applicationId: string; functionId: string }): string =>
|
|
13
|
+
`api/function/${params.applicationId}/${params.functionId}/version`;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* `GET .../version`: the frozen versions, newest first. Needs REFLEX_READ. A version of the function's
|
|
17
|
+
* Service publishes its draft when it changed (`service.version.create`).
|
|
18
|
+
*/
|
|
19
|
+
export const listFunctionVersion = async (
|
|
20
|
+
params: IListFunctionVersionParams,
|
|
21
|
+
): Promise<IListFunctionVersionResponse> =>
|
|
22
|
+
(await AbyssReflexCore.axios.get<IListFunctionVersionResponse>(versionUrl(params))).data;
|
|
23
|
+
|
|
24
|
+
/** `GET .../version/:versionId`. Needs REFLEX_READ. */
|
|
25
|
+
export const getFunctionVersion = async (
|
|
26
|
+
params: IGetFunctionVersionParams,
|
|
27
|
+
): Promise<IGetFunctionVersionResponse> =>
|
|
28
|
+
(
|
|
29
|
+
await AbyssReflexCore.axios.get<IGetFunctionVersionResponse>(
|
|
30
|
+
`${versionUrl(params)}/${params.versionId}`,
|
|
31
|
+
)
|
|
32
|
+
).data;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* `GET .../version/:versionId/step-stats`: per step, over the retention window, the executions, the median
|
|
36
|
+
* and p95 of duration, CPU, heap peak and cost, and the share of the cost; interrupted executions left
|
|
37
|
+
* out. With `environmentId`, also the p99 heap peak per step of the version running there. Needs REFLEX_LOG_READ.
|
|
38
|
+
*/
|
|
39
|
+
export const getFunctionVersionStepStats = async (
|
|
40
|
+
params: IGetFunctionVersionStepStatsParams,
|
|
41
|
+
query: IGetFunctionVersionStepStatsQuery = {},
|
|
42
|
+
): Promise<IGetFunctionVersionStepStatsResponse> =>
|
|
43
|
+
(
|
|
44
|
+
await AbyssReflexCore.axios.get<IGetFunctionVersionStepStatsResponse>(
|
|
45
|
+
`${versionUrl(params)}/${params.versionId}/step-stats`,
|
|
46
|
+
{ params: query },
|
|
47
|
+
)
|
|
48
|
+
).data;
|