@abyss-project/reflex 6.1.0 → 6.3.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 (117) hide show
  1. package/.eslintrc.js +32 -32
  2. package/README.md +15 -15
  3. package/dist/api/function-run.api.d.ts +1 -2
  4. package/dist/api/function-run.api.js +1 -3
  5. package/dist/api/function-run.api.js.map +1 -1
  6. package/dist/api/function-settings.api.d.ts +1 -3
  7. package/dist/api/function-settings.api.js +1 -7
  8. package/dist/api/function-settings.api.js.map +1 -1
  9. package/dist/index.d.ts +0 -5
  10. package/dist/index.js +0 -5
  11. package/dist/index.js.map +1 -1
  12. package/dist/types/enum/discord-host-action.enum.d.ts +3 -1
  13. package/dist/types/enum/discord-host-action.enum.js +2 -0
  14. package/dist/types/enum/discord-host-action.enum.js.map +1 -1
  15. package/dist/types/enum/reflex-error-code.enum.d.ts +1 -2
  16. package/dist/types/enum/reflex-error-code.enum.js +0 -1
  17. package/dist/types/enum/reflex-error-code.enum.js.map +1 -1
  18. package/dist/types/interface/api/requests/application-run-settings.request.d.ts +0 -1
  19. package/dist/types/interface/api/requests/function-run.request.d.ts +0 -8
  20. package/dist/types/interface/api/requests/function-settings.request.d.ts +0 -12
  21. package/dist/types/interface/api/requests/service-discord.request.d.ts +1 -0
  22. package/dist/types/interface/api/requests/service.request.d.ts +0 -1
  23. package/dist/types/interface/api/responses/function-run.response.d.ts +0 -4
  24. package/dist/types/interface/api/responses/function-settings.response.d.ts +1 -5
  25. package/dist/types/interface/models/index.d.ts +0 -2
  26. package/dist/types/interface/models/index.js +0 -2
  27. package/dist/types/interface/models/index.js.map +1 -1
  28. package/dist/types/interface/models/reflex-discord.model.d.ts +5 -0
  29. package/dist/types/interface/models/reflex-discord.model.js +2 -0
  30. package/dist/types/interface/models/reflex-discord.model.js.map +1 -1
  31. package/dist/types/interface/models/reflex-price-list.model.d.ts +1 -0
  32. package/dist/types/interface/models/reflex-run-settings.model.d.ts +0 -4
  33. package/dist/types/interface/models/reflex-run.model.d.ts +0 -5
  34. package/dist/types/interface/models/reflex-service-deployment.model.d.ts +2 -2
  35. package/dist/types/interface/models/reflex-service.model.d.ts +0 -1
  36. package/jest.config.ts +11 -11
  37. package/package.json +1 -1
  38. package/src/api/alert-rule.api.test.ts +72 -72
  39. package/src/api/alert-rule.api.ts +57 -57
  40. package/src/api/application-insights.api.test.ts +42 -42
  41. package/src/api/application-insights.api.ts +38 -38
  42. package/src/api/application-run-settings.api.test.ts +0 -11
  43. package/src/api/application-run-settings.api.ts +30 -30
  44. package/src/api/function-access.api.ts +87 -87
  45. package/src/api/function-insights.api.test.ts +27 -27
  46. package/src/api/function-insights.api.ts +18 -18
  47. package/src/api/function-run.api.ts +0 -15
  48. package/src/api/function-settings.api.ts +0 -22
  49. package/src/api/function-template.api.test.ts +72 -72
  50. package/src/api/function-template.api.ts +52 -52
  51. package/src/api/function-test.api.ts +34 -34
  52. package/src/api/function-version.api.ts +66 -66
  53. package/src/api/function.api.test.ts +0 -55
  54. package/src/api/function.api.ts +62 -62
  55. package/src/api/health.api.ts +10 -10
  56. package/src/api/index.ts +26 -26
  57. package/src/api/route-stats.api.test.ts +45 -45
  58. package/src/api/route-stats.api.ts +36 -36
  59. package/src/api/service-completion-webhook.api.test.ts +97 -97
  60. package/src/api/service-completion-webhook.api.ts +39 -39
  61. package/src/api/service-configuration.api.ts +16 -16
  62. package/src/api/service-consumer.api.test.ts +104 -104
  63. package/src/api/service-consumer.api.ts +90 -90
  64. package/src/api/service-deployment.api.ts +79 -79
  65. package/src/api/service-discord-event.api.test.ts +106 -106
  66. package/src/api/service-discord-event.api.ts +78 -78
  67. package/src/api/service-discord.api.test.ts +178 -178
  68. package/src/api/service-discord.api.ts +222 -222
  69. package/src/api/service-insights.api.test.ts +36 -36
  70. package/src/api/service-insights.api.ts +42 -42
  71. package/src/api/service-limits.api.test.ts +100 -100
  72. package/src/api/service-limits.api.ts +37 -37
  73. package/src/api/service-openapi.api.test.ts +52 -52
  74. package/src/api/service-openapi.api.ts +21 -21
  75. package/src/api/service-route.api.ts +74 -74
  76. package/src/api/service-task.api.test.ts +140 -140
  77. package/src/api/service-task.api.ts +141 -141
  78. package/src/api/service-version.api.ts +54 -54
  79. package/src/api/service.api.test.ts +1 -6
  80. package/src/api/service.api.ts +55 -55
  81. package/src/discord/discord-event-filter-cases.ts +261 -261
  82. package/src/discord/discord-event-filters.test.ts +91 -91
  83. package/src/discord/discord-event-filters.ts +95 -95
  84. package/src/discord/discord-event-intents.test.ts +112 -112
  85. package/src/discord/discord-event-intents.ts +55 -55
  86. package/src/discord/index.ts +3 -3
  87. package/src/index.test.ts +104 -104
  88. package/src/index.ts +0 -12
  89. package/src/insights/index.ts +1 -1
  90. package/src/insights/percentiles.test.ts +75 -75
  91. package/src/insights/percentiles.ts +37 -37
  92. package/src/types/enum/discord-host-action.enum.ts +2 -0
  93. package/src/types/enum/reflex-error-code.enum.ts +0 -5
  94. package/src/types/interface/api/requests/application-run-settings.request.ts +0 -2
  95. package/src/types/interface/api/requests/function-run.request.ts +0 -10
  96. package/src/types/interface/api/requests/function-settings.request.ts +0 -16
  97. package/src/types/interface/api/requests/service-discord.request.ts +6 -0
  98. package/src/types/interface/api/requests/service.request.ts +0 -2
  99. package/src/types/interface/api/responses/function-run.response.ts +0 -5
  100. package/src/types/interface/api/responses/function-settings.response.ts +0 -7
  101. package/src/types/interface/models/index.ts +0 -2
  102. package/src/types/interface/models/reflex-discord.model.ts +12 -0
  103. package/src/types/interface/models/reflex-price-list.model.ts +2 -0
  104. package/src/types/interface/models/reflex-run-settings.model.ts +0 -11
  105. package/src/types/interface/models/reflex-run.model.ts +0 -10
  106. package/src/types/interface/models/reflex-service-deployment.model.ts +2 -4
  107. package/src/types/interface/models/reflex-service.model.ts +0 -2
  108. package/tsconfig.check.json +15 -15
  109. package/tsconfig.json +35 -35
  110. package/dist/types/interface/models/reflex-run-retention.model.d.ts +0 -13
  111. package/dist/types/interface/models/reflex-run-retention.model.js +0 -8
  112. package/dist/types/interface/models/reflex-run-retention.model.js.map +0 -1
  113. package/dist/types/interface/models/reflex-storage-surplus.model.d.ts +0 -11
  114. package/dist/types/interface/models/reflex-storage-surplus.model.js +0 -3
  115. package/dist/types/interface/models/reflex-storage-surplus.model.js.map +0 -1
  116. package/src/types/interface/models/reflex-run-retention.model.ts +0 -24
  117. package/src/types/interface/models/reflex-storage-surplus.model.ts +0 -23
@@ -1,66 +1,66 @@
1
- import { AbyssReflexCore } from '..';
2
- import type {
3
- IGetFunctionVersionParams,
4
- IGetFunctionVersionResponse,
5
- IGetFunctionVersionStepStatsParams,
6
- IGetFunctionVersionStepStatsQuery,
7
- IGetFunctionVersionStepStatsResponse,
8
- IListFunctionVersionParams,
9
- IListFunctionVersionQuery,
10
- IOpenFunctionVersionParams,
11
- IOpenFunctionVersionResponse,
12
- IListFunctionVersionResponse,
13
- } from '../types';
14
-
15
- const versionUrl = (params: { applicationId: string; functionId: string }): string =>
16
- `api/function/${params.applicationId}/${params.functionId}/version`;
17
-
18
- /**
19
- * `GET .../version`: the frozen versions, newest first, one page of those matching the filters. Needs REFLEX_READ. A version of the function's
20
- * Service publishes its draft when it changed (`service.version.create`).
21
- */
22
- export const listFunctionVersion = async (
23
- params: IListFunctionVersionParams,
24
- query: IListFunctionVersionQuery = {},
25
- ): Promise<IListFunctionVersionResponse> =>
26
- (
27
- await AbyssReflexCore.axios.get<IListFunctionVersionResponse>(versionUrl(params), {
28
- params: query,
29
- })
30
- ).data;
31
-
32
- /** `GET .../version/:versionId`. Needs REFLEX_READ. */
33
- export const getFunctionVersion = async (
34
- params: IGetFunctionVersionParams,
35
- ): Promise<IGetFunctionVersionResponse> =>
36
- (
37
- await AbyssReflexCore.axios.get<IGetFunctionVersionResponse>(
38
- `${versionUrl(params)}/${params.versionId}`,
39
- )
40
- ).data;
41
-
42
- /**
43
- * `GET .../version/:versionId/step-stats`: per step, over the retention window, the executions, the median
44
- * and p95 of duration, CPU, heap peak and cost, and the share of the cost; interrupted executions left
45
- * out. With `environmentId`, also the p99 heap peak per step of the version running there. Needs REFLEX_LOG_READ.
46
- */
47
- export const getFunctionVersionStepStats = async (
48
- params: IGetFunctionVersionStepStatsParams,
49
- query: IGetFunctionVersionStepStatsQuery = {},
50
- ): Promise<IGetFunctionVersionStepStatsResponse> =>
51
- (
52
- await AbyssReflexCore.axios.get<IGetFunctionVersionStepStatsResponse>(
53
- `${versionUrl(params)}/${params.versionId}/step-stats`,
54
- { params: query },
55
- )
56
- ).data;
57
-
58
- /** `POST .../version/:versionId/open`: replaces the draft with the definition of the version and records it as the base of the draft. Needs REFLEX_FUNCTION_UPDATE. */
59
- export const openFunctionVersion = async (
60
- params: IOpenFunctionVersionParams,
61
- ): Promise<IOpenFunctionVersionResponse> =>
62
- (
63
- await AbyssReflexCore.axios.post<IOpenFunctionVersionResponse>(
64
- `${versionUrl(params)}/${params.versionId}/open`,
65
- )
66
- ).data;
1
+ import { AbyssReflexCore } from '..';
2
+ import type {
3
+ IGetFunctionVersionParams,
4
+ IGetFunctionVersionResponse,
5
+ IGetFunctionVersionStepStatsParams,
6
+ IGetFunctionVersionStepStatsQuery,
7
+ IGetFunctionVersionStepStatsResponse,
8
+ IListFunctionVersionParams,
9
+ IListFunctionVersionQuery,
10
+ IOpenFunctionVersionParams,
11
+ IOpenFunctionVersionResponse,
12
+ IListFunctionVersionResponse,
13
+ } from '../types';
14
+
15
+ const versionUrl = (params: { applicationId: string; functionId: string }): string =>
16
+ `api/function/${params.applicationId}/${params.functionId}/version`;
17
+
18
+ /**
19
+ * `GET .../version`: the frozen versions, newest first, one page of those matching the filters. Needs REFLEX_READ. A version of the function's
20
+ * Service publishes its draft when it changed (`service.version.create`).
21
+ */
22
+ export const listFunctionVersion = async (
23
+ params: IListFunctionVersionParams,
24
+ query: IListFunctionVersionQuery = {},
25
+ ): Promise<IListFunctionVersionResponse> =>
26
+ (
27
+ await AbyssReflexCore.axios.get<IListFunctionVersionResponse>(versionUrl(params), {
28
+ params: query,
29
+ })
30
+ ).data;
31
+
32
+ /** `GET .../version/:versionId`. Needs REFLEX_READ. */
33
+ export const getFunctionVersion = async (
34
+ params: IGetFunctionVersionParams,
35
+ ): Promise<IGetFunctionVersionResponse> =>
36
+ (
37
+ await AbyssReflexCore.axios.get<IGetFunctionVersionResponse>(
38
+ `${versionUrl(params)}/${params.versionId}`,
39
+ )
40
+ ).data;
41
+
42
+ /**
43
+ * `GET .../version/:versionId/step-stats`: per step, over the retention window, the executions, the median
44
+ * and p95 of duration, CPU, heap peak and cost, and the share of the cost; interrupted executions left
45
+ * out. With `environmentId`, also the p99 heap peak per step of the version running there. Needs REFLEX_LOG_READ.
46
+ */
47
+ export const getFunctionVersionStepStats = async (
48
+ params: IGetFunctionVersionStepStatsParams,
49
+ query: IGetFunctionVersionStepStatsQuery = {},
50
+ ): Promise<IGetFunctionVersionStepStatsResponse> =>
51
+ (
52
+ await AbyssReflexCore.axios.get<IGetFunctionVersionStepStatsResponse>(
53
+ `${versionUrl(params)}/${params.versionId}/step-stats`,
54
+ { params: query },
55
+ )
56
+ ).data;
57
+
58
+ /** `POST .../version/:versionId/open`: replaces the draft with the definition of the version and records it as the base of the draft. Needs REFLEX_FUNCTION_UPDATE. */
59
+ export const openFunctionVersion = async (
60
+ params: IOpenFunctionVersionParams,
61
+ ): Promise<IOpenFunctionVersionResponse> =>
62
+ (
63
+ await AbyssReflexCore.axios.post<IOpenFunctionVersionResponse>(
64
+ `${versionUrl(params)}/${params.versionId}/open`,
65
+ )
66
+ ).data;
@@ -8,11 +8,6 @@ import {
8
8
  REFLEX_EXECUTION_SETTINGS_LIMITS,
9
9
  RESPOND_STATUS_MAX,
10
10
  RESPOND_STATUS_MIN,
11
- REFLEX_RUN_ARCHIVE_AFTER_DAYS,
12
- REFLEX_RUN_ARCHIVE_MIN_TIER_DAYS,
13
- REFLEX_RUN_RETENTION_TIER_DAYS,
14
- REFLEX_VERSIONS_KEPT,
15
- ReflexErrorCode,
16
11
  } from '..';
17
12
 
18
13
  const APP = 'app-1';
@@ -182,34 +177,6 @@ const calls: Call[] = [
182
177
  url: `${BASE}/run/r-1/state`,
183
178
  run: () => sdk().run.state({ applicationId: APP, functionId: FN, runId: 'r-1' }),
184
179
  },
185
- {
186
- label: 'run.favorite',
187
- method: 'put',
188
- url: `${BASE}/run/r-1/favorite`,
189
- body: { isFavorite: true },
190
- run: () =>
191
- sdk().run.favorite(
192
- { applicationId: APP, functionId: FN, runId: 'r-1' },
193
- { isFavorite: true },
194
- ),
195
- },
196
- {
197
- label: 'runRetention.get',
198
- method: 'get',
199
- url: `${BASE}/run-retention`,
200
- run: () => sdk().runRetention.get({ applicationId: APP, functionId: FN }),
201
- },
202
- {
203
- label: 'runRetention.set',
204
- method: 'put',
205
- url: `${BASE}/run-retention`,
206
- body: { runRetentionDays: 90, versionsKept: 30 },
207
- run: () =>
208
- sdk().runRetention.set(
209
- { applicationId: APP, functionId: FN },
210
- { runRetentionDays: 90, versionsKept: 30 },
211
- ),
212
- },
213
180
  {
214
181
  label: 'version.stepStats',
215
182
  method: 'get',
@@ -322,25 +289,3 @@ describe('respond status bounds', () => {
322
289
  expect([RESPOND_STATUS_MIN, RESPOND_STATUS_MAX]).toEqual([200, 599]);
323
290
  });
324
291
  });
325
-
326
- describe('run retention constants (L3a)', () => {
327
- it('list the seven tiers the database accepts', () => {
328
- expect(REFLEX_RUN_RETENTION_TIER_DAYS).toEqual([3, 7, 15, 30, 90, 180, 365]);
329
- });
330
-
331
- it('bound the versions kept to 5 to 100, 20 by default', () => {
332
- expect(REFLEX_VERSIONS_KEPT).toEqual({ default: 20, min: 5, max: 100 });
333
- });
334
-
335
- it('archive the detail past 30 days, for the tiers of 90 days and more', () => {
336
- expect(REFLEX_RUN_ARCHIVE_AFTER_DAYS).toBe(30);
337
- expect(REFLEX_RUN_ARCHIVE_MIN_TIER_DAYS).toBe(90);
338
- expect(
339
- REFLEX_RUN_RETENTION_TIER_DAYS.filter((d) => d >= REFLEX_RUN_ARCHIVE_MIN_TIER_DAYS),
340
- ).toEqual([90, 180, 365]);
341
- });
342
-
343
- it('name the error of an archive that cannot be read', () => {
344
- expect(ReflexErrorCode.ARCHIVE_UNAVAILABLE).toBe('ARCHIVE_UNAVAILABLE');
345
- });
346
- });
@@ -1,62 +1,62 @@
1
- import { AbyssReflexCore } from '..';
2
- import type {
3
- ICreateFunctionBody,
4
- ICreateFunctionParams,
5
- ICreateFunctionResponse,
6
- IDeleteFunctionParams,
7
- IDeleteFunctionResponse,
8
- IGetFunctionParams,
9
- IGetFunctionResponse,
10
- IListFunctionParams,
11
- IListFunctionResponse,
12
- IUpdateFunctionBody,
13
- IUpdateFunctionParams,
14
- IUpdateFunctionResponse,
15
- } from '../types';
16
-
17
- /** `GET /api/function/:applicationId`: needs REFLEX_READ. */
18
- export const listFunction = async (params: IListFunctionParams): Promise<IListFunctionResponse> =>
19
- (await AbyssReflexCore.axios.get<IListFunctionResponse>(`api/function/${params.applicationId}`))
20
- .data;
21
-
22
- /** `POST /api/function/:applicationId`: needs REFLEX_FUNCTION_CREATE. A definition that breaks the format is a `400` naming the path of each fault. */
23
- export const createFunction = async (
24
- params: ICreateFunctionParams,
25
- body: ICreateFunctionBody,
26
- ): Promise<ICreateFunctionResponse> =>
27
- (
28
- await AbyssReflexCore.axios.post<ICreateFunctionResponse>(
29
- `api/function/${params.applicationId}`,
30
- body,
31
- )
32
- ).data;
33
-
34
- /** `GET /api/function/:applicationId/:functionId`: needs REFLEX_READ. */
35
- export const getFunction = async (params: IGetFunctionParams): Promise<IGetFunctionResponse> =>
36
- (
37
- await AbyssReflexCore.axios.get<IGetFunctionResponse>(
38
- `api/function/${params.applicationId}/${params.functionId}`,
39
- )
40
- ).data;
41
-
42
- /** `PUT /api/function/:applicationId/:functionId`: needs REFLEX_FUNCTION_UPDATE. */
43
- export const updateFunction = async (
44
- params: IUpdateFunctionParams,
45
- body: IUpdateFunctionBody,
46
- ): Promise<IUpdateFunctionResponse> =>
47
- (
48
- await AbyssReflexCore.axios.put<IUpdateFunctionResponse>(
49
- `api/function/${params.applicationId}/${params.functionId}`,
50
- body,
51
- )
52
- ).data;
53
-
54
- /** `DELETE /api/function/:applicationId/:functionId`: needs REFLEX_FUNCTION_DELETE. Takes the function off every environment. */
55
- export const deleteFunction = async (
56
- params: IDeleteFunctionParams,
57
- ): Promise<IDeleteFunctionResponse> =>
58
- (
59
- await AbyssReflexCore.axios.delete<IDeleteFunctionResponse>(
60
- `api/function/${params.applicationId}/${params.functionId}`,
61
- )
62
- ).data;
1
+ import { AbyssReflexCore } from '..';
2
+ import type {
3
+ ICreateFunctionBody,
4
+ ICreateFunctionParams,
5
+ ICreateFunctionResponse,
6
+ IDeleteFunctionParams,
7
+ IDeleteFunctionResponse,
8
+ IGetFunctionParams,
9
+ IGetFunctionResponse,
10
+ IListFunctionParams,
11
+ IListFunctionResponse,
12
+ IUpdateFunctionBody,
13
+ IUpdateFunctionParams,
14
+ IUpdateFunctionResponse,
15
+ } from '../types';
16
+
17
+ /** `GET /api/function/:applicationId`: needs REFLEX_READ. */
18
+ export const listFunction = async (params: IListFunctionParams): Promise<IListFunctionResponse> =>
19
+ (await AbyssReflexCore.axios.get<IListFunctionResponse>(`api/function/${params.applicationId}`))
20
+ .data;
21
+
22
+ /** `POST /api/function/:applicationId`: needs REFLEX_FUNCTION_CREATE. A definition that breaks the format is a `400` naming the path of each fault. */
23
+ export const createFunction = async (
24
+ params: ICreateFunctionParams,
25
+ body: ICreateFunctionBody,
26
+ ): Promise<ICreateFunctionResponse> =>
27
+ (
28
+ await AbyssReflexCore.axios.post<ICreateFunctionResponse>(
29
+ `api/function/${params.applicationId}`,
30
+ body,
31
+ )
32
+ ).data;
33
+
34
+ /** `GET /api/function/:applicationId/:functionId`: needs REFLEX_READ. */
35
+ export const getFunction = async (params: IGetFunctionParams): Promise<IGetFunctionResponse> =>
36
+ (
37
+ await AbyssReflexCore.axios.get<IGetFunctionResponse>(
38
+ `api/function/${params.applicationId}/${params.functionId}`,
39
+ )
40
+ ).data;
41
+
42
+ /** `PUT /api/function/:applicationId/:functionId`: needs REFLEX_FUNCTION_UPDATE. */
43
+ export const updateFunction = async (
44
+ params: IUpdateFunctionParams,
45
+ body: IUpdateFunctionBody,
46
+ ): Promise<IUpdateFunctionResponse> =>
47
+ (
48
+ await AbyssReflexCore.axios.put<IUpdateFunctionResponse>(
49
+ `api/function/${params.applicationId}/${params.functionId}`,
50
+ body,
51
+ )
52
+ ).data;
53
+
54
+ /** `DELETE /api/function/:applicationId/:functionId`: needs REFLEX_FUNCTION_DELETE. Takes the function off every environment. */
55
+ export const deleteFunction = async (
56
+ params: IDeleteFunctionParams,
57
+ ): Promise<IDeleteFunctionResponse> =>
58
+ (
59
+ await AbyssReflexCore.axios.delete<IDeleteFunctionResponse>(
60
+ `api/function/${params.applicationId}/${params.functionId}`,
61
+ )
62
+ ).data;
@@ -1,10 +1,10 @@
1
- import { AbyssReflexCore } from '..';
2
- import type { IHealthResponse } from '../types';
3
-
4
- /**
5
- * `GET /health` — status of the database and Redis behind the API. Resolves on `200`; a `503`
6
- * (a component down) rejects as an axios error whose `response.data` is the same
7
- * {@link IHealthResponse}, naming the component that failed.
8
- */
9
- export const health = async (): Promise<IHealthResponse> =>
10
- (await AbyssReflexCore.axios.get<IHealthResponse>('health')).data;
1
+ import { AbyssReflexCore } from '..';
2
+ import type { IHealthResponse } from '../types';
3
+
4
+ /**
5
+ * `GET /health` — status of the database and Redis behind the API. Resolves on `200`; a `503`
6
+ * (a component down) rejects as an axios error whose `response.data` is the same
7
+ * {@link IHealthResponse}, naming the component that failed.
8
+ */
9
+ export const health = async (): Promise<IHealthResponse> =>
10
+ (await AbyssReflexCore.axios.get<IHealthResponse>('health')).data;
package/src/api/index.ts CHANGED
@@ -1,26 +1,26 @@
1
- export * from './health.api';
2
- export * from './function.api';
3
- export * from './function-access.api';
4
- export * from './function-test.api';
5
- export * from './function-version.api';
6
- export * from './function-run.api';
7
- export * from './function-settings.api';
8
- export * from './service.api';
9
- export * from './service-route.api';
10
- export * from './service-version.api';
11
- export * from './service-deployment.api';
12
- export * from './service-configuration.api';
13
- export * from './service-discord.api';
14
- export * from './service-discord-event.api';
15
- export * from './service-insights.api';
16
- export * from './function-insights.api';
17
- export * from './service-task.api';
18
- export * from './application-run-settings.api';
19
- export * from './application-insights.api';
20
- export * from './alert-rule.api';
21
- export * from './route-stats.api';
22
- export * from './function-template.api';
23
- export * from './service-consumer.api';
24
- export * from './service-openapi.api';
25
- export * from './service-limits.api';
26
- export * from './service-completion-webhook.api';
1
+ export * from './health.api';
2
+ export * from './function.api';
3
+ export * from './function-access.api';
4
+ export * from './function-test.api';
5
+ export * from './function-version.api';
6
+ export * from './function-run.api';
7
+ export * from './function-settings.api';
8
+ export * from './service.api';
9
+ export * from './service-route.api';
10
+ export * from './service-version.api';
11
+ export * from './service-deployment.api';
12
+ export * from './service-configuration.api';
13
+ export * from './service-discord.api';
14
+ export * from './service-discord-event.api';
15
+ export * from './service-insights.api';
16
+ export * from './function-insights.api';
17
+ export * from './service-task.api';
18
+ export * from './application-run-settings.api';
19
+ export * from './application-insights.api';
20
+ export * from './alert-rule.api';
21
+ export * from './route-stats.api';
22
+ export * from './function-template.api';
23
+ export * from './service-consumer.api';
24
+ export * from './service-openapi.api';
25
+ export * from './service-limits.api';
26
+ export * from './service-completion-webhook.api';
@@ -1,45 +1,45 @@
1
- import { AxiosAdapter, InternalAxiosRequestConfig } from 'axios';
2
- import { AbyssReflexCore, InsightsPeriod } from '..';
3
-
4
- const adapter = jest.fn<ReturnType<AxiosAdapter>, [InternalAxiosRequestConfig]>(async (config) => ({
5
- data: { data: {} },
6
- status: 200,
7
- statusText: '',
8
- headers: {},
9
- config,
10
- }));
11
-
12
- beforeAll(() => {
13
- AbyssReflexCore.setConfig({ baseURL: 'http://reflex.test/', token: 'session-token' });
14
- AbyssReflexCore.axios.defaults.adapter = adapter;
15
- });
16
-
17
- beforeEach(() => adapter.mockClear());
18
-
19
- const QUERY = { environmentId: 'e-1', period: InsightsPeriod.HOURS_24 };
20
-
21
- describe('AbyssReflexCore route statistics routes', () => {
22
- it('routeStats.list calls GET .../route-stats with the environment and the period', async () => {
23
- await AbyssReflexCore.sdk.service.routeStats.list(
24
- { applicationId: 'app-1', serviceId: 'svc-1' },
25
- QUERY,
26
- );
27
-
28
- const config = adapter.mock.calls[0][0];
29
- expect(config.method).toBe('get');
30
- expect(config.url).toBe('api/service/app-1/svc-1/route-stats');
31
- expect(config.params).toEqual({ environmentId: 'e-1', period: '24h' });
32
- });
33
-
34
- it('routeStats.insights calls GET .../route/:routeId/insights', async () => {
35
- await AbyssReflexCore.sdk.service.routeStats.insights(
36
- { applicationId: 'app-1', serviceId: 'svc-1', routeId: 'r-1' },
37
- QUERY,
38
- );
39
-
40
- const config = adapter.mock.calls[0][0];
41
- expect(config.method).toBe('get');
42
- expect(config.url).toBe('api/service/app-1/svc-1/route/r-1/insights');
43
- expect(config.params).toEqual({ environmentId: 'e-1', period: '24h' });
44
- });
45
- });
1
+ import { AxiosAdapter, InternalAxiosRequestConfig } from 'axios';
2
+ import { AbyssReflexCore, InsightsPeriod } from '..';
3
+
4
+ const adapter = jest.fn<ReturnType<AxiosAdapter>, [InternalAxiosRequestConfig]>(async (config) => ({
5
+ data: { data: {} },
6
+ status: 200,
7
+ statusText: '',
8
+ headers: {},
9
+ config,
10
+ }));
11
+
12
+ beforeAll(() => {
13
+ AbyssReflexCore.setConfig({ baseURL: 'http://reflex.test/', token: 'session-token' });
14
+ AbyssReflexCore.axios.defaults.adapter = adapter;
15
+ });
16
+
17
+ beforeEach(() => adapter.mockClear());
18
+
19
+ const QUERY = { environmentId: 'e-1', period: InsightsPeriod.HOURS_24 };
20
+
21
+ describe('AbyssReflexCore route statistics routes', () => {
22
+ it('routeStats.list calls GET .../route-stats with the environment and the period', async () => {
23
+ await AbyssReflexCore.sdk.service.routeStats.list(
24
+ { applicationId: 'app-1', serviceId: 'svc-1' },
25
+ QUERY,
26
+ );
27
+
28
+ const config = adapter.mock.calls[0][0];
29
+ expect(config.method).toBe('get');
30
+ expect(config.url).toBe('api/service/app-1/svc-1/route-stats');
31
+ expect(config.params).toEqual({ environmentId: 'e-1', period: '24h' });
32
+ });
33
+
34
+ it('routeStats.insights calls GET .../route/:routeId/insights', async () => {
35
+ await AbyssReflexCore.sdk.service.routeStats.insights(
36
+ { applicationId: 'app-1', serviceId: 'svc-1', routeId: 'r-1' },
37
+ QUERY,
38
+ );
39
+
40
+ const config = adapter.mock.calls[0][0];
41
+ expect(config.method).toBe('get');
42
+ expect(config.url).toBe('api/service/app-1/svc-1/route/r-1/insights');
43
+ expect(config.params).toEqual({ environmentId: 'e-1', period: '24h' });
44
+ });
45
+ });
@@ -1,36 +1,36 @@
1
- import { AbyssReflexCore } from '..';
2
- import type {
3
- IGetRouteInsightsParams,
4
- IGetRouteInsightsQuery,
5
- IGetRouteInsightsResponse,
6
- IGetServiceRouteStatsParams,
7
- IGetServiceRouteStatsQuery,
8
- IGetServiceRouteStatsResponse,
9
- } from '../types';
10
-
11
- /**
12
- * `GET .../route-stats`: every route of a Service over a period: runs, failures, p50, p95, p99, HTTP classes and
13
- * a short series. Needs REFLEX_READ.
14
- */
15
- export const getServiceRouteStats = async (
16
- params: IGetServiceRouteStatsParams,
17
- query: IGetServiceRouteStatsQuery,
18
- ): Promise<IGetServiceRouteStatsResponse> =>
19
- (
20
- await AbyssReflexCore.axios.get<IGetServiceRouteStatsResponse>(
21
- `api/service/${params.applicationId}/${params.serviceId}/route-stats`,
22
- { params: query },
23
- )
24
- ).data;
25
-
26
- /** `GET .../route/:routeId/insights`: runs, HTTP classes and percentiles of one route, step by step. Needs REFLEX_READ. */
27
- export const getRouteInsights = async (
28
- params: IGetRouteInsightsParams,
29
- query: IGetRouteInsightsQuery,
30
- ): Promise<IGetRouteInsightsResponse> =>
31
- (
32
- await AbyssReflexCore.axios.get<IGetRouteInsightsResponse>(
33
- `api/service/${params.applicationId}/${params.serviceId}/route/${params.routeId}/insights`,
34
- { params: query },
35
- )
36
- ).data;
1
+ import { AbyssReflexCore } from '..';
2
+ import type {
3
+ IGetRouteInsightsParams,
4
+ IGetRouteInsightsQuery,
5
+ IGetRouteInsightsResponse,
6
+ IGetServiceRouteStatsParams,
7
+ IGetServiceRouteStatsQuery,
8
+ IGetServiceRouteStatsResponse,
9
+ } from '../types';
10
+
11
+ /**
12
+ * `GET .../route-stats`: every route of a Service over a period: runs, failures, p50, p95, p99, HTTP classes and
13
+ * a short series. Needs REFLEX_READ.
14
+ */
15
+ export const getServiceRouteStats = async (
16
+ params: IGetServiceRouteStatsParams,
17
+ query: IGetServiceRouteStatsQuery,
18
+ ): Promise<IGetServiceRouteStatsResponse> =>
19
+ (
20
+ await AbyssReflexCore.axios.get<IGetServiceRouteStatsResponse>(
21
+ `api/service/${params.applicationId}/${params.serviceId}/route-stats`,
22
+ { params: query },
23
+ )
24
+ ).data;
25
+
26
+ /** `GET .../route/:routeId/insights`: runs, HTTP classes and percentiles of one route, step by step. Needs REFLEX_READ. */
27
+ export const getRouteInsights = async (
28
+ params: IGetRouteInsightsParams,
29
+ query: IGetRouteInsightsQuery,
30
+ ): Promise<IGetRouteInsightsResponse> =>
31
+ (
32
+ await AbyssReflexCore.axios.get<IGetRouteInsightsResponse>(
33
+ `api/service/${params.applicationId}/${params.serviceId}/route/${params.routeId}/insights`,
34
+ { params: query },
35
+ )
36
+ ).data;