@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,37 +1,37 @@
1
- import type { IReflexDurationPercentile } from '../types';
2
-
3
- /**
4
- * Reads a percentile on a duration histogram: the upper bound of the bucket holding the `q` quantile (the
5
- * smallest bucket whose cumulative count reaches `ceil(q * total)`). The histogram has one bucket per bound plus
6
- * an open one; a percentile in the open bucket answers the last bound with `open` true. Null when the histogram
7
- * holds no run: the denominator is its own sum, never the number of runs.
8
- */
9
- export const percentileOfHistogram = (
10
- histogram: readonly number[],
11
- bounds: readonly number[],
12
- q: number,
13
- ): IReflexDurationPercentile | null => {
14
- if (bounds.length === 0 || histogram.length !== bounds.length + 1) {
15
- throw new Error(
16
- `A histogram needs one bucket per bound plus an open one: got ${histogram.length} buckets for ${bounds.length} bounds`,
17
- );
18
- }
19
- if (!(q > 0 && q <= 1)) {
20
- throw new Error(`A quantile is in ]0, 1]: got ${q}`);
21
- }
22
- const total = histogram.reduce((sum, count) => sum + count, 0);
23
- if (total === 0) {
24
- return null;
25
- }
26
- const rank = Math.max(1, Math.ceil(q * total));
27
- let cumulative = 0;
28
- for (let index = 0; index < histogram.length; index += 1) {
29
- cumulative += histogram[index];
30
- if (cumulative >= rank) {
31
- return index < bounds.length
32
- ? { upperBoundMs: bounds[index], open: false }
33
- : { upperBoundMs: bounds[bounds.length - 1], open: true };
34
- }
35
- }
36
- return { upperBoundMs: bounds[bounds.length - 1], open: true };
37
- };
1
+ import type { IReflexDurationPercentile } from '../types';
2
+
3
+ /**
4
+ * Reads a percentile on a duration histogram: the upper bound of the bucket holding the `q` quantile (the
5
+ * smallest bucket whose cumulative count reaches `ceil(q * total)`). The histogram has one bucket per bound plus
6
+ * an open one; a percentile in the open bucket answers the last bound with `open` true. Null when the histogram
7
+ * holds no run: the denominator is its own sum, never the number of runs.
8
+ */
9
+ export const percentileOfHistogram = (
10
+ histogram: readonly number[],
11
+ bounds: readonly number[],
12
+ q: number,
13
+ ): IReflexDurationPercentile | null => {
14
+ if (bounds.length === 0 || histogram.length !== bounds.length + 1) {
15
+ throw new Error(
16
+ `A histogram needs one bucket per bound plus an open one: got ${histogram.length} buckets for ${bounds.length} bounds`,
17
+ );
18
+ }
19
+ if (!(q > 0 && q <= 1)) {
20
+ throw new Error(`A quantile is in ]0, 1]: got ${q}`);
21
+ }
22
+ const total = histogram.reduce((sum, count) => sum + count, 0);
23
+ if (total === 0) {
24
+ return null;
25
+ }
26
+ const rank = Math.max(1, Math.ceil(q * total));
27
+ let cumulative = 0;
28
+ for (let index = 0; index < histogram.length; index += 1) {
29
+ cumulative += histogram[index];
30
+ if (cumulative >= rank) {
31
+ return index < bounds.length
32
+ ? { upperBoundMs: bounds[index], open: false }
33
+ : { upperBoundMs: bounds[bounds.length - 1], open: true };
34
+ }
35
+ }
36
+ return { upperBoundMs: bounds[bounds.length - 1], open: true };
37
+ };
@@ -32,4 +32,6 @@ export enum DiscordHostAction {
32
32
  DELETE_ROLE = 'discord.deleteRole',
33
33
  CREATE_THREAD = 'discord.createThread',
34
34
  END_POLL = 'discord.endPoll',
35
+ AUTOCOMPLETE = 'discord.autocomplete',
36
+ READ_ATTACHMENT = 'discord.readAttachment',
35
37
  }
@@ -70,20 +70,4 @@ export enum ReflexErrorCode {
70
70
  * to one or does not resolve.
71
71
  */
72
72
  COMPLETION_WEBHOOK_URL_REFUSED = 'COMPLETION_WEBHOOK_URL_REFUSED',
73
- /**
74
- * 503: the run detail is in the customer's archive and the archive cannot be read now (Storage unreachable, key
75
- * unavailable, object failing its check). The run itself is untouched; asking again later may succeed.
76
- */
77
- ARCHIVE_UNAVAILABLE = 'ARCHIVE_UNAVAILABLE',
78
- /**
79
- * 404: the detail of the run was in the customer's archive and the archive was deleted (day 90 of the storage
80
- * surplus). The run's row stays; its detail, steps and log lines are gone for good.
81
- */
82
- ARCHIVE_DELETED = 'ARCHIVE_DELETED',
83
- /**
84
- * 409: the version cannot be published because the AbyssReflex storage of the organization is full: its online quota
85
- * is reached, or the personal threshold of AbyssReflex is, with "Block deposits" on. Nothing was published; the
86
- * versions that exist and the executions go on. Delete versions, or raise the quota or the threshold.
87
- */
88
- STORAGE_PUBLISH_REFUSED = 'STORAGE_PUBLISH_REFUSED',
89
73
  }
@@ -8,6 +8,4 @@ export interface ISetApplicationRunSettingsParams {
8
8
  export interface ISetApplicationRunSettingsBody {
9
9
  /** Cap of log lines per run, 1 to 10 000; null for no cap. */
10
10
  maxLogLinesPerRun: number | null;
11
- /** The retention tier of the runs, one of `REFLEX_RUN_RETENTION_TIER_DAYS`; null to follow the plan. Left alone when absent. */
12
- runRetentionDays?: number | null;
13
11
  }
@@ -30,13 +30,3 @@ export interface IGetFunctionRunStateParams {
30
30
  /** The `executionId` an async route answered with: the id of the live run. */
31
31
  runId: string;
32
32
  }
33
-
34
- export interface ISetFunctionRunFavoriteParams {
35
- applicationId: string;
36
- functionId: string;
37
- runId: string;
38
- }
39
- export interface ISetFunctionRunFavoriteBody {
40
- /** A favorite run is never purged. */
41
- isFavorite: boolean;
42
- }
@@ -32,19 +32,3 @@ export interface ISetFunctionLogCapParams {
32
32
  }
33
33
  /** `lines` is required, 1 to 10 000, when `mode` is LIMIT, and forbidden otherwise. */
34
34
  export type ISetFunctionLogCapBody = IReflexFunctionLogCap;
35
-
36
- export interface IGetFunctionRunRetentionParams {
37
- applicationId: string;
38
- functionId: string;
39
- }
40
-
41
- export interface ISetFunctionRunRetentionParams {
42
- applicationId: string;
43
- functionId: string;
44
- }
45
- export interface ISetFunctionRunRetentionBody {
46
- /** One of `REFLEX_RUN_RETENTION_TIER_DAYS`; null to follow the application. Left alone when absent. */
47
- runRetentionDays?: number | null;
48
- /** `REFLEX_VERSIONS_KEPT.min` to `REFLEX_VERSIONS_KEPT.max`. Left alone when absent. */
49
- versionsKept?: number;
50
- }
@@ -22,4 +22,3 @@ export * from './service-consumer.request';
22
22
  export * from './service-openapi.request';
23
23
  export * from './service-limits.request';
24
24
  export * from './service-completion-webhook.request';
25
- export * from './storage-surplus.admin.request';
@@ -121,6 +121,12 @@ export interface ISetServiceDiscordEnvironmentBody {
121
121
  activityType?: DiscordActivityType | null;
122
122
  /** 1 to 128 characters, required with an `activityType`, null without. */
123
123
  activityText?: string | null;
124
+ /**
125
+ * Largest file the bot receives or sends, in bytes, 1 to `REFLEX_DISCORD_LIMITS.attachmentMaxBytesBound`; omitted,
126
+ * the current size is kept (the default until one is set), unlike the other fields of this body, which an
127
+ * omission resets: a screen sends it only when it changed it.
128
+ */
129
+ maxAttachmentBytes?: number;
124
130
  }
125
131
 
126
132
  export interface ICheckServiceDiscordConnectionParams {
@@ -38,8 +38,6 @@ export interface IUpdateServiceBody {
38
38
  cors?: IReflexServiceCors;
39
39
  /** 1 to 6000. */
40
40
  rateLimitPerIpPerMinute?: number;
41
- /** `REFLEX_VERSIONS_KEPT.min` to `REFLEX_VERSIONS_KEPT.max`: how many versions of the Service the purge keeps. */
42
- versionsKept?: number;
43
41
  }
44
42
 
45
43
  export interface IDeleteServiceParams {
@@ -16,8 +16,3 @@ export interface IGetFunctionRunStateData {
16
16
  state: IReflexExecutionState;
17
17
  }
18
18
  export type IGetFunctionRunStateResponse = IResponse<IGetFunctionRunStateData>;
19
-
20
- export interface ISetFunctionRunFavoriteData {
21
- run: IReflexRun;
22
- }
23
- export type ISetFunctionRunFavoriteResponse = IResponse<ISetFunctionRunFavoriteData>;
@@ -3,7 +3,6 @@ import type {
3
3
  IReflexExecutionSettings,
4
4
  IReflexExecutionSettingsValues,
5
5
  IReflexFunctionLogCap,
6
- IReflexFunctionRunRetention,
7
6
  IReflexIssuedCompletionSecret,
8
7
  IReflexPriceList,
9
8
  } from '../../models';
@@ -49,9 +48,3 @@ export type IRemoveFunctionEnvironmentSettingsResponse =
49
48
 
50
49
  export type ISetFunctionLogCapData = IReflexFunctionLogCap;
51
50
  export type ISetFunctionLogCapResponse = IResponse<ISetFunctionLogCapData>;
52
-
53
- export type IGetFunctionRunRetentionData = IReflexFunctionRunRetention;
54
- export type IGetFunctionRunRetentionResponse = IResponse<IGetFunctionRunRetentionData>;
55
-
56
- export type ISetFunctionRunRetentionData = IReflexFunctionRunRetention;
57
- export type ISetFunctionRunRetentionResponse = IResponse<ISetFunctionRunRetentionData>;
@@ -22,4 +22,3 @@ export * from './service-consumer.response';
22
22
  export * from './service-openapi.response';
23
23
  export * from './service-limits.response';
24
24
  export * from './service-completion-webhook.response';
25
- export * from './storage-surplus.admin.response';
@@ -25,5 +25,3 @@ export * from './reflex-route-contract.model';
25
25
  export * from './reflex-consumer.model';
26
26
  export * from './reflex-service-limits.model';
27
27
  export * from './reflex-completion-webhook.model';
28
- export * from './reflex-run-retention.model';
29
- export * from './reflex-storage-surplus.model';
@@ -30,6 +30,9 @@ export const REFLEX_DISCORD_LIMITS = {
30
30
  optionLengthMax: 6000,
31
31
  /** Length of the name of a choice, localized or not. */
32
32
  choiceNameMaxLength: 100,
33
+ /** Largest file a bot receives or sends, per bot and environment (#915): the default, and the bound the setting may not pass. */
34
+ attachmentMaxBytesDefault: 2 * 1024 * 1024,
35
+ attachmentMaxBytesBound: 8 * 1024 * 1024,
33
36
  } as const;
34
37
 
35
38
  /** A translated command or option name Discord accepts: its pattern, and lower case where the script has one. */
@@ -62,6 +65,11 @@ export interface IReflexDiscordCommandOption {
62
65
  required: boolean;
63
66
  /** 25 at most, only for STRING, INTEGER and NUMBER; within `minValue`/`maxValue` and `minLength`/`maxLength`. */
64
67
  choices?: IReflexDiscordOptionChoice[];
68
+ /**
69
+ * Discord asks the function for the choices while the user types. Only for STRING, INTEGER and NUMBER,
70
+ * never together with `choices`. Absent means false.
71
+ */
72
+ autocomplete?: boolean;
65
73
  /** INTEGER and NUMBER: safe numbers, `minValue` <= `maxValue`. */
66
74
  minValue?: number;
67
75
  maxValue?: number;
@@ -152,6 +160,8 @@ export interface IReflexDiscordEnvironmentSettings {
152
160
  activityType: DiscordActivityType | null;
153
161
  /** 1 to 128 characters with an `activityType`, null without. */
154
162
  activityText: string | null;
163
+ /** Largest file the bot receives or sends, in bytes: `REFLEX_DISCORD_LIMITS.attachmentMaxBytesDefault` until set. */
164
+ maxAttachmentBytes: number;
155
165
  createdAt: Date;
156
166
  updatedAt: Date;
157
167
  }
@@ -180,6 +190,8 @@ export interface IReflexDiscordEnvironmentConnection {
180
190
  presenceStatus: DiscordPresenceStatus;
181
191
  activityType: DiscordActivityType | null;
182
192
  activityText: string | null;
193
+ /** Largest file the bot receives or sends, in bytes (1 to `REFLEX_DISCORD_LIMITS.attachmentMaxBytesBound`). */
194
+ maxAttachmentBytes: number;
183
195
  /** The Gateway connection; null while the bot is not in service in this environment. */
184
196
  presence: IReflexDiscordPresence | null;
185
197
  /** Address to give Discord for interactions in this environment. */
@@ -8,6 +8,8 @@ import type { ExecutionProfile } from '../../enum';
8
8
  export interface IReflexPriceList {
9
9
  /** Once per execution; 0 for an interrupted or refused execution. */
10
10
  executionMillicredits: number;
11
+ /** Once per autocomplete execution, in place of `executionMillicredits`; its CPU and memory are not billed. */
12
+ autocompleteExecutionMillicredits: number;
11
13
  cpuMillicreditsPerSecond: number;
12
14
  /** Per GB-second of the memory the profile allocates, GB = 1024 MB. */
13
15
  memoryMillicreditsPerGbSecond: number;
@@ -17,17 +17,6 @@ export interface IReflexApplicationRunSettings {
17
17
  maxLogLinesPerRun: number | null;
18
18
  /** How long runs are kept, from the Monitor plan; null until the first synchronization answered. Read only. */
19
19
  retentionDays: number | null;
20
- /**
21
- * The retention tier the customer chose for the runs of the application, one of `REFLEX_RUN_RETENTION_TIER_DAYS`;
22
- * null follows the plan (`retentionDays`). A function's own tier wins over it.
23
- */
24
- runRetentionDays: number | null;
25
- /** The owner's storage is cut: the runs recorded now keep no detail, steps or log lines. Read only. */
26
- historyMinimal: boolean;
27
- /** Bytes the runs of the application hold online (detail, steps, log lines). Read only. */
28
- storedBytesOnline: number;
29
- /** Bytes the runs of the application hold in the customer's archive. Read only. */
30
- storedBytesArchive: number;
31
20
  /** Whether the application has Monitor activated. Read only. */
32
21
  monitorActivated: boolean;
33
22
  }
@@ -184,16 +184,6 @@ export interface IReflexRun {
184
184
  delivery?: IReflexCompletionDelivery;
185
185
  createdByUserId: string | null;
186
186
  createdAt: Date;
187
- /** When the run is purged (its start plus the retention in force); null for a test run, and while no retention is known. */
188
- expiresAt: string | null;
189
- /** A favorite run is never purged. */
190
- isFavorite: boolean;
191
- /** The run was recorded while the owner's storage was cut: no detail, steps or log lines were kept. */
192
- historyMinimal: boolean;
193
- /** Bytes the run holds online (detail, steps, log lines); null for a test run, and for a run whose size was never computed. */
194
- storedBytes: number | null;
195
- /** When the detail, steps and log lines moved to the customer's archive; null while they are online. */
196
- detailArchivedAt: string | null;
197
187
  }
198
188
 
199
189
  /** The consumer of a Service that called a route, as the edge passed it to the function. */
@@ -23,10 +23,8 @@ export interface IReflexServiceDeployment {
23
23
  environmentId: string;
24
24
  /** The name of that environment, second segment of the address. */
25
25
  environmentSlug: string;
26
- /** The version this gesture put in service; null once the purge deleted it (the row stays in the history, no way back to it). */
27
- serviceVersionId: string | null;
28
- /** Number of that version; null with `serviceVersionId`. */
29
- serviceVersionNumber: number | null;
26
+ serviceVersionId: string;
27
+ serviceVersionNumber: number;
30
28
  action: ServiceDeploymentAction;
31
29
  status: ServiceDeploymentStatus;
32
30
  grants: IReflexServiceDeploymentGrant[];
@@ -38,8 +38,6 @@ export interface IReflexService {
38
38
  cors: IReflexServiceCors;
39
39
  /** Draft: frozen by the next version. Calls per minute and per client IP, in each environment. */
40
40
  rateLimitPerIpPerMinute: number;
41
- /** How many versions of the Service the purge keeps, `REFLEX_VERSIONS_KEPT.min` to `REFLEX_VERSIONS_KEPT.max`. */
42
- versionsKept: number;
43
41
  createdByUserId: string;
44
42
  updatedByUserId: string;
45
43
  createdAt: Date;
@@ -1,15 +1,15 @@
1
- {
2
- // Perimetre de VERIFICATION, distinct de celui du build.
3
- //
4
- // `tsconfig.json` exclut `src/**/*.spec.ts` parce qu'il sert a emettre `dist/`, ou une spec
5
- // n'a rien a faire. Mais eslint s'appuie sur ce meme fichier via `parserOptions.project` :
6
- // les cinq specs du paquet sortaient donc en « Parsing error: that TSConfig does not include
7
- // this file », mesure du 2026-09-09, et n'etaient lintees par personne.
8
- //
9
- // Ce fichier sert uniquement a eslint. Il n'emet rien et ne change pas ce que `build` produit.
10
- "extends": "./tsconfig.json",
11
- "compilerOptions": {
12
- "noEmit": true
13
- },
14
- "exclude": ["./dist/**/*"]
15
- }
1
+ {
2
+ // Perimetre de VERIFICATION, distinct de celui du build.
3
+ //
4
+ // `tsconfig.json` exclut `src/**/*.spec.ts` parce qu'il sert a emettre `dist/`, ou une spec
5
+ // n'a rien a faire. Mais eslint s'appuie sur ce meme fichier via `parserOptions.project` :
6
+ // les cinq specs du paquet sortaient donc en « Parsing error: that TSConfig does not include
7
+ // this file », mesure du 2026-09-09, et n'etaient lintees par personne.
8
+ //
9
+ // Ce fichier sert uniquement a eslint. Il n'emet rien et ne change pas ce que `build` produit.
10
+ "extends": "./tsconfig.json",
11
+ "compilerOptions": {
12
+ "noEmit": true
13
+ },
14
+ "exclude": ["./dist/**/*"]
15
+ }
package/tsconfig.json CHANGED
@@ -1,35 +1,35 @@
1
- {
2
- "compilerOptions": {
3
- "incremental": false,
4
- "target": "es2021",
5
- "lib": [
6
- "dom",
7
- "es2021"
8
- ],
9
- "module": "commonjs",
10
- "rootDir": "src",
11
- "moduleResolution": "node",
12
- "resolveJsonModule": true,
13
- "declaration": true,
14
- "sourceMap": true,
15
- "outDir": "./dist",
16
- "removeComments": true,
17
- "allowSyntheticDefaultImports": true,
18
- "esModuleInterop": true,
19
- "forceConsistentCasingInFileNames": true,
20
- "strict": true,
21
- "strictNullChecks": true,
22
- "strictFunctionTypes": true,
23
- "strictPropertyInitialization": false,
24
- "skipLibCheck": true
25
- },
26
- "include": [
27
- "./src"
28
- ],
29
- "exclude": [
30
- "./dist/**/*",
31
- "./src/**/*.spec.ts",
32
- "./src/**/*.test.ts",
33
- "./src/**/__tests__/**"
34
- ]
35
- }
1
+ {
2
+ "compilerOptions": {
3
+ "incremental": false,
4
+ "target": "es2021",
5
+ "lib": [
6
+ "dom",
7
+ "es2021"
8
+ ],
9
+ "module": "commonjs",
10
+ "rootDir": "src",
11
+ "moduleResolution": "node",
12
+ "resolveJsonModule": true,
13
+ "declaration": true,
14
+ "sourceMap": true,
15
+ "outDir": "./dist",
16
+ "removeComments": true,
17
+ "allowSyntheticDefaultImports": true,
18
+ "esModuleInterop": true,
19
+ "forceConsistentCasingInFileNames": true,
20
+ "strict": true,
21
+ "strictNullChecks": true,
22
+ "strictFunctionTypes": true,
23
+ "strictPropertyInitialization": false,
24
+ "skipLibCheck": true
25
+ },
26
+ "include": [
27
+ "./src"
28
+ ],
29
+ "exclude": [
30
+ "./dist/**/*",
31
+ "./src/**/*.spec.ts",
32
+ "./src/**/*.test.ts",
33
+ "./src/**/__tests__/**"
34
+ ]
35
+ }
@@ -1,5 +0,0 @@
1
- import type { IApplyStorageSurplusAdminBody, IApplyStorageSurplusAdminResponse, IListStorageSurplusAdminBody, IListStorageSurplusAdminResponse } from '../types';
2
- export declare const listArchivableStorageSurplusAdmin: (body: IListStorageSurplusAdminBody) => Promise<IListStorageSurplusAdminResponse>;
3
- export declare const archiveStorageSurplusAdmin: (body: IApplyStorageSurplusAdminBody) => Promise<IApplyStorageSurplusAdminResponse>;
4
- export declare const listArchivesStorageSurplusAdmin: (body: IListStorageSurplusAdminBody) => Promise<IListStorageSurplusAdminResponse>;
5
- export declare const deleteArchivesStorageSurplusAdmin: (body: IApplyStorageSurplusAdminBody) => Promise<IApplyStorageSurplusAdminResponse>;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteArchivesStorageSurplusAdmin = exports.listArchivesStorageSurplusAdmin = exports.archiveStorageSurplusAdmin = exports.listArchivableStorageSurplusAdmin = void 0;
4
- const __1 = require("..");
5
- const BASE = 'storage-surplus/admin';
6
- const listArchivableStorageSurplusAdmin = async (body) => (await __1.AbyssReflexCore.axios.post(`${BASE}/archivable`, body))
7
- .data;
8
- exports.listArchivableStorageSurplusAdmin = listArchivableStorageSurplusAdmin;
9
- const archiveStorageSurplusAdmin = async (body) => (await __1.AbyssReflexCore.axios.post(`${BASE}/archive`, body))
10
- .data;
11
- exports.archiveStorageSurplusAdmin = archiveStorageSurplusAdmin;
12
- const listArchivesStorageSurplusAdmin = async (body) => (await __1.AbyssReflexCore.axios.post(`${BASE}/archives`, body))
13
- .data;
14
- exports.listArchivesStorageSurplusAdmin = listArchivesStorageSurplusAdmin;
15
- const deleteArchivesStorageSurplusAdmin = async (body) => (await __1.AbyssReflexCore.axios.post(`${BASE}/delete-archives`, body)).data;
16
- exports.deleteArchivesStorageSurplusAdmin = deleteArchivesStorageSurplusAdmin;
17
- //# sourceMappingURL=storage-surplus.admin.api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"storage-surplus.admin.api.js","sourceRoot":"","sources":["../../src/api/storage-surplus.admin.api.ts"],"names":[],"mappings":";;;AAAA,0BAAqC;AAQrC,MAAM,IAAI,GAAG,uBAAuB,CAAC;AAO9B,MAAM,iCAAiC,GAAG,KAAK,EACpD,IAAkC,EACS,EAAE,CAC7C,CAAC,MAAM,mBAAe,CAAC,KAAK,CAAC,IAAI,CAAmC,GAAG,IAAI,aAAa,EAAE,IAAI,CAAC,CAAC;KAC7F,IAAI,CAAC;AAJG,QAAA,iCAAiC,qCAIpC;AAGH,MAAM,0BAA0B,GAAG,KAAK,EAC7C,IAAmC,EACS,EAAE,CAC9C,CAAC,MAAM,mBAAe,CAAC,KAAK,CAAC,IAAI,CAAoC,GAAG,IAAI,UAAU,EAAE,IAAI,CAAC,CAAC;KAC3F,IAAI,CAAC;AAJG,QAAA,0BAA0B,8BAI7B;AAGH,MAAM,+BAA+B,GAAG,KAAK,EAClD,IAAkC,EACS,EAAE,CAC7C,CAAC,MAAM,mBAAe,CAAC,KAAK,CAAC,IAAI,CAAmC,GAAG,IAAI,WAAW,EAAE,IAAI,CAAC,CAAC;KAC3F,IAAI,CAAC;AAJG,QAAA,+BAA+B,mCAIlC;AAGH,MAAM,iCAAiC,GAAG,KAAK,EACpD,IAAmC,EACS,EAAE,CAC9C,CACE,MAAM,mBAAe,CAAC,KAAK,CAAC,IAAI,CAC9B,GAAG,IAAI,kBAAkB,EACzB,IAAI,CACL,CACF,CAAC,IAAI,CAAC;AARI,QAAA,iCAAiC,qCAQrC"}
@@ -1,8 +0,0 @@
1
- import type { IReflexStorageSurplusOwner } from '../../models';
2
- export interface IListStorageSurplusAdminBody {
3
- owner: IReflexStorageSurplusOwner;
4
- }
5
- export interface IApplyStorageSurplusAdminBody {
6
- owner: IReflexStorageSurplusOwner;
7
- itemIds: string[];
8
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=storage-surplus.admin.request.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"storage-surplus.admin.request.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/requests/storage-surplus.admin.request.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- import type { IReflexStorageSurplusItem } from '../../models';
2
- import type { IResponse } from '../response';
3
- export interface IListStorageSurplusAdminData {
4
- items: IReflexStorageSurplusItem[];
5
- }
6
- export type IListStorageSurplusAdminResponse = IResponse<IListStorageSurplusAdminData>;
7
- export type IApplyStorageSurplusAdminData = Record<string, never>;
8
- export type IApplyStorageSurplusAdminResponse = IResponse<IApplyStorageSurplusAdminData>;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=storage-surplus.admin.response.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"storage-surplus.admin.response.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/responses/storage-surplus.admin.response.ts"],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- export declare const REFLEX_RUN_RETENTION_TIER_DAYS: readonly [3, 7, 15, 30, 90, 180, 365];
2
- export declare const REFLEX_VERSIONS_KEPT: {
3
- readonly default: 20;
4
- readonly min: 5;
5
- readonly max: 100;
6
- };
7
- export declare const REFLEX_RUN_ARCHIVE_AFTER_DAYS = 30;
8
- export declare const REFLEX_RUN_ARCHIVE_MIN_TIER_DAYS = 90;
9
- export interface IReflexFunctionRunRetention {
10
- runRetentionDays: number | null;
11
- inheritedDays: number | null;
12
- versionsKept: number;
13
- }
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.REFLEX_RUN_ARCHIVE_MIN_TIER_DAYS = exports.REFLEX_RUN_ARCHIVE_AFTER_DAYS = exports.REFLEX_VERSIONS_KEPT = exports.REFLEX_RUN_RETENTION_TIER_DAYS = void 0;
4
- exports.REFLEX_RUN_RETENTION_TIER_DAYS = [3, 7, 15, 30, 90, 180, 365];
5
- exports.REFLEX_VERSIONS_KEPT = { default: 20, min: 5, max: 100 };
6
- exports.REFLEX_RUN_ARCHIVE_AFTER_DAYS = 30;
7
- exports.REFLEX_RUN_ARCHIVE_MIN_TIER_DAYS = 90;
8
- //# sourceMappingURL=reflex-run-retention.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reflex-run-retention.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/reflex-run-retention.model.ts"],"names":[],"mappings":";;;AAIa,QAAA,8BAA8B,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AAGvE,QAAA,oBAAoB,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAW,CAAC;AAGlE,QAAA,6BAA6B,GAAG,EAAE,CAAC;AAGnC,QAAA,gCAAgC,GAAG,EAAE,CAAC"}
@@ -1,11 +0,0 @@
1
- export interface IReflexStorageSurplusOwner {
2
- organizationId?: string | null;
3
- userId?: string | null;
4
- }
5
- export interface IReflexStorageSurplusItem {
6
- id: string;
7
- sizeBytes: number;
8
- createdAt: Date | string;
9
- isFavorite: boolean;
10
- label: string;
11
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=reflex-storage-surplus.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reflex-storage-surplus.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/reflex-storage-surplus.model.ts"],"names":[],"mappings":""}
@@ -1,66 +0,0 @@
1
- import { AxiosAdapter, InternalAxiosRequestConfig } from 'axios';
2
- import { ADMIN_TOKEN_HEADER, AbyssReflexCore, ReflexErrorCode } from '..';
3
-
4
- const OWNER = { organizationId: 'org-1' };
5
- const BODY = { owner: OWNER, itemIds: ['day-1'] };
6
- const BASE = 'storage-surplus/admin';
7
-
8
- const surplus = () => AbyssReflexCore.sdk.storageSurplus.admin;
9
-
10
- describe('AbyssReflexCore storage surplus routes (day 90 of abyss-main)', () => {
11
- const adapter = jest.fn<ReturnType<AxiosAdapter>, [InternalAxiosRequestConfig]>(
12
- async (config) => ({
13
- data: { data: { items: [] } },
14
- status: 200,
15
- statusText: '',
16
- headers: {},
17
- config,
18
- }),
19
- );
20
-
21
- beforeAll(() => {
22
- AbyssReflexCore.setConfig({ baseURL: 'http://reflex.test/', adminToken: 'mesh-admin-token' });
23
- AbyssReflexCore.axios.defaults.adapter = adapter;
24
- });
25
-
26
- beforeEach(() => adapter.mockClear());
27
-
28
- it.each([
29
- [
30
- 'listArchivable',
31
- `${BASE}/archivable`,
32
- { owner: OWNER },
33
- () => surplus().listArchivable({ owner: OWNER }),
34
- ],
35
- ['archive', `${BASE}/archive`, BODY, () => surplus().archive(BODY)],
36
- [
37
- 'listArchives',
38
- `${BASE}/archives`,
39
- { owner: OWNER },
40
- () => surplus().listArchives({ owner: OWNER }),
41
- ],
42
- ['deleteArchives', `${BASE}/delete-archives`, BODY, () => surplus().deleteArchives(BODY)],
43
- ])('%s posts to %s with the body and the admin token', async (_label, url, body, run) => {
44
- const answer = await run();
45
-
46
- const config = adapter.mock.calls[0][0];
47
- expect(config.method).toBe('post');
48
- expect(config.url).toBe(url);
49
- expect(config.baseURL).toBe('http://reflex.test/');
50
- expect(JSON.parse(config.data)).toEqual(body);
51
- expect(config.headers.get(ADMIN_TOKEN_HEADER)).toBe('mesh-admin-token');
52
- expect(answer).toEqual({ data: { items: [] } });
53
- });
54
-
55
- it('names the header of the mesh admin token', () => {
56
- expect(ADMIN_TOKEN_HEADER).toBe('abyss-admin-token');
57
- });
58
-
59
- it('names the refusal of a publication past the storage quota', () => {
60
- expect(ReflexErrorCode.STORAGE_PUBLISH_REFUSED).toBe('STORAGE_PUBLISH_REFUSED');
61
- });
62
-
63
- it('names the 404 of a run whose archive was deleted', () => {
64
- expect(ReflexErrorCode.ARCHIVE_DELETED).toBe('ARCHIVE_DELETED');
65
- });
66
- });