@abyss-project/reflex 6.2.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 (141) 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/api/index.d.ts +0 -1
  10. package/dist/api/index.js +0 -1
  11. package/dist/api/index.js.map +1 -1
  12. package/dist/index.d.ts +0 -16
  13. package/dist/index.js +1 -19
  14. package/dist/index.js.map +1 -1
  15. package/dist/types/enum/discord-host-action.enum.d.ts +3 -1
  16. package/dist/types/enum/discord-host-action.enum.js +2 -0
  17. package/dist/types/enum/discord-host-action.enum.js.map +1 -1
  18. package/dist/types/enum/reflex-error-code.enum.d.ts +1 -4
  19. package/dist/types/enum/reflex-error-code.enum.js +0 -3
  20. package/dist/types/enum/reflex-error-code.enum.js.map +1 -1
  21. package/dist/types/interface/api/requests/application-run-settings.request.d.ts +0 -1
  22. package/dist/types/interface/api/requests/function-run.request.d.ts +0 -8
  23. package/dist/types/interface/api/requests/function-settings.request.d.ts +0 -12
  24. package/dist/types/interface/api/requests/index.d.ts +0 -1
  25. package/dist/types/interface/api/requests/index.js +0 -1
  26. package/dist/types/interface/api/requests/index.js.map +1 -1
  27. package/dist/types/interface/api/requests/service-discord.request.d.ts +1 -0
  28. package/dist/types/interface/api/requests/service.request.d.ts +0 -1
  29. package/dist/types/interface/api/responses/function-run.response.d.ts +0 -4
  30. package/dist/types/interface/api/responses/function-settings.response.d.ts +1 -5
  31. package/dist/types/interface/api/responses/index.d.ts +0 -1
  32. package/dist/types/interface/api/responses/index.js +0 -1
  33. package/dist/types/interface/api/responses/index.js.map +1 -1
  34. package/dist/types/interface/models/index.d.ts +0 -2
  35. package/dist/types/interface/models/index.js +0 -2
  36. package/dist/types/interface/models/index.js.map +1 -1
  37. package/dist/types/interface/models/reflex-discord.model.d.ts +5 -0
  38. package/dist/types/interface/models/reflex-discord.model.js +2 -0
  39. package/dist/types/interface/models/reflex-discord.model.js.map +1 -1
  40. package/dist/types/interface/models/reflex-price-list.model.d.ts +1 -0
  41. package/dist/types/interface/models/reflex-run-settings.model.d.ts +0 -4
  42. package/dist/types/interface/models/reflex-run.model.d.ts +0 -5
  43. package/dist/types/interface/models/reflex-service-deployment.model.d.ts +2 -2
  44. package/dist/types/interface/models/reflex-service.model.d.ts +0 -1
  45. package/jest.config.ts +11 -11
  46. package/package.json +1 -1
  47. package/src/api/alert-rule.api.test.ts +72 -72
  48. package/src/api/alert-rule.api.ts +57 -57
  49. package/src/api/application-insights.api.test.ts +42 -42
  50. package/src/api/application-insights.api.ts +38 -38
  51. package/src/api/application-run-settings.api.test.ts +0 -11
  52. package/src/api/application-run-settings.api.ts +30 -30
  53. package/src/api/function-access.api.ts +87 -87
  54. package/src/api/function-insights.api.test.ts +27 -27
  55. package/src/api/function-insights.api.ts +18 -18
  56. package/src/api/function-run.api.ts +0 -15
  57. package/src/api/function-settings.api.ts +0 -22
  58. package/src/api/function-template.api.test.ts +72 -72
  59. package/src/api/function-template.api.ts +52 -52
  60. package/src/api/function-test.api.ts +34 -34
  61. package/src/api/function-version.api.ts +66 -66
  62. package/src/api/function.api.test.ts +0 -55
  63. package/src/api/function.api.ts +62 -62
  64. package/src/api/health.api.ts +10 -10
  65. package/src/api/index.ts +26 -27
  66. package/src/api/route-stats.api.test.ts +45 -45
  67. package/src/api/route-stats.api.ts +36 -36
  68. package/src/api/service-completion-webhook.api.test.ts +97 -97
  69. package/src/api/service-completion-webhook.api.ts +39 -39
  70. package/src/api/service-configuration.api.ts +16 -16
  71. package/src/api/service-consumer.api.test.ts +104 -104
  72. package/src/api/service-consumer.api.ts +90 -90
  73. package/src/api/service-deployment.api.ts +79 -79
  74. package/src/api/service-discord-event.api.test.ts +106 -106
  75. package/src/api/service-discord-event.api.ts +78 -78
  76. package/src/api/service-discord.api.test.ts +178 -178
  77. package/src/api/service-discord.api.ts +222 -222
  78. package/src/api/service-insights.api.test.ts +36 -36
  79. package/src/api/service-insights.api.ts +42 -42
  80. package/src/api/service-limits.api.test.ts +100 -100
  81. package/src/api/service-limits.api.ts +37 -37
  82. package/src/api/service-openapi.api.test.ts +52 -52
  83. package/src/api/service-openapi.api.ts +21 -21
  84. package/src/api/service-route.api.ts +74 -74
  85. package/src/api/service-task.api.test.ts +140 -140
  86. package/src/api/service-task.api.ts +141 -141
  87. package/src/api/service-version.api.ts +54 -54
  88. package/src/api/service.api.test.ts +1 -6
  89. package/src/api/service.api.ts +55 -55
  90. package/src/discord/discord-event-filter-cases.ts +261 -261
  91. package/src/discord/discord-event-filters.test.ts +91 -91
  92. package/src/discord/discord-event-filters.ts +95 -95
  93. package/src/discord/discord-event-intents.test.ts +112 -112
  94. package/src/discord/discord-event-intents.ts +55 -55
  95. package/src/discord/index.ts +3 -3
  96. package/src/index.test.ts +104 -104
  97. package/src/index.ts +0 -42
  98. package/src/insights/index.ts +1 -1
  99. package/src/insights/percentiles.test.ts +75 -75
  100. package/src/insights/percentiles.ts +37 -37
  101. package/src/types/enum/discord-host-action.enum.ts +2 -0
  102. package/src/types/enum/reflex-error-code.enum.ts +0 -16
  103. package/src/types/interface/api/requests/application-run-settings.request.ts +0 -2
  104. package/src/types/interface/api/requests/function-run.request.ts +0 -10
  105. package/src/types/interface/api/requests/function-settings.request.ts +0 -16
  106. package/src/types/interface/api/requests/index.ts +0 -1
  107. package/src/types/interface/api/requests/service-discord.request.ts +6 -0
  108. package/src/types/interface/api/requests/service.request.ts +0 -2
  109. package/src/types/interface/api/responses/function-run.response.ts +0 -5
  110. package/src/types/interface/api/responses/function-settings.response.ts +0 -7
  111. package/src/types/interface/api/responses/index.ts +0 -1
  112. package/src/types/interface/models/index.ts +0 -2
  113. package/src/types/interface/models/reflex-discord.model.ts +12 -0
  114. package/src/types/interface/models/reflex-price-list.model.ts +2 -0
  115. package/src/types/interface/models/reflex-run-settings.model.ts +0 -11
  116. package/src/types/interface/models/reflex-run.model.ts +0 -10
  117. package/src/types/interface/models/reflex-service-deployment.model.ts +2 -4
  118. package/src/types/interface/models/reflex-service.model.ts +0 -2
  119. package/tsconfig.check.json +15 -15
  120. package/tsconfig.json +35 -35
  121. package/dist/api/storage-surplus.admin.api.d.ts +0 -5
  122. package/dist/api/storage-surplus.admin.api.js +0 -17
  123. package/dist/api/storage-surplus.admin.api.js.map +0 -1
  124. package/dist/types/interface/api/requests/storage-surplus.admin.request.d.ts +0 -8
  125. package/dist/types/interface/api/requests/storage-surplus.admin.request.js +0 -3
  126. package/dist/types/interface/api/requests/storage-surplus.admin.request.js.map +0 -1
  127. package/dist/types/interface/api/responses/storage-surplus.admin.response.d.ts +0 -8
  128. package/dist/types/interface/api/responses/storage-surplus.admin.response.js +0 -3
  129. package/dist/types/interface/api/responses/storage-surplus.admin.response.js.map +0 -1
  130. package/dist/types/interface/models/reflex-run-retention.model.d.ts +0 -13
  131. package/dist/types/interface/models/reflex-run-retention.model.js +0 -8
  132. package/dist/types/interface/models/reflex-run-retention.model.js.map +0 -1
  133. package/dist/types/interface/models/reflex-storage-surplus.model.d.ts +0 -11
  134. package/dist/types/interface/models/reflex-storage-surplus.model.js +0 -3
  135. package/dist/types/interface/models/reflex-storage-surplus.model.js.map +0 -1
  136. package/src/api/storage-surplus.admin.api.test.ts +0 -66
  137. package/src/api/storage-surplus.admin.api.ts +0 -45
  138. package/src/types/interface/api/requests/storage-surplus.admin.request.ts +0 -12
  139. package/src/types/interface/api/responses/storage-surplus.admin.response.ts +0 -10
  140. package/src/types/interface/models/reflex-run-retention.model.ts +0 -24
  141. package/src/types/interface/models/reflex-storage-surplus.model.ts +0 -23
@@ -1,45 +0,0 @@
1
- import { AbyssReflexCore } from '..';
2
- import type {
3
- IApplyStorageSurplusAdminBody,
4
- IApplyStorageSurplusAdminResponse,
5
- IListStorageSurplusAdminBody,
6
- IListStorageSurplusAdminResponse,
7
- } from '../types';
8
-
9
- const BASE = 'storage-surplus/admin';
10
-
11
- /**
12
- * `POST /storage-surplus/admin/archivable`: the days of runs of an organization that can move to the archive now. For
13
- * abyss-main only: behind the admin token (`setConfig({ adminToken })`). AbyssReflex lists nothing for the surplus of
14
- * the ONLINE quota (its runs are not in it): the answer is always empty.
15
- */
16
- export const listArchivableStorageSurplusAdmin = async (
17
- body: IListStorageSurplusAdminBody,
18
- ): Promise<IListStorageSurplusAdminResponse> =>
19
- (await AbyssReflexCore.axios.post<IListStorageSurplusAdminResponse>(`${BASE}/archivable`, body))
20
- .data;
21
-
22
- /** `POST /storage-surplus/admin/archive`: moves the given days to the archive; idempotent. Admin token. */
23
- export const archiveStorageSurplusAdmin = async (
24
- body: IApplyStorageSurplusAdminBody,
25
- ): Promise<IApplyStorageSurplusAdminResponse> =>
26
- (await AbyssReflexCore.axios.post<IApplyStorageSurplusAdminResponse>(`${BASE}/archive`, body))
27
- .data;
28
-
29
- /** `POST /storage-surplus/admin/archives`: the archived days of the organization, the oldest first. Admin token. */
30
- export const listArchivesStorageSurplusAdmin = async (
31
- body: IListStorageSurplusAdminBody,
32
- ): Promise<IListStorageSurplusAdminResponse> =>
33
- (await AbyssReflexCore.axios.post<IListStorageSurplusAdminResponse>(`${BASE}/archives`, body))
34
- .data;
35
-
36
- /** `POST /storage-surplus/admin/delete-archives`: deletes the given archived days for good; idempotent. Admin token. */
37
- export const deleteArchivesStorageSurplusAdmin = async (
38
- body: IApplyStorageSurplusAdminBody,
39
- ): Promise<IApplyStorageSurplusAdminResponse> =>
40
- (
41
- await AbyssReflexCore.axios.post<IApplyStorageSurplusAdminResponse>(
42
- `${BASE}/delete-archives`,
43
- body,
44
- )
45
- ).data;
@@ -1,12 +0,0 @@
1
- import type { IReflexStorageSurplusOwner } from '../../models';
2
-
3
- /** Body of `archivable` and `archives`: whose storage the call is about. */
4
- export interface IListStorageSurplusAdminBody {
5
- owner: IReflexStorageSurplusOwner;
6
- }
7
-
8
- /** Body of `archive` and `delete-archives`: the items to act on, as `archivable` and `archives` gave them. */
9
- export interface IApplyStorageSurplusAdminBody {
10
- owner: IReflexStorageSurplusOwner;
11
- itemIds: string[];
12
- }
@@ -1,10 +0,0 @@
1
- import type { IReflexStorageSurplusItem } from '../../models';
2
- import type { IResponse } from '../response';
3
-
4
- export interface IListStorageSurplusAdminData {
5
- items: IReflexStorageSurplusItem[];
6
- }
7
- export type IListStorageSurplusAdminResponse = IResponse<IListStorageSurplusAdminData>;
8
-
9
- export type IApplyStorageSurplusAdminData = Record<string, never>;
10
- export type IApplyStorageSurplusAdminResponse = IResponse<IApplyStorageSurplusAdminData>;
@@ -1,24 +0,0 @@
1
- /**
2
- * The retention tiers of the runs a customer may choose, in days (AbyssReflex L3a, #893). The plan's retention is
3
- * the default; a tier is chosen per application, and per function over it. Same list as the database CHECKs.
4
- */
5
- export const REFLEX_RUN_RETENTION_TIER_DAYS = [3, 7, 15, 30, 90, 180, 365] as const;
6
-
7
- /** Bounds of the number of versions the purge keeps, per function and per Service. */
8
- export const REFLEX_VERSIONS_KEPT = { default: 20, min: 5, max: 100 } as const;
9
-
10
- /** The detail of a run (detail, steps, log lines) moves to the archive past this age, in days, when its tier allows it. */
11
- export const REFLEX_RUN_ARCHIVE_AFTER_DAYS = 30;
12
-
13
- /** The runs of a tier under this number of days are never archived: they are purged before they would be. */
14
- export const REFLEX_RUN_ARCHIVE_MIN_TIER_DAYS = 90;
15
-
16
- /** The run retention of a function: its own tier, the one it inherits, and how many versions are kept. */
17
- export interface IReflexFunctionRunRetention {
18
- /** The tier of the function itself, one of `REFLEX_RUN_RETENTION_TIER_DAYS`; null follows the application. */
19
- runRetentionDays: number | null;
20
- /** The tier the function follows when it has none: the application's, else null for the plan's retention. Read only. */
21
- inheritedDays: number | null;
22
- /** How many versions of the function the purge keeps, `REFLEX_VERSIONS_KEPT.min` to `REFLEX_VERSIONS_KEPT.max`. */
23
- versionsKept: number;
24
- }
@@ -1,23 +0,0 @@
1
- /**
2
- * Whose storage a day-90 operation is about (the storage surplus contract of abyss-main, #889): the owner of an
3
- * application is an organization, so `organizationId` is the one Reflex acts on.
4
- */
5
- export interface IReflexStorageSurplusOwner {
6
- organizationId?: string | null;
7
- userId?: string | null;
8
- }
9
-
10
- /**
11
- * One item of the day-90 contract: a day of the runs of one function. Online (archivable) its `id` names the day; in
12
- * the archive it is the id of the archive object of that day.
13
- */
14
- export interface IReflexStorageSurplusItem {
15
- id: string;
16
- sizeBytes: number;
17
- /** The day the item holds the runs of, UTC. */
18
- createdAt: Date | string;
19
- /** The day holds a favorite run. A favorite protects nothing against the quota. */
20
- isFavorite: boolean;
21
- /** What the customer recognises the day by: the function and the day. */
22
- label: string;
23
- }