@abyss-project/reflex 5.7.0 → 5.8.1

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 (158) hide show
  1. package/.eslintrc.js +32 -32
  2. package/.prettierrc +5 -5
  3. package/README.md +15 -15
  4. package/dist/types/enum/discord-channel-type.enum.d.ts +7 -0
  5. package/dist/types/enum/discord-channel-type.enum.js +12 -0
  6. package/dist/types/enum/discord-channel-type.enum.js.map +1 -0
  7. package/dist/types/enum/discord-host-action.enum.d.ts +31 -0
  8. package/dist/types/enum/discord-host-action.enum.js +36 -0
  9. package/dist/types/enum/discord-host-action.enum.js.map +1 -0
  10. package/dist/types/enum/discord-locale.enum.d.ts +34 -0
  11. package/dist/types/enum/discord-locale.enum.js +39 -0
  12. package/dist/types/enum/discord-locale.enum.js.map +1 -0
  13. package/dist/types/enum/index.d.ts +3 -0
  14. package/dist/types/enum/index.js +3 -0
  15. package/dist/types/enum/index.js.map +1 -1
  16. package/dist/types/interface/api/requests/service-discord.request.d.ts +7 -1
  17. package/dist/types/interface/models/reflex-discord-event.model.js.map +1 -1
  18. package/dist/types/interface/models/reflex-discord.model.d.ts +22 -2
  19. package/dist/types/interface/models/reflex-discord.model.js +6 -1
  20. package/dist/types/interface/models/reflex-discord.model.js.map +1 -1
  21. package/jest.config.ts +11 -11
  22. package/package.json +1 -1
  23. package/src/api/function-access.api.ts +36 -36
  24. package/src/api/function-insights.api.test.ts +27 -27
  25. package/src/api/function-insights.api.ts +18 -18
  26. package/src/api/function-run.api.ts +38 -38
  27. package/src/api/function-settings.api.ts +59 -59
  28. package/src/api/function-test.api.ts +34 -34
  29. package/src/api/function-version.api.ts +48 -48
  30. package/src/api/function.api.test.ts +249 -249
  31. package/src/api/function.api.ts +62 -62
  32. package/src/api/health.api.ts +10 -10
  33. package/src/api/index.ts +17 -17
  34. package/src/api/service-configuration.api.ts +16 -16
  35. package/src/api/service-deployment.api.ts +79 -79
  36. package/src/api/service-discord-event.api.test.ts +106 -106
  37. package/src/api/service-discord-event.api.ts +78 -78
  38. package/src/api/service-discord.api.test.ts +197 -197
  39. package/src/api/service-discord.api.ts +241 -241
  40. package/src/api/service-insights.api.test.ts +36 -36
  41. package/src/api/service-insights.api.ts +42 -42
  42. package/src/api/service-route.api.ts +72 -72
  43. package/src/api/service-task.api.test.ts +140 -140
  44. package/src/api/service-task.api.ts +141 -141
  45. package/src/api/service-version.api.ts +54 -54
  46. package/src/api/service.api.test.ts +215 -215
  47. package/src/api/service.api.ts +55 -55
  48. package/src/discord/discord-event-filter-cases.ts +261 -261
  49. package/src/discord/discord-event-filters.test.ts +91 -91
  50. package/src/discord/discord-event-filters.ts +95 -95
  51. package/src/discord/discord-event-intents.test.ts +112 -112
  52. package/src/discord/discord-event-intents.ts +55 -55
  53. package/src/discord/index.ts +3 -3
  54. package/src/index.test.ts +75 -75
  55. package/src/index.ts +317 -317
  56. package/src/types/enum/access-grant-status.enum.ts +12 -12
  57. package/src/types/enum/access-kind.enum.ts +7 -7
  58. package/src/types/enum/bot-event-block-reason.enum.ts +7 -7
  59. package/src/types/enum/configuration-read-as.enum.ts +5 -5
  60. package/src/types/enum/discord-activity-type.enum.ts +9 -9
  61. package/src/types/enum/discord-channel-type.enum.ts +11 -0
  62. package/src/types/enum/discord-component-kind.enum.ts +7 -7
  63. package/src/types/enum/discord-event-drop-reason.enum.ts +13 -13
  64. package/src/types/enum/discord-event-filter-name.enum.ts +11 -11
  65. package/src/types/enum/discord-event-status.enum.ts +13 -13
  66. package/src/types/enum/discord-event-type.enum.ts +7 -7
  67. package/src/types/enum/discord-gateway-failure-code.enum.ts +11 -11
  68. package/src/types/enum/discord-gateway-state.enum.ts +11 -11
  69. package/src/types/enum/discord-host-action.enum.ts +35 -0
  70. package/src/types/enum/discord-locale.enum.ts +35 -0
  71. package/src/types/enum/discord-option-type.enum.ts +12 -12
  72. package/src/types/enum/discord-presence-status.enum.ts +8 -8
  73. package/src/types/enum/discord-sync-status.enum.ts +6 -6
  74. package/src/types/enum/discord-token-state.enum.ts +11 -11
  75. package/src/types/enum/execution-mode.enum.ts +9 -9
  76. package/src/types/enum/execution-profile.enum.ts +20 -20
  77. package/src/types/enum/execution-settings-source.enum.ts +9 -9
  78. package/src/types/enum/health-status.enum.ts +4 -4
  79. package/src/types/enum/index.ts +43 -40
  80. package/src/types/enum/insights-period.enum.ts +8 -8
  81. package/src/types/enum/reflex-error-code.enum.ts +43 -43
  82. package/src/types/enum/route-method.enum.ts +9 -9
  83. package/src/types/enum/run-log-level.enum.ts +6 -6
  84. package/src/types/enum/run-mode.enum.ts +11 -11
  85. package/src/types/enum/run-status.enum.ts +11 -11
  86. package/src/types/enum/run-step-status.enum.ts +7 -7
  87. package/src/types/enum/schedule-sync-status.enum.ts +6 -6
  88. package/src/types/enum/scheduled-run-failure-code.enum.ts +12 -12
  89. package/src/types/enum/scheduled-run-origin.enum.ts +5 -5
  90. package/src/types/enum/scheduled-run-status.enum.ts +17 -17
  91. package/src/types/enum/service-deployment-action.enum.ts +11 -11
  92. package/src/types/enum/service-deployment-status.enum.ts +5 -5
  93. package/src/types/enum/service-type.enum.ts +9 -9
  94. package/src/types/enum/service-version-change-kind.enum.ts +6 -6
  95. package/src/types/enum/trace-effect-type.enum.ts +12 -12
  96. package/src/types/enum/trigger-access-mode.enum.ts +12 -12
  97. package/src/types/enum/trigger-kind.enum.ts +8 -8
  98. package/src/types/enum/vault-value-source.enum.ts +12 -12
  99. package/src/types/enum/vault-visibility.enum.ts +5 -5
  100. package/src/types/index.ts +2 -2
  101. package/src/types/interface/api/index.ts +3 -3
  102. package/src/types/interface/api/requests/function-access.request.ts +25 -25
  103. package/src/types/interface/api/requests/function-run.request.ts +30 -30
  104. package/src/types/interface/api/requests/function-settings.request.ts +27 -27
  105. package/src/types/interface/api/requests/function-test.request.ts +39 -39
  106. package/src/types/interface/api/requests/function-version.request.ts +20 -20
  107. package/src/types/interface/api/requests/function.request.ts +36 -36
  108. package/src/types/interface/api/requests/index.ts +15 -15
  109. package/src/types/interface/api/requests/service-configuration.request.ts +4 -4
  110. package/src/types/interface/api/requests/service-deployment.request.ts +49 -49
  111. package/src/types/interface/api/requests/service-discord-event.request.ts +68 -68
  112. package/src/types/interface/api/requests/service-discord.request.ts +173 -161
  113. package/src/types/interface/api/requests/service-insights.request.ts +31 -31
  114. package/src/types/interface/api/requests/service-route.request.ts +44 -44
  115. package/src/types/interface/api/requests/service-task.request.ts +80 -80
  116. package/src/types/interface/api/requests/service-version.request.ts +24 -24
  117. package/src/types/interface/api/requests/service.request.ts +46 -46
  118. package/src/types/interface/api/response.ts +4 -4
  119. package/src/types/interface/api/responses/function-access.response.ts +17 -17
  120. package/src/types/interface/api/responses/function-run.response.ts +18 -18
  121. package/src/types/interface/api/responses/function-settings.response.ts +36 -36
  122. package/src/types/interface/api/responses/function-test.response.ts +12 -12
  123. package/src/types/interface/api/responses/function-version.response.ts +31 -31
  124. package/src/types/interface/api/responses/function.response.ts +25 -25
  125. package/src/types/interface/api/responses/index.ts +15 -15
  126. package/src/types/interface/api/responses/service-configuration.response.ts +8 -8
  127. package/src/types/interface/api/responses/service-deployment.response.ts +32 -32
  128. package/src/types/interface/api/responses/service-discord-event.response.ts +24 -24
  129. package/src/types/interface/api/responses/service-discord.response.ts +122 -122
  130. package/src/types/interface/api/responses/service-insights.response.ts +11 -11
  131. package/src/types/interface/api/responses/service-route.response.ts +31 -31
  132. package/src/types/interface/api/responses/service-task.response.ts +57 -57
  133. package/src/types/interface/api/responses/service-version.response.ts +106 -106
  134. package/src/types/interface/api/responses/service.response.ts +31 -31
  135. package/src/types/interface/health.response.ts +7 -7
  136. package/src/types/interface/index.ts +3 -3
  137. package/src/types/interface/models/index.ts +19 -19
  138. package/src/types/interface/models/reflex-access-grant.model.ts +14 -14
  139. package/src/types/interface/models/reflex-bot-limits.model.ts +92 -92
  140. package/src/types/interface/models/reflex-definition.model.ts +31 -31
  141. package/src/types/interface/models/reflex-discord-event-log.model.ts +58 -58
  142. package/src/types/interface/models/reflex-discord-event.model.ts +79 -78
  143. package/src/types/interface/models/reflex-discord.model.ts +54 -4
  144. package/src/types/interface/models/reflex-execution-settings.model.ts +50 -50
  145. package/src/types/interface/models/reflex-function-version.model.ts +14 -14
  146. package/src/types/interface/models/reflex-function.model.ts +16 -16
  147. package/src/types/interface/models/reflex-insights.model.ts +120 -120
  148. package/src/types/interface/models/reflex-price-list.model.ts +20 -20
  149. package/src/types/interface/models/reflex-route.model.ts +19 -19
  150. package/src/types/interface/models/reflex-run.model.ts +186 -186
  151. package/src/types/interface/models/reflex-service-configuration.model.ts +22 -22
  152. package/src/types/interface/models/reflex-service-deployment.model.ts +46 -46
  153. package/src/types/interface/models/reflex-service-version.model.ts +61 -61
  154. package/src/types/interface/models/reflex-service.model.ts +45 -45
  155. package/src/types/interface/models/reflex-step-stats.model.ts +35 -35
  156. package/src/types/interface/models/reflex-task.model.ts +97 -97
  157. package/tsconfig.check.json +15 -15
  158. package/tsconfig.json +35 -35
@@ -1,38 +1,38 @@
1
- import { AbyssReflexCore } from '..';
2
- import type {
3
- IGetFunctionRunParams,
4
- IGetFunctionRunResponse,
5
- IGetFunctionRunStateParams,
6
- IGetFunctionRunStateResponse,
7
- IListFunctionRunParams,
8
- IListFunctionRunQuery,
9
- IListFunctionRunResponse,
10
- } from '../types';
11
-
12
- const runUrl = (params: { applicationId: string; functionId: string }): string =>
13
- `api/function/${params.applicationId}/${params.functionId}/run`;
14
-
15
- /** `GET .../run`: the test runs (kept: the last 10, then 7 days) and the live executions of the edge (7 days), merged, newest first, paged by `limit`/`offset`. Needs REFLEX_LOG_READ. */
16
- export const listFunctionRun = async (
17
- params: IListFunctionRunParams,
18
- query: IListFunctionRunQuery = {},
19
- ): Promise<IListFunctionRunResponse> =>
20
- (await AbyssReflexCore.axios.get<IListFunctionRunResponse>(runUrl(params), { params: query }))
21
- .data;
22
-
23
- /** `GET .../run/:runId`: one run; a live one with its measures and its steps. Needs REFLEX_LOG_READ. */
24
- export const getFunctionRun = async (
25
- params: IGetFunctionRunParams,
26
- ): Promise<IGetFunctionRunResponse> =>
27
- (await AbyssReflexCore.axios.get<IGetFunctionRunResponse>(`${runUrl(params)}/${params.runId}`))
28
- .data;
29
-
30
- /** `GET .../run/:runId/state`: the state of a live execution, the one an async route answered with. Needs REFLEX_LOG_READ. */
31
- export const getFunctionRunState = async (
32
- params: IGetFunctionRunStateParams,
33
- ): Promise<IGetFunctionRunStateResponse> =>
34
- (
35
- await AbyssReflexCore.axios.get<IGetFunctionRunStateResponse>(
36
- `${runUrl(params)}/${params.runId}/state`,
37
- )
38
- ).data;
1
+ import { AbyssReflexCore } from '..';
2
+ import type {
3
+ IGetFunctionRunParams,
4
+ IGetFunctionRunResponse,
5
+ IGetFunctionRunStateParams,
6
+ IGetFunctionRunStateResponse,
7
+ IListFunctionRunParams,
8
+ IListFunctionRunQuery,
9
+ IListFunctionRunResponse,
10
+ } from '../types';
11
+
12
+ const runUrl = (params: { applicationId: string; functionId: string }): string =>
13
+ `api/function/${params.applicationId}/${params.functionId}/run`;
14
+
15
+ /** `GET .../run`: the test runs (kept: the last 10, then 7 days) and the live executions of the edge (7 days), merged, newest first, paged by `limit`/`offset`. Needs REFLEX_LOG_READ. */
16
+ export const listFunctionRun = async (
17
+ params: IListFunctionRunParams,
18
+ query: IListFunctionRunQuery = {},
19
+ ): Promise<IListFunctionRunResponse> =>
20
+ (await AbyssReflexCore.axios.get<IListFunctionRunResponse>(runUrl(params), { params: query }))
21
+ .data;
22
+
23
+ /** `GET .../run/:runId`: one run; a live one with its measures and its steps. Needs REFLEX_LOG_READ. */
24
+ export const getFunctionRun = async (
25
+ params: IGetFunctionRunParams,
26
+ ): Promise<IGetFunctionRunResponse> =>
27
+ (await AbyssReflexCore.axios.get<IGetFunctionRunResponse>(`${runUrl(params)}/${params.runId}`))
28
+ .data;
29
+
30
+ /** `GET .../run/:runId/state`: the state of a live execution, the one an async route answered with. Needs REFLEX_LOG_READ. */
31
+ export const getFunctionRunState = async (
32
+ params: IGetFunctionRunStateParams,
33
+ ): Promise<IGetFunctionRunStateResponse> =>
34
+ (
35
+ await AbyssReflexCore.axios.get<IGetFunctionRunStateResponse>(
36
+ `${runUrl(params)}/${params.runId}/state`,
37
+ )
38
+ ).data;
@@ -1,59 +1,59 @@
1
- import { AbyssReflexCore } from '..';
2
- import type {
3
- IGetFunctionSettingsParams,
4
- IGetFunctionSettingsResponse,
5
- IRemoveFunctionEnvironmentSettingsParams,
6
- IRemoveFunctionEnvironmentSettingsResponse,
7
- ISetFunctionDefaultSettingsBody,
8
- ISetFunctionDefaultSettingsParams,
9
- ISetFunctionDefaultSettingsResponse,
10
- ISetFunctionEnvironmentSettingsBody,
11
- ISetFunctionEnvironmentSettingsParams,
12
- ISetFunctionEnvironmentSettingsResponse,
13
- } from '../types';
14
-
15
- const settingsUrl = (params: { applicationId: string; functionId: string }): string =>
16
- `api/function/${params.applicationId}/${params.functionId}/settings`;
17
-
18
- /** `GET .../settings`: the default, the overrides, and what each environment runs with. Needs REFLEX_READ. */
19
- export const getFunctionSettings = async (
20
- params: IGetFunctionSettingsParams,
21
- ): Promise<IGetFunctionSettingsResponse> =>
22
- (await AbyssReflexCore.axios.get<IGetFunctionSettingsResponse>(settingsUrl(params))).data;
23
-
24
- /**
25
- * `PUT .../settings`: sets the default of every environment without an override, applied at once where the
26
- * function runs. Needs REFLEX_FUNCTION_UPDATE, and REFLEX_PUBLISH_PRODUCTION when the default applies to a
27
- * production environment where the function runs.
28
- */
29
- export const setFunctionDefaultSettings = async (
30
- params: ISetFunctionDefaultSettingsParams,
31
- body: ISetFunctionDefaultSettingsBody,
32
- ): Promise<ISetFunctionDefaultSettingsResponse> =>
33
- (await AbyssReflexCore.axios.put<ISetFunctionDefaultSettingsResponse>(settingsUrl(params), body))
34
- .data;
35
-
36
- /**
37
- * `PUT .../settings/:environmentId`: sets the override of one environment. Needs REFLEX_FUNCTION_UPDATE, and
38
- * REFLEX_PUBLISH_PRODUCTION for a production environment.
39
- */
40
- export const setFunctionEnvironmentSettings = async (
41
- params: ISetFunctionEnvironmentSettingsParams,
42
- body: ISetFunctionEnvironmentSettingsBody,
43
- ): Promise<ISetFunctionEnvironmentSettingsResponse> =>
44
- (
45
- await AbyssReflexCore.axios.put<ISetFunctionEnvironmentSettingsResponse>(
46
- `${settingsUrl(params)}/${params.environmentId}`,
47
- body,
48
- )
49
- ).data;
50
-
51
- /** `DELETE .../settings/:environmentId`: the environment falls back on the default. Same rights as setting it. */
52
- export const removeFunctionEnvironmentSettings = async (
53
- params: IRemoveFunctionEnvironmentSettingsParams,
54
- ): Promise<IRemoveFunctionEnvironmentSettingsResponse> =>
55
- (
56
- await AbyssReflexCore.axios.delete<IRemoveFunctionEnvironmentSettingsResponse>(
57
- `${settingsUrl(params)}/${params.environmentId}`,
58
- )
59
- ).data;
1
+ import { AbyssReflexCore } from '..';
2
+ import type {
3
+ IGetFunctionSettingsParams,
4
+ IGetFunctionSettingsResponse,
5
+ IRemoveFunctionEnvironmentSettingsParams,
6
+ IRemoveFunctionEnvironmentSettingsResponse,
7
+ ISetFunctionDefaultSettingsBody,
8
+ ISetFunctionDefaultSettingsParams,
9
+ ISetFunctionDefaultSettingsResponse,
10
+ ISetFunctionEnvironmentSettingsBody,
11
+ ISetFunctionEnvironmentSettingsParams,
12
+ ISetFunctionEnvironmentSettingsResponse,
13
+ } from '../types';
14
+
15
+ const settingsUrl = (params: { applicationId: string; functionId: string }): string =>
16
+ `api/function/${params.applicationId}/${params.functionId}/settings`;
17
+
18
+ /** `GET .../settings`: the default, the overrides, and what each environment runs with. Needs REFLEX_READ. */
19
+ export const getFunctionSettings = async (
20
+ params: IGetFunctionSettingsParams,
21
+ ): Promise<IGetFunctionSettingsResponse> =>
22
+ (await AbyssReflexCore.axios.get<IGetFunctionSettingsResponse>(settingsUrl(params))).data;
23
+
24
+ /**
25
+ * `PUT .../settings`: sets the default of every environment without an override, applied at once where the
26
+ * function runs. Needs REFLEX_FUNCTION_UPDATE, and REFLEX_PUBLISH_PRODUCTION when the default applies to a
27
+ * production environment where the function runs.
28
+ */
29
+ export const setFunctionDefaultSettings = async (
30
+ params: ISetFunctionDefaultSettingsParams,
31
+ body: ISetFunctionDefaultSettingsBody,
32
+ ): Promise<ISetFunctionDefaultSettingsResponse> =>
33
+ (await AbyssReflexCore.axios.put<ISetFunctionDefaultSettingsResponse>(settingsUrl(params), body))
34
+ .data;
35
+
36
+ /**
37
+ * `PUT .../settings/:environmentId`: sets the override of one environment. Needs REFLEX_FUNCTION_UPDATE, and
38
+ * REFLEX_PUBLISH_PRODUCTION for a production environment.
39
+ */
40
+ export const setFunctionEnvironmentSettings = async (
41
+ params: ISetFunctionEnvironmentSettingsParams,
42
+ body: ISetFunctionEnvironmentSettingsBody,
43
+ ): Promise<ISetFunctionEnvironmentSettingsResponse> =>
44
+ (
45
+ await AbyssReflexCore.axios.put<ISetFunctionEnvironmentSettingsResponse>(
46
+ `${settingsUrl(params)}/${params.environmentId}`,
47
+ body,
48
+ )
49
+ ).data;
50
+
51
+ /** `DELETE .../settings/:environmentId`: the environment falls back on the default. Same rights as setting it. */
52
+ export const removeFunctionEnvironmentSettings = async (
53
+ params: IRemoveFunctionEnvironmentSettingsParams,
54
+ ): Promise<IRemoveFunctionEnvironmentSettingsResponse> =>
55
+ (
56
+ await AbyssReflexCore.axios.delete<IRemoveFunctionEnvironmentSettingsResponse>(
57
+ `${settingsUrl(params)}/${params.environmentId}`,
58
+ )
59
+ ).data;
@@ -1,34 +1,34 @@
1
- import { AbyssReflexCore } from '..';
2
- import type {
3
- IDryRunFunctionBody,
4
- IDryRunFunctionResponse,
5
- IFunctionTestParams,
6
- ISimulateFunctionBody,
7
- ISimulateFunctionResponse,
8
- } from '../types';
9
-
10
- const testUrl = (params: IFunctionTestParams): string =>
11
- `api/function/${params.applicationId}/${params.functionId}/test`;
12
-
13
- /**
14
- * `POST .../test/simulate`: runs the draft on a made-up event, in the environment `body.environmentId`.
15
- * Nothing is executed: HTTP steps get the stub they are given, the Store is a scratch copy thrown away.
16
- * Needs REFLEX_TEST_RUN.
17
- */
18
- export const simulateFunction = async (
19
- params: IFunctionTestParams,
20
- body: ISimulateFunctionBody,
21
- ): Promise<ISimulateFunctionResponse> =>
22
- (await AbyssReflexCore.axios.post<ISimulateFunctionResponse>(`${testUrl(params)}/simulate`, body))
23
- .data;
24
-
25
- /**
26
- * `POST .../test/dry-run`: like a simulation, but the Store of the environment `body.environmentId` is
27
- * read for real; writes are recorded and not done. Needs REFLEX_TEST_RUN.
28
- */
29
- export const dryRunFunction = async (
30
- params: IFunctionTestParams,
31
- body: IDryRunFunctionBody,
32
- ): Promise<IDryRunFunctionResponse> =>
33
- (await AbyssReflexCore.axios.post<IDryRunFunctionResponse>(`${testUrl(params)}/dry-run`, body))
34
- .data;
1
+ import { AbyssReflexCore } from '..';
2
+ import type {
3
+ IDryRunFunctionBody,
4
+ IDryRunFunctionResponse,
5
+ IFunctionTestParams,
6
+ ISimulateFunctionBody,
7
+ ISimulateFunctionResponse,
8
+ } from '../types';
9
+
10
+ const testUrl = (params: IFunctionTestParams): string =>
11
+ `api/function/${params.applicationId}/${params.functionId}/test`;
12
+
13
+ /**
14
+ * `POST .../test/simulate`: runs the draft on a made-up event, in the environment `body.environmentId`.
15
+ * Nothing is executed: HTTP steps get the stub they are given, the Store is a scratch copy thrown away.
16
+ * Needs REFLEX_TEST_RUN.
17
+ */
18
+ export const simulateFunction = async (
19
+ params: IFunctionTestParams,
20
+ body: ISimulateFunctionBody,
21
+ ): Promise<ISimulateFunctionResponse> =>
22
+ (await AbyssReflexCore.axios.post<ISimulateFunctionResponse>(`${testUrl(params)}/simulate`, body))
23
+ .data;
24
+
25
+ /**
26
+ * `POST .../test/dry-run`: like a simulation, but the Store of the environment `body.environmentId` is
27
+ * read for real; writes are recorded and not done. Needs REFLEX_TEST_RUN.
28
+ */
29
+ export const dryRunFunction = async (
30
+ params: IFunctionTestParams,
31
+ body: IDryRunFunctionBody,
32
+ ): Promise<IDryRunFunctionResponse> =>
33
+ (await AbyssReflexCore.axios.post<IDryRunFunctionResponse>(`${testUrl(params)}/dry-run`, body))
34
+ .data;
@@ -1,48 +1,48 @@
1
- import { AbyssReflexCore } from '..';
2
- import type {
3
- IGetFunctionVersionParams,
4
- IGetFunctionVersionResponse,
5
- IGetFunctionVersionStepStatsParams,
6
- IGetFunctionVersionStepStatsQuery,
7
- IGetFunctionVersionStepStatsResponse,
8
- IListFunctionVersionParams,
9
- IListFunctionVersionResponse,
10
- } from '../types';
11
-
12
- const versionUrl = (params: { applicationId: string; functionId: string }): string =>
13
- `api/function/${params.applicationId}/${params.functionId}/version`;
14
-
15
- /**
16
- * `GET .../version`: the frozen versions, newest first. Needs REFLEX_READ. A version of the function's
17
- * Service publishes its draft when it changed (`service.version.create`).
18
- */
19
- export const listFunctionVersion = async (
20
- params: IListFunctionVersionParams,
21
- ): Promise<IListFunctionVersionResponse> =>
22
- (await AbyssReflexCore.axios.get<IListFunctionVersionResponse>(versionUrl(params))).data;
23
-
24
- /** `GET .../version/:versionId`. Needs REFLEX_READ. */
25
- export const getFunctionVersion = async (
26
- params: IGetFunctionVersionParams,
27
- ): Promise<IGetFunctionVersionResponse> =>
28
- (
29
- await AbyssReflexCore.axios.get<IGetFunctionVersionResponse>(
30
- `${versionUrl(params)}/${params.versionId}`,
31
- )
32
- ).data;
33
-
34
- /**
35
- * `GET .../version/:versionId/step-stats`: per step, over the retention window, the executions, the median
36
- * and p95 of duration, CPU, heap peak and cost, and the share of the cost; interrupted executions left
37
- * out. With `environmentId`, also the p99 heap peak per step of the version running there. Needs REFLEX_LOG_READ.
38
- */
39
- export const getFunctionVersionStepStats = async (
40
- params: IGetFunctionVersionStepStatsParams,
41
- query: IGetFunctionVersionStepStatsQuery = {},
42
- ): Promise<IGetFunctionVersionStepStatsResponse> =>
43
- (
44
- await AbyssReflexCore.axios.get<IGetFunctionVersionStepStatsResponse>(
45
- `${versionUrl(params)}/${params.versionId}/step-stats`,
46
- { params: query },
47
- )
48
- ).data;
1
+ import { AbyssReflexCore } from '..';
2
+ import type {
3
+ IGetFunctionVersionParams,
4
+ IGetFunctionVersionResponse,
5
+ IGetFunctionVersionStepStatsParams,
6
+ IGetFunctionVersionStepStatsQuery,
7
+ IGetFunctionVersionStepStatsResponse,
8
+ IListFunctionVersionParams,
9
+ IListFunctionVersionResponse,
10
+ } from '../types';
11
+
12
+ const versionUrl = (params: { applicationId: string; functionId: string }): string =>
13
+ `api/function/${params.applicationId}/${params.functionId}/version`;
14
+
15
+ /**
16
+ * `GET .../version`: the frozen versions, newest first. Needs REFLEX_READ. A version of the function's
17
+ * Service publishes its draft when it changed (`service.version.create`).
18
+ */
19
+ export const listFunctionVersion = async (
20
+ params: IListFunctionVersionParams,
21
+ ): Promise<IListFunctionVersionResponse> =>
22
+ (await AbyssReflexCore.axios.get<IListFunctionVersionResponse>(versionUrl(params))).data;
23
+
24
+ /** `GET .../version/:versionId`. Needs REFLEX_READ. */
25
+ export const getFunctionVersion = async (
26
+ params: IGetFunctionVersionParams,
27
+ ): Promise<IGetFunctionVersionResponse> =>
28
+ (
29
+ await AbyssReflexCore.axios.get<IGetFunctionVersionResponse>(
30
+ `${versionUrl(params)}/${params.versionId}`,
31
+ )
32
+ ).data;
33
+
34
+ /**
35
+ * `GET .../version/:versionId/step-stats`: per step, over the retention window, the executions, the median
36
+ * and p95 of duration, CPU, heap peak and cost, and the share of the cost; interrupted executions left
37
+ * out. With `environmentId`, also the p99 heap peak per step of the version running there. Needs REFLEX_LOG_READ.
38
+ */
39
+ export const getFunctionVersionStepStats = async (
40
+ params: IGetFunctionVersionStepStatsParams,
41
+ query: IGetFunctionVersionStepStatsQuery = {},
42
+ ): Promise<IGetFunctionVersionStepStatsResponse> =>
43
+ (
44
+ await AbyssReflexCore.axios.get<IGetFunctionVersionStepStatsResponse>(
45
+ `${versionUrl(params)}/${params.versionId}/step-stats`,
46
+ { params: query },
47
+ )
48
+ ).data;