@abyss-project/reflex 5.1.0 → 5.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 (137) hide show
  1. package/dist/api/index.d.ts +1 -0
  2. package/dist/api/index.js +1 -0
  3. package/dist/api/index.js.map +1 -1
  4. package/dist/api/service-task.api.d.ts +9 -0
  5. package/dist/api/service-task.api.js +24 -0
  6. package/dist/api/service-task.api.js.map +1 -0
  7. package/dist/api/service-version.api.d.ts +2 -1
  8. package/dist/api/service-version.api.js +3 -1
  9. package/dist/api/service-version.api.js.map +1 -1
  10. package/dist/index.d.ts +14 -0
  11. package/dist/index.js +14 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/types/enum/index.d.ts +2 -0
  14. package/dist/types/enum/index.js +2 -0
  15. package/dist/types/enum/index.js.map +1 -1
  16. package/dist/types/enum/reflex-error-code.enum.d.ts +2 -1
  17. package/dist/types/enum/reflex-error-code.enum.js +1 -0
  18. package/dist/types/enum/reflex-error-code.enum.js.map +1 -1
  19. package/dist/types/enum/schedule-sync-status.enum.d.ts +5 -0
  20. package/dist/types/enum/schedule-sync-status.enum.js +10 -0
  21. package/dist/types/enum/schedule-sync-status.enum.js.map +1 -0
  22. package/dist/types/enum/scheduled-run-origin.enum.d.ts +4 -0
  23. package/dist/types/enum/scheduled-run-origin.enum.js +9 -0
  24. package/dist/types/enum/scheduled-run-origin.enum.js.map +1 -0
  25. package/dist/types/interface/api/requests/function-run.request.d.ts +2 -0
  26. package/dist/types/interface/api/requests/function-test.request.d.ts +4 -0
  27. package/dist/types/interface/api/requests/index.d.ts +1 -0
  28. package/dist/types/interface/api/requests/index.js +1 -0
  29. package/dist/types/interface/api/requests/index.js.map +1 -1
  30. package/dist/types/interface/api/requests/service-task.request.d.ts +54 -0
  31. package/dist/types/interface/api/requests/service-task.request.js +3 -0
  32. package/dist/types/interface/api/requests/service-task.request.js.map +1 -0
  33. package/dist/types/interface/api/requests/service-version.request.d.ts +4 -0
  34. package/dist/types/interface/api/responses/index.d.ts +1 -0
  35. package/dist/types/interface/api/responses/index.js +1 -0
  36. package/dist/types/interface/api/responses/index.js.map +1 -1
  37. package/dist/types/interface/api/responses/service-task.response.d.ts +31 -0
  38. package/dist/types/interface/api/responses/service-task.response.js +3 -0
  39. package/dist/types/interface/api/responses/service-task.response.js.map +1 -0
  40. package/dist/types/interface/api/responses/service-version.response.d.ts +13 -1
  41. package/dist/types/interface/models/index.d.ts +1 -0
  42. package/dist/types/interface/models/index.js +1 -0
  43. package/dist/types/interface/models/index.js.map +1 -1
  44. package/dist/types/interface/models/reflex-run.model.d.ts +3 -1
  45. package/dist/types/interface/models/reflex-service-deployment.model.d.ts +4 -1
  46. package/dist/types/interface/models/reflex-service-version.model.d.ts +2 -0
  47. package/dist/types/interface/models/reflex-task.model.d.ts +35 -0
  48. package/dist/types/interface/models/reflex-task.model.js +15 -0
  49. package/dist/types/interface/models/reflex-task.model.js.map +1 -0
  50. package/package.json +10 -15
  51. package/src/api/index.ts +1 -0
  52. package/src/api/service-task.api.test.ts +124 -0
  53. package/src/api/service-task.api.ts +122 -0
  54. package/src/api/service-version.api.ts +15 -0
  55. package/src/api/service.api.test.ts +6 -0
  56. package/src/index.ts +29 -0
  57. package/src/types/enum/access-grant-status.enum.ts +12 -12
  58. package/src/types/enum/access-kind.enum.ts +7 -7
  59. package/src/types/enum/configuration-read-as.enum.ts +5 -5
  60. package/src/types/enum/discord-activity-type.enum.ts +9 -9
  61. package/src/types/enum/discord-component-kind.enum.ts +7 -7
  62. package/src/types/enum/discord-gateway-failure-code.enum.ts +9 -9
  63. package/src/types/enum/discord-gateway-state.enum.ts +11 -11
  64. package/src/types/enum/discord-option-type.enum.ts +12 -12
  65. package/src/types/enum/discord-presence-status.enum.ts +8 -8
  66. package/src/types/enum/discord-sync-status.enum.ts +6 -6
  67. package/src/types/enum/discord-token-state.enum.ts +11 -11
  68. package/src/types/enum/execution-mode.enum.ts +9 -9
  69. package/src/types/enum/execution-profile.enum.ts +20 -20
  70. package/src/types/enum/execution-settings-source.enum.ts +9 -9
  71. package/src/types/enum/health-status.enum.ts +4 -4
  72. package/src/types/enum/index.ts +31 -29
  73. package/src/types/enum/reflex-error-code.enum.ts +39 -37
  74. package/src/types/enum/route-method.enum.ts +9 -9
  75. package/src/types/enum/run-log-level.enum.ts +6 -6
  76. package/src/types/enum/run-mode.enum.ts +11 -11
  77. package/src/types/enum/run-status.enum.ts +11 -11
  78. package/src/types/enum/run-step-status.enum.ts +7 -7
  79. package/src/types/enum/schedule-sync-status.enum.ts +6 -0
  80. package/src/types/enum/scheduled-run-origin.enum.ts +5 -0
  81. package/src/types/enum/service-deployment-action.enum.ts +11 -11
  82. package/src/types/enum/service-deployment-status.enum.ts +5 -5
  83. package/src/types/enum/service-type.enum.ts +9 -9
  84. package/src/types/enum/service-version-change-kind.enum.ts +6 -6
  85. package/src/types/enum/trace-effect-type.enum.ts +12 -12
  86. package/src/types/enum/trigger-access-mode.enum.ts +12 -12
  87. package/src/types/enum/vault-value-source.enum.ts +12 -12
  88. package/src/types/enum/vault-visibility.enum.ts +5 -5
  89. package/src/types/index.ts +2 -2
  90. package/src/types/interface/api/index.ts +3 -3
  91. package/src/types/interface/api/requests/function-access.request.ts +25 -25
  92. package/src/types/interface/api/requests/function-run.request.ts +30 -26
  93. package/src/types/interface/api/requests/function-settings.request.ts +27 -27
  94. package/src/types/interface/api/requests/function-test.request.ts +39 -24
  95. package/src/types/interface/api/requests/function-version.request.ts +20 -20
  96. package/src/types/interface/api/requests/function.request.ts +36 -36
  97. package/src/types/interface/api/requests/index.ts +13 -12
  98. package/src/types/interface/api/requests/service-configuration.request.ts +4 -4
  99. package/src/types/interface/api/requests/service-deployment.request.ts +49 -49
  100. package/src/types/interface/api/requests/service-discord.request.ts +128 -128
  101. package/src/types/interface/api/requests/service-route.request.ts +44 -44
  102. package/src/types/interface/api/requests/service-task.request.ts +66 -0
  103. package/src/types/interface/api/requests/service-version.request.ts +24 -19
  104. package/src/types/interface/api/requests/service.request.ts +46 -46
  105. package/src/types/interface/api/response.ts +4 -4
  106. package/src/types/interface/api/responses/function-access.response.ts +17 -17
  107. package/src/types/interface/api/responses/function-run.response.ts +18 -18
  108. package/src/types/interface/api/responses/function-settings.response.ts +36 -36
  109. package/src/types/interface/api/responses/function-test.response.ts +12 -12
  110. package/src/types/interface/api/responses/function-version.response.ts +31 -31
  111. package/src/types/interface/api/responses/function.response.ts +25 -25
  112. package/src/types/interface/api/responses/index.ts +13 -12
  113. package/src/types/interface/api/responses/service-configuration.response.ts +8 -8
  114. package/src/types/interface/api/responses/service-deployment.response.ts +32 -32
  115. package/src/types/interface/api/responses/service-discord.response.ts +72 -72
  116. package/src/types/interface/api/responses/service-route.response.ts +31 -31
  117. package/src/types/interface/api/responses/service-task.response.ts +48 -0
  118. package/src/types/interface/api/responses/service-version.response.ts +91 -62
  119. package/src/types/interface/api/responses/service.response.ts +31 -31
  120. package/src/types/interface/health.response.ts +7 -7
  121. package/src/types/interface/index.ts +3 -3
  122. package/src/types/interface/models/index.ts +15 -14
  123. package/src/types/interface/models/reflex-access-grant.model.ts +14 -14
  124. package/src/types/interface/models/reflex-definition.model.ts +31 -31
  125. package/src/types/interface/models/reflex-discord.model.ts +146 -146
  126. package/src/types/interface/models/reflex-execution-settings.model.ts +50 -50
  127. package/src/types/interface/models/reflex-function-version.model.ts +14 -14
  128. package/src/types/interface/models/reflex-function.model.ts +16 -16
  129. package/src/types/interface/models/reflex-price-list.model.ts +20 -20
  130. package/src/types/interface/models/reflex-route.model.ts +19 -19
  131. package/src/types/interface/models/reflex-run.model.ts +179 -173
  132. package/src/types/interface/models/reflex-service-configuration.model.ts +22 -22
  133. package/src/types/interface/models/reflex-service-deployment.model.ts +46 -40
  134. package/src/types/interface/models/reflex-service-version.model.ts +58 -55
  135. package/src/types/interface/models/reflex-service.model.ts +45 -45
  136. package/src/types/interface/models/reflex-step-stats.model.ts +35 -35
  137. package/src/types/interface/models/reflex-task.model.ts +61 -0
@@ -1,31 +1,31 @@
1
- import type { ReflexAccessKind } from '../../enum';
2
-
3
- export interface IReflexHttpAccess {
4
- kind: ReflexAccessKind.HTTP;
5
- hosts: string[];
6
- }
7
-
8
- export interface IReflexHostActionAccess {
9
- kind: ReflexAccessKind.HOST_ACTION;
10
- action: string;
11
- }
12
-
13
- export type IReflexAccessDeclaration = IReflexHttpAccess | IReflexHostActionAccess;
14
-
15
- /**
16
- * A function's definition, in the format of @abyss-project/runtime (`formatVersion` 1). The steps are
17
- * the core's own and validated by the API; the SDK only carries them.
18
- */
19
- export interface IReflexDefinition {
20
- formatVersion: number;
21
- accesses: IReflexAccessDeclaration[];
22
- steps: Array<Record<string, unknown>>;
23
- }
24
-
25
- /**
26
- * Bounds of the status a RESPOND step (or `abyss.respond`) may answer with, both included: the
27
- * runtime's `MIN_RESPONSE_STATUS` and `MAX_RESPONSE_STATUS`, which publication and the edge apply.
28
- * The API's tests check that they are equal.
29
- */
30
- export const RESPOND_STATUS_MIN = 200;
31
- export const RESPOND_STATUS_MAX = 599;
1
+ import type { ReflexAccessKind } from '../../enum';
2
+
3
+ export interface IReflexHttpAccess {
4
+ kind: ReflexAccessKind.HTTP;
5
+ hosts: string[];
6
+ }
7
+
8
+ export interface IReflexHostActionAccess {
9
+ kind: ReflexAccessKind.HOST_ACTION;
10
+ action: string;
11
+ }
12
+
13
+ export type IReflexAccessDeclaration = IReflexHttpAccess | IReflexHostActionAccess;
14
+
15
+ /**
16
+ * A function's definition, in the format of @abyss-project/runtime (`formatVersion` 1). The steps are
17
+ * the core's own and validated by the API; the SDK only carries them.
18
+ */
19
+ export interface IReflexDefinition {
20
+ formatVersion: number;
21
+ accesses: IReflexAccessDeclaration[];
22
+ steps: Array<Record<string, unknown>>;
23
+ }
24
+
25
+ /**
26
+ * Bounds of the status a RESPOND step (or `abyss.respond`) may answer with, both included: the
27
+ * runtime's `MIN_RESPONSE_STATUS` and `MAX_RESPONSE_STATUS`, which publication and the edge apply.
28
+ * The API's tests check that they are equal.
29
+ */
30
+ export const RESPOND_STATUS_MIN = 200;
31
+ export const RESPOND_STATUS_MAX = 599;
@@ -1,146 +1,146 @@
1
- import type {
2
- DiscordActivityType,
3
- DiscordComponentKind,
4
- DiscordGatewayFailureCode,
5
- DiscordGatewayState,
6
- DiscordOptionType,
7
- DiscordPresenceStatus,
8
- DiscordTokenState,
9
- } from '../../enum';
10
-
11
- /** Bounds of the commands and components of a Discord bot; the API and its database apply the same ones. */
12
- export const REFLEX_DISCORD_LIMITS = {
13
- /** `^[-_a-z0-9]{1,32}$`: the name typed after the slash. */
14
- commandNamePattern: /^[-_a-z0-9]{1,32}$/,
15
- commandDescriptionMaxLength: 100,
16
- commandsPerServiceMax: 100,
17
- optionsPerCommandMax: 25,
18
- choicesPerOptionMax: 25,
19
- /** `^[a-z0-9_-]{1,40}$`: the start of the `custom_id` of a button, a menu or a form. */
20
- componentPrefixPattern: /^[a-z0-9_-]{1,40}$/,
21
- syncErrorMaxLength: 500,
22
- } as const;
23
-
24
- /** A fixed answer a user picks for a STRING, INTEGER or NUMBER option. */
25
- export interface IReflexDiscordOptionChoice {
26
- name: string;
27
- value: string | number;
28
- }
29
-
30
- /** An option of a command. Required options come first. */
31
- export interface IReflexDiscordCommandOption {
32
- type: DiscordOptionType;
33
- /** Same pattern as the command name. */
34
- name: string;
35
- /** 1 to 100 characters. */
36
- description: string;
37
- required: boolean;
38
- /** 25 at most, only for STRING, INTEGER and NUMBER. */
39
- choices?: IReflexDiscordOptionChoice[];
40
- }
41
-
42
- /** A slash command of the draft of a Discord bot Service. */
43
- export interface IReflexDiscordCommand {
44
- id: string;
45
- serviceId: string;
46
- /** A function of the same Service. */
47
- functionId: string;
48
- /** Unique within the Service. */
49
- name: string;
50
- description: string;
51
- options: IReflexDiscordCommandOption[];
52
- /** Discord permission bits as a decimal string, or null for everyone. */
53
- defaultMemberPermissions: string | null;
54
- allowedInDirectMessages: boolean;
55
- createdAt: Date;
56
- updatedAt: Date;
57
- }
58
-
59
- /** A button, select menu or form of the draft of a Discord bot Service, routed by the start of its `custom_id`. */
60
- export interface IReflexDiscordComponent {
61
- id: string;
62
- serviceId: string;
63
- /** A function of the same Service. */
64
- functionId: string;
65
- /** Unique within the Service; no prefix starts another one. An interaction matches the prefix followed by `:`, or equal to its `custom_id`. */
66
- customIdPrefix: string;
67
- kind: DiscordComponentKind;
68
- createdAt: Date;
69
- updatedAt: Date;
70
- }
71
-
72
- /** A command as a version of the Service froze it. */
73
- export type IReflexDiscordCommandSnapshot = Pick<
74
- IReflexDiscordCommand,
75
- | 'id'
76
- | 'functionId'
77
- | 'name'
78
- | 'description'
79
- | 'options'
80
- | 'defaultMemberPermissions'
81
- | 'allowedInDirectMessages'
82
- >;
83
-
84
- /** A component as a version of the Service froze it. */
85
- export type IReflexDiscordComponentSnapshot = Pick<
86
- IReflexDiscordComponent,
87
- 'id' | 'functionId' | 'customIdPrefix' | 'kind'
88
- >;
89
-
90
- /** Settings of a Discord bot Service in one environment, kept outside the versions. */
91
- export interface IReflexDiscordEnvironmentSettings {
92
- id: string;
93
- serviceId: string;
94
- environmentId: string;
95
- /** Discord server (snowflake) the commands are pushed to outside production; required there. */
96
- testGuildId: string | null;
97
- /** Discord permission bits as a decimal string, put in the invitation link. */
98
- invitePermissions: string;
99
- /** What the bot shows while connected. */
100
- presenceStatus: DiscordPresenceStatus;
101
- /** Null for no activity. */
102
- activityType: DiscordActivityType | null;
103
- /** 1 to 128 characters with an `activityType`, null without. */
104
- activityText: string | null;
105
- createdAt: Date;
106
- updatedAt: Date;
107
- }
108
-
109
- /** The Gateway connection of the bot of one environment, as its row in the execution plane says. */
110
- export interface IReflexDiscordPresence {
111
- state: DiscordGatewayState;
112
- /** Set if and only if `state` is `FAILED`. */
113
- failureCode: DiscordGatewayFailureCode | null;
114
- stateChangedAt: Date;
115
- /** Null until the bot connected once. */
116
- lastConnectedAt: Date | null;
117
- }
118
-
119
- /** What the Connection screen shows of the bot of one environment. Never carries the token. */
120
- export interface IReflexDiscordEnvironmentConnection {
121
- environmentId: string;
122
- /** The Discord application read from the token; null while the token is missing, rejected or unchecked. */
123
- applicationId: string | null;
124
- publicKey: string | null;
125
- botName: string | null;
126
- botAvatarUrl: string | null;
127
- tokenState: DiscordTokenState;
128
- testGuildId: string | null;
129
- invitePermissions: string;
130
- presenceStatus: DiscordPresenceStatus;
131
- activityType: DiscordActivityType | null;
132
- activityText: string | null;
133
- /** The Gateway connection; null while the bot is not in service in this environment. */
134
- presence: IReflexDiscordPresence | null;
135
- /** Address to give Discord for interactions in this environment. */
136
- interactionsUrl: string;
137
- /** Link that adds the bot to a Discord server; null while the application is unknown. */
138
- inviteUrl: string | null;
139
- }
140
-
141
- /** The Vault entry holding the token, and the bot of each environment of the application. */
142
- export interface IReflexDiscordConnection {
143
- /** Vault entry (secret) that holds the bot token, one value per environment; null until chosen. */
144
- discordTokenSecretId: string | null;
145
- environments: IReflexDiscordEnvironmentConnection[];
146
- }
1
+ import type {
2
+ DiscordActivityType,
3
+ DiscordComponentKind,
4
+ DiscordGatewayFailureCode,
5
+ DiscordGatewayState,
6
+ DiscordOptionType,
7
+ DiscordPresenceStatus,
8
+ DiscordTokenState,
9
+ } from '../../enum';
10
+
11
+ /** Bounds of the commands and components of a Discord bot; the API and its database apply the same ones. */
12
+ export const REFLEX_DISCORD_LIMITS = {
13
+ /** `^[-_a-z0-9]{1,32}$`: the name typed after the slash. */
14
+ commandNamePattern: /^[-_a-z0-9]{1,32}$/,
15
+ commandDescriptionMaxLength: 100,
16
+ commandsPerServiceMax: 100,
17
+ optionsPerCommandMax: 25,
18
+ choicesPerOptionMax: 25,
19
+ /** `^[a-z0-9_-]{1,40}$`: the start of the `custom_id` of a button, a menu or a form. */
20
+ componentPrefixPattern: /^[a-z0-9_-]{1,40}$/,
21
+ syncErrorMaxLength: 500,
22
+ } as const;
23
+
24
+ /** A fixed answer a user picks for a STRING, INTEGER or NUMBER option. */
25
+ export interface IReflexDiscordOptionChoice {
26
+ name: string;
27
+ value: string | number;
28
+ }
29
+
30
+ /** An option of a command. Required options come first. */
31
+ export interface IReflexDiscordCommandOption {
32
+ type: DiscordOptionType;
33
+ /** Same pattern as the command name. */
34
+ name: string;
35
+ /** 1 to 100 characters. */
36
+ description: string;
37
+ required: boolean;
38
+ /** 25 at most, only for STRING, INTEGER and NUMBER. */
39
+ choices?: IReflexDiscordOptionChoice[];
40
+ }
41
+
42
+ /** A slash command of the draft of a Discord bot Service. */
43
+ export interface IReflexDiscordCommand {
44
+ id: string;
45
+ serviceId: string;
46
+ /** A function of the same Service. */
47
+ functionId: string;
48
+ /** Unique within the Service. */
49
+ name: string;
50
+ description: string;
51
+ options: IReflexDiscordCommandOption[];
52
+ /** Discord permission bits as a decimal string, or null for everyone. */
53
+ defaultMemberPermissions: string | null;
54
+ allowedInDirectMessages: boolean;
55
+ createdAt: Date;
56
+ updatedAt: Date;
57
+ }
58
+
59
+ /** A button, select menu or form of the draft of a Discord bot Service, routed by the start of its `custom_id`. */
60
+ export interface IReflexDiscordComponent {
61
+ id: string;
62
+ serviceId: string;
63
+ /** A function of the same Service. */
64
+ functionId: string;
65
+ /** Unique within the Service; no prefix starts another one. An interaction matches the prefix followed by `:`, or equal to its `custom_id`. */
66
+ customIdPrefix: string;
67
+ kind: DiscordComponentKind;
68
+ createdAt: Date;
69
+ updatedAt: Date;
70
+ }
71
+
72
+ /** A command as a version of the Service froze it. */
73
+ export type IReflexDiscordCommandSnapshot = Pick<
74
+ IReflexDiscordCommand,
75
+ | 'id'
76
+ | 'functionId'
77
+ | 'name'
78
+ | 'description'
79
+ | 'options'
80
+ | 'defaultMemberPermissions'
81
+ | 'allowedInDirectMessages'
82
+ >;
83
+
84
+ /** A component as a version of the Service froze it. */
85
+ export type IReflexDiscordComponentSnapshot = Pick<
86
+ IReflexDiscordComponent,
87
+ 'id' | 'functionId' | 'customIdPrefix' | 'kind'
88
+ >;
89
+
90
+ /** Settings of a Discord bot Service in one environment, kept outside the versions. */
91
+ export interface IReflexDiscordEnvironmentSettings {
92
+ id: string;
93
+ serviceId: string;
94
+ environmentId: string;
95
+ /** Discord server (snowflake) the commands are pushed to outside production; required there. */
96
+ testGuildId: string | null;
97
+ /** Discord permission bits as a decimal string, put in the invitation link. */
98
+ invitePermissions: string;
99
+ /** What the bot shows while connected. */
100
+ presenceStatus: DiscordPresenceStatus;
101
+ /** Null for no activity. */
102
+ activityType: DiscordActivityType | null;
103
+ /** 1 to 128 characters with an `activityType`, null without. */
104
+ activityText: string | null;
105
+ createdAt: Date;
106
+ updatedAt: Date;
107
+ }
108
+
109
+ /** The Gateway connection of the bot of one environment, as its row in the execution plane says. */
110
+ export interface IReflexDiscordPresence {
111
+ state: DiscordGatewayState;
112
+ /** Set if and only if `state` is `FAILED`. */
113
+ failureCode: DiscordGatewayFailureCode | null;
114
+ stateChangedAt: Date;
115
+ /** Null until the bot connected once. */
116
+ lastConnectedAt: Date | null;
117
+ }
118
+
119
+ /** What the Connection screen shows of the bot of one environment. Never carries the token. */
120
+ export interface IReflexDiscordEnvironmentConnection {
121
+ environmentId: string;
122
+ /** The Discord application read from the token; null while the token is missing, rejected or unchecked. */
123
+ applicationId: string | null;
124
+ publicKey: string | null;
125
+ botName: string | null;
126
+ botAvatarUrl: string | null;
127
+ tokenState: DiscordTokenState;
128
+ testGuildId: string | null;
129
+ invitePermissions: string;
130
+ presenceStatus: DiscordPresenceStatus;
131
+ activityType: DiscordActivityType | null;
132
+ activityText: string | null;
133
+ /** The Gateway connection; null while the bot is not in service in this environment. */
134
+ presence: IReflexDiscordPresence | null;
135
+ /** Address to give Discord for interactions in this environment. */
136
+ interactionsUrl: string;
137
+ /** Link that adds the bot to a Discord server; null while the application is unknown. */
138
+ inviteUrl: string | null;
139
+ }
140
+
141
+ /** The Vault entry holding the token, and the bot of each environment of the application. */
142
+ export interface IReflexDiscordConnection {
143
+ /** Vault entry (secret) that holds the bot token, one value per environment; null until chosen. */
144
+ discordTokenSecretId: string | null;
145
+ environments: IReflexDiscordEnvironmentConnection[];
146
+ }
@@ -1,50 +1,50 @@
1
- import { ExecutionMode, ExecutionProfile } from '../../enum';
2
- import type { ExecutionSettingsSource } from '../../enum';
3
-
4
- /** The execution settings of a function in an environment. */
5
- export interface IReflexExecutionSettingsValues {
6
- profile: ExecutionProfile;
7
- /** Past this, a synchronous caller that got no answer receives 504 and the execution goes on. */
8
- responseTimeoutMs: number;
9
- /** Past this, the execution is stopped with TIMEOUT. */
10
- maxDurationMs: number;
11
- mode: ExecutionMode;
12
- }
13
-
14
- /** Bounds of the settings, in milliseconds. */
15
- export const REFLEX_EXECUTION_SETTINGS_LIMITS = {
16
- responseTimeoutMs: { min: 1_000, max: 100_000 },
17
- maxDurationMs: { min: 1_000, max: 3_600_000 },
18
- } as const;
19
-
20
- /** What a function runs with when nothing is set. */
21
- export const DEFAULT_REFLEX_EXECUTION_SETTINGS: Readonly<IReflexExecutionSettingsValues> = {
22
- profile: ExecutionProfile.S,
23
- responseTimeoutMs: 30_000,
24
- maxDurationMs: 30_000,
25
- mode: ExecutionMode.SYNC,
26
- };
27
-
28
- /** A row of settings: the default of the function (`environmentId` null) or the override of one environment. */
29
- export interface IReflexExecutionSettings extends IReflexExecutionSettingsValues {
30
- id: string;
31
- functionId: string;
32
- /** An environment of the application (abyss-main's id); null for the default of every environment. */
33
- environmentId: string | null;
34
- updatedByUserId: string;
35
- createdAt: Date;
36
- updatedAt: Date;
37
- }
38
-
39
- /** What one environment of the application runs with. */
40
- export interface IReflexEffectiveExecutionSettings {
41
- environmentId: string;
42
- /** The name of the environment (abyss-main), immutable. */
43
- environmentSlug: string;
44
- /** Changing what a production environment runs with needs REFLEX_PUBLISH_PRODUCTION. */
45
- isProduction: boolean;
46
- source: ExecutionSettingsSource;
47
- settings: IReflexExecutionSettingsValues;
48
- /** The version promoted in this environment, whose step statistics drive the profile warning; null when none. */
49
- runningVersionId: string | null;
50
- }
1
+ import { ExecutionMode, ExecutionProfile } from '../../enum';
2
+ import type { ExecutionSettingsSource } from '../../enum';
3
+
4
+ /** The execution settings of a function in an environment. */
5
+ export interface IReflexExecutionSettingsValues {
6
+ profile: ExecutionProfile;
7
+ /** Past this, a synchronous caller that got no answer receives 504 and the execution goes on. */
8
+ responseTimeoutMs: number;
9
+ /** Past this, the execution is stopped with TIMEOUT. */
10
+ maxDurationMs: number;
11
+ mode: ExecutionMode;
12
+ }
13
+
14
+ /** Bounds of the settings, in milliseconds. */
15
+ export const REFLEX_EXECUTION_SETTINGS_LIMITS = {
16
+ responseTimeoutMs: { min: 1_000, max: 100_000 },
17
+ maxDurationMs: { min: 1_000, max: 3_600_000 },
18
+ } as const;
19
+
20
+ /** What a function runs with when nothing is set. */
21
+ export const DEFAULT_REFLEX_EXECUTION_SETTINGS: Readonly<IReflexExecutionSettingsValues> = {
22
+ profile: ExecutionProfile.S,
23
+ responseTimeoutMs: 30_000,
24
+ maxDurationMs: 30_000,
25
+ mode: ExecutionMode.SYNC,
26
+ };
27
+
28
+ /** A row of settings: the default of the function (`environmentId` null) or the override of one environment. */
29
+ export interface IReflexExecutionSettings extends IReflexExecutionSettingsValues {
30
+ id: string;
31
+ functionId: string;
32
+ /** An environment of the application (abyss-main's id); null for the default of every environment. */
33
+ environmentId: string | null;
34
+ updatedByUserId: string;
35
+ createdAt: Date;
36
+ updatedAt: Date;
37
+ }
38
+
39
+ /** What one environment of the application runs with. */
40
+ export interface IReflexEffectiveExecutionSettings {
41
+ environmentId: string;
42
+ /** The name of the environment (abyss-main), immutable. */
43
+ environmentSlug: string;
44
+ /** Changing what a production environment runs with needs REFLEX_PUBLISH_PRODUCTION. */
45
+ isProduction: boolean;
46
+ source: ExecutionSettingsSource;
47
+ settings: IReflexExecutionSettingsValues;
48
+ /** The version promoted in this environment, whose step statistics drive the profile warning; null when none. */
49
+ runningVersionId: string | null;
50
+ }
@@ -1,14 +1,14 @@
1
- import type { IReflexDefinition } from './reflex-definition.model';
2
-
3
- export interface IReflexFunctionVersion {
4
- id: string;
5
- functionId: string;
6
- /** 1, 2, 3...: counted per function. */
7
- number: number;
8
- /** The frozen definition. */
9
- definition: IReflexDefinition;
10
- /** SHA-256 of the definition, lowercase hex. */
11
- hash: string;
12
- publishedByUserId: string;
13
- publishedAt: Date;
14
- }
1
+ import type { IReflexDefinition } from './reflex-definition.model';
2
+
3
+ export interface IReflexFunctionVersion {
4
+ id: string;
5
+ functionId: string;
6
+ /** 1, 2, 3...: counted per function. */
7
+ number: number;
8
+ /** The frozen definition. */
9
+ definition: IReflexDefinition;
10
+ /** SHA-256 of the definition, lowercase hex. */
11
+ hash: string;
12
+ publishedByUserId: string;
13
+ publishedAt: Date;
14
+ }
@@ -1,16 +1,16 @@
1
- import type { IReflexDefinition } from './reflex-definition.model';
2
-
3
- export interface IReflexFunction {
4
- id: string;
5
- applicationId: string;
6
- /** The Service the function belongs to; deleting the Service deletes it. */
7
- serviceId: string;
8
- projectId: string;
9
- name: string;
10
- /** The definition being edited; a publication freezes a copy of it. */
11
- draftDefinition: IReflexDefinition;
12
- createdByUserId: string;
13
- updatedByUserId: string;
14
- createdAt: Date;
15
- updatedAt: Date;
16
- }
1
+ import type { IReflexDefinition } from './reflex-definition.model';
2
+
3
+ export interface IReflexFunction {
4
+ id: string;
5
+ applicationId: string;
6
+ /** The Service the function belongs to; deleting the Service deletes it. */
7
+ serviceId: string;
8
+ projectId: string;
9
+ name: string;
10
+ /** The definition being edited; a publication freezes a copy of it. */
11
+ draftDefinition: IReflexDefinition;
12
+ createdByUserId: string;
13
+ updatedByUserId: string;
14
+ createdAt: Date;
15
+ updatedAt: Date;
16
+ }
@@ -1,20 +1,20 @@
1
- import type { ExecutionProfile } from '../../enum';
2
-
3
- /**
4
- * The price list an execution is billed with (ADR-0244), served by the API from the runtime's
5
- * `COST_RATES` and `RESOURCE_PROFILES`, so that a screen that estimates a cost never holds a copy of it.
6
- * Prices are in millicredits (thousandths of a credit).
7
- */
8
- export interface IReflexPriceList {
9
- /** Once per execution; 0 for an interrupted or refused execution. */
10
- executionMillicredits: number;
11
- cpuMillicreditsPerSecond: number;
12
- /** Per GB-second of the memory the profile allocates, GB = 1024 MB. */
13
- memoryMillicreditsPerGbSecond: number;
14
- /** Per MB sent out, MB = 1024 x 1024 bytes. */
15
- networkOutMillicreditsPerMb: number;
16
- httpCallMillicredits: number;
17
- storeWriteMillicredits: number;
18
- /** The memory of each profile, and the coefficient its CPU part is multiplied by. */
19
- profiles: Record<ExecutionProfile, { memoryMb: number; cpuCoefficient: number }>;
20
- }
1
+ import type { ExecutionProfile } from '../../enum';
2
+
3
+ /**
4
+ * The price list an execution is billed with (ADR-0244), served by the API from the runtime's
5
+ * `COST_RATES` and `RESOURCE_PROFILES`, so that a screen that estimates a cost never holds a copy of it.
6
+ * Prices are in millicredits (thousandths of a credit).
7
+ */
8
+ export interface IReflexPriceList {
9
+ /** Once per execution; 0 for an interrupted or refused execution. */
10
+ executionMillicredits: number;
11
+ cpuMillicreditsPerSecond: number;
12
+ /** Per GB-second of the memory the profile allocates, GB = 1024 MB. */
13
+ memoryMillicreditsPerGbSecond: number;
14
+ /** Per MB sent out, MB = 1024 x 1024 bytes. */
15
+ networkOutMillicreditsPerMb: number;
16
+ httpCallMillicredits: number;
17
+ storeWriteMillicredits: number;
18
+ /** The memory of each profile, and the coefficient its CPU part is multiplied by. */
19
+ profiles: Record<ExecutionProfile, { memoryMb: number; cpuCoefficient: number }>;
20
+ }
@@ -1,19 +1,19 @@
1
- import type { RouteMethod, TriggerAccessMode } from '../../enum';
2
-
3
- /**
4
- * A route of the draft of a Service: callable only once a version that holds it is in service in the
5
- * environment. Never carries the key or the signing secret: they are shown once, when created or rotated.
6
- */
7
- export interface IReflexRoute {
8
- id: string;
9
- serviceId: string;
10
- /** A function of the same Service. */
11
- functionId: string;
12
- method: RouteMethod;
13
- /** Segments of `[a-z0-9._~-]` or `:param` joined by `/`, without leading or trailing slash; 20 at most. */
14
- path: string;
15
- accessMode: TriggerAccessMode;
16
- createdByUserId: string;
17
- createdAt: Date;
18
- updatedAt: Date;
19
- }
1
+ import type { RouteMethod, TriggerAccessMode } from '../../enum';
2
+
3
+ /**
4
+ * A route of the draft of a Service: callable only once a version that holds it is in service in the
5
+ * environment. Never carries the key or the signing secret: they are shown once, when created or rotated.
6
+ */
7
+ export interface IReflexRoute {
8
+ id: string;
9
+ serviceId: string;
10
+ /** A function of the same Service. */
11
+ functionId: string;
12
+ method: RouteMethod;
13
+ /** Segments of `[a-z0-9._~-]` or `:param` joined by `/`, without leading or trailing slash; 20 at most. */
14
+ path: string;
15
+ accessMode: TriggerAccessMode;
16
+ createdByUserId: string;
17
+ createdAt: Date;
18
+ updatedAt: Date;
19
+ }