@abyss-project/reflex 3.0.0 → 4.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/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/service-configuration.api.d.ts +2 -0
- package/dist/api/service-configuration.api.js +7 -0
- package/dist/api/service-configuration.api.js.map +1 -0
- package/dist/index.d.ts +3 -6
- package/dist/index.js +3 -6
- package/dist/index.js.map +1 -1
- package/dist/types/enum/configuration-read-as.enum.d.ts +4 -0
- package/dist/types/enum/configuration-read-as.enum.js +9 -0
- package/dist/types/enum/configuration-read-as.enum.js.map +1 -0
- package/dist/types/enum/index.d.ts +3 -1
- package/dist/types/enum/index.js +3 -1
- package/dist/types/enum/index.js.map +1 -1
- package/dist/types/enum/vault-value-source.enum.d.ts +6 -0
- package/dist/types/enum/vault-value-source.enum.js +11 -0
- package/dist/types/enum/vault-value-source.enum.js.map +1 -0
- package/dist/types/enum/vault-visibility.enum.d.ts +4 -0
- package/dist/types/enum/vault-visibility.enum.js +9 -0
- package/dist/types/enum/vault-visibility.enum.js.map +1 -0
- package/dist/types/interface/api/requests/index.d.ts +1 -1
- package/dist/types/interface/api/requests/index.js +1 -1
- package/dist/types/interface/api/requests/index.js.map +1 -1
- package/dist/types/interface/api/requests/service-configuration.request.d.ts +4 -0
- package/dist/types/interface/api/requests/{service-variable.request.js → service-configuration.request.js} +1 -1
- package/dist/types/interface/api/requests/service-configuration.request.js.map +1 -0
- package/dist/types/interface/api/responses/index.d.ts +1 -1
- package/dist/types/interface/api/responses/index.js +1 -1
- package/dist/types/interface/api/responses/index.js.map +1 -1
- package/dist/types/interface/api/responses/service-configuration.response.d.ts +6 -0
- package/dist/types/interface/api/responses/{service-variable.response.js → service-configuration.response.js} +1 -1
- package/dist/types/interface/api/responses/service-configuration.response.js.map +1 -0
- package/dist/types/interface/models/index.d.ts +1 -1
- package/dist/types/interface/models/index.js +1 -1
- package/dist/types/interface/models/index.js.map +1 -1
- package/dist/types/interface/models/reflex-service-configuration.model.d.ts +9 -0
- package/dist/types/interface/models/{reflex-service-variable.model.js → reflex-service-configuration.model.js} +1 -1
- package/dist/types/interface/models/reflex-service-configuration.model.js.map +1 -0
- package/dist/types/interface/models/reflex-service.model.d.ts +0 -2
- package/dist/types/interface/models/reflex-service.model.js +0 -2
- package/dist/types/interface/models/reflex-service.model.js.map +1 -1
- package/package.json +1 -1
- package/src/api/function-run.api.ts +38 -38
- package/src/api/function-version.api.ts +48 -48
- package/src/api/function.api.test.ts +249 -249
- package/src/api/index.ts +1 -1
- package/src/api/service-configuration.api.ts +16 -0
- package/src/api/service-deployment.api.ts +79 -79
- package/src/api/service-route.api.ts +72 -72
- package/src/api/service-version.api.ts +39 -39
- package/src/api/service.api.test.ts +209 -234
- package/src/api/service.api.ts +55 -55
- package/src/index.ts +190 -196
- package/src/types/enum/configuration-read-as.enum.ts +5 -0
- package/src/types/enum/execution-mode.enum.ts +9 -9
- package/src/types/enum/index.ts +3 -1
- package/src/types/enum/reflex-error-code.enum.ts +25 -25
- package/src/types/enum/route-method.enum.ts +9 -9
- 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 +7 -7
- package/src/types/enum/service-version-change-kind.enum.ts +6 -6
- package/src/types/enum/trigger-access-mode.enum.ts +12 -12
- package/src/types/enum/vault-value-source.enum.ts +12 -0
- package/src/types/enum/vault-visibility.enum.ts +5 -0
- package/src/types/interface/api/requests/function-run.request.ts +26 -26
- 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 +1 -1
- package/src/types/interface/api/requests/service-configuration.request.ts +4 -0
- package/src/types/interface/api/requests/service-deployment.request.ts +49 -49
- package/src/types/interface/api/requests/service-route.request.ts +44 -44
- package/src/types/interface/api/requests/service-version.request.ts +19 -19
- package/src/types/interface/api/requests/service.request.ts +39 -39
- package/src/types/interface/api/responses/function-version.response.ts +31 -31
- package/src/types/interface/api/responses/index.ts +1 -1
- package/src/types/interface/api/responses/service-configuration.response.ts +8 -0
- package/src/types/interface/api/responses/service-deployment.response.ts +32 -32
- package/src/types/interface/api/responses/service-route.response.ts +31 -31
- package/src/types/interface/api/responses/service-version.response.ts +33 -33
- package/src/types/interface/api/responses/service.response.ts +31 -31
- package/src/types/interface/models/index.ts +1 -1
- package/src/types/interface/models/reflex-function.model.ts +16 -16
- package/src/types/interface/models/reflex-route.model.ts +19 -19
- package/src/types/interface/models/reflex-run.model.ts +164 -164
- package/src/types/interface/models/reflex-service-configuration.model.ts +22 -0
- package/src/types/interface/models/reflex-service-deployment.model.ts +29 -29
- package/src/types/interface/models/reflex-service-version.model.ts +43 -43
- package/src/types/interface/models/reflex-service.model.ts +43 -46
- package/dist/api/service-variable.api.d.ts +0 -5
- package/dist/api/service-variable.api.js +0 -16
- package/dist/api/service-variable.api.js.map +0 -1
- package/dist/types/enum/secret-source.enum.d.ts +0 -5
- package/dist/types/enum/secret-source.enum.js +0 -10
- package/dist/types/enum/secret-source.enum.js.map +0 -1
- package/dist/types/interface/api/requests/service-variable.request.d.ts +0 -23
- package/dist/types/interface/api/requests/service-variable.request.js.map +0 -1
- package/dist/types/interface/api/responses/service-variable.response.d.ts +0 -22
- package/dist/types/interface/api/responses/service-variable.response.js.map +0 -1
- package/dist/types/interface/models/reflex-service-variable.model.d.ts +0 -10
- package/dist/types/interface/models/reflex-service-variable.model.js.map +0 -1
- package/src/api/service-variable.api.ts +0 -58
- package/src/types/enum/secret-source.enum.ts +0 -9
- package/src/types/interface/api/requests/service-variable.request.ts +0 -29
- package/src/types/interface/api/responses/service-variable.response.ts +0 -31
- package/src/types/interface/models/reflex-service-variable.model.ts +0 -16
package/src/index.ts
CHANGED
|
@@ -1,196 +1,190 @@
|
|
|
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
|
|
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
|
-
|
|
88
|
-
list: typeof
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
baseURL: DEFAULT_BASE_URL,
|
|
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
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
public static getConfig(): CoreConfig {
|
|
194
|
-
return AbyssReflexCore.config;
|
|
195
|
-
}
|
|
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 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 serviceConfigurationApi from './api/service-configuration.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
|
+
configuration: {
|
|
88
|
+
list: typeof serviceConfigurationApi.listServiceConfiguration;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export class AbyssReflexCore {
|
|
94
|
+
private static config: CoreConfig = {
|
|
95
|
+
baseURL: DEFAULT_BASE_URL,
|
|
96
|
+
};
|
|
97
|
+
static axios = axios.create({
|
|
98
|
+
baseURL: DEFAULT_BASE_URL,
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
private static _sdk: AbyssReflexCoreSDK | null = null;
|
|
102
|
+
|
|
103
|
+
public static get sdk(): AbyssReflexCoreSDK {
|
|
104
|
+
if (!AbyssReflexCore._sdk) {
|
|
105
|
+
AbyssReflexCore._sdk = {
|
|
106
|
+
health: healthApi.health,
|
|
107
|
+
function: {
|
|
108
|
+
list: functionApi.listFunction,
|
|
109
|
+
create: functionApi.createFunction,
|
|
110
|
+
get: functionApi.getFunction,
|
|
111
|
+
update: functionApi.updateFunction,
|
|
112
|
+
delete: functionApi.deleteFunction,
|
|
113
|
+
access: {
|
|
114
|
+
list: functionAccessApi.listFunctionAccess,
|
|
115
|
+
grant: functionAccessApi.grantFunctionAccess,
|
|
116
|
+
revoke: functionAccessApi.revokeFunctionAccess,
|
|
117
|
+
},
|
|
118
|
+
test: {
|
|
119
|
+
simulate: functionTestApi.simulateFunction,
|
|
120
|
+
dryRun: functionTestApi.dryRunFunction,
|
|
121
|
+
},
|
|
122
|
+
version: {
|
|
123
|
+
list: functionVersionApi.listFunctionVersion,
|
|
124
|
+
get: functionVersionApi.getFunctionVersion,
|
|
125
|
+
stepStats: functionVersionApi.getFunctionVersionStepStats,
|
|
126
|
+
},
|
|
127
|
+
run: {
|
|
128
|
+
list: functionRunApi.listFunctionRun,
|
|
129
|
+
get: functionRunApi.getFunctionRun,
|
|
130
|
+
state: functionRunApi.getFunctionRunState,
|
|
131
|
+
},
|
|
132
|
+
settings: {
|
|
133
|
+
get: functionSettingsApi.getFunctionSettings,
|
|
134
|
+
setDefault: functionSettingsApi.setFunctionDefaultSettings,
|
|
135
|
+
setEnvironment: functionSettingsApi.setFunctionEnvironmentSettings,
|
|
136
|
+
removeEnvironment: functionSettingsApi.removeFunctionEnvironmentSettings,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
service: {
|
|
140
|
+
list: serviceApi.listService,
|
|
141
|
+
create: serviceApi.createService,
|
|
142
|
+
get: serviceApi.getService,
|
|
143
|
+
update: serviceApi.updateService,
|
|
144
|
+
delete: serviceApi.deleteService,
|
|
145
|
+
route: {
|
|
146
|
+
list: serviceRouteApi.listServiceRoute,
|
|
147
|
+
create: serviceRouteApi.createServiceRoute,
|
|
148
|
+
update: serviceRouteApi.updateServiceRoute,
|
|
149
|
+
delete: serviceRouteApi.deleteServiceRoute,
|
|
150
|
+
rotate: serviceRouteApi.rotateServiceRoute,
|
|
151
|
+
},
|
|
152
|
+
version: {
|
|
153
|
+
list: serviceVersionApi.listServiceVersion,
|
|
154
|
+
create: serviceVersionApi.createServiceVersion,
|
|
155
|
+
get: serviceVersionApi.getServiceVersion,
|
|
156
|
+
},
|
|
157
|
+
deployment: {
|
|
158
|
+
list: serviceDeploymentApi.listServiceDeployment,
|
|
159
|
+
goLive: serviceDeploymentApi.goLiveService,
|
|
160
|
+
rollback: serviceDeploymentApi.rollbackService,
|
|
161
|
+
pause: serviceDeploymentApi.pauseService,
|
|
162
|
+
resume: serviceDeploymentApi.resumeService,
|
|
163
|
+
},
|
|
164
|
+
configuration: {
|
|
165
|
+
list: serviceConfigurationApi.listServiceConfiguration,
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
return AbyssReflexCore._sdk;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
public static setConfig(config: CoreConfig): void {
|
|
174
|
+
AbyssReflexCore._sdk = null;
|
|
175
|
+
|
|
176
|
+
AbyssReflexCore.config = { ...AbyssReflexCore.config, ...config };
|
|
177
|
+
|
|
178
|
+
if (config.baseURL) {
|
|
179
|
+
AbyssReflexCore.axios.defaults.baseURL = config.baseURL;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (config.token) {
|
|
183
|
+
AbyssReflexCore.axios.defaults.headers.common.Authorization = `Bearer ${config.token}`;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
public static getConfig(): CoreConfig {
|
|
188
|
+
return AbyssReflexCore.config;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
@@ -1,9 +1,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
|
-
}
|
|
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
|
@@ -15,5 +15,7 @@ export * from './service-type.enum';
|
|
|
15
15
|
export * from './route-method.enum';
|
|
16
16
|
export * from './service-deployment-action.enum';
|
|
17
17
|
export * from './service-deployment-status.enum';
|
|
18
|
-
export * from './
|
|
18
|
+
export * from './vault-value-source.enum';
|
|
19
|
+
export * from './vault-visibility.enum';
|
|
20
|
+
export * from './configuration-read-as.enum';
|
|
19
21
|
export * from './service-version-change-kind.enum';
|
|
@@ -1,25 +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
|
-
/** 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
|
+
/** `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,9 +1,9 @@
|
|
|
1
|
-
/** The HTTP method a route answers. `ANY` answers every method; a `FUNCTIONS` Service only has `ANY` routes. */
|
|
2
|
-
export enum RouteMethod {
|
|
3
|
-
GET = 'GET',
|
|
4
|
-
POST = 'POST',
|
|
5
|
-
PUT = 'PUT',
|
|
6
|
-
PATCH = 'PATCH',
|
|
7
|
-
DELETE = 'DELETE',
|
|
8
|
-
ANY = 'ANY',
|
|
9
|
-
}
|
|
1
|
+
/** The HTTP method a route answers. `ANY` answers every method; a `FUNCTIONS` Service only has `ANY` routes. */
|
|
2
|
+
export enum RouteMethod {
|
|
3
|
+
GET = 'GET',
|
|
4
|
+
POST = 'POST',
|
|
5
|
+
PUT = 'PUT',
|
|
6
|
+
PATCH = 'PATCH',
|
|
7
|
+
DELETE = 'DELETE',
|
|
8
|
+
ANY = 'ANY',
|
|
9
|
+
}
|
|
@@ -1,11 +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
|
-
}
|
|
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
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** State of the Service in an environment after a deployment gesture. */
|
|
2
|
-
export enum ServiceDeploymentStatus {
|
|
3
|
-
ACTIVE = 'ACTIVE',
|
|
4
|
-
PAUSED = 'PAUSED',
|
|
5
|
-
}
|
|
1
|
+
/** State of the Service in an environment after a deployment gesture. */
|
|
2
|
+
export enum ServiceDeploymentStatus {
|
|
3
|
+
ACTIVE = 'ACTIVE',
|
|
4
|
+
PAUSED = 'PAUSED',
|
|
5
|
+
}
|
|
@@ -1,7 +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
|
+
/** 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,6 +1,6 @@
|
|
|
1
|
-
/** How a route differs between a version of a Service and the previous one. */
|
|
2
|
-
export enum ServiceVersionChangeKind {
|
|
3
|
-
ADDED = 'ADDED',
|
|
4
|
-
REMOVED = 'REMOVED',
|
|
5
|
-
MODIFIED = 'MODIFIED',
|
|
6
|
-
}
|
|
1
|
+
/** How a route differs between a version of a Service and the previous one. */
|
|
2
|
+
export enum ServiceVersionChangeKind {
|
|
3
|
+
ADDED = 'ADDED',
|
|
4
|
+
REMOVED = 'REMOVED',
|
|
5
|
+
MODIFIED = 'MODIFIED',
|
|
6
|
+
}
|
|
@@ -1,12 +1,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
|
+
/**
|
|
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
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the value a Console vault entry gives to an environment comes from, in the order of the
|
|
3
|
+
* resolution: the value of the environment, the entry's default value, the value of the entry's default
|
|
4
|
+
* environment, or nothing (the entry is absent for the environment). Mirrors Console's enum of the
|
|
5
|
+
* same name, so the SDK needs no dependency on it.
|
|
6
|
+
*/
|
|
7
|
+
export enum VaultValueSource {
|
|
8
|
+
ENVIRONMENT = 'ENVIRONMENT',
|
|
9
|
+
DEFAULT = 'DEFAULT',
|
|
10
|
+
DEFAULT_ENVIRONMENT = 'DEFAULT_ENVIRONMENT',
|
|
11
|
+
ABSENT = 'ABSENT',
|
|
12
|
+
}
|