@abyss-project/reflex 5.1.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.
Files changed (103) hide show
  1. package/dist/api/service-version.api.d.ts +2 -1
  2. package/dist/api/service-version.api.js +3 -1
  3. package/dist/api/service-version.api.js.map +1 -1
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.js +1 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/types/interface/api/requests/service-version.request.d.ts +4 -0
  8. package/dist/types/interface/api/responses/service-version.response.d.ts +4 -0
  9. package/package.json +10 -15
  10. package/src/api/function-access.api.ts +36 -36
  11. package/src/api/function-run.api.ts +38 -38
  12. package/src/api/function-settings.api.ts +59 -59
  13. package/src/api/function-test.api.ts +34 -34
  14. package/src/api/function-version.api.ts +48 -48
  15. package/src/api/function.api.test.ts +249 -249
  16. package/src/api/function.api.ts +62 -62
  17. package/src/api/health.api.ts +10 -10
  18. package/src/api/index.ts +13 -13
  19. package/src/api/service-configuration.api.ts +16 -16
  20. package/src/api/service-deployment.api.ts +79 -79
  21. package/src/api/service-discord.api.test.ts +170 -170
  22. package/src/api/service-discord.api.ts +203 -203
  23. package/src/api/service-route.api.ts +72 -72
  24. package/src/api/service-version.api.ts +54 -39
  25. package/src/api/service.api.test.ts +215 -209
  26. package/src/api/service.api.ts +55 -55
  27. package/src/index.ts +237 -235
  28. package/src/types/enum/access-grant-status.enum.ts +12 -12
  29. package/src/types/enum/access-kind.enum.ts +7 -7
  30. package/src/types/enum/configuration-read-as.enum.ts +5 -5
  31. package/src/types/enum/discord-activity-type.enum.ts +9 -9
  32. package/src/types/enum/discord-component-kind.enum.ts +7 -7
  33. package/src/types/enum/discord-gateway-failure-code.enum.ts +9 -9
  34. package/src/types/enum/discord-gateway-state.enum.ts +11 -11
  35. package/src/types/enum/discord-option-type.enum.ts +12 -12
  36. package/src/types/enum/discord-presence-status.enum.ts +8 -8
  37. package/src/types/enum/discord-sync-status.enum.ts +6 -6
  38. package/src/types/enum/discord-token-state.enum.ts +11 -11
  39. package/src/types/enum/execution-mode.enum.ts +9 -9
  40. package/src/types/enum/execution-profile.enum.ts +20 -20
  41. package/src/types/enum/execution-settings-source.enum.ts +9 -9
  42. package/src/types/enum/health-status.enum.ts +4 -4
  43. package/src/types/enum/index.ts +29 -29
  44. package/src/types/enum/reflex-error-code.enum.ts +37 -37
  45. package/src/types/enum/route-method.enum.ts +9 -9
  46. package/src/types/enum/run-log-level.enum.ts +6 -6
  47. package/src/types/enum/run-mode.enum.ts +11 -11
  48. package/src/types/enum/run-status.enum.ts +11 -11
  49. package/src/types/enum/run-step-status.enum.ts +7 -7
  50. package/src/types/enum/service-deployment-action.enum.ts +11 -11
  51. package/src/types/enum/service-deployment-status.enum.ts +5 -5
  52. package/src/types/enum/service-type.enum.ts +9 -9
  53. package/src/types/enum/service-version-change-kind.enum.ts +6 -6
  54. package/src/types/enum/trace-effect-type.enum.ts +12 -12
  55. package/src/types/enum/trigger-access-mode.enum.ts +12 -12
  56. package/src/types/enum/vault-value-source.enum.ts +12 -12
  57. package/src/types/enum/vault-visibility.enum.ts +5 -5
  58. package/src/types/index.ts +2 -2
  59. package/src/types/interface/api/index.ts +3 -3
  60. package/src/types/interface/api/requests/function-access.request.ts +25 -25
  61. package/src/types/interface/api/requests/function-run.request.ts +26 -26
  62. package/src/types/interface/api/requests/function-settings.request.ts +27 -27
  63. package/src/types/interface/api/requests/function-test.request.ts +24 -24
  64. package/src/types/interface/api/requests/function-version.request.ts +20 -20
  65. package/src/types/interface/api/requests/function.request.ts +36 -36
  66. package/src/types/interface/api/requests/index.ts +12 -12
  67. package/src/types/interface/api/requests/service-configuration.request.ts +4 -4
  68. package/src/types/interface/api/requests/service-deployment.request.ts +49 -49
  69. package/src/types/interface/api/requests/service-discord.request.ts +128 -128
  70. package/src/types/interface/api/requests/service-route.request.ts +44 -44
  71. package/src/types/interface/api/requests/service-version.request.ts +5 -0
  72. package/src/types/interface/api/requests/service.request.ts +46 -46
  73. package/src/types/interface/api/response.ts +4 -4
  74. package/src/types/interface/api/responses/function-access.response.ts +17 -17
  75. package/src/types/interface/api/responses/function-run.response.ts +18 -18
  76. package/src/types/interface/api/responses/function-settings.response.ts +36 -36
  77. package/src/types/interface/api/responses/function-test.response.ts +12 -12
  78. package/src/types/interface/api/responses/function-version.response.ts +31 -31
  79. package/src/types/interface/api/responses/function.response.ts +25 -25
  80. package/src/types/interface/api/responses/index.ts +12 -12
  81. package/src/types/interface/api/responses/service-configuration.response.ts +8 -8
  82. package/src/types/interface/api/responses/service-deployment.response.ts +32 -32
  83. package/src/types/interface/api/responses/service-discord.response.ts +72 -72
  84. package/src/types/interface/api/responses/service-route.response.ts +31 -31
  85. package/src/types/interface/api/responses/service-version.response.ts +11 -0
  86. package/src/types/interface/api/responses/service.response.ts +31 -31
  87. package/src/types/interface/health.response.ts +7 -7
  88. package/src/types/interface/index.ts +3 -3
  89. package/src/types/interface/models/index.ts +14 -14
  90. package/src/types/interface/models/reflex-access-grant.model.ts +14 -14
  91. package/src/types/interface/models/reflex-definition.model.ts +31 -31
  92. package/src/types/interface/models/reflex-discord.model.ts +146 -146
  93. package/src/types/interface/models/reflex-execution-settings.model.ts +50 -50
  94. package/src/types/interface/models/reflex-function-version.model.ts +14 -14
  95. package/src/types/interface/models/reflex-function.model.ts +16 -16
  96. package/src/types/interface/models/reflex-price-list.model.ts +20 -20
  97. package/src/types/interface/models/reflex-route.model.ts +19 -19
  98. package/src/types/interface/models/reflex-run.model.ts +173 -173
  99. package/src/types/interface/models/reflex-service-configuration.model.ts +22 -22
  100. package/src/types/interface/models/reflex-service-deployment.model.ts +40 -40
  101. package/src/types/interface/models/reflex-service-version.model.ts +55 -55
  102. package/src/types/interface/models/reflex-service.model.ts +45 -45
  103. package/src/types/interface/models/reflex-step-stats.model.ts +35 -35
@@ -1,72 +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
+ 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>;
@@ -48,6 +48,17 @@ export interface ICreateServiceVersionData {
48
48
  }
49
49
  export type ICreateServiceVersionResponse = IResponse<ICreateServiceVersionData>;
50
50
 
51
+ export interface IGetServiceVersionDraftStatusData {
52
+ /**
53
+ * How many functions of the Service a version created now would freeze at a version other than the one
54
+ * the last Service version froze: a function new to the Service, a draft that differs from its last
55
+ * version (an invalid draft counts), or a function version published since. Same rule as
56
+ * `POST .../version`; 0 for a Service without functions.
57
+ */
58
+ changedFunctions: number;
59
+ }
60
+ export type IGetServiceVersionDraftStatusResponse = IResponse<IGetServiceVersionDraftStatusData>;
61
+
51
62
  export interface IGetServiceVersionData {
52
63
  version: IReflexServiceVersion;
53
64
  /** The version just before; null for the first one. */
@@ -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;