@abyss-project/reflex 5.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.
Files changed (91) hide show
  1. package/dist/types/enum/discord-activity-type.enum.d.ts +7 -0
  2. package/dist/types/enum/discord-activity-type.enum.js +12 -0
  3. package/dist/types/enum/discord-activity-type.enum.js.map +1 -0
  4. package/dist/types/enum/discord-gateway-failure-code.enum.d.ts +5 -0
  5. package/dist/types/enum/discord-gateway-failure-code.enum.js +10 -0
  6. package/dist/types/enum/discord-gateway-failure-code.enum.js.map +1 -0
  7. package/dist/types/enum/discord-gateway-state.enum.d.ts +6 -0
  8. package/dist/types/enum/discord-gateway-state.enum.js +11 -0
  9. package/dist/types/enum/discord-gateway-state.enum.js.map +1 -0
  10. package/dist/types/enum/discord-presence-status.enum.d.ts +5 -0
  11. package/dist/types/enum/discord-presence-status.enum.js +10 -0
  12. package/dist/types/enum/discord-presence-status.enum.js.map +1 -0
  13. package/dist/types/enum/index.d.ts +4 -0
  14. package/dist/types/enum/index.js +4 -0
  15. package/dist/types/enum/index.js.map +1 -1
  16. package/dist/types/interface/api/requests/service-discord.request.d.ts +4 -1
  17. package/dist/types/interface/models/reflex-discord.model.d.ts +14 -1
  18. package/dist/types/interface/models/reflex-discord.model.js.map +1 -1
  19. package/package.json +15 -10
  20. package/src/api/service-discord.api.test.ts +170 -170
  21. package/src/api/service-discord.api.ts +203 -203
  22. package/src/index.ts +235 -235
  23. package/src/types/enum/access-grant-status.enum.ts +12 -12
  24. package/src/types/enum/access-kind.enum.ts +7 -7
  25. package/src/types/enum/configuration-read-as.enum.ts +5 -5
  26. package/src/types/enum/discord-activity-type.enum.ts +9 -0
  27. package/src/types/enum/discord-gateway-failure-code.enum.ts +9 -0
  28. package/src/types/enum/discord-gateway-state.enum.ts +11 -0
  29. package/src/types/enum/discord-presence-status.enum.ts +8 -0
  30. package/src/types/enum/execution-mode.enum.ts +9 -9
  31. package/src/types/enum/execution-profile.enum.ts +20 -20
  32. package/src/types/enum/execution-settings-source.enum.ts +9 -9
  33. package/src/types/enum/health-status.enum.ts +4 -4
  34. package/src/types/enum/index.ts +29 -25
  35. package/src/types/enum/reflex-error-code.enum.ts +37 -37
  36. package/src/types/enum/route-method.enum.ts +9 -9
  37. package/src/types/enum/run-log-level.enum.ts +6 -6
  38. package/src/types/enum/run-mode.enum.ts +11 -11
  39. package/src/types/enum/run-status.enum.ts +11 -11
  40. package/src/types/enum/run-step-status.enum.ts +7 -7
  41. package/src/types/enum/service-deployment-action.enum.ts +11 -11
  42. package/src/types/enum/service-deployment-status.enum.ts +5 -5
  43. package/src/types/enum/service-type.enum.ts +9 -9
  44. package/src/types/enum/service-version-change-kind.enum.ts +6 -6
  45. package/src/types/enum/trace-effect-type.enum.ts +12 -12
  46. package/src/types/enum/trigger-access-mode.enum.ts +12 -12
  47. package/src/types/enum/vault-value-source.enum.ts +12 -12
  48. package/src/types/enum/vault-visibility.enum.ts +5 -5
  49. package/src/types/index.ts +2 -2
  50. package/src/types/interface/api/index.ts +3 -3
  51. package/src/types/interface/api/requests/function-access.request.ts +25 -25
  52. package/src/types/interface/api/requests/function-run.request.ts +26 -26
  53. package/src/types/interface/api/requests/function-settings.request.ts +27 -27
  54. package/src/types/interface/api/requests/function-test.request.ts +24 -24
  55. package/src/types/interface/api/requests/function-version.request.ts +20 -20
  56. package/src/types/interface/api/requests/function.request.ts +36 -36
  57. package/src/types/interface/api/requests/index.ts +12 -12
  58. package/src/types/interface/api/requests/service-configuration.request.ts +4 -4
  59. package/src/types/interface/api/requests/service-deployment.request.ts +49 -49
  60. package/src/types/interface/api/requests/service-discord.request.ts +11 -1
  61. package/src/types/interface/api/requests/service-route.request.ts +44 -44
  62. package/src/types/interface/api/requests/service-version.request.ts +19 -19
  63. package/src/types/interface/api/requests/service.request.ts +46 -46
  64. package/src/types/interface/api/response.ts +4 -4
  65. package/src/types/interface/api/responses/function-access.response.ts +17 -17
  66. package/src/types/interface/api/responses/function-run.response.ts +18 -18
  67. package/src/types/interface/api/responses/function-settings.response.ts +36 -36
  68. package/src/types/interface/api/responses/function-test.response.ts +12 -12
  69. package/src/types/interface/api/responses/function-version.response.ts +31 -31
  70. package/src/types/interface/api/responses/function.response.ts +25 -25
  71. package/src/types/interface/api/responses/index.ts +12 -12
  72. package/src/types/interface/api/responses/service-configuration.response.ts +8 -8
  73. package/src/types/interface/api/responses/service-deployment.response.ts +32 -32
  74. package/src/types/interface/api/responses/service-route.response.ts +31 -31
  75. package/src/types/interface/api/responses/service.response.ts +31 -31
  76. package/src/types/interface/health.response.ts +7 -7
  77. package/src/types/interface/index.ts +3 -3
  78. package/src/types/interface/models/index.ts +14 -14
  79. package/src/types/interface/models/reflex-access-grant.model.ts +14 -14
  80. package/src/types/interface/models/reflex-definition.model.ts +31 -31
  81. package/src/types/interface/models/reflex-discord.model.ts +30 -1
  82. package/src/types/interface/models/reflex-execution-settings.model.ts +50 -50
  83. package/src/types/interface/models/reflex-function-version.model.ts +14 -14
  84. package/src/types/interface/models/reflex-function.model.ts +16 -16
  85. package/src/types/interface/models/reflex-price-list.model.ts +20 -20
  86. package/src/types/interface/models/reflex-route.model.ts +19 -19
  87. package/src/types/interface/models/reflex-service-configuration.model.ts +22 -22
  88. package/src/types/interface/models/reflex-service-deployment.model.ts +40 -40
  89. package/src/types/interface/models/reflex-service-version.model.ts +55 -55
  90. package/src/types/interface/models/reflex-service.model.ts +45 -45
  91. package/src/types/interface/models/reflex-step-stats.model.ts +35 -35
@@ -1,12 +1,12 @@
1
- import type { IReflexRun } from '../../models';
2
- import type { IResponse } from '../response';
3
-
4
- export interface ISimulateFunctionData {
5
- run: IReflexRun;
6
- }
7
- export type ISimulateFunctionResponse = IResponse<ISimulateFunctionData>;
8
-
9
- export interface IDryRunFunctionData {
10
- run: IReflexRun;
11
- }
12
- export type IDryRunFunctionResponse = IResponse<IDryRunFunctionData>;
1
+ import type { IReflexRun } from '../../models';
2
+ import type { IResponse } from '../response';
3
+
4
+ export interface ISimulateFunctionData {
5
+ run: IReflexRun;
6
+ }
7
+ export type ISimulateFunctionResponse = IResponse<ISimulateFunctionData>;
8
+
9
+ export interface IDryRunFunctionData {
10
+ run: IReflexRun;
11
+ }
12
+ export type IDryRunFunctionResponse = IResponse<IDryRunFunctionData>;
@@ -1,31 +1,31 @@
1
- import type {
2
- IReflexFunctionVersion,
3
- IReflexRunningVersionHeapPeaks,
4
- IReflexStepStats,
5
- } from '../../models';
6
- import type { IResponse } from '../response';
7
-
8
- export interface IListFunctionVersionData {
9
- versions: IReflexFunctionVersion[];
10
- }
11
- export type IListFunctionVersionResponse = IResponse<IListFunctionVersionData>;
12
-
13
- export interface IGetFunctionVersionData {
14
- version: IReflexFunctionVersion;
15
- }
16
- export type IGetFunctionVersionResponse = IResponse<IGetFunctionVersionData>;
17
-
18
- export interface IGetFunctionVersionStepStatsData {
19
- versionId: string;
20
- /** The environment asked for; null for every environment. */
21
- environmentId: string | null;
22
- /** The window the statistics cover: the retention of the live runs. */
23
- windowDays: number;
24
- /** Executions of the version in the window, interrupted and running ones left out. */
25
- executions: number;
26
- /** One entry per step that ran, most costly first. */
27
- steps: IReflexStepStats[];
28
- /** The p99 heap peak per step of the version running in `environmentId`; null without an environment or when nothing runs there. */
29
- runningVersion: IReflexRunningVersionHeapPeaks | null;
30
- }
31
- export type IGetFunctionVersionStepStatsResponse = IResponse<IGetFunctionVersionStepStatsData>;
1
+ import type {
2
+ IReflexFunctionVersion,
3
+ IReflexRunningVersionHeapPeaks,
4
+ IReflexStepStats,
5
+ } from '../../models';
6
+ import type { IResponse } from '../response';
7
+
8
+ export interface IListFunctionVersionData {
9
+ versions: IReflexFunctionVersion[];
10
+ }
11
+ export type IListFunctionVersionResponse = IResponse<IListFunctionVersionData>;
12
+
13
+ export interface IGetFunctionVersionData {
14
+ version: IReflexFunctionVersion;
15
+ }
16
+ export type IGetFunctionVersionResponse = IResponse<IGetFunctionVersionData>;
17
+
18
+ export interface IGetFunctionVersionStepStatsData {
19
+ versionId: string;
20
+ /** The environment asked for; null for every environment. */
21
+ environmentId: string | null;
22
+ /** The window the statistics cover: the retention of the live runs. */
23
+ windowDays: number;
24
+ /** Executions of the version in the window, interrupted and running ones left out. */
25
+ executions: number;
26
+ /** One entry per step that ran, most costly first. */
27
+ steps: IReflexStepStats[];
28
+ /** The p99 heap peak per step of the version running in `environmentId`; null without an environment or when nothing runs there. */
29
+ runningVersion: IReflexRunningVersionHeapPeaks | null;
30
+ }
31
+ export type IGetFunctionVersionStepStatsResponse = IResponse<IGetFunctionVersionStepStatsData>;
@@ -1,25 +1,25 @@
1
- import type { IReflexFunction } from '../../models';
2
- import type { IResponse } from '../response';
3
-
4
- export interface IListFunctionData {
5
- functions: IReflexFunction[];
6
- }
7
- export type IListFunctionResponse = IResponse<IListFunctionData>;
8
-
9
- export interface ICreateFunctionData {
10
- function: IReflexFunction;
11
- }
12
- export type ICreateFunctionResponse = IResponse<ICreateFunctionData>;
13
-
14
- export interface IGetFunctionData {
15
- function: IReflexFunction;
16
- }
17
- export type IGetFunctionResponse = IResponse<IGetFunctionData>;
18
-
19
- export interface IUpdateFunctionData {
20
- function: IReflexFunction;
21
- }
22
- export type IUpdateFunctionResponse = IResponse<IUpdateFunctionData>;
23
-
24
- export type IDeleteFunctionData = Record<string, never>;
25
- export type IDeleteFunctionResponse = IResponse<IDeleteFunctionData>;
1
+ import type { IReflexFunction } from '../../models';
2
+ import type { IResponse } from '../response';
3
+
4
+ export interface IListFunctionData {
5
+ functions: IReflexFunction[];
6
+ }
7
+ export type IListFunctionResponse = IResponse<IListFunctionData>;
8
+
9
+ export interface ICreateFunctionData {
10
+ function: IReflexFunction;
11
+ }
12
+ export type ICreateFunctionResponse = IResponse<ICreateFunctionData>;
13
+
14
+ export interface IGetFunctionData {
15
+ function: IReflexFunction;
16
+ }
17
+ export type IGetFunctionResponse = IResponse<IGetFunctionData>;
18
+
19
+ export interface IUpdateFunctionData {
20
+ function: IReflexFunction;
21
+ }
22
+ export type IUpdateFunctionResponse = IResponse<IUpdateFunctionData>;
23
+
24
+ export type IDeleteFunctionData = Record<string, never>;
25
+ export type IDeleteFunctionResponse = IResponse<IDeleteFunctionData>;
@@ -1,12 +1,12 @@
1
- export * from './function.response';
2
- export * from './function-access.response';
3
- export * from './function-test.response';
4
- export * from './function-version.response';
5
- export * from './function-run.response';
6
- export * from './function-settings.response';
7
- export * from './service.response';
8
- export * from './service-route.response';
9
- export * from './service-version.response';
10
- export * from './service-deployment.response';
11
- export * from './service-configuration.response';
12
- export * from './service-discord.response';
1
+ export * from './function.response';
2
+ export * from './function-access.response';
3
+ export * from './function-test.response';
4
+ export * from './function-version.response';
5
+ export * from './function-run.response';
6
+ export * from './function-settings.response';
7
+ export * from './service.response';
8
+ export * from './service-route.response';
9
+ export * from './service-version.response';
10
+ export * from './service-deployment.response';
11
+ export * from './service-configuration.response';
12
+ export * from './service-discord.response';
@@ -1,8 +1,8 @@
1
- import type { IReflexServiceConfigurationEntry } from '../../models';
2
- import type { IResponse } from '../response';
3
-
4
- export interface IListServiceConfigurationData {
5
- /** One entry per key and way of reading it, by key then `readAs`. */
6
- configuration: IReflexServiceConfigurationEntry[];
7
- }
8
- export type IListServiceConfigurationResponse = IResponse<IListServiceConfigurationData>;
1
+ import type { IReflexServiceConfigurationEntry } from '../../models';
2
+ import type { IResponse } from '../response';
3
+
4
+ export interface IListServiceConfigurationData {
5
+ /** One entry per key and way of reading it, by key then `readAs`. */
6
+ configuration: IReflexServiceConfigurationEntry[];
7
+ }
8
+ export type IListServiceConfigurationResponse = IResponse<IListServiceConfigurationData>;
@@ -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>;
@@ -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,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
- export * from './reflex-definition.model';
2
- export * from './reflex-function.model';
3
- export * from './reflex-function-version.model';
4
- export * from './reflex-access-grant.model';
5
- export * from './reflex-run.model';
6
- export * from './reflex-execution-settings.model';
7
- export * from './reflex-step-stats.model';
8
- export * from './reflex-price-list.model';
9
- export * from './reflex-service.model';
10
- export * from './reflex-route.model';
11
- export * from './reflex-service-version.model';
12
- export * from './reflex-service-deployment.model';
13
- export * from './reflex-service-configuration.model';
14
- export * from './reflex-discord.model';
1
+ export * from './reflex-definition.model';
2
+ export * from './reflex-function.model';
3
+ export * from './reflex-function-version.model';
4
+ export * from './reflex-access-grant.model';
5
+ export * from './reflex-run.model';
6
+ export * from './reflex-execution-settings.model';
7
+ export * from './reflex-step-stats.model';
8
+ export * from './reflex-price-list.model';
9
+ export * from './reflex-service.model';
10
+ export * from './reflex-route.model';
11
+ export * from './reflex-service-version.model';
12
+ export * from './reflex-service-deployment.model';
13
+ export * from './reflex-service-configuration.model';
14
+ export * from './reflex-discord.model';
@@ -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;
@@ -1,4 +1,12 @@
1
- import type { DiscordComponentKind, DiscordOptionType, DiscordTokenState } from '../../enum';
1
+ import type {
2
+ DiscordActivityType,
3
+ DiscordComponentKind,
4
+ DiscordGatewayFailureCode,
5
+ DiscordGatewayState,
6
+ DiscordOptionType,
7
+ DiscordPresenceStatus,
8
+ DiscordTokenState,
9
+ } from '../../enum';
2
10
 
3
11
  /** Bounds of the commands and components of a Discord bot; the API and its database apply the same ones. */
4
12
  export const REFLEX_DISCORD_LIMITS = {
@@ -88,10 +96,26 @@ export interface IReflexDiscordEnvironmentSettings {
88
96
  testGuildId: string | null;
89
97
  /** Discord permission bits as a decimal string, put in the invitation link. */
90
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;
91
105
  createdAt: Date;
92
106
  updatedAt: Date;
93
107
  }
94
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
+
95
119
  /** What the Connection screen shows of the bot of one environment. Never carries the token. */
96
120
  export interface IReflexDiscordEnvironmentConnection {
97
121
  environmentId: string;
@@ -103,6 +127,11 @@ export interface IReflexDiscordEnvironmentConnection {
103
127
  tokenState: DiscordTokenState;
104
128
  testGuildId: string | null;
105
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;
106
135
  /** Address to give Discord for interactions in this environment. */
107
136
  interactionsUrl: string;
108
137
  /** Link that adds the bot to a Discord server; null while the application is unknown. */