@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,73 +1,112 @@
1
- /** `error.code` of the refusals a client acts on. */
2
- export enum ReflexErrorCode {
3
- /** 400: the definition does not match the format; `error.details` holds the path of each fault. */
4
- INVALID_DEFINITION = 'INVALID_DEFINITION',
5
- /** 409: an access granted to the function is suspended; revoke it and grant it again. */
6
- GRANT_SUSPENDED = 'GRANT_SUSPENDED',
7
- /** 409: the function has no frozen version of its own draft yet, or none to go back to. */
8
- NO_VERSION = 'NO_VERSION',
9
- /** 409: the access to grant is not declared by the draft of the function. */
10
- ACCESS_NOT_DECLARED = 'ACCESS_NOT_DECLARED',
11
- /** 404: the environment is not one of the application's environments (abyss-main). */
12
- ENVIRONMENT_NOT_FOUND = 'ENVIRONMENT_NOT_FOUND',
13
- /** 409: a name, a path or an access already exists. */
14
- ALREADY_EXISTS = 'ALREADY_EXISTS',
15
- /** 403: the function is promoted in a production environment and the member lacks REFLEX_PUBLISH_PRODUCTION. */
16
- PUBLISH_PRODUCTION_REQUIRED = 'PUBLISH_PRODUCTION_REQUIRED',
17
- /** 503 (edge): the Service is paused in this environment; nothing ran, nothing is billed. */
18
- SERVICE_PAUSED = 'SERVICE_PAUSED',
19
- /** 429: the caller went past the limit; `Retry-After` and `RateLimit-*` say when to come back. */
20
- RATE_LIMIT_EXCEEDED = 'RATE_LIMIT_EXCEEDED',
21
- /** 409: the route would hide another one of the Service (same method, paths equal but for their parameters). */
22
- ROUTE_CONFLICT = 'ROUTE_CONFLICT',
23
- /** 409: the Service has not changed since its last version. */
24
- VERSION_UNCHANGED = 'VERSION_UNCHANGED',
25
- /** 409: the Discord bot token has no value in this environment's Vault entry. */
26
- DISCORD_TOKEN_MISSING = 'DISCORD_TOKEN_MISSING',
27
- /** 409: Discord refused the bot token (401). */
28
- DISCORD_TOKEN_REJECTED = 'DISCORD_TOKEN_REJECTED',
29
- /** 409: a non-production environment needs a test server before a Discord bot goes live there. */
30
- DISCORD_TEST_GUILD_REQUIRED = 'DISCORD_TEST_GUILD_REQUIRED',
31
- /** 409: a command of that name already exists in the Service. */
32
- DISCORD_COMMAND_CONFLICT = 'DISCORD_COMMAND_CONFLICT',
33
- /** 409: the component prefix equals, starts or is started by another prefix of the Service. */
34
- DISCORD_COMPONENT_PREFIX_CONFLICT = 'DISCORD_COMPONENT_PREFIX_CONFLICT',
35
- /** 400: the field does not exist for this type of Service (CORS or rate limit on a Discord bot). */
36
- SERVICE_TYPE_FIELD_REFUSED = 'SERVICE_TYPE_FIELD_REFUSED',
37
- /**
38
- * 400: a route path cannot start with `_`: the edge keeps those paths for its own addresses (`_abyss` for the ticks
39
- * of the cron tasks, `_executions` for the state of an async execution).
40
- */
41
- ROUTE_SEGMENT_RESERVED = 'ROUTE_SEGMENT_RESERVED',
42
- /** 409: the bot bills credit overage but the organization does not allow overage of the credits metric. */
43
- CREDIT_OVERAGE_NOT_ALLOWED = 'CREDIT_OVERAGE_NOT_ALLOWED',
44
- /** 409: the lots asked for do not fit in the event rate reserve of the organization (the sum of its allocations would go past it). */
45
- BOT_EVENT_RESERVE_EXCEEDED = 'BOT_EVENT_RESERVE_EXCEEDED',
46
- /**
47
- * 422 (edge): the body or the query of the request does not match the contract of the route; `error.errors` holds
48
- * at most `REFLEX_CONTRACT_LIMITS.maxErrors` faults (`IReflexContractError`). Nothing ran, nothing is billed.
49
- */
50
- REQUEST_INVALID = 'REQUEST_INVALID',
51
- /**
52
- * 503 (edge): the credits of the organization are spent and the Service has no overage in this environment;
53
- * `Retry-After` points at the first day of the next month (UTC). Nothing ran, nothing is billed.
54
- */
55
- CREDITS_EXHAUSTED = 'CREDITS_EXHAUSTED',
56
- /**
57
- * 503 (edge): the monthly spend cap of the Service in this environment is reached; `Retry-After` points at the
58
- * first day of the next month (UTC), and raising the cap lifts the stop at the next computation. Nothing ran,
59
- * nothing is billed.
60
- */
61
- BUDGET_REACHED = 'BUDGET_REACHED',
62
- /** 400: the contract of a route is not a valid one; `error.details` holds each fault (`IReflexContractError`). */
63
- CONTRACT_INVALID = 'CONTRACT_INVALID',
64
- /** 409: the Service already has `REFLEX_CONSUMER_LIMITS.perService` consumers. */
65
- CONSUMER_LIMIT_REACHED = 'CONSUMER_LIMIT_REACHED',
66
- /** 409: the consumer already has `REFLEX_CONSUMER_LIMITS.activeKeysPerConsumer` keys that are not revoked. */
67
- CONSUMER_KEY_LIMIT_REACHED = 'CONSUMER_KEY_LIMIT_REACHED',
68
- /**
69
- * 400: the completion webhook URL is refused: not `https`, a private or internal address, or a name that resolves
70
- * to one or does not resolve.
71
- */
72
- COMPLETION_WEBHOOK_URL_REFUSED = 'COMPLETION_WEBHOOK_URL_REFUSED',
73
- }
1
+ /** `error.code` of the refusals a client acts on. */
2
+ export enum ReflexErrorCode {
3
+ /** 400: the definition does not match the format; `error.details` holds the path of each fault. */
4
+ INVALID_DEFINITION = 'INVALID_DEFINITION',
5
+ /** 409: an access granted to the function is suspended; revoke it and grant it again. */
6
+ GRANT_SUSPENDED = 'GRANT_SUSPENDED',
7
+ /** 409: the function has no frozen version of its own draft yet, or none to go back to. */
8
+ NO_VERSION = 'NO_VERSION',
9
+ /** 409: the access to grant is not declared by the draft of the function. */
10
+ ACCESS_NOT_DECLARED = 'ACCESS_NOT_DECLARED',
11
+ /** 404: the environment is not one of the application's environments (abyss-main). */
12
+ ENVIRONMENT_NOT_FOUND = 'ENVIRONMENT_NOT_FOUND',
13
+ /** 409: a name, a path or an access already exists. */
14
+ ALREADY_EXISTS = 'ALREADY_EXISTS',
15
+ /** 403: the function is promoted in a production environment and the member lacks REFLEX_PUBLISH_PRODUCTION. */
16
+ PUBLISH_PRODUCTION_REQUIRED = 'PUBLISH_PRODUCTION_REQUIRED',
17
+ /** 503 (edge): the Service is paused in this environment; nothing ran, nothing is billed. */
18
+ SERVICE_PAUSED = 'SERVICE_PAUSED',
19
+ /** 429: the caller went past the limit; `Retry-After` and `RateLimit-*` say when to come back. */
20
+ RATE_LIMIT_EXCEEDED = 'RATE_LIMIT_EXCEEDED',
21
+ /** 409: the route would hide another one of the Service (same method, paths equal but for their parameters). */
22
+ ROUTE_CONFLICT = 'ROUTE_CONFLICT',
23
+ /** 409: the Service has not changed since its last version. */
24
+ VERSION_UNCHANGED = 'VERSION_UNCHANGED',
25
+ /** 409: the Discord bot token has no value in this environment's Vault entry. */
26
+ DISCORD_TOKEN_MISSING = 'DISCORD_TOKEN_MISSING',
27
+ /** 409: Discord refused the bot token (401). */
28
+ DISCORD_TOKEN_REJECTED = 'DISCORD_TOKEN_REJECTED',
29
+ /** 409: a non-production environment needs a test server before a Discord bot goes live there. */
30
+ DISCORD_TEST_GUILD_REQUIRED = 'DISCORD_TEST_GUILD_REQUIRED',
31
+ /** 409: a command of that name already exists in the Service. */
32
+ DISCORD_COMMAND_CONFLICT = 'DISCORD_COMMAND_CONFLICT',
33
+ /**
34
+ * 422: the tree of a slash command is refused: a group under a group or under a subcommand, a child of a context menu
35
+ * or of a leaf, options on a command that has subcommands, or more than `subcommandsPerLevelMax` children.
36
+ */
37
+ DISCORD_COMMAND_TREE_INVALID = 'DISCORD_COMMAND_TREE_INVALID',
38
+ /** 422: a field Discord only reads on the root (default permissions, direct messages, user install) is set on a child. */
39
+ DISCORD_COMMAND_ROOT_ONLY_FIELD = 'DISCORD_COMMAND_ROOT_ONLY_FIELD',
40
+ /** 422: a version is refused while a command with subcommands, or a group, has no child; `error.data.commandIds` names them. */
41
+ DISCORD_COMMAND_EMPTY_PARENT = 'DISCORD_COMMAND_EMPTY_PARENT',
42
+ /** 409: the Service already has the most commands of that type (100 slash commands, 15 menus of each type). */
43
+ DISCORD_COMMAND_LIMIT = 'DISCORD_COMMAND_LIMIT',
44
+ /** 422: the run cannot be replayed: it was not started by a Discord event trigger. */
45
+ REPLAY_NOT_EVENT_RUN = 'REPLAY_NOT_EVENT_RUN',
46
+ /** 410: the detail of the run is gone (retention of the plan): nothing to replay. */
47
+ RUN_DETAIL_GONE = 'RUN_DETAIL_GONE',
48
+ /** 422: the kept input of the run was cut to fit its budget: replaying it would mislead the function. */
49
+ REPLAY_INPUT_TRUNCATED = 'REPLAY_INPUT_TRUNCATED',
50
+ /** 409: the event trigger of the run is no longer in service in its environment. */
51
+ REPLAY_TRIGGER_GONE = 'REPLAY_TRIGGER_GONE',
52
+ /** 409: the events of the bot are stopped in that environment (credits spent or monthly cap reached). */
53
+ BOT_EVENTS_BLOCKED = 'BOT_EVENTS_BLOCKED',
54
+ /** 429: the bot already has `REFLEX_REPLAY_LIMITS.liveReplaysPerMinute` real replays in the last minute in that environment. */
55
+ REPLAY_RATE_LIMITED = 'REPLAY_RATE_LIMITED',
56
+ /** 409: the component prefix equals, starts or is started by another prefix of the Service. */
57
+ DISCORD_COMPONENT_PREFIX_CONFLICT = 'DISCORD_COMPONENT_PREFIX_CONFLICT',
58
+ /** 400: the field does not exist for this type of Service (CORS or rate limit on a Discord bot). */
59
+ SERVICE_TYPE_FIELD_REFUSED = 'SERVICE_TYPE_FIELD_REFUSED',
60
+ /**
61
+ * 400: a route path cannot start with `_`: the edge keeps those paths for its own addresses (`_abyss` for the ticks
62
+ * of the cron tasks, `_executions` for the state of an async execution).
63
+ */
64
+ ROUTE_SEGMENT_RESERVED = 'ROUTE_SEGMENT_RESERVED',
65
+ /** 409: the bot bills credit overage but the organization does not allow overage of the credits metric. */
66
+ CREDIT_OVERAGE_NOT_ALLOWED = 'CREDIT_OVERAGE_NOT_ALLOWED',
67
+ /** 409: the lots asked for do not fit in the event rate reserve of the organization (the sum of its allocations would go past it). */
68
+ BOT_EVENT_RESERVE_EXCEEDED = 'BOT_EVENT_RESERVE_EXCEEDED',
69
+ /**
70
+ * 422 (edge): the body or the query of the request does not match the contract of the route; `error.errors` holds
71
+ * at most `REFLEX_CONTRACT_LIMITS.maxErrors` faults (`IReflexContractError`). Nothing ran, nothing is billed.
72
+ */
73
+ REQUEST_INVALID = 'REQUEST_INVALID',
74
+ /**
75
+ * 503 (edge): the credits of the organization are spent and the Service has no overage in this environment;
76
+ * `Retry-After` points at the first day of the next month (UTC). Nothing ran, nothing is billed.
77
+ */
78
+ CREDITS_EXHAUSTED = 'CREDITS_EXHAUSTED',
79
+ /**
80
+ * 503 (edge): the monthly spend cap of the Service in this environment is reached; `Retry-After` points at the
81
+ * first day of the next month (UTC), and raising the cap lifts the stop at the next computation. Nothing ran,
82
+ * nothing is billed.
83
+ */
84
+ BUDGET_REACHED = 'BUDGET_REACHED',
85
+ /** 400: the contract of a route is not a valid one; `error.details` holds each fault (`IReflexContractError`). */
86
+ CONTRACT_INVALID = 'CONTRACT_INVALID',
87
+ /** 409: the Service already has `REFLEX_CONSUMER_LIMITS.perService` consumers. */
88
+ CONSUMER_LIMIT_REACHED = 'CONSUMER_LIMIT_REACHED',
89
+ /** 409: the consumer already has `REFLEX_CONSUMER_LIMITS.activeKeysPerConsumer` keys that are not revoked. */
90
+ CONSUMER_KEY_LIMIT_REACHED = 'CONSUMER_KEY_LIMIT_REACHED',
91
+ /**
92
+ * 400: the completion webhook URL is refused: not `https`, a private or internal address, or a name that resolves
93
+ * to one or does not resolve.
94
+ */
95
+ COMPLETION_WEBHOOK_URL_REFUSED = 'COMPLETION_WEBHOOK_URL_REFUSED',
96
+ /**
97
+ * 503: the run detail is in the customer's archive and the archive cannot be read now (Storage unreachable, key
98
+ * unavailable, object failing its check). The run itself is untouched; asking again later may succeed.
99
+ */
100
+ ARCHIVE_UNAVAILABLE = 'ARCHIVE_UNAVAILABLE',
101
+ /**
102
+ * 404: the detail of the run was in the customer's archive and the archive was deleted (day 90 of the storage
103
+ * surplus). The run's row stays; its detail, steps and log lines are gone for good.
104
+ */
105
+ ARCHIVE_DELETED = 'ARCHIVE_DELETED',
106
+ /**
107
+ * 409: the version cannot be published because the AbyssReflex storage of the organization is full: its online quota
108
+ * is reached, or the personal threshold of AbyssReflex is, with "Block deposits" on. Nothing was published; the
109
+ * versions that exist and the executions go on. Delete versions, or raise the quota or the threshold.
110
+ */
111
+ STORAGE_PUBLISH_REFUSED = 'STORAGE_PUBLISH_REFUSED',
112
+ }
@@ -1,11 +1,13 @@
1
- export interface IGetApplicationRunSettingsParams {
2
- applicationId: string;
3
- }
4
-
5
- export interface ISetApplicationRunSettingsParams {
6
- applicationId: string;
7
- }
8
- export interface ISetApplicationRunSettingsBody {
9
- /** Cap of log lines per run, 1 to 10 000; null for no cap. */
10
- maxLogLinesPerRun: number | null;
11
- }
1
+ export interface IGetApplicationRunSettingsParams {
2
+ applicationId: string;
3
+ }
4
+
5
+ export interface ISetApplicationRunSettingsParams {
6
+ applicationId: string;
7
+ }
8
+ export interface ISetApplicationRunSettingsBody {
9
+ /** Cap of log lines per run, 1 to 10 000; null for no cap. */
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
+ }
@@ -1,32 +1,53 @@
1
- import type { RunMode } from '../../../enum';
2
-
3
- export interface IListFunctionRunParams {
4
- applicationId: string;
5
- functionId: string;
6
- }
7
- export interface IListFunctionRunQuery {
8
- mode?: RunMode;
9
- /** 1 to 100, 50 by default. */
10
- limit?: number;
11
- /** Runs skipped, newest first; 0 by default. */
12
- offset?: number;
13
- /** Only the live runs this task started (a tick of its cron or a delayed run); test runs have no task. */
14
- taskId?: string;
15
- /** Only the runs of this environment of the application (abyss-main's id). */
16
- environmentId?: string;
17
- /** Only the live runs this consumer of the Service called; test runs have no consumer. */
18
- consumerId?: string;
19
- }
20
-
21
- export interface IGetFunctionRunParams {
22
- applicationId: string;
23
- functionId: string;
24
- runId: string;
25
- }
26
-
27
- export interface IGetFunctionRunStateParams {
28
- applicationId: string;
29
- functionId: string;
30
- /** The `executionId` an async route answered with: the id of the live run. */
31
- runId: string;
32
- }
1
+ import type { RunMode } from '../../../enum';
2
+
3
+ export interface IReplayFunctionRunParams {
4
+ applicationId: string;
5
+ functionId: string;
6
+ /** A live run started by a Discord event trigger. */
7
+ runId: string;
8
+ }
9
+ export interface IReplayFunctionRunBody {
10
+ /** `DRY_RUN`: the draft, effects recorded not executed. `LIVE`: the version in service, as a received event. */
11
+ mode: RunMode.DRY_RUN | RunMode.LIVE;
12
+ }
13
+
14
+ export interface IListFunctionRunParams {
15
+ applicationId: string;
16
+ functionId: string;
17
+ }
18
+ export interface IListFunctionRunQuery {
19
+ mode?: RunMode;
20
+ /** 1 to 100, 50 by default. */
21
+ limit?: number;
22
+ /** Runs skipped, newest first; 0 by default. */
23
+ offset?: number;
24
+ /** Only the live runs this task started (a tick of its cron or a delayed run); test runs have no task. */
25
+ taskId?: string;
26
+ /** Only the runs of this environment of the application (abyss-main's id). */
27
+ environmentId?: string;
28
+ /** Only the live runs this consumer of the Service called; test runs have no consumer. */
29
+ consumerId?: string;
30
+ }
31
+
32
+ export interface IGetFunctionRunParams {
33
+ applicationId: string;
34
+ functionId: string;
35
+ runId: string;
36
+ }
37
+
38
+ export interface IGetFunctionRunStateParams {
39
+ applicationId: string;
40
+ functionId: string;
41
+ /** The `executionId` an async route answered with: the id of the live run. */
42
+ runId: string;
43
+ }
44
+
45
+ export interface ISetFunctionRunFavoriteParams {
46
+ applicationId: string;
47
+ functionId: string;
48
+ runId: string;
49
+ }
50
+ export interface ISetFunctionRunFavoriteBody {
51
+ /** A favorite run is never purged. */
52
+ isFavorite: boolean;
53
+ }
@@ -1,34 +1,50 @@
1
- import type { IReflexExecutionSettingsValues, IReflexFunctionLogCap } from '../../models';
2
-
3
- export interface IGetFunctionSettingsParams {
4
- applicationId: string;
5
- functionId: string;
6
- }
7
-
8
- export interface ISetFunctionDefaultSettingsParams {
9
- applicationId: string;
10
- functionId: string;
11
- }
12
- /** Every value is required: a row of settings is whole. */
13
- export type ISetFunctionDefaultSettingsBody = IReflexExecutionSettingsValues;
14
-
15
- export interface ISetFunctionEnvironmentSettingsParams {
16
- applicationId: string;
17
- functionId: string;
18
- /** An environment of the application (abyss-main's id). */
19
- environmentId: string;
20
- }
21
- export type ISetFunctionEnvironmentSettingsBody = IReflexExecutionSettingsValues;
22
-
23
- export interface IRemoveFunctionEnvironmentSettingsParams {
24
- applicationId: string;
25
- functionId: string;
26
- environmentId: string;
27
- }
28
-
29
- export interface ISetFunctionLogCapParams {
30
- applicationId: string;
31
- functionId: string;
32
- }
33
- /** `lines` is required, 1 to 10 000, when `mode` is LIMIT, and forbidden otherwise. */
34
- export type ISetFunctionLogCapBody = IReflexFunctionLogCap;
1
+ import type { IReflexExecutionSettingsValues, IReflexFunctionLogCap } from '../../models';
2
+
3
+ export interface IGetFunctionSettingsParams {
4
+ applicationId: string;
5
+ functionId: string;
6
+ }
7
+
8
+ export interface ISetFunctionDefaultSettingsParams {
9
+ applicationId: string;
10
+ functionId: string;
11
+ }
12
+ /** Every value is required: a row of settings is whole. */
13
+ export type ISetFunctionDefaultSettingsBody = IReflexExecutionSettingsValues;
14
+
15
+ export interface ISetFunctionEnvironmentSettingsParams {
16
+ applicationId: string;
17
+ functionId: string;
18
+ /** An environment of the application (abyss-main's id). */
19
+ environmentId: string;
20
+ }
21
+ export type ISetFunctionEnvironmentSettingsBody = IReflexExecutionSettingsValues;
22
+
23
+ export interface IRemoveFunctionEnvironmentSettingsParams {
24
+ applicationId: string;
25
+ functionId: string;
26
+ environmentId: string;
27
+ }
28
+
29
+ export interface ISetFunctionLogCapParams {
30
+ applicationId: string;
31
+ functionId: string;
32
+ }
33
+ /** `lines` is required, 1 to 10 000, when `mode` is LIMIT, and forbidden otherwise. */
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
+ }
@@ -1,24 +1,25 @@
1
- export * from './function.request';
2
- export * from './function-access.request';
3
- export * from './function-test.request';
4
- export * from './function-version.request';
5
- export * from './function-run.request';
6
- export * from './function-settings.request';
7
- export * from './service.request';
8
- export * from './service-route.request';
9
- export * from './service-version.request';
10
- export * from './service-deployment.request';
11
- export * from './service-configuration.request';
12
- export * from './service-discord.request';
13
- export * from './service-task.request';
14
- export * from './service-discord-event.request';
15
- export * from './service-insights.request';
16
- export * from './application-run-settings.request';
17
- export * from './application-insights.request';
18
- export * from './alert-rule.request';
19
- export * from './route-stats.request';
20
- export * from './function-template.request';
21
- export * from './service-consumer.request';
22
- export * from './service-openapi.request';
23
- export * from './service-limits.request';
24
- export * from './service-completion-webhook.request';
1
+ export * from './function.request';
2
+ export * from './function-access.request';
3
+ export * from './function-test.request';
4
+ export * from './function-version.request';
5
+ export * from './function-run.request';
6
+ export * from './function-settings.request';
7
+ export * from './service.request';
8
+ export * from './service-route.request';
9
+ export * from './service-version.request';
10
+ export * from './service-deployment.request';
11
+ export * from './service-configuration.request';
12
+ export * from './service-discord.request';
13
+ export * from './service-task.request';
14
+ export * from './service-discord-event.request';
15
+ export * from './service-insights.request';
16
+ export * from './application-run-settings.request';
17
+ export * from './application-insights.request';
18
+ export * from './alert-rule.request';
19
+ export * from './route-stats.request';
20
+ export * from './function-template.request';
21
+ export * from './service-consumer.request';
22
+ export * from './service-openapi.request';
23
+ export * from './service-limits.request';
24
+ export * from './service-completion-webhook.request';
25
+ export * from './storage-surplus.admin.request';
@@ -1,5 +1,7 @@
1
1
  import type {
2
2
  DiscordActivityType,
3
+ DiscordCommandNodeType,
4
+ DiscordCommandType,
3
5
  DiscordComponentKind,
4
6
  DiscordPresenceStatus,
5
7
  } from '../../../enum';
@@ -15,14 +17,23 @@ export interface ICreateServiceDiscordCommandParams {
15
17
  serviceId: string;
16
18
  }
17
19
  export interface ICreateServiceDiscordCommandBody {
18
- /** `^[-_a-z0-9]{1,32}$`, unique within the Service. */
20
+ /** `CHAT_INPUT` (default), or a context menu. Not editable. */
21
+ type?: DiscordCommandType;
22
+ /** `COMMAND` (default), or a group or a subcommand under `parentId`. Not editable. */
23
+ nodeType?: DiscordCommandNodeType;
24
+ /** The command (or group) of a group or a subcommand. Not editable. */
25
+ parentId?: string;
26
+ /** See `IReflexDiscordCommand.name`: unique among the nodes of the same parent, or the menus of the same type. */
19
27
  name: string;
20
- /** 1 to 100 characters. */
21
- description: string;
22
- /** 25 at most, required options first; empty by default. */
28
+ /** 1 to 100 characters; empty (or absent) for a context menu. */
29
+ description?: string;
30
+ /** 25 at most, required options first; empty by default, and always on a command with subcommands, a group and a menu. */
23
31
  options?: IReflexDiscordCommandOption[];
24
- /** A function of the same Service. */
25
- functionId: string;
32
+ /**
33
+ * A function of the same Service. Required for a leaf; absent for a group, and for a command created to hold
34
+ * subcommands.
35
+ */
36
+ functionId?: string;
26
37
  /** Discord permission bits as a decimal string; null (default) for everyone. */
27
38
  defaultMemberPermissions?: string | null;
28
39
  /** `true` by default. */
@@ -127,6 +138,8 @@ export interface ISetServiceDiscordEnvironmentBody {
127
138
  * omission resets: a screen sends it only when it changed it.
128
139
  */
129
140
  maxAttachmentBytes?: number;
141
+ /** Turns poll votes on or off; omitted, the current choice is kept (off until set), like `maxAttachmentBytes`. */
142
+ pollVotesEnabled?: boolean;
130
143
  }
131
144
 
132
145
  export interface ICheckServiceDiscordConnectionParams {
@@ -1,46 +1,48 @@
1
- import type { ServiceType } from '../../../enum';
2
- import type { IReflexServiceCors } from '../../models';
3
-
4
- export interface IListServiceParams {
5
- applicationId: string;
6
- }
7
-
8
- export interface ICreateServiceParams {
9
- applicationId: string;
10
- }
11
- export interface ICreateServiceBody {
12
- /** Unique within the application, 1 to 100 characters. */
13
- name: string;
14
- /** `^[a-z0-9][a-z0-9-]{0,39}$`, unique within the application, immutable. */
15
- slug: string;
16
- type: ServiceType;
17
- /** Not for a `DISCORD_BOT` Service: `400 SERVICE_TYPE_FIELD_REFUSED`. */
18
- cors?: IReflexServiceCors;
19
- /** 1 to 6000. Not for a `DISCORD_BOT` Service: `400 SERVICE_TYPE_FIELD_REFUSED`. */
20
- rateLimitPerIpPerMinute?: number;
21
- }
22
-
23
- export interface IGetServiceParams {
24
- applicationId: string;
25
- serviceId: string;
26
- }
27
-
28
- export interface IUpdateServiceParams {
29
- applicationId: string;
30
- serviceId: string;
31
- }
32
- /**
33
- * Changes the draft: the next version freezes `cors` and `rateLimitPerIpPerMinute`. Neither exists for a
34
- * `DISCORD_BOT` Service (`400 SERVICE_TYPE_FIELD_REFUSED`).
35
- */
36
- export interface IUpdateServiceBody {
37
- name?: string;
38
- cors?: IReflexServiceCors;
39
- /** 1 to 6000. */
40
- rateLimitPerIpPerMinute?: number;
41
- }
42
-
43
- export interface IDeleteServiceParams {
44
- applicationId: string;
45
- serviceId: string;
46
- }
1
+ import type { ServiceType } from '../../../enum';
2
+ import type { IReflexServiceCors } from '../../models';
3
+
4
+ export interface IListServiceParams {
5
+ applicationId: string;
6
+ }
7
+
8
+ export interface ICreateServiceParams {
9
+ applicationId: string;
10
+ }
11
+ export interface ICreateServiceBody {
12
+ /** Unique within the application, 1 to 100 characters. */
13
+ name: string;
14
+ /** `^[a-z0-9][a-z0-9-]{0,39}$`, unique within the application, immutable. */
15
+ slug: string;
16
+ type: ServiceType;
17
+ /** Not for a `DISCORD_BOT` Service: `400 SERVICE_TYPE_FIELD_REFUSED`. */
18
+ cors?: IReflexServiceCors;
19
+ /** 1 to 6000. Not for a `DISCORD_BOT` Service: `400 SERVICE_TYPE_FIELD_REFUSED`. */
20
+ rateLimitPerIpPerMinute?: number;
21
+ }
22
+
23
+ export interface IGetServiceParams {
24
+ applicationId: string;
25
+ serviceId: string;
26
+ }
27
+
28
+ export interface IUpdateServiceParams {
29
+ applicationId: string;
30
+ serviceId: string;
31
+ }
32
+ /**
33
+ * Changes the draft: the next version freezes `cors` and `rateLimitPerIpPerMinute`. Neither exists for a
34
+ * `DISCORD_BOT` Service (`400 SERVICE_TYPE_FIELD_REFUSED`).
35
+ */
36
+ export interface IUpdateServiceBody {
37
+ name?: string;
38
+ cors?: IReflexServiceCors;
39
+ /** 1 to 6000. */
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
+ }
44
+
45
+ export interface IDeleteServiceParams {
46
+ applicationId: string;
47
+ serviceId: string;
48
+ }
@@ -0,0 +1,12 @@
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
+ }