@abyss-project/reflex 4.0.0 → 5.1.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 -0
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/service-discord.api.d.ts +14 -0
- package/dist/api/service-discord.api.js +38 -0
- package/dist/api/service-discord.api.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +22 -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-component-kind.enum.d.ts +4 -0
- package/dist/types/enum/discord-component-kind.enum.js +9 -0
- package/dist/types/enum/discord-component-kind.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-option-type.enum.d.ts +11 -0
- package/dist/types/enum/discord-option-type.enum.js +16 -0
- package/dist/types/enum/discord-option-type.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/discord-sync-status.enum.d.ts +5 -0
- package/dist/types/enum/discord-sync-status.enum.js +10 -0
- package/dist/types/enum/discord-sync-status.enum.js.map +1 -0
- package/dist/types/enum/discord-token-state.enum.d.ts +6 -0
- package/dist/types/enum/discord-token-state.enum.js +11 -0
- package/dist/types/enum/discord-token-state.enum.js.map +1 -0
- package/dist/types/enum/index.d.ts +8 -0
- package/dist/types/enum/index.js +8 -0
- package/dist/types/enum/index.js.map +1 -1
- package/dist/types/enum/reflex-error-code.enum.d.ts +7 -1
- package/dist/types/enum/reflex-error-code.enum.js +6 -0
- package/dist/types/enum/reflex-error-code.enum.js.map +1 -1
- package/dist/types/enum/service-type.enum.d.ts +2 -1
- package/dist/types/enum/service-type.enum.js +1 -0
- package/dist/types/enum/service-type.enum.js.map +1 -1
- package/dist/types/interface/api/requests/index.d.ts +1 -0
- package/dist/types/interface/api/requests/index.js +1 -0
- package/dist/types/interface/api/requests/index.js.map +1 -1
- package/dist/types/interface/api/requests/service-discord.request.d.ts +97 -0
- package/dist/types/interface/api/requests/service-discord.request.js +3 -0
- package/dist/types/interface/api/requests/service-discord.request.js.map +1 -0
- package/dist/types/interface/api/requests/service.request.d.ts +2 -0
- package/dist/types/interface/api/responses/index.d.ts +1 -0
- package/dist/types/interface/api/responses/index.js +1 -0
- package/dist/types/interface/api/responses/index.js.map +1 -1
- package/dist/types/interface/api/responses/service-discord.response.d.ts +50 -0
- package/dist/types/interface/api/responses/service-discord.response.js +3 -0
- package/dist/types/interface/api/responses/service-discord.response.js.map +1 -0
- package/dist/types/interface/api/responses/service-version.response.d.ts +15 -1
- package/dist/types/interface/models/index.d.ts +1 -0
- package/dist/types/interface/models/index.js +1 -0
- package/dist/types/interface/models/index.js.map +1 -1
- package/dist/types/interface/models/reflex-discord.model.d.ts +82 -0
- package/dist/types/interface/models/reflex-discord.model.js +13 -0
- package/dist/types/interface/models/reflex-discord.model.js.map +1 -0
- package/dist/types/interface/models/reflex-run.model.d.ts +3 -0
- package/dist/types/interface/models/reflex-service-deployment.model.d.ts +5 -1
- package/dist/types/interface/models/reflex-service-version.model.d.ts +6 -0
- package/dist/types/interface/models/reflex-service.model.d.ts +1 -0
- package/package.json +15 -10
- package/src/api/index.ts +13 -12
- package/src/api/service-configuration.api.ts +16 -16
- package/src/api/service-discord.api.test.ts +170 -0
- package/src/api/service-discord.api.ts +203 -0
- package/src/index.ts +45 -0
- package/src/types/enum/access-grant-status.enum.ts +12 -12
- package/src/types/enum/access-kind.enum.ts +7 -7
- package/src/types/enum/discord-activity-type.enum.ts +9 -0
- package/src/types/enum/discord-component-kind.enum.ts +7 -0
- 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 -0
- package/src/types/enum/discord-presence-status.enum.ts +8 -0
- package/src/types/enum/discord-sync-status.enum.ts +6 -0
- package/src/types/enum/discord-token-state.enum.ts +11 -0
- package/src/types/enum/execution-mode.enum.ts +9 -9
- package/src/types/enum/execution-profile.enum.ts +20 -20
- package/src/types/enum/execution-settings-source.enum.ts +9 -9
- package/src/types/enum/health-status.enum.ts +4 -4
- package/src/types/enum/index.ts +8 -0
- package/src/types/enum/reflex-error-code.enum.ts +37 -25
- package/src/types/enum/route-method.enum.ts +9 -9
- package/src/types/enum/run-log-level.enum.ts +6 -6
- package/src/types/enum/run-mode.enum.ts +11 -11
- package/src/types/enum/run-status.enum.ts +11 -11
- package/src/types/enum/run-step-status.enum.ts +7 -7
- package/src/types/enum/service-deployment-action.enum.ts +11 -11
- package/src/types/enum/service-deployment-status.enum.ts +5 -5
- package/src/types/enum/service-type.enum.ts +9 -7
- package/src/types/enum/service-version-change-kind.enum.ts +6 -6
- package/src/types/enum/trace-effect-type.enum.ts +12 -12
- package/src/types/enum/trigger-access-mode.enum.ts +12 -12
- package/src/types/index.ts +2 -2
- package/src/types/interface/api/index.ts +3 -3
- package/src/types/interface/api/requests/function-access.request.ts +25 -25
- package/src/types/interface/api/requests/function-run.request.ts +26 -26
- package/src/types/interface/api/requests/function-settings.request.ts +27 -27
- package/src/types/interface/api/requests/function-test.request.ts +24 -24
- package/src/types/interface/api/requests/function-version.request.ts +20 -20
- package/src/types/interface/api/requests/function.request.ts +36 -36
- package/src/types/interface/api/requests/index.ts +1 -0
- package/src/types/interface/api/requests/service-deployment.request.ts +49 -49
- package/src/types/interface/api/requests/service-discord.request.ts +128 -0
- 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 +46 -39
- package/src/types/interface/api/response.ts +4 -4
- package/src/types/interface/api/responses/function-access.response.ts +17 -17
- package/src/types/interface/api/responses/function-run.response.ts +18 -18
- package/src/types/interface/api/responses/function-settings.response.ts +36 -36
- package/src/types/interface/api/responses/function-test.response.ts +12 -12
- package/src/types/interface/api/responses/function-version.response.ts +31 -31
- package/src/types/interface/api/responses/function.response.ts +25 -25
- package/src/types/interface/api/responses/index.ts +1 -0
- package/src/types/interface/api/responses/service-deployment.response.ts +32 -32
- package/src/types/interface/api/responses/service-discord.response.ts +72 -0
- package/src/types/interface/api/responses/service-route.response.ts +31 -31
- package/src/types/interface/api/responses/service-version.response.ts +62 -33
- package/src/types/interface/api/responses/service.response.ts +31 -31
- package/src/types/interface/health.response.ts +7 -7
- package/src/types/interface/index.ts +3 -3
- package/src/types/interface/models/index.ts +1 -0
- package/src/types/interface/models/reflex-access-grant.model.ts +14 -14
- package/src/types/interface/models/reflex-definition.model.ts +31 -31
- package/src/types/interface/models/reflex-discord.model.ts +146 -0
- package/src/types/interface/models/reflex-execution-settings.model.ts +50 -50
- package/src/types/interface/models/reflex-function-version.model.ts +14 -14
- package/src/types/interface/models/reflex-function.model.ts +16 -16
- package/src/types/interface/models/reflex-price-list.model.ts +20 -20
- package/src/types/interface/models/reflex-route.model.ts +19 -19
- package/src/types/interface/models/reflex-run.model.ts +173 -164
- package/src/types/interface/models/reflex-service-deployment.model.ts +40 -29
- package/src/types/interface/models/reflex-service-version.model.ts +55 -43
- package/src/types/interface/models/reflex-service.model.ts +45 -43
- package/src/types/interface/models/reflex-step-stats.model.ts +35 -35
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import type { IReflexServiceDeployment } from '../../models';
|
|
2
|
-
import type { IResponse } from '../response';
|
|
3
|
-
|
|
4
|
-
export interface IListServiceDeploymentData {
|
|
5
|
-
/** The current deployment of each environment. */
|
|
6
|
-
current: IReflexServiceDeployment[];
|
|
7
|
-
/** Every gesture, newest first, one page of it. */
|
|
8
|
-
history: IReflexServiceDeployment[];
|
|
9
|
-
/** Gestures in the history, every page. */
|
|
10
|
-
total: number;
|
|
11
|
-
}
|
|
12
|
-
export type IListServiceDeploymentResponse = IResponse<IListServiceDeploymentData>;
|
|
13
|
-
|
|
14
|
-
export interface IGoLiveServiceData {
|
|
15
|
-
deployment: IReflexServiceDeployment;
|
|
16
|
-
}
|
|
17
|
-
export type IGoLiveServiceResponse = IResponse<IGoLiveServiceData>;
|
|
18
|
-
|
|
19
|
-
export interface IRollbackServiceData {
|
|
20
|
-
deployment: IReflexServiceDeployment;
|
|
21
|
-
}
|
|
22
|
-
export type IRollbackServiceResponse = IResponse<IRollbackServiceData>;
|
|
23
|
-
|
|
24
|
-
export interface IPauseServiceData {
|
|
25
|
-
deployment: IReflexServiceDeployment;
|
|
26
|
-
}
|
|
27
|
-
export type IPauseServiceResponse = IResponse<IPauseServiceData>;
|
|
28
|
-
|
|
29
|
-
export interface IResumeServiceData {
|
|
30
|
-
deployment: IReflexServiceDeployment;
|
|
31
|
-
}
|
|
32
|
-
export type IResumeServiceResponse = IResponse<IResumeServiceData>;
|
|
1
|
+
import type { IReflexServiceDeployment } from '../../models';
|
|
2
|
+
import type { IResponse } from '../response';
|
|
3
|
+
|
|
4
|
+
export interface IListServiceDeploymentData {
|
|
5
|
+
/** The current deployment of each environment. */
|
|
6
|
+
current: IReflexServiceDeployment[];
|
|
7
|
+
/** Every gesture, newest first, one page of it. */
|
|
8
|
+
history: IReflexServiceDeployment[];
|
|
9
|
+
/** Gestures in the history, every page. */
|
|
10
|
+
total: number;
|
|
11
|
+
}
|
|
12
|
+
export type IListServiceDeploymentResponse = IResponse<IListServiceDeploymentData>;
|
|
13
|
+
|
|
14
|
+
export interface IGoLiveServiceData {
|
|
15
|
+
deployment: IReflexServiceDeployment;
|
|
16
|
+
}
|
|
17
|
+
export type IGoLiveServiceResponse = IResponse<IGoLiveServiceData>;
|
|
18
|
+
|
|
19
|
+
export interface IRollbackServiceData {
|
|
20
|
+
deployment: IReflexServiceDeployment;
|
|
21
|
+
}
|
|
22
|
+
export type IRollbackServiceResponse = IResponse<IRollbackServiceData>;
|
|
23
|
+
|
|
24
|
+
export interface IPauseServiceData {
|
|
25
|
+
deployment: IReflexServiceDeployment;
|
|
26
|
+
}
|
|
27
|
+
export type IPauseServiceResponse = IResponse<IPauseServiceData>;
|
|
28
|
+
|
|
29
|
+
export interface IResumeServiceData {
|
|
30
|
+
deployment: IReflexServiceDeployment;
|
|
31
|
+
}
|
|
32
|
+
export type IResumeServiceResponse = IResponse<IResumeServiceData>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
IReflexDiscordCommand,
|
|
3
|
+
IReflexDiscordComponent,
|
|
4
|
+
IReflexDiscordConnection,
|
|
5
|
+
IReflexDiscordEnvironmentConnection,
|
|
6
|
+
IReflexServiceDeployment,
|
|
7
|
+
} from '../../models';
|
|
8
|
+
import type { IResponse } from '../response';
|
|
9
|
+
|
|
10
|
+
export interface IListServiceDiscordCommandData {
|
|
11
|
+
/** By name. */
|
|
12
|
+
commands: IReflexDiscordCommand[];
|
|
13
|
+
}
|
|
14
|
+
export type IListServiceDiscordCommandResponse = IResponse<IListServiceDiscordCommandData>;
|
|
15
|
+
|
|
16
|
+
export interface ICreateServiceDiscordCommandData {
|
|
17
|
+
command: IReflexDiscordCommand;
|
|
18
|
+
}
|
|
19
|
+
export type ICreateServiceDiscordCommandResponse = IResponse<ICreateServiceDiscordCommandData>;
|
|
20
|
+
|
|
21
|
+
export interface IUpdateServiceDiscordCommandData {
|
|
22
|
+
command: IReflexDiscordCommand;
|
|
23
|
+
}
|
|
24
|
+
export type IUpdateServiceDiscordCommandResponse = IResponse<IUpdateServiceDiscordCommandData>;
|
|
25
|
+
|
|
26
|
+
export type IDeleteServiceDiscordCommandData = Record<string, never>;
|
|
27
|
+
export type IDeleteServiceDiscordCommandResponse = IResponse<IDeleteServiceDiscordCommandData>;
|
|
28
|
+
|
|
29
|
+
export interface IListServiceDiscordComponentData {
|
|
30
|
+
/** By prefix. */
|
|
31
|
+
components: IReflexDiscordComponent[];
|
|
32
|
+
}
|
|
33
|
+
export type IListServiceDiscordComponentResponse = IResponse<IListServiceDiscordComponentData>;
|
|
34
|
+
|
|
35
|
+
export interface ICreateServiceDiscordComponentData {
|
|
36
|
+
component: IReflexDiscordComponent;
|
|
37
|
+
}
|
|
38
|
+
export type ICreateServiceDiscordComponentResponse = IResponse<ICreateServiceDiscordComponentData>;
|
|
39
|
+
|
|
40
|
+
export interface IUpdateServiceDiscordComponentData {
|
|
41
|
+
component: IReflexDiscordComponent;
|
|
42
|
+
}
|
|
43
|
+
export type IUpdateServiceDiscordComponentResponse = IResponse<IUpdateServiceDiscordComponentData>;
|
|
44
|
+
|
|
45
|
+
export type IDeleteServiceDiscordComponentData = Record<string, never>;
|
|
46
|
+
export type IDeleteServiceDiscordComponentResponse = IResponse<IDeleteServiceDiscordComponentData>;
|
|
47
|
+
|
|
48
|
+
export interface IGetServiceDiscordConnectionData {
|
|
49
|
+
connection: IReflexDiscordConnection;
|
|
50
|
+
}
|
|
51
|
+
export type IGetServiceDiscordConnectionResponse = IResponse<IGetServiceDiscordConnectionData>;
|
|
52
|
+
|
|
53
|
+
export interface ISetServiceDiscordTokenSecretData {
|
|
54
|
+
connection: IReflexDiscordConnection;
|
|
55
|
+
}
|
|
56
|
+
export type ISetServiceDiscordTokenSecretResponse = IResponse<ISetServiceDiscordTokenSecretData>;
|
|
57
|
+
|
|
58
|
+
export interface ISetServiceDiscordEnvironmentData {
|
|
59
|
+
environment: IReflexDiscordEnvironmentConnection;
|
|
60
|
+
}
|
|
61
|
+
export type ISetServiceDiscordEnvironmentResponse = IResponse<ISetServiceDiscordEnvironmentData>;
|
|
62
|
+
|
|
63
|
+
export interface ICheckServiceDiscordConnectionData {
|
|
64
|
+
environment: IReflexDiscordEnvironmentConnection;
|
|
65
|
+
}
|
|
66
|
+
export type ICheckServiceDiscordConnectionResponse = IResponse<ICheckServiceDiscordConnectionData>;
|
|
67
|
+
|
|
68
|
+
export interface IRetryServiceDiscordSyncData {
|
|
69
|
+
/** The current deployment of the environment, with the new state of the synchronization. */
|
|
70
|
+
deployment: IReflexServiceDeployment;
|
|
71
|
+
}
|
|
72
|
+
export type IRetryServiceDiscordSyncResponse = IResponse<IRetryServiceDiscordSyncData>;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import type { IReflexRoute } from '../../models';
|
|
2
|
-
import type { IResponse } from '../response';
|
|
3
|
-
|
|
4
|
-
export interface IListServiceRouteData {
|
|
5
|
-
routes: IReflexRoute[];
|
|
6
|
-
}
|
|
7
|
-
export type IListServiceRouteResponse = IResponse<IListServiceRouteData>;
|
|
8
|
-
|
|
9
|
-
export interface ICreateServiceRouteData {
|
|
10
|
-
route: IReflexRoute;
|
|
11
|
-
/** The API key (API_KEY) or the signing secret (SIGNATURE), in clear, ONCE. `null` for PUBLIC. */
|
|
12
|
-
secret: string | null;
|
|
13
|
-
}
|
|
14
|
-
export type ICreateServiceRouteResponse = IResponse<ICreateServiceRouteData>;
|
|
15
|
-
|
|
16
|
-
export interface IUpdateServiceRouteData {
|
|
17
|
-
route: IReflexRoute;
|
|
18
|
-
/** A new key or signing secret, in clear, ONCE, when the change of `accessMode` needs one; `null` otherwise. */
|
|
19
|
-
secret: string | null;
|
|
20
|
-
}
|
|
21
|
-
export type IUpdateServiceRouteResponse = IResponse<IUpdateServiceRouteData>;
|
|
22
|
-
|
|
23
|
-
export type IDeleteServiceRouteData = Record<string, never>;
|
|
24
|
-
export type IDeleteServiceRouteResponse = IResponse<IDeleteServiceRouteData>;
|
|
25
|
-
|
|
26
|
-
export interface IRotateServiceRouteData {
|
|
27
|
-
route: IReflexRoute;
|
|
28
|
-
/** The new key or signing secret, in clear, ONCE; the previous one stops working at once. */
|
|
29
|
-
secret: string;
|
|
30
|
-
}
|
|
31
|
-
export type IRotateServiceRouteResponse = IResponse<IRotateServiceRouteData>;
|
|
1
|
+
import type { IReflexRoute } from '../../models';
|
|
2
|
+
import type { IResponse } from '../response';
|
|
3
|
+
|
|
4
|
+
export interface IListServiceRouteData {
|
|
5
|
+
routes: IReflexRoute[];
|
|
6
|
+
}
|
|
7
|
+
export type IListServiceRouteResponse = IResponse<IListServiceRouteData>;
|
|
8
|
+
|
|
9
|
+
export interface ICreateServiceRouteData {
|
|
10
|
+
route: IReflexRoute;
|
|
11
|
+
/** The API key (API_KEY) or the signing secret (SIGNATURE), in clear, ONCE. `null` for PUBLIC. */
|
|
12
|
+
secret: string | null;
|
|
13
|
+
}
|
|
14
|
+
export type ICreateServiceRouteResponse = IResponse<ICreateServiceRouteData>;
|
|
15
|
+
|
|
16
|
+
export interface IUpdateServiceRouteData {
|
|
17
|
+
route: IReflexRoute;
|
|
18
|
+
/** A new key or signing secret, in clear, ONCE, when the change of `accessMode` needs one; `null` otherwise. */
|
|
19
|
+
secret: string | null;
|
|
20
|
+
}
|
|
21
|
+
export type IUpdateServiceRouteResponse = IResponse<IUpdateServiceRouteData>;
|
|
22
|
+
|
|
23
|
+
export type IDeleteServiceRouteData = Record<string, never>;
|
|
24
|
+
export type IDeleteServiceRouteResponse = IResponse<IDeleteServiceRouteData>;
|
|
25
|
+
|
|
26
|
+
export interface IRotateServiceRouteData {
|
|
27
|
+
route: IReflexRoute;
|
|
28
|
+
/** The new key or signing secret, in clear, ONCE; the previous one stops working at once. */
|
|
29
|
+
secret: string;
|
|
30
|
+
}
|
|
31
|
+
export type IRotateServiceRouteResponse = IResponse<IRotateServiceRouteData>;
|
|
@@ -1,33 +1,62 @@
|
|
|
1
|
-
import type { ServiceVersionChangeKind } from '../../../enum';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export interface
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import type { ServiceVersionChangeKind } from '../../../enum';
|
|
2
|
+
import type {
|
|
3
|
+
IReflexDiscordCommandSnapshot,
|
|
4
|
+
IReflexDiscordComponentSnapshot,
|
|
5
|
+
IReflexServiceVersion,
|
|
6
|
+
IReflexServiceVersionRoute,
|
|
7
|
+
} from '../../models';
|
|
8
|
+
import type { IResponse } from '../response';
|
|
9
|
+
|
|
10
|
+
/** How one route differs from the previous version, matched by route id. */
|
|
11
|
+
export interface IReflexServiceVersionRouteChange {
|
|
12
|
+
routeId: string;
|
|
13
|
+
kind: ServiceVersionChangeKind;
|
|
14
|
+
/** The route in the previous version; null when ADDED. */
|
|
15
|
+
before: IReflexServiceVersionRoute | null;
|
|
16
|
+
/** The route in this version; null when REMOVED. */
|
|
17
|
+
after: IReflexServiceVersionRoute | null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** How one command of a Discord bot differs from the previous version, matched by command id. */
|
|
21
|
+
export interface IReflexServiceVersionCommandChange {
|
|
22
|
+
commandId: string;
|
|
23
|
+
kind: ServiceVersionChangeKind;
|
|
24
|
+
/** The command in the previous version; null when ADDED. */
|
|
25
|
+
before: IReflexDiscordCommandSnapshot | null;
|
|
26
|
+
/** The command in this version; null when REMOVED. */
|
|
27
|
+
after: IReflexDiscordCommandSnapshot | null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** How one component of a Discord bot differs from the previous version, matched by component id. */
|
|
31
|
+
export interface IReflexServiceVersionComponentChange {
|
|
32
|
+
componentId: string;
|
|
33
|
+
kind: ServiceVersionChangeKind;
|
|
34
|
+
/** The component in the previous version; null when ADDED. */
|
|
35
|
+
before: IReflexDiscordComponentSnapshot | null;
|
|
36
|
+
/** The component in this version; null when REMOVED. */
|
|
37
|
+
after: IReflexDiscordComponentSnapshot | null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface IListServiceVersionData {
|
|
41
|
+
/** Newest first. */
|
|
42
|
+
versions: IReflexServiceVersion[];
|
|
43
|
+
}
|
|
44
|
+
export type IListServiceVersionResponse = IResponse<IListServiceVersionData>;
|
|
45
|
+
|
|
46
|
+
export interface ICreateServiceVersionData {
|
|
47
|
+
version: IReflexServiceVersion;
|
|
48
|
+
}
|
|
49
|
+
export type ICreateServiceVersionResponse = IResponse<ICreateServiceVersionData>;
|
|
50
|
+
|
|
51
|
+
export interface IGetServiceVersionData {
|
|
52
|
+
version: IReflexServiceVersion;
|
|
53
|
+
/** The version just before; null for the first one. */
|
|
54
|
+
previousVersion: IReflexServiceVersion | null;
|
|
55
|
+
/** The routes added, removed or modified since `previousVersion` (every route is ADDED for the first one). */
|
|
56
|
+
routeChanges: IReflexServiceVersionRouteChange[];
|
|
57
|
+
/** The commands added, removed or modified since `previousVersion`; empty for a Service that is not a Discord bot. */
|
|
58
|
+
commandChanges: IReflexServiceVersionCommandChange[];
|
|
59
|
+
/** The components added, removed or modified since `previousVersion`; empty for a Service that is not a Discord bot. */
|
|
60
|
+
componentChanges: IReflexServiceVersionComponentChange[];
|
|
61
|
+
}
|
|
62
|
+
export type IGetServiceVersionResponse = IResponse<IGetServiceVersionData>;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import type { IReflexService, IReflexServiceDeployment } from '../../models';
|
|
2
|
-
import type { IResponse } from '../response';
|
|
3
|
-
|
|
4
|
-
/** A Service with what runs in each environment of the application. */
|
|
5
|
-
export interface IReflexServiceListItem extends IReflexService {
|
|
6
|
-
/** The current deployment of each environment where the Service was ever put in service. */
|
|
7
|
-
currentDeployments: IReflexServiceDeployment[];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface IListServiceData {
|
|
11
|
-
services: IReflexServiceListItem[];
|
|
12
|
-
}
|
|
13
|
-
export type IListServiceResponse = IResponse<IListServiceData>;
|
|
14
|
-
|
|
15
|
-
export interface ICreateServiceData {
|
|
16
|
-
service: IReflexService;
|
|
17
|
-
}
|
|
18
|
-
export type ICreateServiceResponse = IResponse<ICreateServiceData>;
|
|
19
|
-
|
|
20
|
-
export interface IGetServiceData {
|
|
21
|
-
service: IReflexService;
|
|
22
|
-
}
|
|
23
|
-
export type IGetServiceResponse = IResponse<IGetServiceData>;
|
|
24
|
-
|
|
25
|
-
export interface IUpdateServiceData {
|
|
26
|
-
service: IReflexService;
|
|
27
|
-
}
|
|
28
|
-
export type IUpdateServiceResponse = IResponse<IUpdateServiceData>;
|
|
29
|
-
|
|
30
|
-
export type IDeleteServiceData = Record<string, never>;
|
|
31
|
-
export type IDeleteServiceResponse = IResponse<IDeleteServiceData>;
|
|
1
|
+
import type { IReflexService, IReflexServiceDeployment } from '../../models';
|
|
2
|
+
import type { IResponse } from '../response';
|
|
3
|
+
|
|
4
|
+
/** A Service with what runs in each environment of the application. */
|
|
5
|
+
export interface IReflexServiceListItem extends IReflexService {
|
|
6
|
+
/** The current deployment of each environment where the Service was ever put in service. */
|
|
7
|
+
currentDeployments: IReflexServiceDeployment[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface IListServiceData {
|
|
11
|
+
services: IReflexServiceListItem[];
|
|
12
|
+
}
|
|
13
|
+
export type IListServiceResponse = IResponse<IListServiceData>;
|
|
14
|
+
|
|
15
|
+
export interface ICreateServiceData {
|
|
16
|
+
service: IReflexService;
|
|
17
|
+
}
|
|
18
|
+
export type ICreateServiceResponse = IResponse<ICreateServiceData>;
|
|
19
|
+
|
|
20
|
+
export interface IGetServiceData {
|
|
21
|
+
service: IReflexService;
|
|
22
|
+
}
|
|
23
|
+
export type IGetServiceResponse = IResponse<IGetServiceData>;
|
|
24
|
+
|
|
25
|
+
export interface IUpdateServiceData {
|
|
26
|
+
service: IReflexService;
|
|
27
|
+
}
|
|
28
|
+
export type IUpdateServiceResponse = IResponse<IUpdateServiceData>;
|
|
29
|
+
|
|
30
|
+
export type IDeleteServiceData = Record<string, never>;
|
|
31
|
+
export type IDeleteServiceResponse = IResponse<IDeleteServiceData>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { HealthStatus } from '../enum';
|
|
2
|
-
|
|
3
|
-
/** Body of `GET /health`: `200` when both components are up, `503` with the same shape otherwise. */
|
|
4
|
-
export interface IHealthResponse {
|
|
5
|
-
database: HealthStatus;
|
|
6
|
-
redis: HealthStatus;
|
|
7
|
-
}
|
|
1
|
+
import type { HealthStatus } from '../enum';
|
|
2
|
+
|
|
3
|
+
/** Body of `GET /health`: `200` when both components are up, `503` with the same shape otherwise. */
|
|
4
|
+
export interface IHealthResponse {
|
|
5
|
+
database: HealthStatus;
|
|
6
|
+
redis: HealthStatus;
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './health.response';
|
|
2
|
-
export * from './models';
|
|
3
|
-
export * from './api';
|
|
1
|
+
export * from './health.response';
|
|
2
|
+
export * from './models';
|
|
3
|
+
export * from './api';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { AccessGrantStatus } from '../../enum';
|
|
2
|
-
import type { IReflexAccessDeclaration } from './reflex-definition.model';
|
|
3
|
-
|
|
4
|
-
export interface IReflexAccessGrant {
|
|
5
|
-
id: string;
|
|
6
|
-
functionId: string;
|
|
7
|
-
declaration: IReflexAccessDeclaration;
|
|
8
|
-
status: AccessGrantStatus;
|
|
9
|
-
grantedByUserId: string;
|
|
10
|
-
grantedAt: Date;
|
|
11
|
-
suspendedAt: Date | null;
|
|
12
|
-
revokedByUserId: string | null;
|
|
13
|
-
revokedAt: Date | null;
|
|
14
|
-
}
|
|
1
|
+
import type { AccessGrantStatus } from '../../enum';
|
|
2
|
+
import type { IReflexAccessDeclaration } from './reflex-definition.model';
|
|
3
|
+
|
|
4
|
+
export interface IReflexAccessGrant {
|
|
5
|
+
id: string;
|
|
6
|
+
functionId: string;
|
|
7
|
+
declaration: IReflexAccessDeclaration;
|
|
8
|
+
status: AccessGrantStatus;
|
|
9
|
+
grantedByUserId: string;
|
|
10
|
+
grantedAt: Date;
|
|
11
|
+
suspendedAt: Date | null;
|
|
12
|
+
revokedByUserId: string | null;
|
|
13
|
+
revokedAt: Date | null;
|
|
14
|
+
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import type { ReflexAccessKind } from '../../enum';
|
|
2
|
-
|
|
3
|
-
export interface IReflexHttpAccess {
|
|
4
|
-
kind: ReflexAccessKind.HTTP;
|
|
5
|
-
hosts: string[];
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface IReflexHostActionAccess {
|
|
9
|
-
kind: ReflexAccessKind.HOST_ACTION;
|
|
10
|
-
action: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type IReflexAccessDeclaration = IReflexHttpAccess | IReflexHostActionAccess;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* A function's definition, in the format of @abyss-project/runtime (`formatVersion` 1). The steps are
|
|
17
|
-
* the core's own and validated by the API; the SDK only carries them.
|
|
18
|
-
*/
|
|
19
|
-
export interface IReflexDefinition {
|
|
20
|
-
formatVersion: number;
|
|
21
|
-
accesses: IReflexAccessDeclaration[];
|
|
22
|
-
steps: Array<Record<string, unknown>>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Bounds of the status a RESPOND step (or `abyss.respond`) may answer with, both included: the
|
|
27
|
-
* runtime's `MIN_RESPONSE_STATUS` and `MAX_RESPONSE_STATUS`, which publication and the edge apply.
|
|
28
|
-
* The API's tests check that they are equal.
|
|
29
|
-
*/
|
|
30
|
-
export const RESPOND_STATUS_MIN = 200;
|
|
31
|
-
export const RESPOND_STATUS_MAX = 599;
|
|
1
|
+
import type { ReflexAccessKind } from '../../enum';
|
|
2
|
+
|
|
3
|
+
export interface IReflexHttpAccess {
|
|
4
|
+
kind: ReflexAccessKind.HTTP;
|
|
5
|
+
hosts: string[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface IReflexHostActionAccess {
|
|
9
|
+
kind: ReflexAccessKind.HOST_ACTION;
|
|
10
|
+
action: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type IReflexAccessDeclaration = IReflexHttpAccess | IReflexHostActionAccess;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A function's definition, in the format of @abyss-project/runtime (`formatVersion` 1). The steps are
|
|
17
|
+
* the core's own and validated by the API; the SDK only carries them.
|
|
18
|
+
*/
|
|
19
|
+
export interface IReflexDefinition {
|
|
20
|
+
formatVersion: number;
|
|
21
|
+
accesses: IReflexAccessDeclaration[];
|
|
22
|
+
steps: Array<Record<string, unknown>>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Bounds of the status a RESPOND step (or `abyss.respond`) may answer with, both included: the
|
|
27
|
+
* runtime's `MIN_RESPONSE_STATUS` and `MAX_RESPONSE_STATUS`, which publication and the edge apply.
|
|
28
|
+
* The API's tests check that they are equal.
|
|
29
|
+
*/
|
|
30
|
+
export const RESPOND_STATUS_MIN = 200;
|
|
31
|
+
export const RESPOND_STATUS_MAX = 599;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
DiscordActivityType,
|
|
3
|
+
DiscordComponentKind,
|
|
4
|
+
DiscordGatewayFailureCode,
|
|
5
|
+
DiscordGatewayState,
|
|
6
|
+
DiscordOptionType,
|
|
7
|
+
DiscordPresenceStatus,
|
|
8
|
+
DiscordTokenState,
|
|
9
|
+
} from '../../enum';
|
|
10
|
+
|
|
11
|
+
/** Bounds of the commands and components of a Discord bot; the API and its database apply the same ones. */
|
|
12
|
+
export const REFLEX_DISCORD_LIMITS = {
|
|
13
|
+
/** `^[-_a-z0-9]{1,32}$`: the name typed after the slash. */
|
|
14
|
+
commandNamePattern: /^[-_a-z0-9]{1,32}$/,
|
|
15
|
+
commandDescriptionMaxLength: 100,
|
|
16
|
+
commandsPerServiceMax: 100,
|
|
17
|
+
optionsPerCommandMax: 25,
|
|
18
|
+
choicesPerOptionMax: 25,
|
|
19
|
+
/** `^[a-z0-9_-]{1,40}$`: the start of the `custom_id` of a button, a menu or a form. */
|
|
20
|
+
componentPrefixPattern: /^[a-z0-9_-]{1,40}$/,
|
|
21
|
+
syncErrorMaxLength: 500,
|
|
22
|
+
} as const;
|
|
23
|
+
|
|
24
|
+
/** A fixed answer a user picks for a STRING, INTEGER or NUMBER option. */
|
|
25
|
+
export interface IReflexDiscordOptionChoice {
|
|
26
|
+
name: string;
|
|
27
|
+
value: string | number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** An option of a command. Required options come first. */
|
|
31
|
+
export interface IReflexDiscordCommandOption {
|
|
32
|
+
type: DiscordOptionType;
|
|
33
|
+
/** Same pattern as the command name. */
|
|
34
|
+
name: string;
|
|
35
|
+
/** 1 to 100 characters. */
|
|
36
|
+
description: string;
|
|
37
|
+
required: boolean;
|
|
38
|
+
/** 25 at most, only for STRING, INTEGER and NUMBER. */
|
|
39
|
+
choices?: IReflexDiscordOptionChoice[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** A slash command of the draft of a Discord bot Service. */
|
|
43
|
+
export interface IReflexDiscordCommand {
|
|
44
|
+
id: string;
|
|
45
|
+
serviceId: string;
|
|
46
|
+
/** A function of the same Service. */
|
|
47
|
+
functionId: string;
|
|
48
|
+
/** Unique within the Service. */
|
|
49
|
+
name: string;
|
|
50
|
+
description: string;
|
|
51
|
+
options: IReflexDiscordCommandOption[];
|
|
52
|
+
/** Discord permission bits as a decimal string, or null for everyone. */
|
|
53
|
+
defaultMemberPermissions: string | null;
|
|
54
|
+
allowedInDirectMessages: boolean;
|
|
55
|
+
createdAt: Date;
|
|
56
|
+
updatedAt: Date;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** A button, select menu or form of the draft of a Discord bot Service, routed by the start of its `custom_id`. */
|
|
60
|
+
export interface IReflexDiscordComponent {
|
|
61
|
+
id: string;
|
|
62
|
+
serviceId: string;
|
|
63
|
+
/** A function of the same Service. */
|
|
64
|
+
functionId: string;
|
|
65
|
+
/** Unique within the Service; no prefix starts another one. An interaction matches the prefix followed by `:`, or equal to its `custom_id`. */
|
|
66
|
+
customIdPrefix: string;
|
|
67
|
+
kind: DiscordComponentKind;
|
|
68
|
+
createdAt: Date;
|
|
69
|
+
updatedAt: Date;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** A command as a version of the Service froze it. */
|
|
73
|
+
export type IReflexDiscordCommandSnapshot = Pick<
|
|
74
|
+
IReflexDiscordCommand,
|
|
75
|
+
| 'id'
|
|
76
|
+
| 'functionId'
|
|
77
|
+
| 'name'
|
|
78
|
+
| 'description'
|
|
79
|
+
| 'options'
|
|
80
|
+
| 'defaultMemberPermissions'
|
|
81
|
+
| 'allowedInDirectMessages'
|
|
82
|
+
>;
|
|
83
|
+
|
|
84
|
+
/** A component as a version of the Service froze it. */
|
|
85
|
+
export type IReflexDiscordComponentSnapshot = Pick<
|
|
86
|
+
IReflexDiscordComponent,
|
|
87
|
+
'id' | 'functionId' | 'customIdPrefix' | 'kind'
|
|
88
|
+
>;
|
|
89
|
+
|
|
90
|
+
/** Settings of a Discord bot Service in one environment, kept outside the versions. */
|
|
91
|
+
export interface IReflexDiscordEnvironmentSettings {
|
|
92
|
+
id: string;
|
|
93
|
+
serviceId: string;
|
|
94
|
+
environmentId: string;
|
|
95
|
+
/** Discord server (snowflake) the commands are pushed to outside production; required there. */
|
|
96
|
+
testGuildId: string | null;
|
|
97
|
+
/** Discord permission bits as a decimal string, put in the invitation link. */
|
|
98
|
+
invitePermissions: string;
|
|
99
|
+
/** What the bot shows while connected. */
|
|
100
|
+
presenceStatus: DiscordPresenceStatus;
|
|
101
|
+
/** Null for no activity. */
|
|
102
|
+
activityType: DiscordActivityType | null;
|
|
103
|
+
/** 1 to 128 characters with an `activityType`, null without. */
|
|
104
|
+
activityText: string | null;
|
|
105
|
+
createdAt: Date;
|
|
106
|
+
updatedAt: Date;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** The Gateway connection of the bot of one environment, as its row in the execution plane says. */
|
|
110
|
+
export interface IReflexDiscordPresence {
|
|
111
|
+
state: DiscordGatewayState;
|
|
112
|
+
/** Set if and only if `state` is `FAILED`. */
|
|
113
|
+
failureCode: DiscordGatewayFailureCode | null;
|
|
114
|
+
stateChangedAt: Date;
|
|
115
|
+
/** Null until the bot connected once. */
|
|
116
|
+
lastConnectedAt: Date | null;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** What the Connection screen shows of the bot of one environment. Never carries the token. */
|
|
120
|
+
export interface IReflexDiscordEnvironmentConnection {
|
|
121
|
+
environmentId: string;
|
|
122
|
+
/** The Discord application read from the token; null while the token is missing, rejected or unchecked. */
|
|
123
|
+
applicationId: string | null;
|
|
124
|
+
publicKey: string | null;
|
|
125
|
+
botName: string | null;
|
|
126
|
+
botAvatarUrl: string | null;
|
|
127
|
+
tokenState: DiscordTokenState;
|
|
128
|
+
testGuildId: string | null;
|
|
129
|
+
invitePermissions: string;
|
|
130
|
+
presenceStatus: DiscordPresenceStatus;
|
|
131
|
+
activityType: DiscordActivityType | null;
|
|
132
|
+
activityText: string | null;
|
|
133
|
+
/** The Gateway connection; null while the bot is not in service in this environment. */
|
|
134
|
+
presence: IReflexDiscordPresence | null;
|
|
135
|
+
/** Address to give Discord for interactions in this environment. */
|
|
136
|
+
interactionsUrl: string;
|
|
137
|
+
/** Link that adds the bot to a Discord server; null while the application is unknown. */
|
|
138
|
+
inviteUrl: string | null;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** The Vault entry holding the token, and the bot of each environment of the application. */
|
|
142
|
+
export interface IReflexDiscordConnection {
|
|
143
|
+
/** Vault entry (secret) that holds the bot token, one value per environment; null until chosen. */
|
|
144
|
+
discordTokenSecretId: string | null;
|
|
145
|
+
environments: IReflexDiscordEnvironmentConnection[];
|
|
146
|
+
}
|