@abyss-project/reflex 2.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/dist/api/function-version.api.d.ts +1 -2
  2. package/dist/api/function-version.api.js +1 -3
  3. package/dist/api/function-version.api.js.map +1 -1
  4. package/dist/api/index.d.ts +5 -2
  5. package/dist/api/index.js +5 -2
  6. package/dist/api/index.js.map +1 -1
  7. package/dist/api/service-configuration.api.d.ts +2 -0
  8. package/dist/api/service-configuration.api.js +7 -0
  9. package/dist/api/service-configuration.api.js.map +1 -0
  10. package/dist/api/service-deployment.api.d.ts +6 -0
  11. package/dist/api/service-deployment.api.js +19 -0
  12. package/dist/api/service-deployment.api.js.map +1 -0
  13. package/dist/api/service-route.api.d.ts +6 -0
  14. package/dist/api/service-route.api.js +16 -0
  15. package/dist/api/service-route.api.js.map +1 -0
  16. package/dist/api/service-version.api.d.ts +4 -0
  17. package/dist/api/service-version.api.js +12 -0
  18. package/dist/api/service-version.api.js.map +1 -0
  19. package/dist/api/service.api.d.ts +6 -0
  20. package/dist/api/service.api.js +17 -0
  21. package/dist/api/service.api.js.map +1 -0
  22. package/dist/index.d.ts +34 -14
  23. package/dist/index.js +34 -14
  24. package/dist/index.js.map +1 -1
  25. package/dist/types/enum/configuration-read-as.enum.d.ts +4 -0
  26. package/dist/types/enum/configuration-read-as.enum.js +9 -0
  27. package/dist/types/enum/configuration-read-as.enum.js.map +1 -0
  28. package/dist/types/enum/index.d.ts +8 -1
  29. package/dist/types/enum/index.js +8 -1
  30. package/dist/types/enum/index.js.map +1 -1
  31. package/dist/types/enum/reflex-error-code.enum.d.ts +5 -2
  32. package/dist/types/enum/reflex-error-code.enum.js +4 -1
  33. package/dist/types/enum/reflex-error-code.enum.js.map +1 -1
  34. package/dist/types/enum/route-method.enum.d.ts +8 -0
  35. package/dist/types/enum/route-method.enum.js +13 -0
  36. package/dist/types/enum/route-method.enum.js.map +1 -0
  37. package/dist/types/enum/service-deployment-action.enum.d.ts +6 -0
  38. package/dist/types/enum/service-deployment-action.enum.js +11 -0
  39. package/dist/types/enum/service-deployment-action.enum.js.map +1 -0
  40. package/dist/types/enum/service-deployment-status.enum.d.ts +4 -0
  41. package/dist/types/enum/service-deployment-status.enum.js +9 -0
  42. package/dist/types/enum/service-deployment-status.enum.js.map +1 -0
  43. package/dist/types/enum/service-type.enum.d.ts +4 -0
  44. package/dist/types/enum/service-type.enum.js +9 -0
  45. package/dist/types/enum/service-type.enum.js.map +1 -0
  46. package/dist/types/enum/service-version-change-kind.enum.d.ts +5 -0
  47. package/dist/types/enum/service-version-change-kind.enum.js +10 -0
  48. package/dist/types/enum/service-version-change-kind.enum.js.map +1 -0
  49. package/dist/types/enum/vault-value-source.enum.d.ts +6 -0
  50. package/dist/types/enum/vault-value-source.enum.js +11 -0
  51. package/dist/types/enum/vault-value-source.enum.js.map +1 -0
  52. package/dist/types/enum/vault-visibility.enum.d.ts +4 -0
  53. package/dist/types/enum/vault-visibility.enum.js +9 -0
  54. package/dist/types/enum/vault-visibility.enum.js.map +1 -0
  55. package/dist/types/interface/api/requests/function-version.request.d.ts +0 -4
  56. package/dist/types/interface/api/requests/function.request.d.ts +1 -0
  57. package/dist/types/interface/api/requests/index.d.ts +5 -2
  58. package/dist/types/interface/api/requests/index.js +5 -2
  59. package/dist/types/interface/api/requests/index.js.map +1 -1
  60. package/dist/types/interface/api/requests/service-configuration.request.d.ts +4 -0
  61. package/dist/types/interface/api/requests/service-configuration.request.js +3 -0
  62. package/dist/types/interface/api/requests/service-configuration.request.js.map +1 -0
  63. package/dist/types/interface/api/requests/service-deployment.request.d.ts +39 -0
  64. package/dist/types/interface/api/requests/{function-promotion.request.js → service-deployment.request.js} +1 -1
  65. package/dist/types/interface/api/requests/service-deployment.request.js.map +1 -0
  66. package/dist/types/interface/api/requests/service-route.request.d.ts +36 -0
  67. package/dist/types/interface/api/requests/{function-trigger.request.js → service-route.request.js} +1 -1
  68. package/dist/types/interface/api/requests/service-route.request.js.map +1 -0
  69. package/dist/types/interface/api/requests/service-version.request.d.ts +16 -0
  70. package/dist/types/interface/api/{responses/function-trigger.response.js → requests/service-version.request.js} +1 -1
  71. package/dist/types/interface/api/requests/service-version.request.js.map +1 -0
  72. package/dist/types/interface/api/requests/service.request.d.ts +30 -0
  73. package/dist/types/interface/{models/reflex-trigger.model.js → api/requests/service.request.js} +1 -1
  74. package/dist/types/interface/api/requests/service.request.js.map +1 -0
  75. package/dist/types/interface/api/responses/function-version.response.d.ts +0 -4
  76. package/dist/types/interface/api/responses/index.d.ts +5 -2
  77. package/dist/types/interface/api/responses/index.js +5 -2
  78. package/dist/types/interface/api/responses/index.js.map +1 -1
  79. package/dist/types/interface/api/responses/service-configuration.response.d.ts +6 -0
  80. package/dist/types/interface/api/responses/service-configuration.response.js +3 -0
  81. package/dist/types/interface/api/responses/service-configuration.response.js.map +1 -0
  82. package/dist/types/interface/api/responses/service-deployment.response.d.ts +24 -0
  83. package/dist/types/interface/api/responses/{function-promotion.response.js → service-deployment.response.js} +1 -1
  84. package/dist/types/interface/api/responses/service-deployment.response.js.map +1 -0
  85. package/dist/types/interface/api/responses/service-route.response.d.ts +23 -0
  86. package/dist/types/interface/api/responses/service-route.response.js +3 -0
  87. package/dist/types/interface/api/responses/service-route.response.js.map +1 -0
  88. package/dist/types/interface/api/responses/service-version.response.d.ts +23 -0
  89. package/dist/types/interface/api/responses/service-version.response.js +3 -0
  90. package/dist/types/interface/api/responses/service-version.response.js.map +1 -0
  91. package/dist/types/interface/api/responses/service.response.d.ts +23 -0
  92. package/dist/types/interface/api/responses/service.response.js +3 -0
  93. package/dist/types/interface/api/responses/service.response.js.map +1 -0
  94. package/dist/types/interface/models/index.d.ts +5 -2
  95. package/dist/types/interface/models/index.js +5 -2
  96. package/dist/types/interface/models/index.js.map +1 -1
  97. package/dist/types/interface/models/reflex-function.model.d.ts +1 -0
  98. package/dist/types/interface/models/reflex-route.model.d.ts +12 -0
  99. package/dist/types/interface/models/reflex-route.model.js +3 -0
  100. package/dist/types/interface/models/reflex-route.model.js.map +1 -0
  101. package/dist/types/interface/models/reflex-run.model.d.ts +1 -1
  102. package/dist/types/interface/models/reflex-service-configuration.model.d.ts +9 -0
  103. package/dist/types/interface/models/reflex-service-configuration.model.js +3 -0
  104. package/dist/types/interface/models/reflex-service-configuration.model.js.map +1 -0
  105. package/dist/types/interface/models/reflex-service-deployment.model.d.ts +20 -0
  106. package/dist/types/interface/models/reflex-service-deployment.model.js +3 -0
  107. package/dist/types/interface/models/reflex-service-deployment.model.js.map +1 -0
  108. package/dist/types/interface/models/reflex-service-version.model.d.ts +30 -0
  109. package/dist/types/interface/models/reflex-service-version.model.js +3 -0
  110. package/dist/types/interface/models/reflex-service-version.model.js.map +1 -0
  111. package/dist/types/interface/models/reflex-service.model.d.ts +31 -0
  112. package/dist/types/interface/models/reflex-service.model.js +13 -0
  113. package/dist/types/interface/models/reflex-service.model.js.map +1 -0
  114. package/package.json +1 -1
  115. package/src/api/function-run.api.ts +1 -1
  116. package/src/api/function-test.api.ts +34 -34
  117. package/src/api/function-version.api.ts +4 -12
  118. package/src/api/function.api.test.ts +249 -311
  119. package/src/api/index.ts +12 -9
  120. package/src/api/service-configuration.api.ts +16 -0
  121. package/src/api/service-deployment.api.ts +79 -0
  122. package/src/api/service-route.api.ts +72 -0
  123. package/src/api/service-version.api.ts +39 -0
  124. package/src/api/service.api.test.ts +209 -0
  125. package/src/api/service.api.ts +55 -0
  126. package/src/index.ts +64 -26
  127. package/src/types/enum/configuration-read-as.enum.ts +5 -0
  128. package/src/types/enum/execution-mode.enum.ts +1 -1
  129. package/src/types/enum/index.ts +21 -14
  130. package/src/types/enum/reflex-error-code.enum.ts +25 -19
  131. package/src/types/enum/route-method.enum.ts +9 -0
  132. package/src/types/enum/service-deployment-action.enum.ts +11 -0
  133. package/src/types/enum/service-deployment-status.enum.ts +5 -0
  134. package/src/types/enum/service-type.enum.ts +7 -0
  135. package/src/types/enum/service-version-change-kind.enum.ts +6 -0
  136. package/src/types/enum/trigger-access-mode.enum.ts +1 -1
  137. package/src/types/enum/vault-value-source.enum.ts +12 -0
  138. package/src/types/enum/vault-visibility.enum.ts +5 -0
  139. package/src/types/interface/api/requests/function-run.request.ts +1 -1
  140. package/src/types/interface/api/requests/function-settings.request.ts +27 -27
  141. package/src/types/interface/api/requests/function-test.request.ts +24 -24
  142. package/src/types/interface/api/requests/function-version.request.ts +20 -25
  143. package/src/types/interface/api/requests/function.request.ts +2 -0
  144. package/src/types/interface/api/requests/index.ts +11 -8
  145. package/src/types/interface/api/requests/service-configuration.request.ts +4 -0
  146. package/src/types/interface/api/requests/service-deployment.request.ts +49 -0
  147. package/src/types/interface/api/requests/service-route.request.ts +44 -0
  148. package/src/types/interface/api/requests/service-version.request.ts +19 -0
  149. package/src/types/interface/api/requests/service.request.ts +39 -0
  150. package/src/types/interface/api/responses/function-settings.response.ts +36 -36
  151. package/src/types/interface/api/responses/function-version.response.ts +0 -5
  152. package/src/types/interface/api/responses/index.ts +11 -8
  153. package/src/types/interface/api/responses/service-configuration.response.ts +8 -0
  154. package/src/types/interface/api/responses/service-deployment.response.ts +32 -0
  155. package/src/types/interface/api/responses/service-route.response.ts +31 -0
  156. package/src/types/interface/api/responses/service-version.response.ts +33 -0
  157. package/src/types/interface/api/responses/service.response.ts +31 -0
  158. package/src/types/interface/models/index.ts +13 -10
  159. package/src/types/interface/models/reflex-execution-settings.model.ts +50 -50
  160. package/src/types/interface/models/reflex-function.model.ts +2 -0
  161. package/src/types/interface/models/reflex-route.model.ts +19 -0
  162. package/src/types/interface/models/reflex-run.model.ts +164 -164
  163. package/src/types/interface/models/reflex-service-configuration.model.ts +22 -0
  164. package/src/types/interface/models/reflex-service-deployment.model.ts +29 -0
  165. package/src/types/interface/models/reflex-service-version.model.ts +43 -0
  166. package/src/types/interface/models/reflex-service.model.ts +43 -0
  167. package/dist/api/function-promotion.api.d.ts +0 -4
  168. package/dist/api/function-promotion.api.js +0 -12
  169. package/dist/api/function-promotion.api.js.map +0 -1
  170. package/dist/api/function-trigger.api.d.ts +0 -5
  171. package/dist/api/function-trigger.api.js +0 -14
  172. package/dist/api/function-trigger.api.js.map +0 -1
  173. package/dist/types/enum/trigger-type.enum.d.ts +0 -3
  174. package/dist/types/enum/trigger-type.enum.js +0 -8
  175. package/dist/types/enum/trigger-type.enum.js.map +0 -1
  176. package/dist/types/interface/api/requests/function-promotion.request.d.ts +0 -20
  177. package/dist/types/interface/api/requests/function-promotion.request.js.map +0 -1
  178. package/dist/types/interface/api/requests/function-trigger.request.d.ts +0 -23
  179. package/dist/types/interface/api/requests/function-trigger.request.js.map +0 -1
  180. package/dist/types/interface/api/responses/function-promotion.response.d.ts +0 -14
  181. package/dist/types/interface/api/responses/function-promotion.response.js.map +0 -1
  182. package/dist/types/interface/api/responses/function-trigger.response.d.ts +0 -18
  183. package/dist/types/interface/api/responses/function-trigger.response.js.map +0 -1
  184. package/dist/types/interface/models/reflex-environment-pointer.model.d.ts +0 -13
  185. package/dist/types/interface/models/reflex-environment-pointer.model.js +0 -3
  186. package/dist/types/interface/models/reflex-environment-pointer.model.js.map +0 -1
  187. package/dist/types/interface/models/reflex-trigger.model.d.ts +0 -13
  188. package/dist/types/interface/models/reflex-trigger.model.js.map +0 -1
  189. package/src/api/function-promotion.api.ts +0 -42
  190. package/src/api/function-trigger.api.ts +0 -52
  191. package/src/types/enum/trigger-type.enum.ts +0 -4
  192. package/src/types/interface/api/requests/function-promotion.request.ts +0 -25
  193. package/src/types/interface/api/requests/function-trigger.request.ts +0 -28
  194. package/src/types/interface/api/responses/function-promotion.response.ts +0 -18
  195. package/src/types/interface/api/responses/function-trigger.response.ts +0 -24
  196. package/src/types/interface/models/reflex-environment-pointer.model.ts +0 -18
  197. package/src/types/interface/models/reflex-trigger.model.ts +0 -17
@@ -1,19 +1,25 @@
1
- /** `error.code` of the refusals a client acts on. */
2
- export enum ReflexErrorCode {
3
- /** 400: the definition does not match the format; `error.details` holds the path of each fault. */
4
- INVALID_DEFINITION = 'INVALID_DEFINITION',
5
- /** 409: an access granted to the function is suspended; revoke it and grant it again. */
6
- GRANT_SUSPENDED = 'GRANT_SUSPENDED',
7
- /** 409: the function has no frozen version of its own draft yet, or none to go back to. */
8
- NO_VERSION = 'NO_VERSION',
9
- /** 409: the access to grant is not declared by the draft of the function. */
10
- ACCESS_NOT_DECLARED = 'ACCESS_NOT_DECLARED',
11
- /** 409: the draft has not changed since the last published version. */
12
- NOTHING_TO_PUBLISH = 'NOTHING_TO_PUBLISH',
13
- /** 404: the environment is not one of the application's environments (abyss-main). */
14
- ENVIRONMENT_NOT_FOUND = 'ENVIRONMENT_NOT_FOUND',
15
- /** 409: a name, a path or an access already exists. */
16
- ALREADY_EXISTS = 'ALREADY_EXISTS',
17
- /** 403: the function is promoted in a production environment and the member lacks REFLEX_PUBLISH_PRODUCTION. */
18
- PUBLISH_PRODUCTION_REQUIRED = 'PUBLISH_PRODUCTION_REQUIRED',
19
- }
1
+ /** `error.code` of the refusals a client acts on. */
2
+ export enum ReflexErrorCode {
3
+ /** 400: the definition does not match the format; `error.details` holds the path of each fault. */
4
+ INVALID_DEFINITION = 'INVALID_DEFINITION',
5
+ /** 409: an access granted to the function is suspended; revoke it and grant it again. */
6
+ GRANT_SUSPENDED = 'GRANT_SUSPENDED',
7
+ /** 409: the function has no frozen version of its own draft yet, or none to go back to. */
8
+ NO_VERSION = 'NO_VERSION',
9
+ /** 409: the access to grant is not declared by the draft of the function. */
10
+ ACCESS_NOT_DECLARED = 'ACCESS_NOT_DECLARED',
11
+ /** 404: the environment is not one of the application's environments (abyss-main). */
12
+ ENVIRONMENT_NOT_FOUND = 'ENVIRONMENT_NOT_FOUND',
13
+ /** 409: a name, a path or an access already exists. */
14
+ ALREADY_EXISTS = 'ALREADY_EXISTS',
15
+ /** 403: the function is promoted in a production environment and the member lacks REFLEX_PUBLISH_PRODUCTION. */
16
+ PUBLISH_PRODUCTION_REQUIRED = 'PUBLISH_PRODUCTION_REQUIRED',
17
+ /** 503 (edge): the Service is paused in this environment; nothing ran, nothing is billed. */
18
+ SERVICE_PAUSED = 'SERVICE_PAUSED',
19
+ /** 429: the caller went past the limit; `Retry-After` and `RateLimit-*` say when to come back. */
20
+ RATE_LIMIT_EXCEEDED = 'RATE_LIMIT_EXCEEDED',
21
+ /** 409: the route would hide another one of the Service (same method, paths equal but for their parameters). */
22
+ ROUTE_CONFLICT = 'ROUTE_CONFLICT',
23
+ /** 409: the Service has not changed since its last version. */
24
+ VERSION_UNCHANGED = 'VERSION_UNCHANGED',
25
+ }
@@ -0,0 +1,9 @@
1
+ /** The HTTP method a route answers. `ANY` answers every method; a `FUNCTIONS` Service only has `ANY` routes. */
2
+ export enum RouteMethod {
3
+ GET = 'GET',
4
+ POST = 'POST',
5
+ PUT = 'PUT',
6
+ PATCH = 'PATCH',
7
+ DELETE = 'DELETE',
8
+ ANY = 'ANY',
9
+ }
@@ -0,0 +1,11 @@
1
+ /** The gesture a deployment row records, one row per gesture in an environment. */
2
+ export enum ServiceDeploymentAction {
3
+ /** A version of the Service put in service. */
4
+ GO_LIVE = 'GO_LIVE',
5
+ /** A version deployed before put back in service. */
6
+ ROLLBACK = 'ROLLBACK',
7
+ /** The Service stops answering (503 SERVICE_PAUSED), its version kept. */
8
+ PAUSE = 'PAUSE',
9
+ /** The paused Service answers again, with the same version. */
10
+ RESUME = 'RESUME',
11
+ }
@@ -0,0 +1,5 @@
1
+ /** State of the Service in an environment after a deployment gesture. */
2
+ export enum ServiceDeploymentStatus {
3
+ ACTIVE = 'ACTIVE',
4
+ PAUSED = 'PAUSED',
5
+ }
@@ -0,0 +1,7 @@
1
+ /** What a Service exposes. */
2
+ export enum ServiceType {
3
+ /** Routes of a method and a path, each calling one function of the Service. */
4
+ HTTP_API = 'HTTP_API',
5
+ /** Functions, each at a path, answering every method (routes of method `ANY` only). */
6
+ FUNCTIONS = 'FUNCTIONS',
7
+ }
@@ -0,0 +1,6 @@
1
+ /** How a route differs between a version of a Service and the previous one. */
2
+ export enum ServiceVersionChangeKind {
3
+ ADDED = 'ADDED',
4
+ REMOVED = 'REMOVED',
5
+ MODIFIED = 'MODIFIED',
6
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Who may call an HTTP trigger.
2
+ * Who may call a route of a Service.
3
3
  * - PUBLIC: anyone.
4
4
  * - API_KEY: the caller sends the key in `x-api-key`.
5
5
  * - SIGNATURE: the caller signs the raw body: `x-reflex-signature: sha256=<hex HMAC-SHA256(secret,
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Where the value a Console vault entry gives to an environment comes from, in the order of the
3
+ * resolution: the value of the environment, the entry's default value, the value of the entry's default
4
+ * environment, or nothing (the entry is absent for the environment). Mirrors Console's enum of the
5
+ * same name, so the SDK needs no dependency on it.
6
+ */
7
+ export enum VaultValueSource {
8
+ ENVIRONMENT = 'ENVIRONMENT',
9
+ DEFAULT = 'DEFAULT',
10
+ DEFAULT_ENVIRONMENT = 'DEFAULT_ENVIRONMENT',
11
+ ABSENT = 'ABSENT',
12
+ }
@@ -0,0 +1,5 @@
1
+ /** Whether a Console vault entry hides its value. Mirrors Console's `SecretVisibility`. */
2
+ export enum VaultVisibility {
3
+ SECRET = 'SECRET',
4
+ VISIBLE = 'VISIBLE',
5
+ }
@@ -21,6 +21,6 @@ export interface IGetFunctionRunParams {
21
21
  export interface IGetFunctionRunStateParams {
22
22
  applicationId: string;
23
23
  functionId: string;
24
- /** The `executionId` an async trigger answered with: the id of the live run. */
24
+ /** The `executionId` an async route answered with: the id of the live run. */
25
25
  runId: string;
26
26
  }
@@ -1,27 +1,27 @@
1
- import type { IReflexExecutionSettingsValues } from '../../models';
2
-
3
- export interface IGetFunctionSettingsParams {
4
- applicationId: string;
5
- functionId: string;
6
- }
7
-
8
- export interface ISetFunctionDefaultSettingsParams {
9
- applicationId: string;
10
- functionId: string;
11
- }
12
- /** Every value is required: a row of settings is whole. */
13
- export type ISetFunctionDefaultSettingsBody = IReflexExecutionSettingsValues;
14
-
15
- export interface ISetFunctionEnvironmentSettingsParams {
16
- applicationId: string;
17
- functionId: string;
18
- /** An environment of the application (abyss-main's id). */
19
- environmentId: string;
20
- }
21
- export type ISetFunctionEnvironmentSettingsBody = IReflexExecutionSettingsValues;
22
-
23
- export interface IRemoveFunctionEnvironmentSettingsParams {
24
- applicationId: string;
25
- functionId: string;
26
- environmentId: string;
27
- }
1
+ import type { IReflexExecutionSettingsValues } from '../../models';
2
+
3
+ export interface IGetFunctionSettingsParams {
4
+ applicationId: string;
5
+ functionId: string;
6
+ }
7
+
8
+ export interface ISetFunctionDefaultSettingsParams {
9
+ applicationId: string;
10
+ functionId: string;
11
+ }
12
+ /** Every value is required: a row of settings is whole. */
13
+ export type ISetFunctionDefaultSettingsBody = IReflexExecutionSettingsValues;
14
+
15
+ export interface ISetFunctionEnvironmentSettingsParams {
16
+ applicationId: string;
17
+ functionId: string;
18
+ /** An environment of the application (abyss-main's id). */
19
+ environmentId: string;
20
+ }
21
+ export type ISetFunctionEnvironmentSettingsBody = IReflexExecutionSettingsValues;
22
+
23
+ export interface IRemoveFunctionEnvironmentSettingsParams {
24
+ applicationId: string;
25
+ functionId: string;
26
+ environmentId: string;
27
+ }
@@ -1,24 +1,24 @@
1
- export interface IFunctionTestParams {
2
- applicationId: string;
3
- functionId: string;
4
- }
5
-
6
- /** The answer an HTTP step gets in a test; nothing is sent. Defaults to `200` with no body. */
7
- export interface IReflexHttpStub {
8
- status: number;
9
- headers?: Record<string, string>;
10
- body?: unknown;
11
- }
12
-
13
- export interface ISimulateFunctionBody {
14
- /**
15
- * The environment of the application the run takes place in (abyss-main's id): a dry run reads its
16
- * Store, the run is measured with its effective settings and recorded with it.
17
- */
18
- environmentId: string;
19
- /** The event the function receives, as the edge builds it: `{method, path, query, headers, body}`. */
20
- input?: unknown;
21
- /** Simulated responses of HTTP steps, by step id. */
22
- httpStubs?: Record<string, IReflexHttpStub>;
23
- }
24
- export type IDryRunFunctionBody = ISimulateFunctionBody;
1
+ export interface IFunctionTestParams {
2
+ applicationId: string;
3
+ functionId: string;
4
+ }
5
+
6
+ /** The answer an HTTP step gets in a test; nothing is sent. Defaults to `200` with no body. */
7
+ export interface IReflexHttpStub {
8
+ status: number;
9
+ headers?: Record<string, string>;
10
+ body?: unknown;
11
+ }
12
+
13
+ export interface ISimulateFunctionBody {
14
+ /**
15
+ * The environment of the application the run takes place in (abyss-main's id): a dry run reads its
16
+ * Store, the run is measured with its effective settings and recorded with it.
17
+ */
18
+ environmentId: string;
19
+ /** The event the function receives, as the edge builds it: `{method, path, query, headers, body}`. */
20
+ input?: unknown;
21
+ /** Simulated responses of HTTP steps, by step id. */
22
+ httpStubs?: Record<string, IReflexHttpStub>;
23
+ }
24
+ export type IDryRunFunctionBody = ISimulateFunctionBody;
@@ -1,25 +1,20 @@
1
- export interface IListFunctionVersionParams {
2
- applicationId: string;
3
- functionId: string;
4
- }
5
-
6
- export interface IPublishFunctionVersionParams {
7
- applicationId: string;
8
- functionId: string;
9
- }
10
-
11
- export interface IGetFunctionVersionParams {
12
- applicationId: string;
13
- functionId: string;
14
- versionId: string;
15
- }
16
-
17
- export interface IGetFunctionVersionStepStatsParams {
18
- applicationId: string;
19
- functionId: string;
20
- versionId: string;
21
- }
22
- export interface IGetFunctionVersionStepStatsQuery {
23
- /** Only the executions of this environment; every environment when absent. */
24
- environmentId?: string;
25
- }
1
+ export interface IListFunctionVersionParams {
2
+ applicationId: string;
3
+ functionId: string;
4
+ }
5
+
6
+ export interface IGetFunctionVersionParams {
7
+ applicationId: string;
8
+ functionId: string;
9
+ versionId: string;
10
+ }
11
+
12
+ export interface IGetFunctionVersionStepStatsParams {
13
+ applicationId: string;
14
+ functionId: string;
15
+ versionId: string;
16
+ }
17
+ export interface IGetFunctionVersionStepStatsQuery {
18
+ /** Only the executions of this environment; every environment when absent. */
19
+ environmentId?: string;
20
+ }
@@ -8,6 +8,8 @@ export interface ICreateFunctionParams {
8
8
  applicationId: string;
9
9
  }
10
10
  export interface ICreateFunctionBody {
11
+ /** A Service of the application, which the function joins. */
12
+ serviceId: string;
11
13
  /** Unique within the application, 1 to 100 characters. */
12
14
  name: string;
13
15
  /** Absent: a function without access or step, to fill in. */
@@ -1,8 +1,11 @@
1
- export * from './function.request';
2
- export * from './function-access.request';
3
- export * from './function-test.request';
4
- export * from './function-version.request';
5
- export * from './function-promotion.request';
6
- export * from './function-trigger.request';
7
- export * from './function-run.request';
8
- export * from './function-settings.request';
1
+ export * from './function.request';
2
+ export * from './function-access.request';
3
+ export * from './function-test.request';
4
+ export * from './function-version.request';
5
+ export * from './function-run.request';
6
+ export * from './function-settings.request';
7
+ export * from './service.request';
8
+ export * from './service-route.request';
9
+ export * from './service-version.request';
10
+ export * from './service-deployment.request';
11
+ export * from './service-configuration.request';
@@ -0,0 +1,4 @@
1
+ export interface IListServiceConfigurationParams {
2
+ applicationId: string;
3
+ serviceId: string;
4
+ }
@@ -0,0 +1,49 @@
1
+ export interface IListServiceDeploymentParams {
2
+ applicationId: string;
3
+ serviceId: string;
4
+ }
5
+ export interface IListServiceDeploymentQuery {
6
+ /** Only the history of this environment; every environment when absent. */
7
+ environmentId?: string;
8
+ /** 1 to 100, 50 by default. */
9
+ limit?: number;
10
+ /** Gestures skipped, newest first; 0 by default. */
11
+ offset?: number;
12
+ }
13
+
14
+ export interface IGoLiveServiceParams {
15
+ applicationId: string;
16
+ serviceId: string;
17
+ }
18
+ /** A production environment needs REFLEX_PUBLISH_PRODUCTION, any other REFLEX_PUBLISH. */
19
+ export interface IGoLiveServiceBody {
20
+ /** An environment of the application (abyss-main's id). */
21
+ environmentId: string;
22
+ serviceVersionId: string;
23
+ }
24
+
25
+ export interface IRollbackServiceParams {
26
+ applicationId: string;
27
+ serviceId: string;
28
+ }
29
+ export interface IRollbackServiceBody {
30
+ environmentId: string;
31
+ /** A deployment of this environment, from the history: its version is put back in service. */
32
+ deploymentId: string;
33
+ }
34
+
35
+ export interface IPauseServiceParams {
36
+ applicationId: string;
37
+ serviceId: string;
38
+ }
39
+ export interface IPauseServiceBody {
40
+ environmentId: string;
41
+ }
42
+
43
+ export interface IResumeServiceParams {
44
+ applicationId: string;
45
+ serviceId: string;
46
+ }
47
+ export interface IResumeServiceBody {
48
+ environmentId: string;
49
+ }
@@ -0,0 +1,44 @@
1
+ import type { RouteMethod, TriggerAccessMode } from '../../../enum';
2
+
3
+ export interface IListServiceRouteParams {
4
+ applicationId: string;
5
+ serviceId: string;
6
+ }
7
+
8
+ export interface ICreateServiceRouteParams {
9
+ applicationId: string;
10
+ serviceId: string;
11
+ }
12
+ export interface ICreateServiceRouteBody {
13
+ /** `ANY` only in a `FUNCTIONS` Service. */
14
+ method: RouteMethod;
15
+ /** Segments of `[a-z0-9._~-]` or `:param` joined by `/`, 20 at most; must not hide another route. */
16
+ path: string;
17
+ /** A function of the same Service. */
18
+ functionId: string;
19
+ accessMode: TriggerAccessMode;
20
+ }
21
+
22
+ export interface IUpdateServiceRouteParams {
23
+ applicationId: string;
24
+ serviceId: string;
25
+ routeId: string;
26
+ }
27
+ export interface IUpdateServiceRouteBody {
28
+ method?: RouteMethod;
29
+ path?: string;
30
+ functionId?: string;
31
+ accessMode?: TriggerAccessMode;
32
+ }
33
+
34
+ export interface IDeleteServiceRouteParams {
35
+ applicationId: string;
36
+ serviceId: string;
37
+ routeId: string;
38
+ }
39
+
40
+ export interface IRotateServiceRouteParams {
41
+ applicationId: string;
42
+ serviceId: string;
43
+ routeId: string;
44
+ }
@@ -0,0 +1,19 @@
1
+ export interface IListServiceVersionParams {
2
+ applicationId: string;
3
+ serviceId: string;
4
+ }
5
+
6
+ export interface ICreateServiceVersionParams {
7
+ applicationId: string;
8
+ serviceId: string;
9
+ }
10
+ export interface ICreateServiceVersionBody {
11
+ /** 500 characters at most. */
12
+ message?: string;
13
+ }
14
+
15
+ export interface IGetServiceVersionParams {
16
+ applicationId: string;
17
+ serviceId: string;
18
+ versionId: string;
19
+ }
@@ -0,0 +1,39 @@
1
+ import type { ServiceType } from '../../../enum';
2
+ import type { IReflexServiceCors } from '../../models';
3
+
4
+ export interface IListServiceParams {
5
+ applicationId: string;
6
+ }
7
+
8
+ export interface ICreateServiceParams {
9
+ applicationId: string;
10
+ }
11
+ export interface ICreateServiceBody {
12
+ /** Unique within the application, 1 to 100 characters. */
13
+ name: string;
14
+ /** `^[a-z0-9][a-z0-9-]{0,39}$`, unique within the application, immutable. */
15
+ slug: string;
16
+ type: ServiceType;
17
+ }
18
+
19
+ export interface IGetServiceParams {
20
+ applicationId: string;
21
+ serviceId: string;
22
+ }
23
+
24
+ export interface IUpdateServiceParams {
25
+ applicationId: string;
26
+ serviceId: string;
27
+ }
28
+ /** Changes the draft: the next version freezes `cors` and `rateLimitPerIpPerMinute`. */
29
+ export interface IUpdateServiceBody {
30
+ name?: string;
31
+ cors?: IReflexServiceCors;
32
+ /** 1 to 6000. */
33
+ rateLimitPerIpPerMinute?: number;
34
+ }
35
+
36
+ export interface IDeleteServiceParams {
37
+ applicationId: string;
38
+ serviceId: string;
39
+ }
@@ -1,36 +1,36 @@
1
- import type {
2
- IReflexEffectiveExecutionSettings,
3
- IReflexExecutionSettings,
4
- IReflexExecutionSettingsValues,
5
- IReflexPriceList,
6
- } from '../../models';
7
- import type { IResponse } from '../response';
8
-
9
- export interface IGetFunctionSettingsData {
10
- /** The default of the function; null when none is set. */
11
- default: IReflexExecutionSettings | null;
12
- /** The override of each environment that has one. */
13
- environments: IReflexExecutionSettings[];
14
- /** What each environment of the application runs with. */
15
- effective: IReflexEffectiveExecutionSettings[];
16
- /** What applies when neither the environment nor the function sets anything. */
17
- builtIn: IReflexExecutionSettingsValues;
18
- /** The price list an execution is billed with, to estimate the cost of a setting. */
19
- priceList: IReflexPriceList;
20
- }
21
- export type IGetFunctionSettingsResponse = IResponse<IGetFunctionSettingsData>;
22
-
23
- export interface ISetFunctionDefaultSettingsData {
24
- settings: IReflexExecutionSettings;
25
- }
26
- export type ISetFunctionDefaultSettingsResponse = IResponse<ISetFunctionDefaultSettingsData>;
27
-
28
- export interface ISetFunctionEnvironmentSettingsData {
29
- settings: IReflexExecutionSettings;
30
- }
31
- export type ISetFunctionEnvironmentSettingsResponse =
32
- IResponse<ISetFunctionEnvironmentSettingsData>;
33
-
34
- export type IRemoveFunctionEnvironmentSettingsData = Record<string, never>;
35
- export type IRemoveFunctionEnvironmentSettingsResponse =
36
- IResponse<IRemoveFunctionEnvironmentSettingsData>;
1
+ import type {
2
+ IReflexEffectiveExecutionSettings,
3
+ IReflexExecutionSettings,
4
+ IReflexExecutionSettingsValues,
5
+ IReflexPriceList,
6
+ } from '../../models';
7
+ import type { IResponse } from '../response';
8
+
9
+ export interface IGetFunctionSettingsData {
10
+ /** The default of the function; null when none is set. */
11
+ default: IReflexExecutionSettings | null;
12
+ /** The override of each environment that has one. */
13
+ environments: IReflexExecutionSettings[];
14
+ /** What each environment of the application runs with. */
15
+ effective: IReflexEffectiveExecutionSettings[];
16
+ /** What applies when neither the environment nor the function sets anything. */
17
+ builtIn: IReflexExecutionSettingsValues;
18
+ /** The price list an execution is billed with, to estimate the cost of a setting. */
19
+ priceList: IReflexPriceList;
20
+ }
21
+ export type IGetFunctionSettingsResponse = IResponse<IGetFunctionSettingsData>;
22
+
23
+ export interface ISetFunctionDefaultSettingsData {
24
+ settings: IReflexExecutionSettings;
25
+ }
26
+ export type ISetFunctionDefaultSettingsResponse = IResponse<ISetFunctionDefaultSettingsData>;
27
+
28
+ export interface ISetFunctionEnvironmentSettingsData {
29
+ settings: IReflexExecutionSettings;
30
+ }
31
+ export type ISetFunctionEnvironmentSettingsResponse =
32
+ IResponse<ISetFunctionEnvironmentSettingsData>;
33
+
34
+ export type IRemoveFunctionEnvironmentSettingsData = Record<string, never>;
35
+ export type IRemoveFunctionEnvironmentSettingsResponse =
36
+ IResponse<IRemoveFunctionEnvironmentSettingsData>;
@@ -10,11 +10,6 @@ export interface IListFunctionVersionData {
10
10
  }
11
11
  export type IListFunctionVersionResponse = IResponse<IListFunctionVersionData>;
12
12
 
13
- export interface IPublishFunctionVersionData {
14
- version: IReflexFunctionVersion;
15
- }
16
- export type IPublishFunctionVersionResponse = IResponse<IPublishFunctionVersionData>;
17
-
18
13
  export interface IGetFunctionVersionData {
19
14
  version: IReflexFunctionVersion;
20
15
  }
@@ -1,8 +1,11 @@
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-promotion.response';
6
- export * from './function-trigger.response';
7
- export * from './function-run.response';
8
- export * from './function-settings.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';
@@ -0,0 +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>;
@@ -0,0 +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>;