@abyss-project/reflex 1.2.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-test.api.d.ts +2 -2
- package/dist/api/function-test.api.js +2 -2
- package/dist/api/function-test.api.js.map +1 -1
- 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-test.request.d.ts +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 +1 -1
- package/src/api/function-settings.api.ts +59 -59
- package/src/api/function-test.api.ts +7 -6
- package/src/api/function-version.api.ts +4 -12
- package/src/api/function.api.test.ts +10 -68
- package/src/api/index.ts +5 -2
- 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 +70 -26
- package/src/types/enum/execution-mode.enum.ts +1 -1
- 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/index.ts +6 -1
- package/src/types/enum/reflex-error-code.enum.ts +25 -19
- package/src/types/enum/route-method.enum.ts +9 -0
- package/src/types/enum/run-log-level.enum.ts +6 -6
- 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/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/trace-effect-type.enum.ts +12 -12
- package/src/types/enum/trigger-access-mode.enum.ts +12 -12
- package/src/types/interface/api/requests/function-run.request.ts +1 -1
- package/src/types/interface/api/requests/function-settings.request.ts +27 -27
- package/src/types/interface/api/requests/function-test.request.ts +5 -0
- package/src/types/interface/api/requests/function-version.request.ts +1 -6
- package/src/types/interface/api/requests/function.request.ts +36 -34
- package/src/types/interface/api/requests/index.ts +5 -2
- 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-run.response.ts +18 -18
- package/src/types/interface/api/responses/function-settings.response.ts +36 -36
- package/src/types/interface/api/responses/function-version.response.ts +0 -5
- package/src/types/interface/api/responses/index.ts +5 -2
- 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 +5 -2
- package/src/types/interface/models/reflex-definition.model.ts +31 -31
- 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-price-list.model.ts +20 -20
- package/src/types/interface/models/reflex-route.model.ts +19 -0
- package/src/types/interface/models/reflex-run.model.ts +11 -7
- 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/src/types/interface/models/reflex-step-stats.model.ts +35 -35
- 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
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AbyssReflexCore } from '..';
|
|
2
|
+
import type {
|
|
3
|
+
ICreateServiceVersionBody,
|
|
4
|
+
ICreateServiceVersionParams,
|
|
5
|
+
ICreateServiceVersionResponse,
|
|
6
|
+
IGetServiceVersionParams,
|
|
7
|
+
IGetServiceVersionResponse,
|
|
8
|
+
IListServiceVersionParams,
|
|
9
|
+
IListServiceVersionResponse,
|
|
10
|
+
} from '../types';
|
|
11
|
+
|
|
12
|
+
const versionUrl = (params: { applicationId: string; serviceId: string }): string =>
|
|
13
|
+
`api/service/${params.applicationId}/${params.serviceId}/version`;
|
|
14
|
+
|
|
15
|
+
/** `GET .../version`: the versions of the Service, newest first. Needs REFLEX_READ. */
|
|
16
|
+
export const listServiceVersion = async (
|
|
17
|
+
params: IListServiceVersionParams,
|
|
18
|
+
): Promise<IListServiceVersionResponse> =>
|
|
19
|
+
(await AbyssReflexCore.axios.get<IListServiceVersionResponse>(versionUrl(params))).data;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* `POST .../version`: publishes the drafts that changed and freezes the routes, the function versions,
|
|
23
|
+
* the CORS and the rate limit. `409 VERSION_UNCHANGED` when nothing changed. Needs REFLEX_PUBLISH.
|
|
24
|
+
*/
|
|
25
|
+
export const createServiceVersion = async (
|
|
26
|
+
params: ICreateServiceVersionParams,
|
|
27
|
+
body: ICreateServiceVersionBody = {},
|
|
28
|
+
): Promise<ICreateServiceVersionResponse> =>
|
|
29
|
+
(await AbyssReflexCore.axios.post<ICreateServiceVersionResponse>(versionUrl(params), body)).data;
|
|
30
|
+
|
|
31
|
+
/** `GET .../version/:versionId`: the snapshot and the route changes since the version before. Needs REFLEX_READ. */
|
|
32
|
+
export const getServiceVersion = async (
|
|
33
|
+
params: IGetServiceVersionParams,
|
|
34
|
+
): Promise<IGetServiceVersionResponse> =>
|
|
35
|
+
(
|
|
36
|
+
await AbyssReflexCore.axios.get<IGetServiceVersionResponse>(
|
|
37
|
+
`${versionUrl(params)}/${params.versionId}`,
|
|
38
|
+
)
|
|
39
|
+
).data;
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { AxiosAdapter, InternalAxiosRequestConfig } from 'axios';
|
|
2
|
+
import {
|
|
3
|
+
AbyssReflexCore,
|
|
4
|
+
REFLEX_SERVICE_LIMITS,
|
|
5
|
+
RouteMethod,
|
|
6
|
+
ServiceType,
|
|
7
|
+
TriggerAccessMode,
|
|
8
|
+
} from '..';
|
|
9
|
+
|
|
10
|
+
const APP = 'app-1';
|
|
11
|
+
const SVC = 'svc-1';
|
|
12
|
+
const BASE = `api/service/${APP}/${SVC}`;
|
|
13
|
+
const SERVICE = { applicationId: APP, serviceId: SVC };
|
|
14
|
+
|
|
15
|
+
interface Call {
|
|
16
|
+
label: string;
|
|
17
|
+
method: string;
|
|
18
|
+
url: string;
|
|
19
|
+
body?: unknown;
|
|
20
|
+
params?: unknown;
|
|
21
|
+
run: () => Promise<unknown>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const sdk = () => AbyssReflexCore.sdk.service;
|
|
25
|
+
|
|
26
|
+
const calls: Call[] = [
|
|
27
|
+
{
|
|
28
|
+
label: 'list',
|
|
29
|
+
method: 'get',
|
|
30
|
+
url: `api/service/${APP}`,
|
|
31
|
+
run: () => sdk().list({ applicationId: APP }),
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: 'create',
|
|
35
|
+
method: 'post',
|
|
36
|
+
url: `api/service/${APP}`,
|
|
37
|
+
body: { name: 'Shop', slug: 'shop', type: ServiceType.HTTP_API },
|
|
38
|
+
run: () =>
|
|
39
|
+
sdk().create(
|
|
40
|
+
{ applicationId: APP },
|
|
41
|
+
{ name: 'Shop', slug: 'shop', type: ServiceType.HTTP_API },
|
|
42
|
+
),
|
|
43
|
+
},
|
|
44
|
+
{ label: 'get', method: 'get', url: BASE, run: () => sdk().get(SERVICE) },
|
|
45
|
+
{
|
|
46
|
+
label: 'update',
|
|
47
|
+
method: 'patch',
|
|
48
|
+
url: BASE,
|
|
49
|
+
body: { cors: { allowedOrigins: ['https://shop.example'] }, rateLimitPerIpPerMinute: 120 },
|
|
50
|
+
run: () =>
|
|
51
|
+
sdk().update(SERVICE, {
|
|
52
|
+
cors: { allowedOrigins: ['https://shop.example'] },
|
|
53
|
+
rateLimitPerIpPerMinute: 120,
|
|
54
|
+
}),
|
|
55
|
+
},
|
|
56
|
+
{ label: 'delete', method: 'delete', url: BASE, run: () => sdk().delete(SERVICE) },
|
|
57
|
+
{
|
|
58
|
+
label: 'route.list',
|
|
59
|
+
method: 'get',
|
|
60
|
+
url: `${BASE}/route`,
|
|
61
|
+
run: () => sdk().route.list(SERVICE),
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: 'route.create',
|
|
65
|
+
method: 'post',
|
|
66
|
+
url: `${BASE}/route`,
|
|
67
|
+
body: {
|
|
68
|
+
method: RouteMethod.GET,
|
|
69
|
+
path: 'orders/:id',
|
|
70
|
+
functionId: 'fn-1',
|
|
71
|
+
accessMode: TriggerAccessMode.API_KEY,
|
|
72
|
+
},
|
|
73
|
+
run: () =>
|
|
74
|
+
sdk().route.create(SERVICE, {
|
|
75
|
+
method: RouteMethod.GET,
|
|
76
|
+
path: 'orders/:id',
|
|
77
|
+
functionId: 'fn-1',
|
|
78
|
+
accessMode: TriggerAccessMode.API_KEY,
|
|
79
|
+
}),
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
label: 'route.update',
|
|
83
|
+
method: 'patch',
|
|
84
|
+
url: `${BASE}/route/r-1`,
|
|
85
|
+
body: { path: 'orders/:ref' },
|
|
86
|
+
run: () => sdk().route.update({ ...SERVICE, routeId: 'r-1' }, { path: 'orders/:ref' }),
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
label: 'route.delete',
|
|
90
|
+
method: 'delete',
|
|
91
|
+
url: `${BASE}/route/r-1`,
|
|
92
|
+
run: () => sdk().route.delete({ ...SERVICE, routeId: 'r-1' }),
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
label: 'route.rotate',
|
|
96
|
+
method: 'post',
|
|
97
|
+
url: `${BASE}/route/r-1/rotate`,
|
|
98
|
+
body: {},
|
|
99
|
+
run: () => sdk().route.rotate({ ...SERVICE, routeId: 'r-1' }),
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
label: 'version.list',
|
|
103
|
+
method: 'get',
|
|
104
|
+
url: `${BASE}/version`,
|
|
105
|
+
run: () => sdk().version.list(SERVICE),
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
label: 'version.create',
|
|
109
|
+
method: 'post',
|
|
110
|
+
url: `${BASE}/version`,
|
|
111
|
+
body: { message: 'orders by id' },
|
|
112
|
+
run: () => sdk().version.create(SERVICE, { message: 'orders by id' }),
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
label: 'version.get',
|
|
116
|
+
method: 'get',
|
|
117
|
+
url: `${BASE}/version/v-1`,
|
|
118
|
+
run: () => sdk().version.get({ ...SERVICE, versionId: 'v-1' }),
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
label: 'deployment.list',
|
|
122
|
+
method: 'get',
|
|
123
|
+
url: `${BASE}/deployment`,
|
|
124
|
+
params: { environmentId: 'e-1', limit: 10, offset: 20 },
|
|
125
|
+
run: () => sdk().deployment.list(SERVICE, { environmentId: 'e-1', limit: 10, offset: 20 }),
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
label: 'deployment.goLive',
|
|
129
|
+
method: 'post',
|
|
130
|
+
url: `${BASE}/deployment/go-live`,
|
|
131
|
+
body: { environmentId: 'e-1', serviceVersionId: 'v-1' },
|
|
132
|
+
run: () => sdk().deployment.goLive(SERVICE, { environmentId: 'e-1', serviceVersionId: 'v-1' }),
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
label: 'deployment.rollback',
|
|
136
|
+
method: 'post',
|
|
137
|
+
url: `${BASE}/deployment/rollback`,
|
|
138
|
+
body: { environmentId: 'e-1', deploymentId: 'd-1' },
|
|
139
|
+
run: () => sdk().deployment.rollback(SERVICE, { environmentId: 'e-1', deploymentId: 'd-1' }),
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
label: 'deployment.pause',
|
|
143
|
+
method: 'post',
|
|
144
|
+
url: `${BASE}/deployment/pause`,
|
|
145
|
+
body: { environmentId: 'e-1' },
|
|
146
|
+
run: () => sdk().deployment.pause(SERVICE, { environmentId: 'e-1' }),
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
label: 'deployment.resume',
|
|
150
|
+
method: 'post',
|
|
151
|
+
url: `${BASE}/deployment/resume`,
|
|
152
|
+
body: { environmentId: 'e-1' },
|
|
153
|
+
run: () => sdk().deployment.resume(SERVICE, { environmentId: 'e-1' }),
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
label: 'variable.list',
|
|
157
|
+
method: 'get',
|
|
158
|
+
url: `${BASE}/variable`,
|
|
159
|
+
run: () => sdk().variable.list(SERVICE),
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
label: 'variable.set',
|
|
163
|
+
method: 'put',
|
|
164
|
+
url: `${BASE}/variable/e-1/API_BASE`,
|
|
165
|
+
body: { value: 'https://api.example' },
|
|
166
|
+
run: () =>
|
|
167
|
+
sdk().variable.set(
|
|
168
|
+
{ ...SERVICE, environmentId: 'e-1', name: 'API_BASE' },
|
|
169
|
+
{ value: 'https://api.example' },
|
|
170
|
+
),
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
label: 'variable.delete',
|
|
174
|
+
method: 'delete',
|
|
175
|
+
url: `${BASE}/variable/e-1/API_BASE`,
|
|
176
|
+
run: () => sdk().variable.delete({ ...SERVICE, environmentId: 'e-1', name: 'API_BASE' }),
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
label: 'secretStatus',
|
|
180
|
+
method: 'get',
|
|
181
|
+
url: `${BASE}/secret-status`,
|
|
182
|
+
run: () => sdk().secretStatus(SERVICE),
|
|
183
|
+
},
|
|
184
|
+
];
|
|
185
|
+
|
|
186
|
+
describe('AbyssReflexCore service routes', () => {
|
|
187
|
+
const adapter = jest.fn<ReturnType<AxiosAdapter>, [InternalAxiosRequestConfig]>(
|
|
188
|
+
async (config) => ({ data: { data: {} }, status: 200, statusText: '', headers: {}, config }),
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
beforeAll(() => {
|
|
192
|
+
AbyssReflexCore.setConfig({ baseURL: 'http://reflex.test/', token: 'session-token' });
|
|
193
|
+
AbyssReflexCore.axios.defaults.adapter = adapter;
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
beforeEach(() => adapter.mockClear());
|
|
197
|
+
|
|
198
|
+
it.each(calls)('$label calls $method $url', async (call) => {
|
|
199
|
+
await call.run();
|
|
200
|
+
|
|
201
|
+
const config = adapter.mock.calls[0][0];
|
|
202
|
+
expect(config.method).toBe(call.method);
|
|
203
|
+
expect(config.url).toBe(call.url);
|
|
204
|
+
expect(config.baseURL).toBe('http://reflex.test/');
|
|
205
|
+
expect(config.params).toEqual(call.params);
|
|
206
|
+
if (call.body !== undefined) {
|
|
207
|
+
expect(JSON.parse(config.data)).toEqual(call.body);
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it('exposes no route twice', () => {
|
|
212
|
+
expect(new Set(calls.map((call) => `${call.method} ${call.url}`)).size).toBe(calls.length);
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
it('sends an empty body for a version without a message', async () => {
|
|
216
|
+
await sdk().version.create(SERVICE);
|
|
217
|
+
|
|
218
|
+
expect(JSON.parse(adapter.mock.calls[0][0].data)).toEqual({});
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
describe('service limits', () => {
|
|
223
|
+
it('match the bounds of the database', () => {
|
|
224
|
+
expect(REFLEX_SERVICE_LIMITS.slugPattern.test('shop-2')).toBe(true);
|
|
225
|
+
expect(REFLEX_SERVICE_LIMITS.slugPattern.test('-shop')).toBe(false);
|
|
226
|
+
expect(REFLEX_SERVICE_LIMITS.rateLimitPerIpPerMinute).toEqual({
|
|
227
|
+
min: 1,
|
|
228
|
+
max: 6000,
|
|
229
|
+
default: 60,
|
|
230
|
+
});
|
|
231
|
+
expect(REFLEX_SERVICE_LIMITS.variableNamePattern.test('API_BASE')).toBe(true);
|
|
232
|
+
expect(REFLEX_SERVICE_LIMITS.variableNamePattern.test('api_base')).toBe(false);
|
|
233
|
+
});
|
|
234
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { AbyssReflexCore } from '..';
|
|
2
|
+
import type {
|
|
3
|
+
ICreateServiceBody,
|
|
4
|
+
ICreateServiceParams,
|
|
5
|
+
ICreateServiceResponse,
|
|
6
|
+
IDeleteServiceParams,
|
|
7
|
+
IDeleteServiceResponse,
|
|
8
|
+
IGetServiceParams,
|
|
9
|
+
IGetServiceResponse,
|
|
10
|
+
IListServiceParams,
|
|
11
|
+
IListServiceResponse,
|
|
12
|
+
IUpdateServiceBody,
|
|
13
|
+
IUpdateServiceParams,
|
|
14
|
+
IUpdateServiceResponse,
|
|
15
|
+
} from '../types';
|
|
16
|
+
|
|
17
|
+
const serviceListUrl = (params: { applicationId: string }): string =>
|
|
18
|
+
`api/service/${params.applicationId}`;
|
|
19
|
+
|
|
20
|
+
const serviceUrl = (params: { applicationId: string; serviceId: string }): string =>
|
|
21
|
+
`${serviceListUrl(params)}/${params.serviceId}`;
|
|
22
|
+
|
|
23
|
+
/** `GET /service/:applicationId`: the Services, each with its current deployment per environment. Needs REFLEX_READ. */
|
|
24
|
+
export const listService = async (params: IListServiceParams): Promise<IListServiceResponse> =>
|
|
25
|
+
(await AbyssReflexCore.axios.get<IListServiceResponse>(serviceListUrl(params))).data;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* `POST /service/:applicationId`: a Service of a name, a slug (immutable, third segment of the address)
|
|
29
|
+
* and a type. `409 ALREADY_EXISTS` when the name or the slug is taken. Needs REFLEX_FUNCTION_CREATE.
|
|
30
|
+
*/
|
|
31
|
+
export const createService = async (
|
|
32
|
+
params: ICreateServiceParams,
|
|
33
|
+
body: ICreateServiceBody,
|
|
34
|
+
): Promise<ICreateServiceResponse> =>
|
|
35
|
+
(await AbyssReflexCore.axios.post<ICreateServiceResponse>(serviceListUrl(params), body)).data;
|
|
36
|
+
|
|
37
|
+
/** `GET .../:serviceId`. Needs REFLEX_READ. */
|
|
38
|
+
export const getService = async (params: IGetServiceParams): Promise<IGetServiceResponse> =>
|
|
39
|
+
(await AbyssReflexCore.axios.get<IGetServiceResponse>(serviceUrl(params))).data;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* `PATCH .../:serviceId`: the name, and the draft of the CORS and of the rate limit, frozen by the next
|
|
43
|
+
* version. Needs REFLEX_FUNCTION_UPDATE.
|
|
44
|
+
*/
|
|
45
|
+
export const updateService = async (
|
|
46
|
+
params: IUpdateServiceParams,
|
|
47
|
+
body: IUpdateServiceBody,
|
|
48
|
+
): Promise<IUpdateServiceResponse> =>
|
|
49
|
+
(await AbyssReflexCore.axios.patch<IUpdateServiceResponse>(serviceUrl(params), body)).data;
|
|
50
|
+
|
|
51
|
+
/** `DELETE .../:serviceId`: the Service, its functions, routes, versions and deployments. Needs REFLEX_FUNCTION_DELETE. */
|
|
52
|
+
export const deleteService = async (
|
|
53
|
+
params: IDeleteServiceParams,
|
|
54
|
+
): Promise<IDeleteServiceResponse> =>
|
|
55
|
+
(await AbyssReflexCore.axios.delete<IDeleteServiceResponse>(serviceUrl(params))).data;
|
package/src/index.ts
CHANGED
|
@@ -4,10 +4,13 @@ import * as functionApi from './api/function.api';
|
|
|
4
4
|
import * as functionAccessApi from './api/function-access.api';
|
|
5
5
|
import * as functionTestApi from './api/function-test.api';
|
|
6
6
|
import * as functionVersionApi from './api/function-version.api';
|
|
7
|
-
import * as functionPromotionApi from './api/function-promotion.api';
|
|
8
|
-
import * as functionTriggerApi from './api/function-trigger.api';
|
|
9
7
|
import * as functionRunApi from './api/function-run.api';
|
|
10
8
|
import * as functionSettingsApi from './api/function-settings.api';
|
|
9
|
+
import * as serviceApi from './api/service.api';
|
|
10
|
+
import * as serviceRouteApi from './api/service-route.api';
|
|
11
|
+
import * as serviceVersionApi from './api/service-version.api';
|
|
12
|
+
import * as serviceDeploymentApi from './api/service-deployment.api';
|
|
13
|
+
import * as serviceVariableApi from './api/service-variable.api';
|
|
11
14
|
|
|
12
15
|
export * from './api';
|
|
13
16
|
export * from './types';
|
|
@@ -40,21 +43,9 @@ type AbyssReflexCoreSDK = {
|
|
|
40
43
|
};
|
|
41
44
|
version: {
|
|
42
45
|
list: typeof functionVersionApi.listFunctionVersion;
|
|
43
|
-
publish: typeof functionVersionApi.publishFunctionVersion;
|
|
44
46
|
get: typeof functionVersionApi.getFunctionVersion;
|
|
45
47
|
stepStats: typeof functionVersionApi.getFunctionVersionStepStats;
|
|
46
48
|
};
|
|
47
|
-
promotion: {
|
|
48
|
-
list: typeof functionPromotionApi.listFunctionPromotion;
|
|
49
|
-
promote: typeof functionPromotionApi.promoteFunction;
|
|
50
|
-
rollback: typeof functionPromotionApi.rollbackFunction;
|
|
51
|
-
};
|
|
52
|
-
trigger: {
|
|
53
|
-
list: typeof functionTriggerApi.listFunctionTrigger;
|
|
54
|
-
create: typeof functionTriggerApi.createFunctionTrigger;
|
|
55
|
-
rotate: typeof functionTriggerApi.rotateFunctionTrigger;
|
|
56
|
-
delete: typeof functionTriggerApi.deleteFunctionTrigger;
|
|
57
|
-
};
|
|
58
49
|
run: {
|
|
59
50
|
list: typeof functionRunApi.listFunctionRun;
|
|
60
51
|
get: typeof functionRunApi.getFunctionRun;
|
|
@@ -67,6 +58,39 @@ type AbyssReflexCoreSDK = {
|
|
|
67
58
|
removeEnvironment: typeof functionSettingsApi.removeFunctionEnvironmentSettings;
|
|
68
59
|
};
|
|
69
60
|
};
|
|
61
|
+
/** Services: the unit versioned, put in service and paused as one (`/api/service/:applicationId/...`). */
|
|
62
|
+
service: {
|
|
63
|
+
list: typeof serviceApi.listService;
|
|
64
|
+
create: typeof serviceApi.createService;
|
|
65
|
+
get: typeof serviceApi.getService;
|
|
66
|
+
update: typeof serviceApi.updateService;
|
|
67
|
+
delete: typeof serviceApi.deleteService;
|
|
68
|
+
route: {
|
|
69
|
+
list: typeof serviceRouteApi.listServiceRoute;
|
|
70
|
+
create: typeof serviceRouteApi.createServiceRoute;
|
|
71
|
+
update: typeof serviceRouteApi.updateServiceRoute;
|
|
72
|
+
delete: typeof serviceRouteApi.deleteServiceRoute;
|
|
73
|
+
rotate: typeof serviceRouteApi.rotateServiceRoute;
|
|
74
|
+
};
|
|
75
|
+
version: {
|
|
76
|
+
list: typeof serviceVersionApi.listServiceVersion;
|
|
77
|
+
create: typeof serviceVersionApi.createServiceVersion;
|
|
78
|
+
get: typeof serviceVersionApi.getServiceVersion;
|
|
79
|
+
};
|
|
80
|
+
deployment: {
|
|
81
|
+
list: typeof serviceDeploymentApi.listServiceDeployment;
|
|
82
|
+
goLive: typeof serviceDeploymentApi.goLiveService;
|
|
83
|
+
rollback: typeof serviceDeploymentApi.rollbackService;
|
|
84
|
+
pause: typeof serviceDeploymentApi.pauseService;
|
|
85
|
+
resume: typeof serviceDeploymentApi.resumeService;
|
|
86
|
+
};
|
|
87
|
+
variable: {
|
|
88
|
+
list: typeof serviceVariableApi.listServiceVariable;
|
|
89
|
+
set: typeof serviceVariableApi.setServiceVariable;
|
|
90
|
+
delete: typeof serviceVariableApi.deleteServiceVariable;
|
|
91
|
+
};
|
|
92
|
+
secretStatus: typeof serviceVariableApi.getServiceSecretStatus;
|
|
93
|
+
};
|
|
70
94
|
};
|
|
71
95
|
|
|
72
96
|
export class AbyssReflexCore {
|
|
@@ -100,21 +124,9 @@ export class AbyssReflexCore {
|
|
|
100
124
|
},
|
|
101
125
|
version: {
|
|
102
126
|
list: functionVersionApi.listFunctionVersion,
|
|
103
|
-
publish: functionVersionApi.publishFunctionVersion,
|
|
104
127
|
get: functionVersionApi.getFunctionVersion,
|
|
105
128
|
stepStats: functionVersionApi.getFunctionVersionStepStats,
|
|
106
129
|
},
|
|
107
|
-
promotion: {
|
|
108
|
-
list: functionPromotionApi.listFunctionPromotion,
|
|
109
|
-
promote: functionPromotionApi.promoteFunction,
|
|
110
|
-
rollback: functionPromotionApi.rollbackFunction,
|
|
111
|
-
},
|
|
112
|
-
trigger: {
|
|
113
|
-
list: functionTriggerApi.listFunctionTrigger,
|
|
114
|
-
create: functionTriggerApi.createFunctionTrigger,
|
|
115
|
-
rotate: functionTriggerApi.rotateFunctionTrigger,
|
|
116
|
-
delete: functionTriggerApi.deleteFunctionTrigger,
|
|
117
|
-
},
|
|
118
130
|
run: {
|
|
119
131
|
list: functionRunApi.listFunctionRun,
|
|
120
132
|
get: functionRunApi.getFunctionRun,
|
|
@@ -127,6 +139,38 @@ export class AbyssReflexCore {
|
|
|
127
139
|
removeEnvironment: functionSettingsApi.removeFunctionEnvironmentSettings,
|
|
128
140
|
},
|
|
129
141
|
},
|
|
142
|
+
service: {
|
|
143
|
+
list: serviceApi.listService,
|
|
144
|
+
create: serviceApi.createService,
|
|
145
|
+
get: serviceApi.getService,
|
|
146
|
+
update: serviceApi.updateService,
|
|
147
|
+
delete: serviceApi.deleteService,
|
|
148
|
+
route: {
|
|
149
|
+
list: serviceRouteApi.listServiceRoute,
|
|
150
|
+
create: serviceRouteApi.createServiceRoute,
|
|
151
|
+
update: serviceRouteApi.updateServiceRoute,
|
|
152
|
+
delete: serviceRouteApi.deleteServiceRoute,
|
|
153
|
+
rotate: serviceRouteApi.rotateServiceRoute,
|
|
154
|
+
},
|
|
155
|
+
version: {
|
|
156
|
+
list: serviceVersionApi.listServiceVersion,
|
|
157
|
+
create: serviceVersionApi.createServiceVersion,
|
|
158
|
+
get: serviceVersionApi.getServiceVersion,
|
|
159
|
+
},
|
|
160
|
+
deployment: {
|
|
161
|
+
list: serviceDeploymentApi.listServiceDeployment,
|
|
162
|
+
goLive: serviceDeploymentApi.goLiveService,
|
|
163
|
+
rollback: serviceDeploymentApi.rollbackService,
|
|
164
|
+
pause: serviceDeploymentApi.pauseService,
|
|
165
|
+
resume: serviceDeploymentApi.resumeService,
|
|
166
|
+
},
|
|
167
|
+
variable: {
|
|
168
|
+
list: serviceVariableApi.listServiceVariable,
|
|
169
|
+
set: serviceVariableApi.setServiceVariable,
|
|
170
|
+
delete: serviceVariableApi.deleteServiceVariable,
|
|
171
|
+
},
|
|
172
|
+
secretStatus: serviceVariableApi.getServiceSecretStatus,
|
|
173
|
+
},
|
|
130
174
|
};
|
|
131
175
|
}
|
|
132
176
|
return AbyssReflexCore._sdk;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* How
|
|
2
|
+
* How a route answers its caller.
|
|
3
3
|
* - SYNC: the caller waits for the Respond step, or gets 504 past the response timeout.
|
|
4
4
|
* - ASYNC: the caller gets `202 {executionId}` before the execution starts, and reads its state.
|
|
5
5
|
*/
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Memory of the isolate an execution runs in (ADR-
|
|
3
|
-
* profile: S x1, M x1.05, L x1.10, XL x1.20, XXL x1.35.
|
|
4
|
-
*/
|
|
5
|
-
export enum ExecutionProfile {
|
|
6
|
-
S = 'S',
|
|
7
|
-
M = 'M',
|
|
8
|
-
L = 'L',
|
|
9
|
-
XL = 'XL',
|
|
10
|
-
XXL = 'XXL',
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/** Memory limit of each profile, in MB (1 GB = 1024 MB). */
|
|
14
|
-
export const EXECUTION_PROFILE_MEMORY_MB: Readonly<Record<ExecutionProfile, number>> = {
|
|
15
|
-
[ExecutionProfile.S]: 128,
|
|
16
|
-
[ExecutionProfile.M]: 256,
|
|
17
|
-
[ExecutionProfile.L]: 512,
|
|
18
|
-
[ExecutionProfile.XL]: 1024,
|
|
19
|
-
[ExecutionProfile.XXL]: 2048,
|
|
20
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Memory of the isolate an execution runs in (ADR-0244). The CPU part of the cost grows with the
|
|
3
|
+
* profile: S x1, M x1.05, L x1.10, XL x1.20, XXL x1.35.
|
|
4
|
+
*/
|
|
5
|
+
export enum ExecutionProfile {
|
|
6
|
+
S = 'S',
|
|
7
|
+
M = 'M',
|
|
8
|
+
L = 'L',
|
|
9
|
+
XL = 'XL',
|
|
10
|
+
XXL = 'XXL',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Memory limit of each profile, in MB (1 GB = 1024 MB). */
|
|
14
|
+
export const EXECUTION_PROFILE_MEMORY_MB: Readonly<Record<ExecutionProfile, number>> = {
|
|
15
|
+
[ExecutionProfile.S]: 128,
|
|
16
|
+
[ExecutionProfile.M]: 256,
|
|
17
|
+
[ExecutionProfile.L]: 512,
|
|
18
|
+
[ExecutionProfile.XL]: 1024,
|
|
19
|
+
[ExecutionProfile.XXL]: 2048,
|
|
20
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/** Where the effective settings of an environment come from. */
|
|
2
|
-
export enum ExecutionSettingsSource {
|
|
3
|
-
/** The override of this environment. */
|
|
4
|
-
ENVIRONMENT = 'ENVIRONMENT',
|
|
5
|
-
/** The default of the function, for every environment without an override. */
|
|
6
|
-
DEFAULT = 'DEFAULT',
|
|
7
|
-
/** Nothing is set: the built-in defaults. */
|
|
8
|
-
BUILT_IN = 'BUILT_IN',
|
|
9
|
-
}
|
|
1
|
+
/** Where the effective settings of an environment come from. */
|
|
2
|
+
export enum ExecutionSettingsSource {
|
|
3
|
+
/** The override of this environment. */
|
|
4
|
+
ENVIRONMENT = 'ENVIRONMENT',
|
|
5
|
+
/** The default of the function, for every environment without an override. */
|
|
6
|
+
DEFAULT = 'DEFAULT',
|
|
7
|
+
/** Nothing is set: the built-in defaults. */
|
|
8
|
+
BUILT_IN = 'BUILT_IN',
|
|
9
|
+
}
|
package/src/types/enum/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from './health-status.enum';
|
|
2
|
-
export * from './trigger-type.enum';
|
|
3
2
|
export * from './trigger-access-mode.enum';
|
|
4
3
|
export * from './access-grant-status.enum';
|
|
5
4
|
export * from './run-mode.enum';
|
|
@@ -12,3 +11,9 @@ export * from './execution-mode.enum';
|
|
|
12
11
|
export * from './execution-settings-source.enum';
|
|
13
12
|
export * from './run-step-status.enum';
|
|
14
13
|
export * from './run-log-level.enum';
|
|
14
|
+
export * from './service-type.enum';
|
|
15
|
+
export * from './route-method.enum';
|
|
16
|
+
export * from './service-deployment-action.enum';
|
|
17
|
+
export * from './service-deployment-status.enum';
|
|
18
|
+
export * from './secret-source.enum';
|
|
19
|
+
export * from './service-version-change-kind.enum';
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
/** `error.code` of the refusals a client acts on. */
|
|
2
|
-
export enum ReflexErrorCode {
|
|
3
|
-
/** 400: the definition does not match the format; `error.details` holds the path of each fault. */
|
|
4
|
-
INVALID_DEFINITION = 'INVALID_DEFINITION',
|
|
5
|
-
/** 409: an access granted to the function is suspended; revoke it and grant it again. */
|
|
6
|
-
GRANT_SUSPENDED = 'GRANT_SUSPENDED',
|
|
7
|
-
/** 409: the function has no frozen version of its own draft yet, or none to go back to. */
|
|
8
|
-
NO_VERSION = 'NO_VERSION',
|
|
9
|
-
/** 409: the access to grant is not declared by the draft of the function. */
|
|
10
|
-
ACCESS_NOT_DECLARED = 'ACCESS_NOT_DECLARED',
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
/** `error.code` of the refusals a client acts on. */
|
|
2
|
+
export enum ReflexErrorCode {
|
|
3
|
+
/** 400: the definition does not match the format; `error.details` holds the path of each fault. */
|
|
4
|
+
INVALID_DEFINITION = 'INVALID_DEFINITION',
|
|
5
|
+
/** 409: an access granted to the function is suspended; revoke it and grant it again. */
|
|
6
|
+
GRANT_SUSPENDED = 'GRANT_SUSPENDED',
|
|
7
|
+
/** 409: the function has no frozen version of its own draft yet, or none to go back to. */
|
|
8
|
+
NO_VERSION = 'NO_VERSION',
|
|
9
|
+
/** 409: the access to grant is not declared by the draft of the function. */
|
|
10
|
+
ACCESS_NOT_DECLARED = 'ACCESS_NOT_DECLARED',
|
|
11
|
+
/** 404: the environment is not one of the application's environments (abyss-main). */
|
|
12
|
+
ENVIRONMENT_NOT_FOUND = 'ENVIRONMENT_NOT_FOUND',
|
|
13
|
+
/** 409: a name, a path or an access already exists. */
|
|
14
|
+
ALREADY_EXISTS = 'ALREADY_EXISTS',
|
|
15
|
+
/** 403: the function is promoted in a production environment and the member lacks REFLEX_PUBLISH_PRODUCTION. */
|
|
16
|
+
PUBLISH_PRODUCTION_REQUIRED = 'PUBLISH_PRODUCTION_REQUIRED',
|
|
17
|
+
/** 503 (edge): the Service is paused in this environment; nothing ran, nothing is billed. */
|
|
18
|
+
SERVICE_PAUSED = 'SERVICE_PAUSED',
|
|
19
|
+
/** 429: the caller went past the limit; `Retry-After` and `RateLimit-*` say when to come back. */
|
|
20
|
+
RATE_LIMIT_EXCEEDED = 'RATE_LIMIT_EXCEEDED',
|
|
21
|
+
/** 409: the route would hide another one of the Service (same method, paths equal but for their parameters). */
|
|
22
|
+
ROUTE_CONFLICT = 'ROUTE_CONFLICT',
|
|
23
|
+
/** 409: the Service has not changed since its last version. */
|
|
24
|
+
VERSION_UNCHANGED = 'VERSION_UNCHANGED',
|
|
25
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/** The level of a log line an execution wrote (LOG step, `abyss.log.*`, `console.*`). */
|
|
2
|
-
export enum RunLogLevel {
|
|
3
|
-
INFO = 'info',
|
|
4
|
-
WARN = 'warn',
|
|
5
|
-
ERROR = 'error',
|
|
6
|
-
}
|
|
1
|
+
/** The level of a log line an execution wrote (LOG step, `abyss.log.*`, `console.*`). */
|
|
2
|
+
export enum RunLogLevel {
|
|
3
|
+
INFO = 'info',
|
|
4
|
+
WARN = 'warn',
|
|
5
|
+
ERROR = 'error',
|
|
6
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export enum RunStatus {
|
|
2
|
-
/** A live execution accepted and not finished yet (an async caller reads it by its id). */
|
|
3
|
-
RUNNING = 'RUNNING',
|
|
4
|
-
SUCCEEDED = 'SUCCEEDED',
|
|
5
|
-
FAILED = 'FAILED',
|
|
6
|
-
/**
|
|
7
|
-
* A live execution stopped by the end of a pod of the edge or of the runner: offered (cost 0), kept in
|
|
8
|
-
* the journal with its measures up to the interruption, left out of every statistic.
|
|
9
|
-
*/
|
|
10
|
-
INTERRUPTED = 'INTERRUPTED',
|
|
11
|
-
}
|
|
1
|
+
export enum RunStatus {
|
|
2
|
+
/** A live execution accepted and not finished yet (an async caller reads it by its id). */
|
|
3
|
+
RUNNING = 'RUNNING',
|
|
4
|
+
SUCCEEDED = 'SUCCEEDED',
|
|
5
|
+
FAILED = 'FAILED',
|
|
6
|
+
/**
|
|
7
|
+
* A live execution stopped by the end of a pod of the edge or of the runner: offered (cost 0), kept in
|
|
8
|
+
* the journal with its measures up to the interruption, left out of every statistic.
|
|
9
|
+
*/
|
|
10
|
+
INTERRUPTED = 'INTERRUPTED',
|
|
11
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** How one step of a live execution ended. */
|
|
2
|
-
export enum RunStepStatus {
|
|
3
|
-
SUCCEEDED = 'SUCCEEDED',
|
|
4
|
-
FAILED = 'FAILED',
|
|
5
|
-
/** The step was running when the pod of the edge or of the runner stopped. */
|
|
6
|
-
INTERRUPTED = 'INTERRUPTED',
|
|
7
|
-
}
|
|
1
|
+
/** How one step of a live execution ended. */
|
|
2
|
+
export enum RunStepStatus {
|
|
3
|
+
SUCCEEDED = 'SUCCEEDED',
|
|
4
|
+
FAILED = 'FAILED',
|
|
5
|
+
/** The step was running when the pod of the edge or of the runner stopped. */
|
|
6
|
+
INTERRUPTED = 'INTERRUPTED',
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Where the value of a secret a Service uses comes from, in one environment. */
|
|
2
|
+
export enum SecretSource {
|
|
3
|
+
/** The project value of the Console vault entry. */
|
|
4
|
+
PROJECT = 'PROJECT',
|
|
5
|
+
/** The override the vault entry holds for this environment. */
|
|
6
|
+
OVERRIDE = 'OVERRIDE',
|
|
7
|
+
/** No vault entry of that name in the project. */
|
|
8
|
+
MISSING = 'MISSING',
|
|
9
|
+
}
|