@abyss-project/reflex 6.3.0 → 6.6.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 (123) hide show
  1. package/.prettierrc +5 -5
  2. package/dist/api/function-run.api.d.ts +3 -1
  3. package/dist/api/function-run.api.js +5 -1
  4. package/dist/api/function-run.api.js.map +1 -1
  5. package/dist/api/function-settings.api.d.ts +3 -1
  6. package/dist/api/function-settings.api.js +7 -1
  7. package/dist/api/function-settings.api.js.map +1 -1
  8. package/dist/api/index.d.ts +1 -0
  9. package/dist/api/index.js +1 -0
  10. package/dist/api/index.js.map +1 -1
  11. package/dist/api/storage-surplus.admin.api.d.ts +5 -0
  12. package/dist/api/storage-surplus.admin.api.js +17 -0
  13. package/dist/api/storage-surplus.admin.api.js.map +1 -0
  14. package/dist/discord/discord-command-tree.d.ts +5 -0
  15. package/dist/discord/discord-command-tree.js +38 -0
  16. package/dist/discord/discord-command-tree.js.map +1 -0
  17. package/dist/discord/discord-event-filter-cases.js +27 -11
  18. package/dist/discord/discord-event-filter-cases.js.map +1 -1
  19. package/dist/discord/discord-event-filters.js +7 -3
  20. package/dist/discord/discord-event-filters.js.map +1 -1
  21. package/dist/discord/discord-event-intents.d.ts +8 -2
  22. package/dist/discord/discord-event-intents.js +13 -2
  23. package/dist/discord/discord-event-intents.js.map +1 -1
  24. package/dist/discord/index.d.ts +1 -0
  25. package/dist/discord/index.js +1 -0
  26. package/dist/discord/index.js.map +1 -1
  27. package/dist/index.d.ts +17 -0
  28. package/dist/index.js +20 -1
  29. package/dist/index.js.map +1 -1
  30. package/dist/types/enum/discord-command-node-type.enum.d.ts +5 -0
  31. package/dist/types/enum/discord-command-node-type.enum.js +10 -0
  32. package/dist/types/enum/discord-command-node-type.enum.js.map +1 -0
  33. package/dist/types/enum/discord-command-type.enum.d.ts +5 -0
  34. package/dist/types/enum/discord-command-type.enum.js +10 -0
  35. package/dist/types/enum/discord-command-type.enum.js.map +1 -0
  36. package/dist/types/enum/discord-event-type.enum.d.ts +3 -1
  37. package/dist/types/enum/discord-event-type.enum.js +2 -0
  38. package/dist/types/enum/discord-event-type.enum.js.map +1 -1
  39. package/dist/types/enum/index.d.ts +2 -0
  40. package/dist/types/enum/index.js +2 -0
  41. package/dist/types/enum/index.js.map +1 -1
  42. package/dist/types/enum/reflex-error-code.enum.d.ts +14 -1
  43. package/dist/types/enum/reflex-error-code.enum.js +13 -0
  44. package/dist/types/enum/reflex-error-code.enum.js.map +1 -1
  45. package/dist/types/interface/api/requests/application-run-settings.request.d.ts +1 -0
  46. package/dist/types/interface/api/requests/function-run.request.d.ts +16 -0
  47. package/dist/types/interface/api/requests/function-settings.request.d.ts +12 -0
  48. package/dist/types/interface/api/requests/index.d.ts +1 -0
  49. package/dist/types/interface/api/requests/index.js +1 -0
  50. package/dist/types/interface/api/requests/index.js.map +1 -1
  51. package/dist/types/interface/api/requests/service-discord.request.d.ts +7 -3
  52. package/dist/types/interface/api/requests/service.request.d.ts +1 -0
  53. package/dist/types/interface/api/requests/storage-surplus.admin.request.d.ts +8 -0
  54. package/dist/types/interface/api/requests/storage-surplus.admin.request.js +3 -0
  55. package/dist/types/interface/api/requests/storage-surplus.admin.request.js.map +1 -0
  56. package/dist/types/interface/api/responses/function-run.response.d.ts +12 -0
  57. package/dist/types/interface/api/responses/function-settings.response.d.ts +5 -1
  58. package/dist/types/interface/api/responses/index.d.ts +1 -0
  59. package/dist/types/interface/api/responses/index.js +1 -0
  60. package/dist/types/interface/api/responses/index.js.map +1 -1
  61. package/dist/types/interface/api/responses/storage-surplus.admin.response.d.ts +8 -0
  62. package/dist/types/interface/api/responses/storage-surplus.admin.response.js +3 -0
  63. package/dist/types/interface/api/responses/storage-surplus.admin.response.js.map +1 -0
  64. package/dist/types/interface/models/index.d.ts +2 -0
  65. package/dist/types/interface/models/index.js +2 -0
  66. package/dist/types/interface/models/index.js.map +1 -1
  67. package/dist/types/interface/models/reflex-discord.model.d.ts +18 -2
  68. package/dist/types/interface/models/reflex-discord.model.js +4 -0
  69. package/dist/types/interface/models/reflex-discord.model.js.map +1 -1
  70. package/dist/types/interface/models/reflex-run-retention.model.d.ts +13 -0
  71. package/dist/types/interface/models/reflex-run-retention.model.js +8 -0
  72. package/dist/types/interface/models/reflex-run-retention.model.js.map +1 -0
  73. package/dist/types/interface/models/reflex-run-settings.model.d.ts +4 -0
  74. package/dist/types/interface/models/reflex-run.model.d.ts +9 -0
  75. package/dist/types/interface/models/reflex-run.model.js +4 -1
  76. package/dist/types/interface/models/reflex-run.model.js.map +1 -1
  77. package/dist/types/interface/models/reflex-service-deployment.model.d.ts +2 -2
  78. package/dist/types/interface/models/reflex-service.model.d.ts +1 -0
  79. package/dist/types/interface/models/reflex-storage-surplus.model.d.ts +11 -0
  80. package/dist/types/interface/models/reflex-storage-surplus.model.js +3 -0
  81. package/dist/types/interface/models/reflex-storage-surplus.model.js.map +1 -0
  82. package/package.json +1 -1
  83. package/src/api/application-run-settings.api.test.ts +62 -51
  84. package/src/api/function-run.api.ts +34 -0
  85. package/src/api/function-settings.api.ts +96 -74
  86. package/src/api/function.api.test.ts +346 -291
  87. package/src/api/index.ts +27 -26
  88. package/src/api/service.api.test.ts +220 -215
  89. package/src/api/storage-surplus.admin.api.test.ts +66 -0
  90. package/src/api/storage-surplus.admin.api.ts +45 -0
  91. package/src/discord/discord-command-tree.test.ts +47 -0
  92. package/src/discord/discord-command-tree.ts +60 -0
  93. package/src/discord/discord-event-filter-cases.ts +54 -16
  94. package/src/discord/discord-event-filters.test.ts +33 -4
  95. package/src/discord/discord-event-filters.ts +13 -5
  96. package/src/discord/discord-event-intents.test.ts +27 -0
  97. package/src/discord/discord-event-intents.ts +31 -6
  98. package/src/discord/index.ts +1 -0
  99. package/src/index.ts +44 -0
  100. package/src/types/enum/discord-command-node-type.enum.ts +10 -0
  101. package/src/types/enum/discord-command-type.enum.ts +9 -0
  102. package/src/types/enum/discord-event-type.enum.ts +4 -0
  103. package/src/types/enum/index.ts +2 -0
  104. package/src/types/enum/reflex-error-code.enum.ts +112 -73
  105. package/src/types/interface/api/requests/application-run-settings.request.ts +13 -11
  106. package/src/types/interface/api/requests/function-run.request.ts +53 -32
  107. package/src/types/interface/api/requests/function-settings.request.ts +50 -34
  108. package/src/types/interface/api/requests/index.ts +25 -24
  109. package/src/types/interface/api/requests/service-discord.request.ts +19 -6
  110. package/src/types/interface/api/requests/service.request.ts +48 -46
  111. package/src/types/interface/api/requests/storage-surplus.admin.request.ts +12 -0
  112. package/src/types/interface/api/responses/function-run.response.ts +35 -18
  113. package/src/types/interface/api/responses/function-settings.response.ts +57 -50
  114. package/src/types/interface/api/responses/index.ts +25 -24
  115. package/src/types/interface/api/responses/storage-surplus.admin.response.ts +10 -0
  116. package/src/types/interface/models/index.ts +29 -27
  117. package/src/types/interface/models/reflex-discord.model.ts +45 -4
  118. package/src/types/interface/models/reflex-run-retention.model.ts +24 -0
  119. package/src/types/interface/models/reflex-run-settings.model.ts +39 -28
  120. package/src/types/interface/models/reflex-run.model.ts +317 -299
  121. package/src/types/interface/models/reflex-service-deployment.model.ts +48 -46
  122. package/src/types/interface/models/reflex-service.model.ts +47 -45
  123. package/src/types/interface/models/reflex-storage-surplus.model.ts +23 -0
@@ -1,18 +1,35 @@
1
- import type { IReflexExecutionState, IReflexRun, IReflexRunDetail } from '../../models';
2
- import type { IResponse } from '../response';
3
-
4
- export interface IListFunctionRunData {
5
- /** Newest first. */
6
- runs: IReflexRun[];
7
- }
8
- export type IListFunctionRunResponse = IResponse<IListFunctionRunData>;
9
-
10
- export interface IGetFunctionRunData {
11
- run: IReflexRunDetail;
12
- }
13
- export type IGetFunctionRunResponse = IResponse<IGetFunctionRunData>;
14
-
15
- export interface IGetFunctionRunStateData {
16
- state: IReflexExecutionState;
17
- }
18
- export type IGetFunctionRunStateResponse = IResponse<IGetFunctionRunStateData>;
1
+ import type { IReflexExecutionState, IReflexRun, IReflexRunDetail } from '../../models';
2
+ import type { IResponse } from '../response';
3
+ import type { RunMode } from '../../../enum';
4
+
5
+ export interface IListFunctionRunData {
6
+ /** Newest first. */
7
+ runs: IReflexRun[];
8
+ }
9
+ export type IListFunctionRunResponse = IResponse<IListFunctionRunData>;
10
+
11
+ export interface IGetFunctionRunData {
12
+ run: IReflexRunDetail;
13
+ }
14
+ export type IGetFunctionRunResponse = IResponse<IGetFunctionRunData>;
15
+
16
+ export interface IReplayFunctionRunData {
17
+ mode: RunMode.DRY_RUN | RunMode.LIVE;
18
+ /** True when the kept input holds masked values (`***`): the function receives them masked. */
19
+ masked: boolean;
20
+ /** The dry run, for `DRY_RUN`. */
21
+ run?: IReflexRun;
22
+ /** The queued event (`event_inbox` row), for `LIVE`: its run appears in the runs and the event log. */
23
+ eventId?: string;
24
+ }
25
+ export type IReplayFunctionRunResponse = IResponse<IReplayFunctionRunData>;
26
+
27
+ export interface IGetFunctionRunStateData {
28
+ state: IReflexExecutionState;
29
+ }
30
+ export type IGetFunctionRunStateResponse = IResponse<IGetFunctionRunStateData>;
31
+
32
+ export interface ISetFunctionRunFavoriteData {
33
+ run: IReflexRun;
34
+ }
35
+ export type ISetFunctionRunFavoriteResponse = IResponse<ISetFunctionRunFavoriteData>;
@@ -1,50 +1,57 @@
1
- import type {
2
- IReflexEffectiveExecutionSettings,
3
- IReflexExecutionSettings,
4
- IReflexExecutionSettingsValues,
5
- IReflexFunctionLogCap,
6
- IReflexIssuedCompletionSecret,
7
- IReflexPriceList,
8
- } from '../../models';
9
- import type { IResponse } from '../response';
10
-
11
- export interface IGetFunctionSettingsData {
12
- /** The default of the function; null when none is set. */
13
- default: IReflexExecutionSettings | null;
14
- /** The override of each environment that has one. */
15
- environments: IReflexExecutionSettings[];
16
- /** What each environment of the application runs with. */
17
- effective: IReflexEffectiveExecutionSettings[];
18
- /** What applies when neither the environment nor the function sets anything. */
19
- builtIn: IReflexExecutionSettingsValues;
20
- /** The price list an execution is billed with, to estimate the cost of a setting. */
21
- priceList: IReflexPriceList;
22
- /** How the function caps the log lines it keeps per run. */
23
- logCap: IReflexFunctionLogCap;
24
- }
25
- export type IGetFunctionSettingsResponse = IResponse<IGetFunctionSettingsData>;
26
-
27
- export interface ISetFunctionDefaultSettingsData {
28
- settings: IReflexExecutionSettings;
29
- /**
30
- * The signing secrets of the completion webhook this change created (the first URL set in an environment of
31
- * the Service), in clear, ONCE; absent when none was created.
32
- */
33
- issuedCompletionSecrets?: IReflexIssuedCompletionSecret[];
34
- }
35
- export type ISetFunctionDefaultSettingsResponse = IResponse<ISetFunctionDefaultSettingsData>;
36
-
37
- export interface ISetFunctionEnvironmentSettingsData {
38
- settings: IReflexExecutionSettings;
39
- /** As for the default settings. */
40
- issuedCompletionSecrets?: IReflexIssuedCompletionSecret[];
41
- }
42
- export type ISetFunctionEnvironmentSettingsResponse =
43
- IResponse<ISetFunctionEnvironmentSettingsData>;
44
-
45
- export type IRemoveFunctionEnvironmentSettingsData = Record<string, never>;
46
- export type IRemoveFunctionEnvironmentSettingsResponse =
47
- IResponse<IRemoveFunctionEnvironmentSettingsData>;
48
-
49
- export type ISetFunctionLogCapData = IReflexFunctionLogCap;
50
- export type ISetFunctionLogCapResponse = IResponse<ISetFunctionLogCapData>;
1
+ import type {
2
+ IReflexEffectiveExecutionSettings,
3
+ IReflexExecutionSettings,
4
+ IReflexExecutionSettingsValues,
5
+ IReflexFunctionLogCap,
6
+ IReflexFunctionRunRetention,
7
+ IReflexIssuedCompletionSecret,
8
+ IReflexPriceList,
9
+ } from '../../models';
10
+ import type { IResponse } from '../response';
11
+
12
+ export interface IGetFunctionSettingsData {
13
+ /** The default of the function; null when none is set. */
14
+ default: IReflexExecutionSettings | null;
15
+ /** The override of each environment that has one. */
16
+ environments: IReflexExecutionSettings[];
17
+ /** What each environment of the application runs with. */
18
+ effective: IReflexEffectiveExecutionSettings[];
19
+ /** What applies when neither the environment nor the function sets anything. */
20
+ builtIn: IReflexExecutionSettingsValues;
21
+ /** The price list an execution is billed with, to estimate the cost of a setting. */
22
+ priceList: IReflexPriceList;
23
+ /** How the function caps the log lines it keeps per run. */
24
+ logCap: IReflexFunctionLogCap;
25
+ }
26
+ export type IGetFunctionSettingsResponse = IResponse<IGetFunctionSettingsData>;
27
+
28
+ export interface ISetFunctionDefaultSettingsData {
29
+ settings: IReflexExecutionSettings;
30
+ /**
31
+ * The signing secrets of the completion webhook this change created (the first URL set in an environment of
32
+ * the Service), in clear, ONCE; absent when none was created.
33
+ */
34
+ issuedCompletionSecrets?: IReflexIssuedCompletionSecret[];
35
+ }
36
+ export type ISetFunctionDefaultSettingsResponse = IResponse<ISetFunctionDefaultSettingsData>;
37
+
38
+ export interface ISetFunctionEnvironmentSettingsData {
39
+ settings: IReflexExecutionSettings;
40
+ /** As for the default settings. */
41
+ issuedCompletionSecrets?: IReflexIssuedCompletionSecret[];
42
+ }
43
+ export type ISetFunctionEnvironmentSettingsResponse =
44
+ IResponse<ISetFunctionEnvironmentSettingsData>;
45
+
46
+ export type IRemoveFunctionEnvironmentSettingsData = Record<string, never>;
47
+ export type IRemoveFunctionEnvironmentSettingsResponse =
48
+ IResponse<IRemoveFunctionEnvironmentSettingsData>;
49
+
50
+ export type ISetFunctionLogCapData = IReflexFunctionLogCap;
51
+ 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>;
@@ -1,24 +1,25 @@
1
- export * from './function.response';
2
- export * from './function-access.response';
3
- export * from './function-test.response';
4
- export * from './function-version.response';
5
- export * from './function-run.response';
6
- export * from './function-settings.response';
7
- export * from './service.response';
8
- export * from './service-route.response';
9
- export * from './service-version.response';
10
- export * from './service-deployment.response';
11
- export * from './service-configuration.response';
12
- export * from './service-discord.response';
13
- export * from './service-task.response';
14
- export * from './service-discord-event.response';
15
- export * from './service-insights.response';
16
- export * from './application-run-settings.response';
17
- export * from './application-insights.response';
18
- export * from './alert-rule.response';
19
- export * from './route-stats.response';
20
- export * from './function-template.response';
21
- export * from './service-consumer.response';
22
- export * from './service-openapi.response';
23
- export * from './service-limits.response';
24
- export * from './service-completion-webhook.response';
1
+ export * from './function.response';
2
+ export * from './function-access.response';
3
+ export * from './function-test.response';
4
+ export * from './function-version.response';
5
+ export * from './function-run.response';
6
+ export * from './function-settings.response';
7
+ export * from './service.response';
8
+ export * from './service-route.response';
9
+ export * from './service-version.response';
10
+ export * from './service-deployment.response';
11
+ export * from './service-configuration.response';
12
+ export * from './service-discord.response';
13
+ export * from './service-task.response';
14
+ export * from './service-discord-event.response';
15
+ export * from './service-insights.response';
16
+ export * from './application-run-settings.response';
17
+ export * from './application-insights.response';
18
+ export * from './alert-rule.response';
19
+ export * from './route-stats.response';
20
+ export * from './function-template.response';
21
+ export * from './service-consumer.response';
22
+ export * from './service-openapi.response';
23
+ export * from './service-limits.response';
24
+ export * from './service-completion-webhook.response';
25
+ export * from './storage-surplus.admin.response';
@@ -0,0 +1,10 @@
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,27 +1,29 @@
1
- export * from './reflex-definition.model';
2
- export * from './reflex-function.model';
3
- export * from './reflex-function-version.model';
4
- export * from './reflex-access-grant.model';
5
- export * from './reflex-run.model';
6
- export * from './reflex-execution-settings.model';
7
- export * from './reflex-step-stats.model';
8
- export * from './reflex-price-list.model';
9
- export * from './reflex-service.model';
10
- export * from './reflex-route.model';
11
- export * from './reflex-service-version.model';
12
- export * from './reflex-service-deployment.model';
13
- export * from './reflex-service-configuration.model';
14
- export * from './reflex-discord.model';
15
- export * from './reflex-task.model';
16
- export * from './reflex-discord-event.model';
17
- export * from './reflex-bot-limits.model';
18
- export * from './reflex-insights.model';
19
- export * from './reflex-discord-event-log.model';
20
- export * from './reflex-run-settings.model';
21
- export * from './reflex-alert-rule.model';
22
- export * from './reflex-access-request.model';
23
- export * from './reflex-function-template.model';
24
- export * from './reflex-route-contract.model';
25
- export * from './reflex-consumer.model';
26
- export * from './reflex-service-limits.model';
27
- export * from './reflex-completion-webhook.model';
1
+ export * from './reflex-definition.model';
2
+ export * from './reflex-function.model';
3
+ export * from './reflex-function-version.model';
4
+ export * from './reflex-access-grant.model';
5
+ export * from './reflex-run.model';
6
+ export * from './reflex-execution-settings.model';
7
+ export * from './reflex-step-stats.model';
8
+ export * from './reflex-price-list.model';
9
+ export * from './reflex-service.model';
10
+ export * from './reflex-route.model';
11
+ export * from './reflex-service-version.model';
12
+ export * from './reflex-service-deployment.model';
13
+ export * from './reflex-service-configuration.model';
14
+ export * from './reflex-discord.model';
15
+ export * from './reflex-task.model';
16
+ export * from './reflex-discord-event.model';
17
+ export * from './reflex-bot-limits.model';
18
+ export * from './reflex-insights.model';
19
+ export * from './reflex-discord-event-log.model';
20
+ export * from './reflex-run-settings.model';
21
+ export * from './reflex-alert-rule.model';
22
+ export * from './reflex-access-request.model';
23
+ export * from './reflex-function-template.model';
24
+ export * from './reflex-route-contract.model';
25
+ export * from './reflex-consumer.model';
26
+ export * from './reflex-service-limits.model';
27
+ export * from './reflex-completion-webhook.model';
28
+ export * from './reflex-run-retention.model';
29
+ export * from './reflex-storage-surplus.model';
@@ -1,6 +1,8 @@
1
1
  import type {
2
2
  DiscordActivityType,
3
3
  DiscordChannelType,
4
+ DiscordCommandNodeType,
5
+ DiscordCommandType,
4
6
  DiscordComponentKind,
5
7
  DiscordLocale,
6
8
  DiscordGatewayFailureCode,
@@ -20,7 +22,15 @@ export const REFLEX_DISCORD_LIMITS = {
20
22
  */
21
23
  localizedNamePattern: /^[-_'\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$/u,
22
24
  commandDescriptionMaxLength: 100,
25
+ /** Slash commands (roots) per Service; a subcommand or a group does not count. */
23
26
  commandsPerServiceMax: 100,
27
+ /** Context menus of each type per Service, as Discord allows. */
28
+ userCommandsPerServiceMax: 15,
29
+ messageCommandsPerServiceMax: 15,
30
+ /** Name of a context menu: 1 to 32 characters, capitals and spaces allowed, no space at either end. */
31
+ contextMenuNameMaxLength: 32,
32
+ /** Children of a command with subcommands, and subcommands of a group. */
33
+ subcommandsPerLevelMax: 25,
24
34
  optionsPerCommandMax: 25,
25
35
  choicesPerOptionMax: 25,
26
36
  /** `^[a-z0-9_-]{1,40}$`: the start of the `custom_id` of a button, a menu or a form. */
@@ -82,15 +92,29 @@ export interface IReflexDiscordCommandOption {
82
92
  descriptionLocalizations?: ReflexDiscordLocalizations;
83
93
  }
84
94
 
85
- /** A slash command of the draft of a Discord bot Service. */
95
+ /**
96
+ * A node of the commands of the draft of a Discord bot Service: a slash command, a subcommand group, a
97
+ * subcommand, or a context menu. Every leaf (a command without children, a subcommand, a context menu) runs its
98
+ * own function; a command with children and a group have none.
99
+ */
86
100
  export interface IReflexDiscordCommand {
87
101
  id: string;
88
102
  serviceId: string;
89
- /** A function of the same Service. */
90
- functionId: string;
91
- /** Unique within the Service. */
103
+ /** `CHAT_INPUT` for a slash command and all its nodes. */
104
+ type: DiscordCommandType;
105
+ nodeType: DiscordCommandNodeType;
106
+ /** The command (or group) this node belongs to; null for a command. */
107
+ parentId: string | null;
108
+ /** A function of the same Service; null for a command with subcommands and for a group. */
109
+ functionId: string | null;
110
+ /**
111
+ * Slash command and its nodes: `^[-_a-z0-9]{1,32}$`, unique among the nodes of the same parent. Context menu: 1 to
112
+ * 32 characters, capitals and spaces allowed, unique among the menus of its type.
113
+ */
92
114
  name: string;
115
+ /** 1 to 100 characters; the empty string for a context menu. */
93
116
  description: string;
117
+ /** Empty on a command with subcommands, a group and a context menu. */
94
118
  options: IReflexDiscordCommandOption[];
95
119
  /** Discord permission bits as a decimal string, or null for everyone. */
96
120
  defaultMemberPermissions: string | null;
@@ -137,8 +161,21 @@ export type IReflexDiscordCommandSnapshot = Pick<
137
161
  nameLocalizations?: ReflexDiscordLocalizations;
138
162
  descriptionLocalizations?: ReflexDiscordLocalizations;
139
163
  userInstallable?: true;
164
+ /** Card 943: only when not `CHAT_INPUT`. */
165
+ type?: DiscordCommandType;
166
+ /** Card 943: only on a group or a subcommand, with its `parentId`. */
167
+ nodeType?: DiscordCommandNodeType;
168
+ parentId?: string;
140
169
  };
141
170
 
171
+ /** A node of a command and its children, in name order (see `buildDiscordCommandTree`). */
172
+ export interface IReflexDiscordCommandTreeNode<
173
+ T extends Pick<IReflexDiscordCommand, 'id' | 'parentId' | 'name'> = IReflexDiscordCommand,
174
+ > {
175
+ command: T;
176
+ children: IReflexDiscordCommandTreeNode<T>[];
177
+ }
178
+
142
179
  /** A component as a version of the Service froze it. */
143
180
  export type IReflexDiscordComponentSnapshot = Pick<
144
181
  IReflexDiscordComponent,
@@ -162,6 +199,8 @@ export interface IReflexDiscordEnvironmentSettings {
162
199
  activityText: string | null;
163
200
  /** Largest file the bot receives or sends, in bytes: `REFLEX_DISCORD_LIMITS.attachmentMaxBytesDefault` until set. */
164
201
  maxAttachmentBytes: number;
202
+ /** The bot receives poll votes (intent `GUILD_MESSAGE_POLLS`); false until the developer turns them on. */
203
+ pollVotesEnabled: boolean;
165
204
  createdAt: Date;
166
205
  updatedAt: Date;
167
206
  }
@@ -192,6 +231,8 @@ export interface IReflexDiscordEnvironmentConnection {
192
231
  activityText: string | null;
193
232
  /** Largest file the bot receives or sends, in bytes (1 to `REFLEX_DISCORD_LIMITS.attachmentMaxBytesBound`). */
194
233
  maxAttachmentBytes: number;
234
+ /** The bot receives poll votes; false until turned on. */
235
+ pollVotesEnabled: boolean;
195
236
  /** The Gateway connection; null while the bot is not in service in this environment. */
196
237
  presence: IReflexDiscordPresence | null;
197
238
  /** Address to give Discord for interactions in this environment. */
@@ -0,0 +1,24 @@
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,28 +1,39 @@
1
- import type { LogCapMode } from '../../enum';
2
-
3
- /** Technical bounds of the log lines of a run, whatever the product cap. */
4
- export const REFLEX_LOG_LIMITS = {
5
- /** Lines kept per run; past it the lines are counted, not kept. */
6
- maxLinesPerRun: 10_000,
7
- /** Bytes of log lines kept per run; the first of the two bounds reached wins. */
8
- maxBytesPerRun: 4_194_304,
9
- /** Bounds of a product cap (application or function). */
10
- cap: { min: 1, max: 10_000 },
11
- } as const;
12
-
13
- /** The run settings of an application. */
14
- export interface IReflexApplicationRunSettings {
15
- applicationId: string;
16
- /** Cap of log lines per run for every function of the application that inherits it; null for no cap. */
17
- maxLogLinesPerRun: number | null;
18
- /** How long runs are kept, from the Monitor plan; null until the first synchronization answered. Read only. */
19
- retentionDays: number | null;
20
- /** Whether the application has Monitor activated. Read only. */
21
- monitorActivated: boolean;
22
- }
23
-
24
- /** The log cap of a function; `lines` is set if and only if `mode` is LIMIT. */
25
- export interface IReflexFunctionLogCap {
26
- mode: LogCapMode;
27
- lines: number | null;
28
- }
1
+ import type { LogCapMode } from '../../enum';
2
+
3
+ /** Technical bounds of the log lines of a run, whatever the product cap. */
4
+ export const REFLEX_LOG_LIMITS = {
5
+ /** Lines kept per run; past it the lines are counted, not kept. */
6
+ maxLinesPerRun: 10_000,
7
+ /** Bytes of log lines kept per run; the first of the two bounds reached wins. */
8
+ maxBytesPerRun: 4_194_304,
9
+ /** Bounds of a product cap (application or function). */
10
+ cap: { min: 1, max: 10_000 },
11
+ } as const;
12
+
13
+ /** The run settings of an application. */
14
+ export interface IReflexApplicationRunSettings {
15
+ applicationId: string;
16
+ /** Cap of log lines per run for every function of the application that inherits it; null for no cap. */
17
+ maxLogLinesPerRun: number | null;
18
+ /** How long runs are kept, from the Monitor plan; null until the first synchronization answered. Read only. */
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
+ /** Whether the application has Monitor activated. Read only. */
32
+ monitorActivated: boolean;
33
+ }
34
+
35
+ /** The log cap of a function; `lines` is set if and only if `mode` is LIMIT. */
36
+ export interface IReflexFunctionLogCap {
37
+ mode: LogCapMode;
38
+ lines: number | null;
39
+ }