@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
package/src/index.ts
CHANGED
|
@@ -1,152 +1,196 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
import * as healthApi from './api/health.api';
|
|
3
|
-
import * as functionApi from './api/function.api';
|
|
4
|
-
import * as functionAccessApi from './api/function-access.api';
|
|
5
|
-
import * as functionTestApi from './api/function-test.api';
|
|
6
|
-
import * as functionVersionApi from './api/function-version.api';
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import * as healthApi from './api/health.api';
|
|
3
|
+
import * as functionApi from './api/function.api';
|
|
4
|
+
import * as functionAccessApi from './api/function-access.api';
|
|
5
|
+
import * as functionTestApi from './api/function-test.api';
|
|
6
|
+
import * as functionVersionApi from './api/function-version.api';
|
|
7
|
+
import * as functionRunApi from './api/function-run.api';
|
|
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';
|
|
14
|
+
|
|
15
|
+
export * from './api';
|
|
16
|
+
export * from './types';
|
|
17
|
+
|
|
18
|
+
const DEFAULT_BASE_URL = 'https://reflex-api.abyss-project.fr/';
|
|
19
|
+
|
|
20
|
+
type CoreConfig = {
|
|
21
|
+
baseURL?: string;
|
|
22
|
+
/** The session token of the member (`Authorization: Bearer`). Every route but `health` needs it. */
|
|
23
|
+
token?: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type AbyssReflexCoreSDK = {
|
|
27
|
+
/** `GET /health` — status of the database and Redis behind the API. */
|
|
28
|
+
health: typeof healthApi.health;
|
|
29
|
+
function: {
|
|
30
|
+
list: typeof functionApi.listFunction;
|
|
31
|
+
create: typeof functionApi.createFunction;
|
|
32
|
+
get: typeof functionApi.getFunction;
|
|
33
|
+
update: typeof functionApi.updateFunction;
|
|
34
|
+
delete: typeof functionApi.deleteFunction;
|
|
35
|
+
access: {
|
|
36
|
+
list: typeof functionAccessApi.listFunctionAccess;
|
|
37
|
+
grant: typeof functionAccessApi.grantFunctionAccess;
|
|
38
|
+
revoke: typeof functionAccessApi.revokeFunctionAccess;
|
|
39
|
+
};
|
|
40
|
+
test: {
|
|
41
|
+
simulate: typeof functionTestApi.simulateFunction;
|
|
42
|
+
dryRun: typeof functionTestApi.dryRunFunction;
|
|
43
|
+
};
|
|
44
|
+
version: {
|
|
45
|
+
list: typeof functionVersionApi.listFunctionVersion;
|
|
46
|
+
get: typeof functionVersionApi.getFunctionVersion;
|
|
47
|
+
stepStats: typeof functionVersionApi.getFunctionVersionStepStats;
|
|
48
|
+
};
|
|
49
|
+
run: {
|
|
50
|
+
list: typeof functionRunApi.listFunctionRun;
|
|
51
|
+
get: typeof functionRunApi.getFunctionRun;
|
|
52
|
+
state: typeof functionRunApi.getFunctionRunState;
|
|
53
|
+
};
|
|
54
|
+
settings: {
|
|
55
|
+
get: typeof functionSettingsApi.getFunctionSettings;
|
|
56
|
+
setDefault: typeof functionSettingsApi.setFunctionDefaultSettings;
|
|
57
|
+
setEnvironment: typeof functionSettingsApi.setFunctionEnvironmentSettings;
|
|
58
|
+
removeEnvironment: typeof functionSettingsApi.removeFunctionEnvironmentSettings;
|
|
59
|
+
};
|
|
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
|
+
};
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export class AbyssReflexCore {
|
|
97
|
+
private static config: CoreConfig = {
|
|
98
|
+
baseURL: DEFAULT_BASE_URL,
|
|
99
|
+
};
|
|
100
|
+
static axios = axios.create({
|
|
101
|
+
baseURL: DEFAULT_BASE_URL,
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
private static _sdk: AbyssReflexCoreSDK | null = null;
|
|
105
|
+
|
|
106
|
+
public static get sdk(): AbyssReflexCoreSDK {
|
|
107
|
+
if (!AbyssReflexCore._sdk) {
|
|
108
|
+
AbyssReflexCore._sdk = {
|
|
109
|
+
health: healthApi.health,
|
|
110
|
+
function: {
|
|
111
|
+
list: functionApi.listFunction,
|
|
112
|
+
create: functionApi.createFunction,
|
|
113
|
+
get: functionApi.getFunction,
|
|
114
|
+
update: functionApi.updateFunction,
|
|
115
|
+
delete: functionApi.deleteFunction,
|
|
116
|
+
access: {
|
|
117
|
+
list: functionAccessApi.listFunctionAccess,
|
|
118
|
+
grant: functionAccessApi.grantFunctionAccess,
|
|
119
|
+
revoke: functionAccessApi.revokeFunctionAccess,
|
|
120
|
+
},
|
|
121
|
+
test: {
|
|
122
|
+
simulate: functionTestApi.simulateFunction,
|
|
123
|
+
dryRun: functionTestApi.dryRunFunction,
|
|
124
|
+
},
|
|
125
|
+
version: {
|
|
126
|
+
list: functionVersionApi.listFunctionVersion,
|
|
127
|
+
get: functionVersionApi.getFunctionVersion,
|
|
128
|
+
stepStats: functionVersionApi.getFunctionVersionStepStats,
|
|
129
|
+
},
|
|
130
|
+
run: {
|
|
131
|
+
list: functionRunApi.listFunctionRun,
|
|
132
|
+
get: functionRunApi.getFunctionRun,
|
|
133
|
+
state: functionRunApi.getFunctionRunState,
|
|
134
|
+
},
|
|
135
|
+
settings: {
|
|
136
|
+
get: functionSettingsApi.getFunctionSettings,
|
|
137
|
+
setDefault: functionSettingsApi.setFunctionDefaultSettings,
|
|
138
|
+
setEnvironment: functionSettingsApi.setFunctionEnvironmentSettings,
|
|
139
|
+
removeEnvironment: functionSettingsApi.removeFunctionEnvironmentSettings,
|
|
140
|
+
},
|
|
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
|
+
},
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
return AbyssReflexCore._sdk;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
public static setConfig(config: CoreConfig): void {
|
|
180
|
+
AbyssReflexCore._sdk = null;
|
|
181
|
+
|
|
182
|
+
AbyssReflexCore.config = { ...AbyssReflexCore.config, ...config };
|
|
183
|
+
|
|
184
|
+
if (config.baseURL) {
|
|
185
|
+
AbyssReflexCore.axios.defaults.baseURL = config.baseURL;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (config.token) {
|
|
189
|
+
AbyssReflexCore.axios.defaults.headers.common.Authorization = `Bearer ${config.token}`;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
public static getConfig(): CoreConfig {
|
|
194
|
+
return AbyssReflexCore.config;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* How
|
|
3
|
-
* - SYNC: the caller waits for the Respond step, or gets 504 past the response timeout.
|
|
4
|
-
* - ASYNC: the caller gets `202 {executionId}` before the execution starts, and reads its state.
|
|
5
|
-
*/
|
|
6
|
-
export enum ExecutionMode {
|
|
7
|
-
SYNC = 'SYNC',
|
|
8
|
-
ASYNC = 'ASYNC',
|
|
9
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* How a route answers its caller.
|
|
3
|
+
* - SYNC: the caller waits for the Respond step, or gets 504 past the response timeout.
|
|
4
|
+
* - ASYNC: the caller gets `202 {executionId}` before the execution starts, and reads its state.
|
|
5
|
+
*/
|
|
6
|
+
export enum ExecutionMode {
|
|
7
|
+
SYNC = 'SYNC',
|
|
8
|
+
ASYNC = 'ASYNC',
|
|
9
|
+
}
|
package/src/types/enum/index.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
export * from './health-status.enum';
|
|
2
|
-
export * from './trigger-
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './run-
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './execution-
|
|
11
|
-
export * from './execution-
|
|
12
|
-
export * from './
|
|
13
|
-
export * from './run-
|
|
14
|
-
export * from './
|
|
1
|
+
export * from './health-status.enum';
|
|
2
|
+
export * from './trigger-access-mode.enum';
|
|
3
|
+
export * from './access-grant-status.enum';
|
|
4
|
+
export * from './run-mode.enum';
|
|
5
|
+
export * from './run-status.enum';
|
|
6
|
+
export * from './trace-effect-type.enum';
|
|
7
|
+
export * from './reflex-error-code.enum';
|
|
8
|
+
export * from './access-kind.enum';
|
|
9
|
+
export * from './execution-profile.enum';
|
|
10
|
+
export * from './execution-mode.enum';
|
|
11
|
+
export * from './execution-settings-source.enum';
|
|
12
|
+
export * from './run-step-status.enum';
|
|
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';
|
|
@@ -8,12 +8,18 @@ export enum ReflexErrorCode {
|
|
|
8
8
|
NO_VERSION = 'NO_VERSION',
|
|
9
9
|
/** 409: the access to grant is not declared by the draft of the function. */
|
|
10
10
|
ACCESS_NOT_DECLARED = 'ACCESS_NOT_DECLARED',
|
|
11
|
-
/** 409: the draft has not changed since the last published version. */
|
|
12
|
-
NOTHING_TO_PUBLISH = 'NOTHING_TO_PUBLISH',
|
|
13
11
|
/** 404: the environment is not one of the application's environments (abyss-main). */
|
|
14
12
|
ENVIRONMENT_NOT_FOUND = 'ENVIRONMENT_NOT_FOUND',
|
|
15
13
|
/** 409: a name, a path or an access already exists. */
|
|
16
14
|
ALREADY_EXISTS = 'ALREADY_EXISTS',
|
|
17
15
|
/** 403: the function is promoted in a production environment and the member lacks REFLEX_PUBLISH_PRODUCTION. */
|
|
18
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',
|
|
19
25
|
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** The gesture a deployment row records, one row per gesture in an environment. */
|
|
2
|
+
export enum ServiceDeploymentAction {
|
|
3
|
+
/** A version of the Service put in service. */
|
|
4
|
+
GO_LIVE = 'GO_LIVE',
|
|
5
|
+
/** A version deployed before put back in service. */
|
|
6
|
+
ROLLBACK = 'ROLLBACK',
|
|
7
|
+
/** The Service stops answering (503 SERVICE_PAUSED), its version kept. */
|
|
8
|
+
PAUSE = 'PAUSE',
|
|
9
|
+
/** The paused Service answers again, with the same version. */
|
|
10
|
+
RESUME = 'RESUME',
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** What a Service exposes. */
|
|
2
|
+
export enum ServiceType {
|
|
3
|
+
/** Routes of a method and a path, each calling one function of the Service. */
|
|
4
|
+
HTTP_API = 'HTTP_API',
|
|
5
|
+
/** Functions, each at a path, answering every method (routes of method `ANY` only). */
|
|
6
|
+
FUNCTIONS = 'FUNCTIONS',
|
|
7
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Who may call
|
|
3
|
-
* - PUBLIC: anyone.
|
|
4
|
-
* - API_KEY: the caller sends the key in `x-api-key`.
|
|
5
|
-
* - SIGNATURE: the caller signs the raw body: `x-reflex-signature: sha256=<hex HMAC-SHA256(secret,
|
|
6
|
-
* "<timestamp>." + body)>` with `x-reflex-timestamp` in Unix seconds, within 300 s of the edge's clock.
|
|
7
|
-
*/
|
|
8
|
-
export enum TriggerAccessMode {
|
|
9
|
-
PUBLIC = 'PUBLIC',
|
|
10
|
-
API_KEY = 'API_KEY',
|
|
11
|
-
SIGNATURE = 'SIGNATURE',
|
|
12
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Who may call a route of a Service.
|
|
3
|
+
* - PUBLIC: anyone.
|
|
4
|
+
* - API_KEY: the caller sends the key in `x-api-key`.
|
|
5
|
+
* - SIGNATURE: the caller signs the raw body: `x-reflex-signature: sha256=<hex HMAC-SHA256(secret,
|
|
6
|
+
* "<timestamp>." + body)>` with `x-reflex-timestamp` in Unix seconds, within 300 s of the edge's clock.
|
|
7
|
+
*/
|
|
8
|
+
export enum TriggerAccessMode {
|
|
9
|
+
PUBLIC = 'PUBLIC',
|
|
10
|
+
API_KEY = 'API_KEY',
|
|
11
|
+
SIGNATURE = 'SIGNATURE',
|
|
12
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import type { RunMode } from '../../../enum';
|
|
2
|
-
|
|
3
|
-
export interface IListFunctionRunParams {
|
|
4
|
-
applicationId: string;
|
|
5
|
-
functionId: string;
|
|
6
|
-
}
|
|
7
|
-
export interface IListFunctionRunQuery {
|
|
8
|
-
mode?: RunMode;
|
|
9
|
-
/** 1 to 100, 50 by default. */
|
|
10
|
-
limit?: number;
|
|
11
|
-
/** Runs skipped, newest first; 0 by default. */
|
|
12
|
-
offset?: number;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface IGetFunctionRunParams {
|
|
16
|
-
applicationId: string;
|
|
17
|
-
functionId: string;
|
|
18
|
-
runId: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface IGetFunctionRunStateParams {
|
|
22
|
-
applicationId: string;
|
|
23
|
-
functionId: string;
|
|
24
|
-
/** The `executionId` an async
|
|
25
|
-
runId: string;
|
|
26
|
-
}
|
|
1
|
+
import type { RunMode } from '../../../enum';
|
|
2
|
+
|
|
3
|
+
export interface IListFunctionRunParams {
|
|
4
|
+
applicationId: string;
|
|
5
|
+
functionId: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IListFunctionRunQuery {
|
|
8
|
+
mode?: RunMode;
|
|
9
|
+
/** 1 to 100, 50 by default. */
|
|
10
|
+
limit?: number;
|
|
11
|
+
/** Runs skipped, newest first; 0 by default. */
|
|
12
|
+
offset?: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface IGetFunctionRunParams {
|
|
16
|
+
applicationId: string;
|
|
17
|
+
functionId: string;
|
|
18
|
+
runId: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface IGetFunctionRunStateParams {
|
|
22
|
+
applicationId: string;
|
|
23
|
+
functionId: string;
|
|
24
|
+
/** The `executionId` an async route answered with: the id of the live run. */
|
|
25
|
+
runId: string;
|
|
26
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import type { IReflexExecutionSettingsValues } from '../../models';
|
|
2
|
-
|
|
3
|
-
export interface IGetFunctionSettingsParams {
|
|
4
|
-
applicationId: string;
|
|
5
|
-
functionId: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface ISetFunctionDefaultSettingsParams {
|
|
9
|
-
applicationId: string;
|
|
10
|
-
functionId: string;
|
|
11
|
-
}
|
|
12
|
-
/** Every value is required: a row of settings is whole. */
|
|
13
|
-
export type ISetFunctionDefaultSettingsBody = IReflexExecutionSettingsValues;
|
|
14
|
-
|
|
15
|
-
export interface ISetFunctionEnvironmentSettingsParams {
|
|
16
|
-
applicationId: string;
|
|
17
|
-
functionId: string;
|
|
18
|
-
/** An environment of the application (abyss-main's id). */
|
|
19
|
-
environmentId: string;
|
|
20
|
-
}
|
|
21
|
-
export type ISetFunctionEnvironmentSettingsBody = IReflexExecutionSettingsValues;
|
|
22
|
-
|
|
23
|
-
export interface IRemoveFunctionEnvironmentSettingsParams {
|
|
24
|
-
applicationId: string;
|
|
25
|
-
functionId: string;
|
|
26
|
-
environmentId: string;
|
|
27
|
-
}
|
|
1
|
+
import type { IReflexExecutionSettingsValues } from '../../models';
|
|
2
|
+
|
|
3
|
+
export interface IGetFunctionSettingsParams {
|
|
4
|
+
applicationId: string;
|
|
5
|
+
functionId: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ISetFunctionDefaultSettingsParams {
|
|
9
|
+
applicationId: string;
|
|
10
|
+
functionId: string;
|
|
11
|
+
}
|
|
12
|
+
/** Every value is required: a row of settings is whole. */
|
|
13
|
+
export type ISetFunctionDefaultSettingsBody = IReflexExecutionSettingsValues;
|
|
14
|
+
|
|
15
|
+
export interface ISetFunctionEnvironmentSettingsParams {
|
|
16
|
+
applicationId: string;
|
|
17
|
+
functionId: string;
|
|
18
|
+
/** An environment of the application (abyss-main's id). */
|
|
19
|
+
environmentId: string;
|
|
20
|
+
}
|
|
21
|
+
export type ISetFunctionEnvironmentSettingsBody = IReflexExecutionSettingsValues;
|
|
22
|
+
|
|
23
|
+
export interface IRemoveFunctionEnvironmentSettingsParams {
|
|
24
|
+
applicationId: string;
|
|
25
|
+
functionId: string;
|
|
26
|
+
environmentId: string;
|
|
27
|
+
}
|