@abyss-project/reflex 5.0.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/service-version.api.d.ts +2 -1
- package/dist/api/service-version.api.js +3 -1
- package/dist/api/service-version.api.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/types/enum/discord-activity-type.enum.d.ts +7 -0
- package/dist/types/enum/discord-activity-type.enum.js +12 -0
- package/dist/types/enum/discord-activity-type.enum.js.map +1 -0
- package/dist/types/enum/discord-gateway-failure-code.enum.d.ts +5 -0
- package/dist/types/enum/discord-gateway-failure-code.enum.js +10 -0
- package/dist/types/enum/discord-gateway-failure-code.enum.js.map +1 -0
- package/dist/types/enum/discord-gateway-state.enum.d.ts +6 -0
- package/dist/types/enum/discord-gateway-state.enum.js +11 -0
- package/dist/types/enum/discord-gateway-state.enum.js.map +1 -0
- package/dist/types/enum/discord-presence-status.enum.d.ts +5 -0
- package/dist/types/enum/discord-presence-status.enum.js +10 -0
- package/dist/types/enum/discord-presence-status.enum.js.map +1 -0
- package/dist/types/enum/index.d.ts +4 -0
- package/dist/types/enum/index.js +4 -0
- package/dist/types/enum/index.js.map +1 -1
- package/dist/types/interface/api/requests/service-discord.request.d.ts +4 -1
- package/dist/types/interface/api/requests/service-version.request.d.ts +4 -0
- package/dist/types/interface/api/responses/service-version.response.d.ts +4 -0
- package/dist/types/interface/models/reflex-discord.model.d.ts +14 -1
- package/dist/types/interface/models/reflex-discord.model.js.map +1 -1
- package/package.json +1 -1
- package/src/api/function-access.api.ts +36 -36
- package/src/api/function-run.api.ts +38 -38
- package/src/api/function-settings.api.ts +59 -59
- package/src/api/function-test.api.ts +34 -34
- package/src/api/function-version.api.ts +48 -48
- package/src/api/function.api.test.ts +249 -249
- package/src/api/function.api.ts +62 -62
- package/src/api/health.api.ts +10 -10
- package/src/api/index.ts +13 -13
- package/src/api/service-configuration.api.ts +16 -16
- package/src/api/service-deployment.api.ts +79 -79
- package/src/api/service-route.api.ts +72 -72
- package/src/api/service-version.api.ts +54 -39
- package/src/api/service.api.test.ts +215 -209
- package/src/api/service.api.ts +55 -55
- package/src/index.ts +2 -0
- package/src/types/enum/discord-activity-type.enum.ts +9 -0
- package/src/types/enum/discord-component-kind.enum.ts +7 -7
- package/src/types/enum/discord-gateway-failure-code.enum.ts +9 -0
- package/src/types/enum/discord-gateway-state.enum.ts +11 -0
- package/src/types/enum/discord-option-type.enum.ts +12 -12
- package/src/types/enum/discord-presence-status.enum.ts +8 -0
- package/src/types/enum/discord-sync-status.enum.ts +6 -6
- package/src/types/enum/discord-token-state.enum.ts +11 -11
- package/src/types/enum/index.ts +4 -0
- package/src/types/interface/api/requests/service-discord.request.ts +128 -118
- package/src/types/interface/api/requests/service-version.request.ts +24 -19
- package/src/types/interface/api/responses/service-discord.response.ts +72 -72
- package/src/types/interface/api/responses/service-version.response.ts +11 -0
- package/src/types/interface/models/reflex-discord.model.ts +146 -117
- package/src/types/interface/models/reflex-run.model.ts +173 -173
package/src/api/function.api.ts
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import { AbyssReflexCore } from '..';
|
|
2
|
-
import type {
|
|
3
|
-
ICreateFunctionBody,
|
|
4
|
-
ICreateFunctionParams,
|
|
5
|
-
ICreateFunctionResponse,
|
|
6
|
-
IDeleteFunctionParams,
|
|
7
|
-
IDeleteFunctionResponse,
|
|
8
|
-
IGetFunctionParams,
|
|
9
|
-
IGetFunctionResponse,
|
|
10
|
-
IListFunctionParams,
|
|
11
|
-
IListFunctionResponse,
|
|
12
|
-
IUpdateFunctionBody,
|
|
13
|
-
IUpdateFunctionParams,
|
|
14
|
-
IUpdateFunctionResponse,
|
|
15
|
-
} from '../types';
|
|
16
|
-
|
|
17
|
-
/** `GET /api/function/:applicationId`: needs REFLEX_READ. */
|
|
18
|
-
export const listFunction = async (params: IListFunctionParams): Promise<IListFunctionResponse> =>
|
|
19
|
-
(await AbyssReflexCore.axios.get<IListFunctionResponse>(`api/function/${params.applicationId}`))
|
|
20
|
-
.data;
|
|
21
|
-
|
|
22
|
-
/** `POST /api/function/:applicationId`: needs REFLEX_FUNCTION_CREATE. A definition that breaks the format is a `400` naming the path of each fault. */
|
|
23
|
-
export const createFunction = async (
|
|
24
|
-
params: ICreateFunctionParams,
|
|
25
|
-
body: ICreateFunctionBody,
|
|
26
|
-
): Promise<ICreateFunctionResponse> =>
|
|
27
|
-
(
|
|
28
|
-
await AbyssReflexCore.axios.post<ICreateFunctionResponse>(
|
|
29
|
-
`api/function/${params.applicationId}`,
|
|
30
|
-
body,
|
|
31
|
-
)
|
|
32
|
-
).data;
|
|
33
|
-
|
|
34
|
-
/** `GET /api/function/:applicationId/:functionId`: needs REFLEX_READ. */
|
|
35
|
-
export const getFunction = async (params: IGetFunctionParams): Promise<IGetFunctionResponse> =>
|
|
36
|
-
(
|
|
37
|
-
await AbyssReflexCore.axios.get<IGetFunctionResponse>(
|
|
38
|
-
`api/function/${params.applicationId}/${params.functionId}`,
|
|
39
|
-
)
|
|
40
|
-
).data;
|
|
41
|
-
|
|
42
|
-
/** `PUT /api/function/:applicationId/:functionId`: needs REFLEX_FUNCTION_UPDATE. */
|
|
43
|
-
export const updateFunction = async (
|
|
44
|
-
params: IUpdateFunctionParams,
|
|
45
|
-
body: IUpdateFunctionBody,
|
|
46
|
-
): Promise<IUpdateFunctionResponse> =>
|
|
47
|
-
(
|
|
48
|
-
await AbyssReflexCore.axios.put<IUpdateFunctionResponse>(
|
|
49
|
-
`api/function/${params.applicationId}/${params.functionId}`,
|
|
50
|
-
body,
|
|
51
|
-
)
|
|
52
|
-
).data;
|
|
53
|
-
|
|
54
|
-
/** `DELETE /api/function/:applicationId/:functionId`: needs REFLEX_FUNCTION_DELETE. Takes the function off every environment. */
|
|
55
|
-
export const deleteFunction = async (
|
|
56
|
-
params: IDeleteFunctionParams,
|
|
57
|
-
): Promise<IDeleteFunctionResponse> =>
|
|
58
|
-
(
|
|
59
|
-
await AbyssReflexCore.axios.delete<IDeleteFunctionResponse>(
|
|
60
|
-
`api/function/${params.applicationId}/${params.functionId}`,
|
|
61
|
-
)
|
|
62
|
-
).data;
|
|
1
|
+
import { AbyssReflexCore } from '..';
|
|
2
|
+
import type {
|
|
3
|
+
ICreateFunctionBody,
|
|
4
|
+
ICreateFunctionParams,
|
|
5
|
+
ICreateFunctionResponse,
|
|
6
|
+
IDeleteFunctionParams,
|
|
7
|
+
IDeleteFunctionResponse,
|
|
8
|
+
IGetFunctionParams,
|
|
9
|
+
IGetFunctionResponse,
|
|
10
|
+
IListFunctionParams,
|
|
11
|
+
IListFunctionResponse,
|
|
12
|
+
IUpdateFunctionBody,
|
|
13
|
+
IUpdateFunctionParams,
|
|
14
|
+
IUpdateFunctionResponse,
|
|
15
|
+
} from '../types';
|
|
16
|
+
|
|
17
|
+
/** `GET /api/function/:applicationId`: needs REFLEX_READ. */
|
|
18
|
+
export const listFunction = async (params: IListFunctionParams): Promise<IListFunctionResponse> =>
|
|
19
|
+
(await AbyssReflexCore.axios.get<IListFunctionResponse>(`api/function/${params.applicationId}`))
|
|
20
|
+
.data;
|
|
21
|
+
|
|
22
|
+
/** `POST /api/function/:applicationId`: needs REFLEX_FUNCTION_CREATE. A definition that breaks the format is a `400` naming the path of each fault. */
|
|
23
|
+
export const createFunction = async (
|
|
24
|
+
params: ICreateFunctionParams,
|
|
25
|
+
body: ICreateFunctionBody,
|
|
26
|
+
): Promise<ICreateFunctionResponse> =>
|
|
27
|
+
(
|
|
28
|
+
await AbyssReflexCore.axios.post<ICreateFunctionResponse>(
|
|
29
|
+
`api/function/${params.applicationId}`,
|
|
30
|
+
body,
|
|
31
|
+
)
|
|
32
|
+
).data;
|
|
33
|
+
|
|
34
|
+
/** `GET /api/function/:applicationId/:functionId`: needs REFLEX_READ. */
|
|
35
|
+
export const getFunction = async (params: IGetFunctionParams): Promise<IGetFunctionResponse> =>
|
|
36
|
+
(
|
|
37
|
+
await AbyssReflexCore.axios.get<IGetFunctionResponse>(
|
|
38
|
+
`api/function/${params.applicationId}/${params.functionId}`,
|
|
39
|
+
)
|
|
40
|
+
).data;
|
|
41
|
+
|
|
42
|
+
/** `PUT /api/function/:applicationId/:functionId`: needs REFLEX_FUNCTION_UPDATE. */
|
|
43
|
+
export const updateFunction = async (
|
|
44
|
+
params: IUpdateFunctionParams,
|
|
45
|
+
body: IUpdateFunctionBody,
|
|
46
|
+
): Promise<IUpdateFunctionResponse> =>
|
|
47
|
+
(
|
|
48
|
+
await AbyssReflexCore.axios.put<IUpdateFunctionResponse>(
|
|
49
|
+
`api/function/${params.applicationId}/${params.functionId}`,
|
|
50
|
+
body,
|
|
51
|
+
)
|
|
52
|
+
).data;
|
|
53
|
+
|
|
54
|
+
/** `DELETE /api/function/:applicationId/:functionId`: needs REFLEX_FUNCTION_DELETE. Takes the function off every environment. */
|
|
55
|
+
export const deleteFunction = async (
|
|
56
|
+
params: IDeleteFunctionParams,
|
|
57
|
+
): Promise<IDeleteFunctionResponse> =>
|
|
58
|
+
(
|
|
59
|
+
await AbyssReflexCore.axios.delete<IDeleteFunctionResponse>(
|
|
60
|
+
`api/function/${params.applicationId}/${params.functionId}`,
|
|
61
|
+
)
|
|
62
|
+
).data;
|
package/src/api/health.api.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AbyssReflexCore } from '..';
|
|
2
|
-
import type { IHealthResponse } from '../types';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* `GET /health` — status of the database and Redis behind the API. Resolves on `200`; a `503`
|
|
6
|
-
* (a component down) rejects as an axios error whose `response.data` is the same
|
|
7
|
-
* {@link IHealthResponse}, naming the component that failed.
|
|
8
|
-
*/
|
|
9
|
-
export const health = async (): Promise<IHealthResponse> =>
|
|
10
|
-
(await AbyssReflexCore.axios.get<IHealthResponse>('health')).data;
|
|
1
|
+
import { AbyssReflexCore } from '..';
|
|
2
|
+
import type { IHealthResponse } from '../types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* `GET /health` — status of the database and Redis behind the API. Resolves on `200`; a `503`
|
|
6
|
+
* (a component down) rejects as an axios error whose `response.data` is the same
|
|
7
|
+
* {@link IHealthResponse}, naming the component that failed.
|
|
8
|
+
*/
|
|
9
|
+
export const health = async (): Promise<IHealthResponse> =>
|
|
10
|
+
(await AbyssReflexCore.axios.get<IHealthResponse>('health')).data;
|
package/src/api/index.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export * from './health.api';
|
|
2
|
-
export * from './function.api';
|
|
3
|
-
export * from './function-access.api';
|
|
4
|
-
export * from './function-test.api';
|
|
5
|
-
export * from './function-version.api';
|
|
6
|
-
export * from './function-run.api';
|
|
7
|
-
export * from './function-settings.api';
|
|
8
|
-
export * from './service.api';
|
|
9
|
-
export * from './service-route.api';
|
|
10
|
-
export * from './service-version.api';
|
|
11
|
-
export * from './service-deployment.api';
|
|
12
|
-
export * from './service-configuration.api';
|
|
13
|
-
export * from './service-discord.api';
|
|
1
|
+
export * from './health.api';
|
|
2
|
+
export * from './function.api';
|
|
3
|
+
export * from './function-access.api';
|
|
4
|
+
export * from './function-test.api';
|
|
5
|
+
export * from './function-version.api';
|
|
6
|
+
export * from './function-run.api';
|
|
7
|
+
export * from './function-settings.api';
|
|
8
|
+
export * from './service.api';
|
|
9
|
+
export * from './service-route.api';
|
|
10
|
+
export * from './service-version.api';
|
|
11
|
+
export * from './service-deployment.api';
|
|
12
|
+
export * from './service-configuration.api';
|
|
13
|
+
export * from './service-discord.api';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { AbyssReflexCore } from '..';
|
|
2
|
-
import type { IListServiceConfigurationParams, IListServiceConfigurationResponse } from '../types';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* `GET .../configuration`: per key the functions of the Service read (draft and versions in service),
|
|
6
|
-
* and per environment of the application, where the Console vault gets its value from; never a value.
|
|
7
|
-
* Needs REFLEX_READ, and SECRET_READ on the project (Console re-checks it).
|
|
8
|
-
*/
|
|
9
|
-
export const listServiceConfiguration = async (
|
|
10
|
-
params: IListServiceConfigurationParams,
|
|
11
|
-
): Promise<IListServiceConfigurationResponse> =>
|
|
12
|
-
(
|
|
13
|
-
await AbyssReflexCore.axios.get<IListServiceConfigurationResponse>(
|
|
14
|
-
`api/service/${params.applicationId}/${params.serviceId}/configuration`,
|
|
15
|
-
)
|
|
16
|
-
).data;
|
|
1
|
+
import { AbyssReflexCore } from '..';
|
|
2
|
+
import type { IListServiceConfigurationParams, IListServiceConfigurationResponse } from '../types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* `GET .../configuration`: per key the functions of the Service read (draft and versions in service),
|
|
6
|
+
* and per environment of the application, where the Console vault gets its value from; never a value.
|
|
7
|
+
* Needs REFLEX_READ, and SECRET_READ on the project (Console re-checks it).
|
|
8
|
+
*/
|
|
9
|
+
export const listServiceConfiguration = async (
|
|
10
|
+
params: IListServiceConfigurationParams,
|
|
11
|
+
): Promise<IListServiceConfigurationResponse> =>
|
|
12
|
+
(
|
|
13
|
+
await AbyssReflexCore.axios.get<IListServiceConfigurationResponse>(
|
|
14
|
+
`api/service/${params.applicationId}/${params.serviceId}/configuration`,
|
|
15
|
+
)
|
|
16
|
+
).data;
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import { AbyssReflexCore } from '..';
|
|
2
|
-
import type {
|
|
3
|
-
IGoLiveServiceBody,
|
|
4
|
-
IGoLiveServiceParams,
|
|
5
|
-
IGoLiveServiceResponse,
|
|
6
|
-
IListServiceDeploymentParams,
|
|
7
|
-
IListServiceDeploymentQuery,
|
|
8
|
-
IListServiceDeploymentResponse,
|
|
9
|
-
IPauseServiceBody,
|
|
10
|
-
IPauseServiceParams,
|
|
11
|
-
IPauseServiceResponse,
|
|
12
|
-
IResumeServiceBody,
|
|
13
|
-
IResumeServiceParams,
|
|
14
|
-
IResumeServiceResponse,
|
|
15
|
-
IRollbackServiceBody,
|
|
16
|
-
IRollbackServiceParams,
|
|
17
|
-
IRollbackServiceResponse,
|
|
18
|
-
} from '../types';
|
|
19
|
-
|
|
20
|
-
const deploymentUrl = (params: { applicationId: string; serviceId: string }): string =>
|
|
21
|
-
`api/service/${params.applicationId}/${params.serviceId}/deployment`;
|
|
22
|
-
|
|
23
|
-
/** `GET .../deployment`: the current deployment per environment and a page of the history. Needs REFLEX_READ. */
|
|
24
|
-
export const listServiceDeployment = async (
|
|
25
|
-
params: IListServiceDeploymentParams,
|
|
26
|
-
query: IListServiceDeploymentQuery = {},
|
|
27
|
-
): Promise<IListServiceDeploymentResponse> =>
|
|
28
|
-
(
|
|
29
|
-
await AbyssReflexCore.axios.get<IListServiceDeploymentResponse>(deploymentUrl(params), {
|
|
30
|
-
params: query,
|
|
31
|
-
})
|
|
32
|
-
).data;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* `POST .../deployment/go-live`: puts a version in service in an environment, in one transaction. Needs
|
|
36
|
-
* REFLEX_PUBLISH, and REFLEX_PUBLISH_PRODUCTION in a production environment.
|
|
37
|
-
*/
|
|
38
|
-
export const goLiveService = async (
|
|
39
|
-
params: IGoLiveServiceParams,
|
|
40
|
-
body: IGoLiveServiceBody,
|
|
41
|
-
): Promise<IGoLiveServiceResponse> =>
|
|
42
|
-
(
|
|
43
|
-
await AbyssReflexCore.axios.post<IGoLiveServiceResponse>(
|
|
44
|
-
`${deploymentUrl(params)}/go-live`,
|
|
45
|
-
body,
|
|
46
|
-
)
|
|
47
|
-
).data;
|
|
48
|
-
|
|
49
|
-
/** `POST .../deployment/rollback`: puts back the version of a deployment of the history. Rights as go-live. */
|
|
50
|
-
export const rollbackService = async (
|
|
51
|
-
params: IRollbackServiceParams,
|
|
52
|
-
body: IRollbackServiceBody,
|
|
53
|
-
): Promise<IRollbackServiceResponse> =>
|
|
54
|
-
(
|
|
55
|
-
await AbyssReflexCore.axios.post<IRollbackServiceResponse>(
|
|
56
|
-
`${deploymentUrl(params)}/rollback`,
|
|
57
|
-
body,
|
|
58
|
-
)
|
|
59
|
-
).data;
|
|
60
|
-
|
|
61
|
-
/** `POST .../deployment/pause`: every call answers `503 SERVICE_PAUSED`. Rights as go-live. */
|
|
62
|
-
export const pauseService = async (
|
|
63
|
-
params: IPauseServiceParams,
|
|
64
|
-
body: IPauseServiceBody,
|
|
65
|
-
): Promise<IPauseServiceResponse> =>
|
|
66
|
-
(await AbyssReflexCore.axios.post<IPauseServiceResponse>(`${deploymentUrl(params)}/pause`, body))
|
|
67
|
-
.data;
|
|
68
|
-
|
|
69
|
-
/** `POST .../deployment/resume`: the paused version answers again. Rights as go-live. */
|
|
70
|
-
export const resumeService = async (
|
|
71
|
-
params: IResumeServiceParams,
|
|
72
|
-
body: IResumeServiceBody,
|
|
73
|
-
): Promise<IResumeServiceResponse> =>
|
|
74
|
-
(
|
|
75
|
-
await AbyssReflexCore.axios.post<IResumeServiceResponse>(
|
|
76
|
-
`${deploymentUrl(params)}/resume`,
|
|
77
|
-
body,
|
|
78
|
-
)
|
|
79
|
-
).data;
|
|
1
|
+
import { AbyssReflexCore } from '..';
|
|
2
|
+
import type {
|
|
3
|
+
IGoLiveServiceBody,
|
|
4
|
+
IGoLiveServiceParams,
|
|
5
|
+
IGoLiveServiceResponse,
|
|
6
|
+
IListServiceDeploymentParams,
|
|
7
|
+
IListServiceDeploymentQuery,
|
|
8
|
+
IListServiceDeploymentResponse,
|
|
9
|
+
IPauseServiceBody,
|
|
10
|
+
IPauseServiceParams,
|
|
11
|
+
IPauseServiceResponse,
|
|
12
|
+
IResumeServiceBody,
|
|
13
|
+
IResumeServiceParams,
|
|
14
|
+
IResumeServiceResponse,
|
|
15
|
+
IRollbackServiceBody,
|
|
16
|
+
IRollbackServiceParams,
|
|
17
|
+
IRollbackServiceResponse,
|
|
18
|
+
} from '../types';
|
|
19
|
+
|
|
20
|
+
const deploymentUrl = (params: { applicationId: string; serviceId: string }): string =>
|
|
21
|
+
`api/service/${params.applicationId}/${params.serviceId}/deployment`;
|
|
22
|
+
|
|
23
|
+
/** `GET .../deployment`: the current deployment per environment and a page of the history. Needs REFLEX_READ. */
|
|
24
|
+
export const listServiceDeployment = async (
|
|
25
|
+
params: IListServiceDeploymentParams,
|
|
26
|
+
query: IListServiceDeploymentQuery = {},
|
|
27
|
+
): Promise<IListServiceDeploymentResponse> =>
|
|
28
|
+
(
|
|
29
|
+
await AbyssReflexCore.axios.get<IListServiceDeploymentResponse>(deploymentUrl(params), {
|
|
30
|
+
params: query,
|
|
31
|
+
})
|
|
32
|
+
).data;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* `POST .../deployment/go-live`: puts a version in service in an environment, in one transaction. Needs
|
|
36
|
+
* REFLEX_PUBLISH, and REFLEX_PUBLISH_PRODUCTION in a production environment.
|
|
37
|
+
*/
|
|
38
|
+
export const goLiveService = async (
|
|
39
|
+
params: IGoLiveServiceParams,
|
|
40
|
+
body: IGoLiveServiceBody,
|
|
41
|
+
): Promise<IGoLiveServiceResponse> =>
|
|
42
|
+
(
|
|
43
|
+
await AbyssReflexCore.axios.post<IGoLiveServiceResponse>(
|
|
44
|
+
`${deploymentUrl(params)}/go-live`,
|
|
45
|
+
body,
|
|
46
|
+
)
|
|
47
|
+
).data;
|
|
48
|
+
|
|
49
|
+
/** `POST .../deployment/rollback`: puts back the version of a deployment of the history. Rights as go-live. */
|
|
50
|
+
export const rollbackService = async (
|
|
51
|
+
params: IRollbackServiceParams,
|
|
52
|
+
body: IRollbackServiceBody,
|
|
53
|
+
): Promise<IRollbackServiceResponse> =>
|
|
54
|
+
(
|
|
55
|
+
await AbyssReflexCore.axios.post<IRollbackServiceResponse>(
|
|
56
|
+
`${deploymentUrl(params)}/rollback`,
|
|
57
|
+
body,
|
|
58
|
+
)
|
|
59
|
+
).data;
|
|
60
|
+
|
|
61
|
+
/** `POST .../deployment/pause`: every call answers `503 SERVICE_PAUSED`. Rights as go-live. */
|
|
62
|
+
export const pauseService = async (
|
|
63
|
+
params: IPauseServiceParams,
|
|
64
|
+
body: IPauseServiceBody,
|
|
65
|
+
): Promise<IPauseServiceResponse> =>
|
|
66
|
+
(await AbyssReflexCore.axios.post<IPauseServiceResponse>(`${deploymentUrl(params)}/pause`, body))
|
|
67
|
+
.data;
|
|
68
|
+
|
|
69
|
+
/** `POST .../deployment/resume`: the paused version answers again. Rights as go-live. */
|
|
70
|
+
export const resumeService = async (
|
|
71
|
+
params: IResumeServiceParams,
|
|
72
|
+
body: IResumeServiceBody,
|
|
73
|
+
): Promise<IResumeServiceResponse> =>
|
|
74
|
+
(
|
|
75
|
+
await AbyssReflexCore.axios.post<IResumeServiceResponse>(
|
|
76
|
+
`${deploymentUrl(params)}/resume`,
|
|
77
|
+
body,
|
|
78
|
+
)
|
|
79
|
+
).data;
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { AbyssReflexCore } from '..';
|
|
2
|
-
import type {
|
|
3
|
-
ICreateServiceRouteBody,
|
|
4
|
-
ICreateServiceRouteParams,
|
|
5
|
-
ICreateServiceRouteResponse,
|
|
6
|
-
IDeleteServiceRouteParams,
|
|
7
|
-
IDeleteServiceRouteResponse,
|
|
8
|
-
IListServiceRouteParams,
|
|
9
|
-
IListServiceRouteResponse,
|
|
10
|
-
IRotateServiceRouteParams,
|
|
11
|
-
IRotateServiceRouteResponse,
|
|
12
|
-
IUpdateServiceRouteBody,
|
|
13
|
-
IUpdateServiceRouteParams,
|
|
14
|
-
IUpdateServiceRouteResponse,
|
|
15
|
-
} from '../types';
|
|
16
|
-
|
|
17
|
-
const routeUrl = (params: { applicationId: string; serviceId: string }): string =>
|
|
18
|
-
`api/service/${params.applicationId}/${params.serviceId}/route`;
|
|
19
|
-
|
|
20
|
-
/** `GET .../route`: the routes of the draft, by path then method. Needs REFLEX_READ. */
|
|
21
|
-
export const listServiceRoute = async (
|
|
22
|
-
params: IListServiceRouteParams,
|
|
23
|
-
): Promise<IListServiceRouteResponse> =>
|
|
24
|
-
(await AbyssReflexCore.axios.get<IListServiceRouteResponse>(routeUrl(params))).data;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* `POST .../route`: a route of the draft, served once a version holding it is in service. The key or
|
|
28
|
-
* signing secret comes back once. `409 ROUTE_CONFLICT` when it would hide another route. Needs
|
|
29
|
-
* REFLEX_FUNCTION_UPDATE.
|
|
30
|
-
*/
|
|
31
|
-
export const createServiceRoute = async (
|
|
32
|
-
params: ICreateServiceRouteParams,
|
|
33
|
-
body: ICreateServiceRouteBody,
|
|
34
|
-
): Promise<ICreateServiceRouteResponse> =>
|
|
35
|
-
(await AbyssReflexCore.axios.post<ICreateServiceRouteResponse>(routeUrl(params), body)).data;
|
|
36
|
-
|
|
37
|
-
/** `PATCH .../route/:routeId`: changes the route in the draft. Needs REFLEX_FUNCTION_UPDATE. */
|
|
38
|
-
export const updateServiceRoute = async (
|
|
39
|
-
params: IUpdateServiceRouteParams,
|
|
40
|
-
body: IUpdateServiceRouteBody,
|
|
41
|
-
): Promise<IUpdateServiceRouteResponse> =>
|
|
42
|
-
(
|
|
43
|
-
await AbyssReflexCore.axios.patch<IUpdateServiceRouteResponse>(
|
|
44
|
-
`${routeUrl(params)}/${params.routeId}`,
|
|
45
|
-
body,
|
|
46
|
-
)
|
|
47
|
-
).data;
|
|
48
|
-
|
|
49
|
-
/** `DELETE .../route/:routeId`: takes the route out of the draft. Needs REFLEX_FUNCTION_UPDATE. */
|
|
50
|
-
export const deleteServiceRoute = async (
|
|
51
|
-
params: IDeleteServiceRouteParams,
|
|
52
|
-
): Promise<IDeleteServiceRouteResponse> =>
|
|
53
|
-
(
|
|
54
|
-
await AbyssReflexCore.axios.delete<IDeleteServiceRouteResponse>(
|
|
55
|
-
`${routeUrl(params)}/${params.routeId}`,
|
|
56
|
-
)
|
|
57
|
-
).data;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* `POST .../route/:routeId/rotate`: a new key or signing secret, shown once, served at once wherever the
|
|
61
|
-
* route is in service. Needs REFLEX_PUBLISH, and REFLEX_PUBLISH_PRODUCTION when a production
|
|
62
|
-
* environment serves the route.
|
|
63
|
-
*/
|
|
64
|
-
export const rotateServiceRoute = async (
|
|
65
|
-
params: IRotateServiceRouteParams,
|
|
66
|
-
): Promise<IRotateServiceRouteResponse> =>
|
|
67
|
-
(
|
|
68
|
-
await AbyssReflexCore.axios.post<IRotateServiceRouteResponse>(
|
|
69
|
-
`${routeUrl(params)}/${params.routeId}/rotate`,
|
|
70
|
-
{},
|
|
71
|
-
)
|
|
72
|
-
).data;
|
|
1
|
+
import { AbyssReflexCore } from '..';
|
|
2
|
+
import type {
|
|
3
|
+
ICreateServiceRouteBody,
|
|
4
|
+
ICreateServiceRouteParams,
|
|
5
|
+
ICreateServiceRouteResponse,
|
|
6
|
+
IDeleteServiceRouteParams,
|
|
7
|
+
IDeleteServiceRouteResponse,
|
|
8
|
+
IListServiceRouteParams,
|
|
9
|
+
IListServiceRouteResponse,
|
|
10
|
+
IRotateServiceRouteParams,
|
|
11
|
+
IRotateServiceRouteResponse,
|
|
12
|
+
IUpdateServiceRouteBody,
|
|
13
|
+
IUpdateServiceRouteParams,
|
|
14
|
+
IUpdateServiceRouteResponse,
|
|
15
|
+
} from '../types';
|
|
16
|
+
|
|
17
|
+
const routeUrl = (params: { applicationId: string; serviceId: string }): string =>
|
|
18
|
+
`api/service/${params.applicationId}/${params.serviceId}/route`;
|
|
19
|
+
|
|
20
|
+
/** `GET .../route`: the routes of the draft, by path then method. Needs REFLEX_READ. */
|
|
21
|
+
export const listServiceRoute = async (
|
|
22
|
+
params: IListServiceRouteParams,
|
|
23
|
+
): Promise<IListServiceRouteResponse> =>
|
|
24
|
+
(await AbyssReflexCore.axios.get<IListServiceRouteResponse>(routeUrl(params))).data;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* `POST .../route`: a route of the draft, served once a version holding it is in service. The key or
|
|
28
|
+
* signing secret comes back once. `409 ROUTE_CONFLICT` when it would hide another route. Needs
|
|
29
|
+
* REFLEX_FUNCTION_UPDATE.
|
|
30
|
+
*/
|
|
31
|
+
export const createServiceRoute = async (
|
|
32
|
+
params: ICreateServiceRouteParams,
|
|
33
|
+
body: ICreateServiceRouteBody,
|
|
34
|
+
): Promise<ICreateServiceRouteResponse> =>
|
|
35
|
+
(await AbyssReflexCore.axios.post<ICreateServiceRouteResponse>(routeUrl(params), body)).data;
|
|
36
|
+
|
|
37
|
+
/** `PATCH .../route/:routeId`: changes the route in the draft. Needs REFLEX_FUNCTION_UPDATE. */
|
|
38
|
+
export const updateServiceRoute = async (
|
|
39
|
+
params: IUpdateServiceRouteParams,
|
|
40
|
+
body: IUpdateServiceRouteBody,
|
|
41
|
+
): Promise<IUpdateServiceRouteResponse> =>
|
|
42
|
+
(
|
|
43
|
+
await AbyssReflexCore.axios.patch<IUpdateServiceRouteResponse>(
|
|
44
|
+
`${routeUrl(params)}/${params.routeId}`,
|
|
45
|
+
body,
|
|
46
|
+
)
|
|
47
|
+
).data;
|
|
48
|
+
|
|
49
|
+
/** `DELETE .../route/:routeId`: takes the route out of the draft. Needs REFLEX_FUNCTION_UPDATE. */
|
|
50
|
+
export const deleteServiceRoute = async (
|
|
51
|
+
params: IDeleteServiceRouteParams,
|
|
52
|
+
): Promise<IDeleteServiceRouteResponse> =>
|
|
53
|
+
(
|
|
54
|
+
await AbyssReflexCore.axios.delete<IDeleteServiceRouteResponse>(
|
|
55
|
+
`${routeUrl(params)}/${params.routeId}`,
|
|
56
|
+
)
|
|
57
|
+
).data;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* `POST .../route/:routeId/rotate`: a new key or signing secret, shown once, served at once wherever the
|
|
61
|
+
* route is in service. Needs REFLEX_PUBLISH, and REFLEX_PUBLISH_PRODUCTION when a production
|
|
62
|
+
* environment serves the route.
|
|
63
|
+
*/
|
|
64
|
+
export const rotateServiceRoute = async (
|
|
65
|
+
params: IRotateServiceRouteParams,
|
|
66
|
+
): Promise<IRotateServiceRouteResponse> =>
|
|
67
|
+
(
|
|
68
|
+
await AbyssReflexCore.axios.post<IRotateServiceRouteResponse>(
|
|
69
|
+
`${routeUrl(params)}/${params.routeId}/rotate`,
|
|
70
|
+
{},
|
|
71
|
+
)
|
|
72
|
+
).data;
|
|
@@ -1,39 +1,54 @@
|
|
|
1
|
-
import { AbyssReflexCore } from '..';
|
|
2
|
-
import type {
|
|
3
|
-
ICreateServiceVersionBody,
|
|
4
|
-
ICreateServiceVersionParams,
|
|
5
|
-
ICreateServiceVersionResponse,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
1
|
+
import { AbyssReflexCore } from '..';
|
|
2
|
+
import type {
|
|
3
|
+
ICreateServiceVersionBody,
|
|
4
|
+
ICreateServiceVersionParams,
|
|
5
|
+
ICreateServiceVersionResponse,
|
|
6
|
+
IGetServiceVersionDraftStatusParams,
|
|
7
|
+
IGetServiceVersionDraftStatusResponse,
|
|
8
|
+
IGetServiceVersionParams,
|
|
9
|
+
IGetServiceVersionResponse,
|
|
10
|
+
IListServiceVersionParams,
|
|
11
|
+
IListServiceVersionResponse,
|
|
12
|
+
} from '../types';
|
|
13
|
+
|
|
14
|
+
const versionUrl = (params: { applicationId: string; serviceId: string }): string =>
|
|
15
|
+
`api/service/${params.applicationId}/${params.serviceId}/version`;
|
|
16
|
+
|
|
17
|
+
/** `GET .../version`: the versions of the Service, newest first. Needs REFLEX_READ. */
|
|
18
|
+
export const listServiceVersion = async (
|
|
19
|
+
params: IListServiceVersionParams,
|
|
20
|
+
): Promise<IListServiceVersionResponse> =>
|
|
21
|
+
(await AbyssReflexCore.axios.get<IListServiceVersionResponse>(versionUrl(params))).data;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* `POST .../version`: publishes the drafts that changed and freezes the routes, the function versions,
|
|
25
|
+
* the CORS and the rate limit. `409 VERSION_UNCHANGED` when nothing changed. Needs REFLEX_PUBLISH.
|
|
26
|
+
*/
|
|
27
|
+
export const createServiceVersion = async (
|
|
28
|
+
params: ICreateServiceVersionParams,
|
|
29
|
+
body: ICreateServiceVersionBody = {},
|
|
30
|
+
): Promise<ICreateServiceVersionResponse> =>
|
|
31
|
+
(await AbyssReflexCore.axios.post<ICreateServiceVersionResponse>(versionUrl(params), body)).data;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* `GET .../version/draft-status`: how many functions of the Service a version created now would freeze
|
|
35
|
+
* differently from the last Service version (`changedFunctions`). Needs REFLEX_READ.
|
|
36
|
+
*/
|
|
37
|
+
export const getServiceVersionDraftStatus = async (
|
|
38
|
+
params: IGetServiceVersionDraftStatusParams,
|
|
39
|
+
): Promise<IGetServiceVersionDraftStatusResponse> =>
|
|
40
|
+
(
|
|
41
|
+
await AbyssReflexCore.axios.get<IGetServiceVersionDraftStatusResponse>(
|
|
42
|
+
`${versionUrl(params)}/draft-status`,
|
|
43
|
+
)
|
|
44
|
+
).data;
|
|
45
|
+
|
|
46
|
+
/** `GET .../version/:versionId`: the snapshot and the route changes since the version before. Needs REFLEX_READ. */
|
|
47
|
+
export const getServiceVersion = async (
|
|
48
|
+
params: IGetServiceVersionParams,
|
|
49
|
+
): Promise<IGetServiceVersionResponse> =>
|
|
50
|
+
(
|
|
51
|
+
await AbyssReflexCore.axios.get<IGetServiceVersionResponse>(
|
|
52
|
+
`${versionUrl(params)}/${params.versionId}`,
|
|
53
|
+
)
|
|
54
|
+
).data;
|