@abyss-project/reflex 5.11.0 → 6.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 (208) hide show
  1. package/dist/api/index.d.ts +4 -0
  2. package/dist/api/index.js +4 -0
  3. package/dist/api/index.js.map +1 -1
  4. package/dist/api/service-completion-webhook.api.d.ts +3 -0
  5. package/dist/api/service-completion-webhook.api.js +10 -0
  6. package/dist/api/service-completion-webhook.api.js.map +1 -0
  7. package/dist/api/service-consumer.api.d.ts +7 -0
  8. package/dist/api/service-consumer.api.js +19 -0
  9. package/dist/api/service-consumer.api.js.map +1 -0
  10. package/dist/api/service-discord.api.d.ts +1 -2
  11. package/dist/api/service-discord.api.js +1 -3
  12. package/dist/api/service-discord.api.js.map +1 -1
  13. package/dist/api/service-limits.api.d.ts +3 -0
  14. package/dist/api/service-limits.api.js +10 -0
  15. package/dist/api/service-limits.api.js.map +1 -0
  16. package/dist/api/service-openapi.api.d.ts +2 -0
  17. package/dist/api/service-openapi.api.js +7 -0
  18. package/dist/api/service-openapi.api.js.map +1 -0
  19. package/dist/api/service-route.api.js.map +1 -1
  20. package/dist/index.d.ts +23 -1
  21. package/dist/index.js +23 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/types/enum/completion-delivery-status.enum.d.ts +5 -0
  24. package/dist/types/enum/completion-delivery-status.enum.js +10 -0
  25. package/dist/types/enum/completion-delivery-status.enum.js.map +1 -0
  26. package/dist/types/enum/index.d.ts +2 -0
  27. package/dist/types/enum/index.js +2 -0
  28. package/dist/types/enum/index.js.map +1 -1
  29. package/dist/types/enum/reflex-error-code.enum.d.ts +8 -1
  30. package/dist/types/enum/reflex-error-code.enum.js +7 -0
  31. package/dist/types/enum/reflex-error-code.enum.js.map +1 -1
  32. package/dist/types/enum/run-status.enum.d.ts +2 -1
  33. package/dist/types/enum/run-status.enum.js +1 -0
  34. package/dist/types/enum/run-status.enum.js.map +1 -1
  35. package/dist/types/enum/scheduled-run-failure-code.enum.d.ts +2 -1
  36. package/dist/types/enum/scheduled-run-failure-code.enum.js +1 -0
  37. package/dist/types/enum/scheduled-run-failure-code.enum.js.map +1 -1
  38. package/dist/types/enum/service-block-reason.enum.d.ts +4 -0
  39. package/dist/types/enum/service-block-reason.enum.js +9 -0
  40. package/dist/types/enum/service-block-reason.enum.js.map +1 -0
  41. package/dist/types/interface/api/requests/function-run.request.d.ts +1 -0
  42. package/dist/types/interface/api/requests/function-test.request.d.ts +1 -0
  43. package/dist/types/interface/api/requests/index.d.ts +4 -0
  44. package/dist/types/interface/api/requests/index.js +4 -0
  45. package/dist/types/interface/api/requests/index.js.map +1 -1
  46. package/dist/types/interface/api/requests/service-completion-webhook.request.d.ts +9 -0
  47. package/dist/types/interface/api/requests/service-completion-webhook.request.js +3 -0
  48. package/dist/types/interface/api/requests/service-completion-webhook.request.js.map +1 -0
  49. package/dist/types/interface/api/requests/service-consumer.request.d.ts +41 -0
  50. package/dist/types/interface/api/requests/service-consumer.request.js +3 -0
  51. package/dist/types/interface/api/requests/service-consumer.request.js.map +1 -0
  52. package/dist/types/interface/api/requests/service-discord.request.d.ts +1 -14
  53. package/dist/types/interface/api/requests/service-limits.request.d.ts +18 -0
  54. package/dist/types/interface/api/requests/service-limits.request.js +3 -0
  55. package/dist/types/interface/api/requests/service-limits.request.js.map +1 -0
  56. package/dist/types/interface/api/requests/service-openapi.request.d.ts +8 -0
  57. package/dist/types/interface/api/requests/service-openapi.request.js +3 -0
  58. package/dist/types/interface/api/requests/service-openapi.request.js.map +1 -0
  59. package/dist/types/interface/api/requests/service-route.request.d.ts +3 -0
  60. package/dist/types/interface/api/responses/function-settings.response.d.ts +3 -1
  61. package/dist/types/interface/api/responses/function-test.response.d.ts +3 -1
  62. package/dist/types/interface/api/responses/index.d.ts +4 -0
  63. package/dist/types/interface/api/responses/index.js +4 -0
  64. package/dist/types/interface/api/responses/index.js.map +1 -1
  65. package/dist/types/interface/api/responses/service-completion-webhook.response.d.ts +8 -0
  66. package/dist/types/interface/api/responses/service-completion-webhook.response.js +3 -0
  67. package/dist/types/interface/api/responses/service-completion-webhook.response.js.map +1 -0
  68. package/dist/types/interface/api/responses/service-consumer.response.d.ts +25 -0
  69. package/dist/types/interface/api/responses/service-consumer.response.js +3 -0
  70. package/dist/types/interface/api/responses/service-consumer.response.js.map +1 -0
  71. package/dist/types/interface/api/responses/service-discord.response.d.ts +1 -9
  72. package/dist/types/interface/api/responses/service-limits.response.d.ts +10 -0
  73. package/dist/types/interface/api/responses/service-limits.response.js +3 -0
  74. package/dist/types/interface/api/responses/service-limits.response.js.map +1 -0
  75. package/dist/types/interface/api/responses/service-openapi.response.d.ts +5 -0
  76. package/dist/types/interface/api/responses/service-openapi.response.js +3 -0
  77. package/dist/types/interface/api/responses/service-openapi.response.js.map +1 -0
  78. package/dist/types/interface/api/responses/service-version.response.d.ts +1 -0
  79. package/dist/types/interface/models/index.d.ts +4 -0
  80. package/dist/types/interface/models/index.js +4 -0
  81. package/dist/types/interface/models/index.js.map +1 -1
  82. package/dist/types/interface/models/reflex-bot-limits.model.d.ts +0 -25
  83. package/dist/types/interface/models/reflex-bot-limits.model.js +8 -7
  84. package/dist/types/interface/models/reflex-bot-limits.model.js.map +1 -1
  85. package/dist/types/interface/models/reflex-completion-webhook.model.d.ts +48 -0
  86. package/dist/types/interface/models/reflex-completion-webhook.model.js +12 -0
  87. package/dist/types/interface/models/reflex-completion-webhook.model.js.map +1 -0
  88. package/dist/types/interface/models/reflex-consumer.model.d.ts +30 -0
  89. package/dist/types/interface/models/reflex-consumer.model.js +11 -0
  90. package/dist/types/interface/models/reflex-consumer.model.js.map +1 -0
  91. package/dist/types/interface/models/reflex-execution-settings.model.d.ts +1 -0
  92. package/dist/types/interface/models/reflex-execution-settings.model.js +1 -0
  93. package/dist/types/interface/models/reflex-execution-settings.model.js.map +1 -1
  94. package/dist/types/interface/models/reflex-route-contract.model.d.ts +22 -0
  95. package/dist/types/interface/models/reflex-route-contract.model.js +13 -0
  96. package/dist/types/interface/models/reflex-route-contract.model.js.map +1 -0
  97. package/dist/types/interface/models/reflex-route.model.d.ts +2 -0
  98. package/dist/types/interface/models/reflex-run.model.d.ts +21 -0
  99. package/dist/types/interface/models/reflex-run.model.js.map +1 -1
  100. package/dist/types/interface/models/reflex-service-limits.model.d.ts +41 -0
  101. package/dist/types/interface/models/reflex-service-limits.model.js +13 -0
  102. package/dist/types/interface/models/reflex-service-limits.model.js.map +1 -0
  103. package/dist/types/interface/models/reflex-service-version.model.d.ts +2 -0
  104. package/package.json +15 -10
  105. package/src/api/function-access.api.ts +87 -87
  106. package/src/api/function-template.api.test.ts +72 -72
  107. package/src/api/function-template.api.ts +52 -52
  108. package/src/api/function-version.api.ts +66 -66
  109. package/src/api/function.api.test.ts +2 -1
  110. package/src/api/index.ts +4 -0
  111. package/src/api/service-completion-webhook.api.test.ts +87 -0
  112. package/src/api/service-completion-webhook.api.ts +37 -0
  113. package/src/api/service-consumer.api.test.ts +104 -0
  114. package/src/api/service-consumer.api.ts +88 -0
  115. package/src/api/service-discord.api.test.ts +178 -197
  116. package/src/api/service-discord.api.ts +222 -241
  117. package/src/api/service-limits.api.test.ts +100 -0
  118. package/src/api/service-limits.api.ts +37 -0
  119. package/src/api/service-openapi.api.test.ts +52 -0
  120. package/src/api/service-openapi.api.ts +21 -0
  121. package/src/api/service-route.api.ts +74 -72
  122. package/src/index.test.ts +104 -87
  123. package/src/index.ts +46 -3
  124. package/src/types/enum/access-request-status.enum.ts +11 -11
  125. package/src/types/enum/completion-delivery-status.enum.ts +9 -0
  126. package/src/types/enum/index.ts +2 -0
  127. package/src/types/enum/reflex-error-code.enum.ts +73 -43
  128. package/src/types/enum/run-status.enum.ts +16 -11
  129. package/src/types/enum/scheduled-run-failure-code.enum.ts +14 -12
  130. package/src/types/enum/service-block-reason.enum.ts +13 -0
  131. package/src/types/interface/api/requests/alert-rule.request.ts +53 -53
  132. package/src/types/interface/api/requests/application-insights.request.ts +18 -18
  133. package/src/types/interface/api/requests/application-run-settings.request.ts +11 -11
  134. package/src/types/interface/api/requests/function-access.request.ts +51 -51
  135. package/src/types/interface/api/requests/function-run.request.ts +2 -0
  136. package/src/types/interface/api/requests/function-settings.request.ts +34 -34
  137. package/src/types/interface/api/requests/function-template.request.ts +29 -29
  138. package/src/types/interface/api/requests/function-test.request.ts +5 -0
  139. package/src/types/interface/api/requests/function-version.request.ts +38 -38
  140. package/src/types/interface/api/requests/function.request.ts +36 -36
  141. package/src/types/interface/api/requests/index.ts +4 -0
  142. package/src/types/interface/api/requests/route-stats.request.ts +22 -22
  143. package/src/types/interface/api/requests/service-completion-webhook.request.ts +11 -0
  144. package/src/types/interface/api/requests/service-configuration.request.ts +4 -4
  145. package/src/types/interface/api/requests/service-consumer.request.ts +51 -0
  146. package/src/types/interface/api/requests/service-deployment.request.ts +49 -49
  147. package/src/types/interface/api/requests/service-discord-event.request.ts +68 -68
  148. package/src/types/interface/api/requests/service-discord.request.ts +1 -25
  149. package/src/types/interface/api/requests/service-insights.request.ts +31 -31
  150. package/src/types/interface/api/requests/service-limits.request.ts +28 -0
  151. package/src/types/interface/api/requests/service-openapi.request.ts +10 -0
  152. package/src/types/interface/api/requests/service-route.request.ts +8 -0
  153. package/src/types/interface/api/requests/service-task.request.ts +80 -80
  154. package/src/types/interface/api/requests/service-version.request.ts +24 -24
  155. package/src/types/interface/api/requests/service.request.ts +46 -46
  156. package/src/types/interface/api/responses/alert-rule.response.ts +24 -24
  157. package/src/types/interface/api/responses/application-insights.response.ts +11 -11
  158. package/src/types/interface/api/responses/application-run-settings.response.ts +8 -8
  159. package/src/types/interface/api/responses/function-access.response.ts +45 -45
  160. package/src/types/interface/api/responses/function-run.response.ts +18 -18
  161. package/src/types/interface/api/responses/function-settings.response.ts +8 -0
  162. package/src/types/interface/api/responses/function-template.response.ts +21 -21
  163. package/src/types/interface/api/responses/function-test.response.ts +8 -1
  164. package/src/types/interface/api/responses/function-version.response.ts +42 -42
  165. package/src/types/interface/api/responses/function.response.ts +25 -25
  166. package/src/types/interface/api/responses/index.ts +4 -0
  167. package/src/types/interface/api/responses/route-stats.response.ts +15 -15
  168. package/src/types/interface/api/responses/service-completion-webhook.response.ts +13 -0
  169. package/src/types/interface/api/responses/service-configuration.response.ts +8 -8
  170. package/src/types/interface/api/responses/service-consumer.response.ts +33 -0
  171. package/src/types/interface/api/responses/service-deployment.response.ts +32 -32
  172. package/src/types/interface/api/responses/service-discord-event.response.ts +24 -24
  173. package/src/types/interface/api/responses/service-discord.response.ts +4 -16
  174. package/src/types/interface/api/responses/service-insights.response.ts +11 -11
  175. package/src/types/interface/api/responses/service-limits.response.ts +13 -0
  176. package/src/types/interface/api/responses/service-openapi.response.ts +7 -0
  177. package/src/types/interface/api/responses/service-route.response.ts +3 -3
  178. package/src/types/interface/api/responses/service-task.response.ts +57 -57
  179. package/src/types/interface/api/responses/service-version.response.ts +112 -106
  180. package/src/types/interface/api/responses/service.response.ts +31 -31
  181. package/src/types/interface/models/index.ts +4 -0
  182. package/src/types/interface/models/reflex-access-grant.model.ts +14 -14
  183. package/src/types/interface/models/reflex-access-request.model.ts +15 -15
  184. package/src/types/interface/models/reflex-alert-rule.model.ts +56 -56
  185. package/src/types/interface/models/reflex-bot-limits.model.ts +12 -51
  186. package/src/types/interface/models/reflex-completion-webhook.model.ts +85 -0
  187. package/src/types/interface/models/reflex-consumer.model.ts +50 -0
  188. package/src/types/interface/models/reflex-definition.model.ts +31 -31
  189. package/src/types/interface/models/reflex-discord-event-log.model.ts +58 -58
  190. package/src/types/interface/models/reflex-discord-event.model.ts +79 -79
  191. package/src/types/interface/models/reflex-discord.model.ts +196 -196
  192. package/src/types/interface/models/reflex-execution-settings.model.ts +7 -0
  193. package/src/types/interface/models/reflex-function-template.model.ts +18 -18
  194. package/src/types/interface/models/reflex-function-version.model.ts +19 -19
  195. package/src/types/interface/models/reflex-function.model.ts +30 -30
  196. package/src/types/interface/models/reflex-insights.model.ts +215 -215
  197. package/src/types/interface/models/reflex-price-list.model.ts +20 -20
  198. package/src/types/interface/models/reflex-route-contract.model.ts +46 -0
  199. package/src/types/interface/models/reflex-route.model.ts +5 -1
  200. package/src/types/interface/models/reflex-run-settings.model.ts +28 -28
  201. package/src/types/interface/models/reflex-run.model.ts +47 -3
  202. package/src/types/interface/models/reflex-service-configuration.model.ts +22 -22
  203. package/src/types/interface/models/reflex-service-deployment.model.ts +46 -46
  204. package/src/types/interface/models/reflex-service-limits.model.ts +73 -0
  205. package/src/types/interface/models/reflex-service-version.model.ts +3 -0
  206. package/src/types/interface/models/reflex-service.model.ts +45 -45
  207. package/src/types/interface/models/reflex-step-stats.model.ts +35 -35
  208. package/src/types/interface/models/reflex-task.model.ts +97 -97
@@ -0,0 +1,21 @@
1
+ import { AbyssReflexCore } from '..';
2
+ import type {
3
+ IGetServiceOpenApiParams,
4
+ IGetServiceOpenApiQuery,
5
+ IGetServiceOpenApiResponse,
6
+ } from '../types';
7
+
8
+ /**
9
+ * `GET .../openapi?environmentId=&versionId=`: the OpenAPI 3.1 document of the routes of a version of the
10
+ * Service, or of its draft without `versionId`, served by the edge of the environment. Needs REFLEX_READ.
11
+ */
12
+ export const getServiceOpenApi = async (
13
+ params: IGetServiceOpenApiParams,
14
+ query: IGetServiceOpenApiQuery,
15
+ ): Promise<IGetServiceOpenApiResponse> =>
16
+ (
17
+ await AbyssReflexCore.axios.get<IGetServiceOpenApiResponse>(
18
+ `api/service/${params.applicationId}/${params.serviceId}/openapi`,
19
+ { params: query },
20
+ )
21
+ ).data;
@@ -1,72 +1,74 @@
1
- import { AbyssReflexCore } from '..';
2
- import type {
3
- ICreateServiceRouteBody,
4
- ICreateServiceRouteParams,
5
- ICreateServiceRouteResponse,
6
- IDeleteServiceRouteParams,
7
- IDeleteServiceRouteResponse,
8
- IListServiceRouteParams,
9
- IListServiceRouteResponse,
10
- IRotateServiceRouteParams,
11
- IRotateServiceRouteResponse,
12
- IUpdateServiceRouteBody,
13
- IUpdateServiceRouteParams,
14
- IUpdateServiceRouteResponse,
15
- } from '../types';
16
-
17
- const routeUrl = (params: { applicationId: string; serviceId: string }): string =>
18
- `api/service/${params.applicationId}/${params.serviceId}/route`;
19
-
20
- /** `GET .../route`: the routes of the draft, by path then method. Needs REFLEX_READ. */
21
- export const listServiceRoute = async (
22
- params: IListServiceRouteParams,
23
- ): Promise<IListServiceRouteResponse> =>
24
- (await AbyssReflexCore.axios.get<IListServiceRouteResponse>(routeUrl(params))).data;
25
-
26
- /**
27
- * `POST .../route`: a route of the draft, served once a version holding it is in service. The key or
28
- * signing secret comes back once. `409 ROUTE_CONFLICT` when it would hide another route. Needs
29
- * REFLEX_FUNCTION_UPDATE.
30
- */
31
- export const createServiceRoute = async (
32
- params: ICreateServiceRouteParams,
33
- body: ICreateServiceRouteBody,
34
- ): Promise<ICreateServiceRouteResponse> =>
35
- (await AbyssReflexCore.axios.post<ICreateServiceRouteResponse>(routeUrl(params), body)).data;
36
-
37
- /** `PATCH .../route/:routeId`: changes the route in the draft. Needs REFLEX_FUNCTION_UPDATE. */
38
- export const updateServiceRoute = async (
39
- params: IUpdateServiceRouteParams,
40
- body: IUpdateServiceRouteBody,
41
- ): Promise<IUpdateServiceRouteResponse> =>
42
- (
43
- await AbyssReflexCore.axios.patch<IUpdateServiceRouteResponse>(
44
- `${routeUrl(params)}/${params.routeId}`,
45
- body,
46
- )
47
- ).data;
48
-
49
- /** `DELETE .../route/:routeId`: takes the route out of the draft. Needs REFLEX_FUNCTION_UPDATE. */
50
- export const deleteServiceRoute = async (
51
- params: IDeleteServiceRouteParams,
52
- ): Promise<IDeleteServiceRouteResponse> =>
53
- (
54
- await AbyssReflexCore.axios.delete<IDeleteServiceRouteResponse>(
55
- `${routeUrl(params)}/${params.routeId}`,
56
- )
57
- ).data;
58
-
59
- /**
60
- * `POST .../route/:routeId/rotate`: a new key or signing secret, shown once, served at once wherever the
61
- * route is in service. Needs REFLEX_PUBLISH, and REFLEX_PUBLISH_PRODUCTION when a production
62
- * environment serves the route.
63
- */
64
- export const rotateServiceRoute = async (
65
- params: IRotateServiceRouteParams,
66
- ): Promise<IRotateServiceRouteResponse> =>
67
- (
68
- await AbyssReflexCore.axios.post<IRotateServiceRouteResponse>(
69
- `${routeUrl(params)}/${params.routeId}/rotate`,
70
- {},
71
- )
72
- ).data;
1
+ import { AbyssReflexCore } from '..';
2
+ import type {
3
+ ICreateServiceRouteBody,
4
+ ICreateServiceRouteParams,
5
+ ICreateServiceRouteResponse,
6
+ IDeleteServiceRouteParams,
7
+ IDeleteServiceRouteResponse,
8
+ IListServiceRouteParams,
9
+ IListServiceRouteResponse,
10
+ IRotateServiceRouteParams,
11
+ IRotateServiceRouteResponse,
12
+ IUpdateServiceRouteBody,
13
+ IUpdateServiceRouteParams,
14
+ IUpdateServiceRouteResponse,
15
+ } from '../types';
16
+
17
+ const routeUrl = (params: { applicationId: string; serviceId: string }): string =>
18
+ `api/service/${params.applicationId}/${params.serviceId}/route`;
19
+
20
+ /** `GET .../route`: the routes of the draft, by path then method. Needs REFLEX_READ. */
21
+ export const listServiceRoute = async (
22
+ params: IListServiceRouteParams,
23
+ ): Promise<IListServiceRouteResponse> =>
24
+ (await AbyssReflexCore.axios.get<IListServiceRouteResponse>(routeUrl(params))).data;
25
+
26
+ /**
27
+ * `POST .../route`: a route of the draft, served once a version holding it is in service. The signing
28
+ * secret of a SIGNATURE route comes back once; an API_KEY route is called with the keys of the consumers.
29
+ * `409 ROUTE_CONFLICT` when it would hide another route, `400 ROUTE_SEGMENT_RESERVED` for a path that starts
30
+ * with `_`, `400 CONTRACT_INVALID` for a contract that is not valid. Needs REFLEX_FUNCTION_UPDATE.
31
+ */
32
+ export const createServiceRoute = async (
33
+ params: ICreateServiceRouteParams,
34
+ body: ICreateServiceRouteBody,
35
+ ): Promise<ICreateServiceRouteResponse> =>
36
+ (await AbyssReflexCore.axios.post<ICreateServiceRouteResponse>(routeUrl(params), body)).data;
37
+
38
+ /** `PATCH .../route/:routeId`: changes the route in the draft. Needs REFLEX_FUNCTION_UPDATE. */
39
+ export const updateServiceRoute = async (
40
+ params: IUpdateServiceRouteParams,
41
+ body: IUpdateServiceRouteBody,
42
+ ): Promise<IUpdateServiceRouteResponse> =>
43
+ (
44
+ await AbyssReflexCore.axios.patch<IUpdateServiceRouteResponse>(
45
+ `${routeUrl(params)}/${params.routeId}`,
46
+ body,
47
+ )
48
+ ).data;
49
+
50
+ /** `DELETE .../route/:routeId`: takes the route out of the draft. Needs REFLEX_FUNCTION_UPDATE. */
51
+ export const deleteServiceRoute = async (
52
+ params: IDeleteServiceRouteParams,
53
+ ): Promise<IDeleteServiceRouteResponse> =>
54
+ (
55
+ await AbyssReflexCore.axios.delete<IDeleteServiceRouteResponse>(
56
+ `${routeUrl(params)}/${params.routeId}`,
57
+ )
58
+ ).data;
59
+
60
+ /**
61
+ * `POST .../route/:routeId/rotate`: a new signing secret of a SIGNATURE route, shown once, served at once
62
+ * wherever the route is in service; `400` for any other route (the key of an API_KEY route is rotated by a new
63
+ * key of its consumer, then the revocation of the old one). Needs REFLEX_PUBLISH, and REFLEX_PUBLISH_PRODUCTION
64
+ * when a production environment serves the route.
65
+ */
66
+ export const rotateServiceRoute = async (
67
+ params: IRotateServiceRouteParams,
68
+ ): Promise<IRotateServiceRouteResponse> =>
69
+ (
70
+ await AbyssReflexCore.axios.post<IRotateServiceRouteResponse>(
71
+ `${routeUrl(params)}/${params.routeId}/rotate`,
72
+ {},
73
+ )
74
+ ).data;
package/src/index.test.ts CHANGED
@@ -1,87 +1,104 @@
1
- import { AxiosAdapter, AxiosError, InternalAxiosRequestConfig } from 'axios';
2
- import {
3
- AbyssReflexCore,
4
- HealthStatus,
5
- IHealthResponse,
6
- intentsOf,
7
- matchesEventFilters,
8
- privilegedIntentsOf,
9
- } from '.';
10
-
11
- const answer =
12
- (status: number, data: IHealthResponse): AxiosAdapter =>
13
- async (config: InternalAxiosRequestConfig) => {
14
- const response = { data, status, statusText: '', headers: {}, config };
15
- if (status >= 400) {
16
- throw new AxiosError('failed', 'ERR_BAD_RESPONSE', config, null, response);
17
- }
18
- return response;
19
- };
20
-
21
- describe('AbyssReflexCore', () => {
22
- it('points at the production API until setConfig says otherwise', () => {
23
- expect(AbyssReflexCore.getConfig().baseURL).toBe('https://reflex-api.abyss-project.fr/');
24
- });
25
-
26
- it('setConfig changes the base URL of the axios instance', () => {
27
- AbyssReflexCore.setConfig({ baseURL: 'http://localhost:10141/' });
28
- expect(AbyssReflexCore.axios.defaults.baseURL).toBe('http://localhost:10141/');
29
- expect(AbyssReflexCore.getConfig().baseURL).toBe('http://localhost:10141/');
30
- });
31
-
32
- it('health() calls GET /health on the configured URL and returns the typed body', async () => {
33
- const adapter = jest.fn(answer(200, { database: HealthStatus.UP, redis: HealthStatus.UP }));
34
- AbyssReflexCore.setConfig({ baseURL: 'http://reflex.test/' });
35
- AbyssReflexCore.axios.defaults.adapter = adapter;
36
-
37
- const body = await AbyssReflexCore.sdk.health();
38
-
39
- expect(body).toEqual({ database: 'up', redis: 'up' });
40
- const config = adapter.mock.calls[0][0];
41
- expect(config.method).toBe('get');
42
- expect(config.url).toBe('health');
43
- expect(config.baseURL).toBe('http://reflex.test/');
44
- });
45
-
46
- it('health() rejects on a 503 and the error carries the component that is down', async () => {
47
- AbyssReflexCore.axios.defaults.adapter = answer(503, {
48
- database: HealthStatus.DOWN,
49
- redis: HealthStatus.UP,
50
- });
51
-
52
- const error = await AbyssReflexCore.sdk.health().catch((e: AxiosError<IHealthResponse>) => e);
53
-
54
- expect((error as AxiosError<IHealthResponse>).response?.status).toBe(503);
55
- expect((error as AxiosError<IHealthResponse>).response?.data.database).toBe(HealthStatus.DOWN);
56
- });
57
- });
58
-
59
- describe('AbyssReflexCore facade of the Discord events', () => {
60
- it('exposes the pure event helpers of the SDK', () => {
61
- expect(intentsOf([])).toBe(0);
62
- expect(typeof matchesEventFilters).toBe('function');
63
- expect(typeof privilegedIntentsOf).toBe('function');
64
- });
65
-
66
- it('exposes the event, insights and bot limit routes under short names', () => {
67
- const { service, function: fn } = AbyssReflexCore.sdk;
68
- expect(Object.keys(service.discord.event)).toEqual(['list', 'create', 'update', 'delete']);
69
- expect(Object.keys(service.discord.eventLog)).toEqual(['list']);
70
- expect(Object.keys(service.insights)).toEqual(['get', 'events']);
71
- expect(Object.keys(fn.insights)).toEqual(['get']);
72
- expect(service.discord.connection.setAllocation).toBeInstanceOf(Function);
73
- expect(service.discord.connection.setBotSettings).toBeInstanceOf(Function);
74
- });
75
- });
76
-
77
- describe('AbyssReflexCore facade of the run understanding routes', () => {
78
- it('exposes the application, route statistics and log cap routes under short names', () => {
79
- const { application, service, function: fn } = AbyssReflexCore.sdk;
80
- expect(Object.keys(application)).toEqual(['runSettings', 'insights', 'alertRule']);
81
- expect(Object.keys(application.runSettings)).toEqual(['get', 'set']);
82
- expect(Object.keys(application.insights)).toEqual(['get', 'calendar']);
83
- expect(Object.keys(application.alertRule)).toEqual(['list', 'create', 'update', 'delete']);
84
- expect(Object.keys(service.routeStats)).toEqual(['list', 'insights']);
85
- expect(Object.keys(fn.logCap)).toEqual(['set']);
86
- });
87
- });
1
+ import { AxiosAdapter, AxiosError, InternalAxiosRequestConfig } from 'axios';
2
+ import {
3
+ AbyssReflexCore,
4
+ HealthStatus,
5
+ IHealthResponse,
6
+ intentsOf,
7
+ matchesEventFilters,
8
+ privilegedIntentsOf,
9
+ } from '.';
10
+
11
+ const answer =
12
+ (status: number, data: IHealthResponse): AxiosAdapter =>
13
+ async (config: InternalAxiosRequestConfig) => {
14
+ const response = { data, status, statusText: '', headers: {}, config };
15
+ if (status >= 400) {
16
+ throw new AxiosError('failed', 'ERR_BAD_RESPONSE', config, null, response);
17
+ }
18
+ return response;
19
+ };
20
+
21
+ describe('AbyssReflexCore', () => {
22
+ it('points at the production API until setConfig says otherwise', () => {
23
+ expect(AbyssReflexCore.getConfig().baseURL).toBe('https://reflex-api.abyss-project.fr/');
24
+ });
25
+
26
+ it('setConfig changes the base URL of the axios instance', () => {
27
+ AbyssReflexCore.setConfig({ baseURL: 'http://localhost:10141/' });
28
+ expect(AbyssReflexCore.axios.defaults.baseURL).toBe('http://localhost:10141/');
29
+ expect(AbyssReflexCore.getConfig().baseURL).toBe('http://localhost:10141/');
30
+ });
31
+
32
+ it('health() calls GET /health on the configured URL and returns the typed body', async () => {
33
+ const adapter = jest.fn(answer(200, { database: HealthStatus.UP, redis: HealthStatus.UP }));
34
+ AbyssReflexCore.setConfig({ baseURL: 'http://reflex.test/' });
35
+ AbyssReflexCore.axios.defaults.adapter = adapter;
36
+
37
+ const body = await AbyssReflexCore.sdk.health();
38
+
39
+ expect(body).toEqual({ database: 'up', redis: 'up' });
40
+ const config = adapter.mock.calls[0][0];
41
+ expect(config.method).toBe('get');
42
+ expect(config.url).toBe('health');
43
+ expect(config.baseURL).toBe('http://reflex.test/');
44
+ });
45
+
46
+ it('health() rejects on a 503 and the error carries the component that is down', async () => {
47
+ AbyssReflexCore.axios.defaults.adapter = answer(503, {
48
+ database: HealthStatus.DOWN,
49
+ redis: HealthStatus.UP,
50
+ });
51
+
52
+ const error = await AbyssReflexCore.sdk.health().catch((e: AxiosError<IHealthResponse>) => e);
53
+
54
+ expect((error as AxiosError<IHealthResponse>).response?.status).toBe(503);
55
+ expect((error as AxiosError<IHealthResponse>).response?.data.database).toBe(HealthStatus.DOWN);
56
+ });
57
+ });
58
+
59
+ describe('AbyssReflexCore facade of the Discord events', () => {
60
+ it('exposes the pure event helpers of the SDK', () => {
61
+ expect(intentsOf([])).toBe(0);
62
+ expect(typeof matchesEventFilters).toBe('function');
63
+ expect(typeof privilegedIntentsOf).toBe('function');
64
+ });
65
+
66
+ it('exposes the event, insights and bot limit routes under short names', () => {
67
+ const { service, function: fn } = AbyssReflexCore.sdk;
68
+ expect(Object.keys(service.discord.event)).toEqual(['list', 'create', 'update', 'delete']);
69
+ expect(Object.keys(service.discord.eventLog)).toEqual(['list']);
70
+ expect(Object.keys(service.insights)).toEqual(['get', 'events']);
71
+ expect(Object.keys(fn.insights)).toEqual(['get']);
72
+ expect(service.discord.connection.setAllocation).toBeInstanceOf(Function);
73
+ expect(Object.keys(service.discord.connection)).not.toContain('setBotSettings');
74
+ });
75
+ });
76
+
77
+ describe('AbyssReflexCore facade of the run understanding routes', () => {
78
+ it('exposes the application, route statistics and log cap routes under short names', () => {
79
+ const { application, service, function: fn } = AbyssReflexCore.sdk;
80
+ expect(Object.keys(application)).toEqual(['runSettings', 'insights', 'alertRule']);
81
+ expect(Object.keys(application.runSettings)).toEqual(['get', 'set']);
82
+ expect(Object.keys(application.insights)).toEqual(['get', 'calendar']);
83
+ expect(Object.keys(application.alertRule)).toEqual(['list', 'create', 'update', 'delete']);
84
+ expect(Object.keys(service.routeStats)).toEqual(['list', 'insights']);
85
+ expect(Object.keys(fn.logCap)).toEqual(['set']);
86
+ });
87
+ });
88
+
89
+ describe('AbyssReflexCore facade of the contract, the consumers and the limits', () => {
90
+ it('exposes the consumer, OpenAPI, limits and completion webhook routes under short names', () => {
91
+ const { service } = AbyssReflexCore.sdk;
92
+ expect(Object.keys(service.consumer)).toEqual([
93
+ 'list',
94
+ 'create',
95
+ 'update',
96
+ 'delete',
97
+ 'createKey',
98
+ 'revokeKey',
99
+ ]);
100
+ expect(Object.keys(service.openapi)).toEqual(['get']);
101
+ expect(Object.keys(service.limits)).toEqual(['list', 'set']);
102
+ expect(Object.keys(service.completionWebhook)).toEqual(['get', 'rotateSecret']);
103
+ });
104
+ });
package/src/index.ts CHANGED
@@ -21,6 +21,10 @@ import * as applicationRunSettingsApi from './api/application-run-settings.api';
21
21
  import * as applicationInsightsApi from './api/application-insights.api';
22
22
  import * as alertRuleApi from './api/alert-rule.api';
23
23
  import * as routeStatsApi from './api/route-stats.api';
24
+ import * as serviceConsumerApi from './api/service-consumer.api';
25
+ import * as serviceOpenApiApi from './api/service-openapi.api';
26
+ import * as serviceLimitsApi from './api/service-limits.api';
27
+ import * as serviceCompletionWebhookApi from './api/service-completion-webhook.api';
24
28
 
25
29
  export * from './api';
26
30
  export * from './types';
@@ -178,8 +182,6 @@ type AbyssReflexCoreSDK = {
178
182
  setEnvironment: typeof serviceDiscordApi.setServiceDiscordEnvironment;
179
183
  /** The lots of the reserve of events per minute the bot holds in an environment. */
180
184
  setAllocation: typeof serviceDiscordApi.setServiceDiscordAllocation;
181
- /** Credit overage, monthly spend cap and alerts of the bot in an environment. */
182
- setBotSettings: typeof serviceDiscordApi.setServiceDiscordBotSettings;
183
185
  check: typeof serviceDiscordApi.checkServiceDiscordConnection;
184
186
  };
185
187
  /** Pushes the interactions address and the commands to Discord again. */
@@ -203,6 +205,29 @@ type AbyssReflexCoreSDK = {
203
205
  /** Synchronizes the cron tasks of the version in service with Flow again. */
204
206
  sync: typeof serviceTaskApi.retryServiceScheduleSync;
205
207
  };
208
+ /** Who calls the API_KEY routes of the Service, and their keys. */
209
+ consumer: {
210
+ list: typeof serviceConsumerApi.listServiceConsumer;
211
+ create: typeof serviceConsumerApi.createServiceConsumer;
212
+ update: typeof serviceConsumerApi.updateServiceConsumer;
213
+ delete: typeof serviceConsumerApi.deleteServiceConsumer;
214
+ createKey: typeof serviceConsumerApi.createServiceConsumerKey;
215
+ revokeKey: typeof serviceConsumerApi.revokeServiceConsumerKey;
216
+ };
217
+ /** The OpenAPI 3.1 document of the routes of a version or of the draft. */
218
+ openapi: {
219
+ get: typeof serviceOpenApiApi.getServiceOpenApi;
220
+ };
221
+ /** Credits, monthly spend cap, alerts and stop of the Service in each environment, whatever its type. */
222
+ limits: {
223
+ list: typeof serviceLimitsApi.listServiceLimits;
224
+ set: typeof serviceLimitsApi.setServiceLimits;
225
+ };
226
+ /** The signing secrets of the completion webhook of the async executions. */
227
+ completionWebhook: {
228
+ get: typeof serviceCompletionWebhookApi.getServiceCompletionWebhook;
229
+ rotateSecret: typeof serviceCompletionWebhookApi.rotateServiceCompletionWebhookSecret;
230
+ };
206
231
  };
207
232
  };
208
233
 
@@ -349,7 +374,6 @@ export class AbyssReflexCore {
349
374
  setTokenSecret: serviceDiscordApi.setServiceDiscordTokenSecret,
350
375
  setEnvironment: serviceDiscordApi.setServiceDiscordEnvironment,
351
376
  setAllocation: serviceDiscordApi.setServiceDiscordAllocation,
352
- setBotSettings: serviceDiscordApi.setServiceDiscordBotSettings,
353
377
  check: serviceDiscordApi.checkServiceDiscordConnection,
354
378
  },
355
379
  sync: serviceDiscordApi.retryServiceDiscordSync,
@@ -369,6 +393,25 @@ export class AbyssReflexCore {
369
393
  },
370
394
  sync: serviceTaskApi.retryServiceScheduleSync,
371
395
  },
396
+ consumer: {
397
+ list: serviceConsumerApi.listServiceConsumer,
398
+ create: serviceConsumerApi.createServiceConsumer,
399
+ update: serviceConsumerApi.updateServiceConsumer,
400
+ delete: serviceConsumerApi.deleteServiceConsumer,
401
+ createKey: serviceConsumerApi.createServiceConsumerKey,
402
+ revokeKey: serviceConsumerApi.revokeServiceConsumerKey,
403
+ },
404
+ openapi: {
405
+ get: serviceOpenApiApi.getServiceOpenApi,
406
+ },
407
+ limits: {
408
+ list: serviceLimitsApi.listServiceLimits,
409
+ set: serviceLimitsApi.setServiceLimits,
410
+ },
411
+ completionWebhook: {
412
+ get: serviceCompletionWebhookApi.getServiceCompletionWebhook,
413
+ rotateSecret: serviceCompletionWebhookApi.rotateServiceCompletionWebhookSecret,
414
+ },
372
415
  },
373
416
  };
374
417
  }
@@ -1,11 +1,11 @@
1
- /**
2
- * State of a request to grant an access a function declares.
3
- * - PENDING: waiting for a member who holds the right the access needs.
4
- * - GRANTED: the access was granted (by the request or by another gesture).
5
- * - DISMISSED: set aside by a member with the right, or because the draft no longer declares the access.
6
- */
7
- export enum AccessRequestStatus {
8
- PENDING = 'PENDING',
9
- GRANTED = 'GRANTED',
10
- DISMISSED = 'DISMISSED',
11
- }
1
+ /**
2
+ * State of a request to grant an access a function declares.
3
+ * - PENDING: waiting for a member who holds the right the access needs.
4
+ * - GRANTED: the access was granted (by the request or by another gesture).
5
+ * - DISMISSED: set aside by a member with the right, or because the draft no longer declares the access.
6
+ */
7
+ export enum AccessRequestStatus {
8
+ PENDING = 'PENDING',
9
+ GRANTED = 'GRANTED',
10
+ DISMISSED = 'DISMISSED',
11
+ }
@@ -0,0 +1,9 @@
1
+ /** Where the completion webhook of an async execution stands. */
2
+ export enum CompletionDeliveryStatus {
3
+ /** Not sent yet, or waiting for its next attempt. */
4
+ PENDING = 'PENDING',
5
+ /** The receiver answered 2xx. */
6
+ DELIVERED = 'DELIVERED',
7
+ /** Given up: every attempt failed, or the receiver answered a status that is not retried. */
8
+ FAILED = 'FAILED',
9
+ }
@@ -47,3 +47,5 @@ export * from './reflex-alert-scope.enum';
47
47
  export * from './reflex-alert-metric.enum';
48
48
  export * from './reflex-alert-notification-state.enum';
49
49
  export * from './access-request-status.enum';
50
+ export * from './service-block-reason.enum';
51
+ export * from './completion-delivery-status.enum';
@@ -1,43 +1,73 @@
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
- /** 409: the Discord bot token has no value in this environment's Vault entry. */
26
- DISCORD_TOKEN_MISSING = 'DISCORD_TOKEN_MISSING',
27
- /** 409: Discord refused the bot token (401). */
28
- DISCORD_TOKEN_REJECTED = 'DISCORD_TOKEN_REJECTED',
29
- /** 409: a non-production environment needs a test server before a Discord bot goes live there. */
30
- DISCORD_TEST_GUILD_REQUIRED = 'DISCORD_TEST_GUILD_REQUIRED',
31
- /** 409: a command of that name already exists in the Service. */
32
- DISCORD_COMMAND_CONFLICT = 'DISCORD_COMMAND_CONFLICT',
33
- /** 409: the component prefix equals, starts or is started by another prefix of the Service. */
34
- DISCORD_COMPONENT_PREFIX_CONFLICT = 'DISCORD_COMPONENT_PREFIX_CONFLICT',
35
- /** 400: the field does not exist for this type of Service (CORS or rate limit on a Discord bot). */
36
- SERVICE_TYPE_FIELD_REFUSED = 'SERVICE_TYPE_FIELD_REFUSED',
37
- /** 400: a route path cannot start with `_abyss`, the segment the edge keeps for its own addresses (ticks of the cron tasks). */
38
- ROUTE_SEGMENT_RESERVED = 'ROUTE_SEGMENT_RESERVED',
39
- /** 409: the bot bills credit overage but the organization does not allow overage of the credits metric. */
40
- CREDIT_OVERAGE_NOT_ALLOWED = 'CREDIT_OVERAGE_NOT_ALLOWED',
41
- /** 409: the lots asked for do not fit in the event rate reserve of the organization (the sum of its allocations would go past it). */
42
- BOT_EVENT_RESERVE_EXCEEDED = 'BOT_EVENT_RESERVE_EXCEEDED',
43
- }
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
+ /** 409: the Discord bot token has no value in this environment's Vault entry. */
26
+ DISCORD_TOKEN_MISSING = 'DISCORD_TOKEN_MISSING',
27
+ /** 409: Discord refused the bot token (401). */
28
+ DISCORD_TOKEN_REJECTED = 'DISCORD_TOKEN_REJECTED',
29
+ /** 409: a non-production environment needs a test server before a Discord bot goes live there. */
30
+ DISCORD_TEST_GUILD_REQUIRED = 'DISCORD_TEST_GUILD_REQUIRED',
31
+ /** 409: a command of that name already exists in the Service. */
32
+ DISCORD_COMMAND_CONFLICT = 'DISCORD_COMMAND_CONFLICT',
33
+ /** 409: the component prefix equals, starts or is started by another prefix of the Service. */
34
+ DISCORD_COMPONENT_PREFIX_CONFLICT = 'DISCORD_COMPONENT_PREFIX_CONFLICT',
35
+ /** 400: the field does not exist for this type of Service (CORS or rate limit on a Discord bot). */
36
+ SERVICE_TYPE_FIELD_REFUSED = 'SERVICE_TYPE_FIELD_REFUSED',
37
+ /**
38
+ * 400: a route path cannot start with `_`: the edge keeps those paths for its own addresses (`_abyss` for the ticks
39
+ * of the cron tasks, `_executions` for the state of an async execution).
40
+ */
41
+ ROUTE_SEGMENT_RESERVED = 'ROUTE_SEGMENT_RESERVED',
42
+ /** 409: the bot bills credit overage but the organization does not allow overage of the credits metric. */
43
+ CREDIT_OVERAGE_NOT_ALLOWED = 'CREDIT_OVERAGE_NOT_ALLOWED',
44
+ /** 409: the lots asked for do not fit in the event rate reserve of the organization (the sum of its allocations would go past it). */
45
+ BOT_EVENT_RESERVE_EXCEEDED = 'BOT_EVENT_RESERVE_EXCEEDED',
46
+ /**
47
+ * 422 (edge): the body or the query of the request does not match the contract of the route; `error.errors` holds
48
+ * at most `REFLEX_CONTRACT_LIMITS.maxErrors` faults (`IReflexContractError`). Nothing ran, nothing is billed.
49
+ */
50
+ REQUEST_INVALID = 'REQUEST_INVALID',
51
+ /**
52
+ * 503 (edge): the credits of the organization are spent and the Service has no overage in this environment;
53
+ * `Retry-After` points at the first day of the next month (UTC). Nothing ran, nothing is billed.
54
+ */
55
+ CREDITS_EXHAUSTED = 'CREDITS_EXHAUSTED',
56
+ /**
57
+ * 503 (edge): the monthly spend cap of the Service in this environment is reached; `Retry-After` points at the
58
+ * first day of the next month (UTC), and raising the cap lifts the stop at the next computation. Nothing ran,
59
+ * nothing is billed.
60
+ */
61
+ BUDGET_REACHED = 'BUDGET_REACHED',
62
+ /** 400: the contract of a route is not a valid one; `error.details` holds each fault (`IReflexContractError`). */
63
+ CONTRACT_INVALID = 'CONTRACT_INVALID',
64
+ /** 409: the Service already has `REFLEX_CONSUMER_LIMITS.perService` consumers. */
65
+ CONSUMER_LIMIT_REACHED = 'CONSUMER_LIMIT_REACHED',
66
+ /** 409: the consumer already has `REFLEX_CONSUMER_LIMITS.activeKeysPerConsumer` keys that are not revoked. */
67
+ CONSUMER_KEY_LIMIT_REACHED = 'CONSUMER_KEY_LIMIT_REACHED',
68
+ /**
69
+ * 400: the completion webhook URL is refused: not `https`, a private or internal address, or a name that resolves
70
+ * to one or does not resolve.
71
+ */
72
+ COMPLETION_WEBHOOK_URL_REFUSED = 'COMPLETION_WEBHOOK_URL_REFUSED',
73
+ }
@@ -1,11 +1,16 @@
1
- export enum RunStatus {
2
- /** A live execution accepted and not finished yet (an async caller reads it by its id). */
3
- RUNNING = 'RUNNING',
4
- SUCCEEDED = 'SUCCEEDED',
5
- FAILED = 'FAILED',
6
- /**
7
- * A live execution stopped by the end of a pod of the edge or of the runner: offered (cost 0), kept in
8
- * the journal with its measures up to the interruption, left out of every statistic.
9
- */
10
- INTERRUPTED = 'INTERRUPTED',
11
- }
1
+ export enum RunStatus {
2
+ /** A live execution accepted and not finished yet (an async caller reads it by its id). */
3
+ RUNNING = 'RUNNING',
4
+ SUCCEEDED = 'SUCCEEDED',
5
+ FAILED = 'FAILED',
6
+ /**
7
+ * A live execution stopped by the end of a pod of the edge or of the runner: offered (cost 0), kept in
8
+ * the journal with its measures up to the interruption, left out of every statistic.
9
+ */
10
+ INTERRUPTED = 'INTERRUPTED',
11
+ /**
12
+ * A live call refused before anything ran: the request did not match the contract of its route
13
+ * (`errorCode` REQUEST_INVALID). Costs 0, has no measures, and is left out of every statistic.
14
+ */
15
+ REFUSED = 'REFUSED',
16
+ }