@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,173 +1,179 @@
1
- import type {
2
- ExecutionMode,
3
- ExecutionProfile,
4
- RunLogLevel,
5
- RunMode,
6
- RunStatus,
7
- RunStepStatus,
8
- TraceEffectType,
9
- } from '../../enum';
10
-
11
- export interface IReflexTraceError {
12
- code: string;
13
- message: string;
14
- }
15
-
16
- /**
17
- * One call the run made to the host, in the order they were served. `recorded` is true when the effect
18
- * was recorded instead of executed (a stubbed HTTP call, a Store write kept aside, a wait not waited).
19
- */
20
- export interface IReflexTraceEntry {
21
- stepId: string;
22
- type: TraceEffectType;
23
- /** The host action, for a HOST effect. */
24
- action?: string;
25
- request?: unknown;
26
- response?: unknown;
27
- error?: IReflexTraceError;
28
- recorded: boolean;
29
- }
30
-
31
- /** What the RESPOND step (or `abyss.respond`) built: the response the caller of the route would get. */
32
- export interface IReflexTraceResponse {
33
- status: number;
34
- headers: Record<string, string>;
35
- body: unknown;
36
- }
37
-
38
- /**
39
- * Bounded: past 100 entries, or a value of more than 4 KB, the trace is cut and says so (`truncated`).
40
- * Every secret value the run was given or read is masked (`***`).
41
- */
42
- export interface IReflexRunTrace {
43
- entries: IReflexTraceEntry[];
44
- outcome: {
45
- status: RunStatus;
46
- output?: unknown;
47
- error?: IReflexTraceError & { stepId?: string };
48
- };
49
- response?: IReflexTraceResponse;
50
- truncated: boolean;
51
- }
52
-
53
- export interface IReflexRun {
54
- id: string;
55
- functionId: string;
56
- versionId: string | null;
57
- /**
58
- * The environment the run took place in: the promoted version's for a LIVE run, the one named in the
59
- * request for a test run. Null only for a test run recorded before test runs named an environment.
60
- */
61
- environmentId: string | null;
62
- mode: RunMode;
63
- status: RunStatus;
64
- durationMs: number;
65
- /** The effects of a test run; null for a LIVE run, which records no trace (nothing of the caller is kept). */
66
- trace: IReflexRunTrace | null;
67
- /** The route that started a LIVE run; null for a test run and for a run a Discord command or component started. */
68
- routeId: string | null;
69
- /** The Discord command that started a LIVE run; null otherwise. */
70
- commandId: string | null;
71
- /** The Discord component that started a LIVE run; null otherwise. */
72
- componentId: string | null;
73
- /**
74
- * What started the run, for a screen: `METHOD path` for a route, `/name` for a command, the custom id
75
- * prefix for a component. Null for a test run, and when the route, command or component was deleted.
76
- */
77
- originLabel: string | null;
78
- /** The HTTP status the caller of a LIVE run got; null for a test run. */
79
- httpStatus: number | null;
80
- /** The code of the error a failed LIVE run answered (FUNCTION_FAILED, FUNCTION_TIMEOUT, RUNNER_UNAVAILABLE, RUNNER_SATURATED, INTERNAL_ERROR); null otherwise, an interrupted run included. */
81
- errorCode: string | null;
82
- /** The execution mode of the function when a LIVE run started; null for a test run. */
83
- executionMode: ExecutionMode | null;
84
- /** When the caller of a LIVE run got its answer; null for a test run, or before any answer. */
85
- responseSentAt: Date | null;
86
- /**
87
- * What the run consumed and cost: measured by the runner for a live run and for a test run (with the
88
- * function's effective settings in the run's environment, and the network of its stubs); null for a running execution, or a run
89
- * recorded before the measures.
90
- */
91
- metrics: IReflexRunMetrics | null;
92
- createdByUserId: string | null;
93
- createdAt: Date;
94
- }
95
-
96
- /** What a live execution consumed, and what it costs (ADR-0244). */
97
- export interface IReflexRunMetrics {
98
- /** The profile it ran with, and the memory that profile allocates. */
99
- profile: ExecutionProfile;
100
- memoryLimitMb: number;
101
- /** Measured by the runner in the isolate. */
102
- cpuMs: number;
103
- heapPeakBytes: number;
104
- /** Measured by the host: bytes sent and received by `fetch`, plus the answer sent to the caller. */
105
- netOutBytes: number;
106
- netInBytes: number;
107
- httpCalls: number;
108
- storeWrites: number;
109
- /** In thousandths of a credit; 0 for an interrupted execution, which is offered. */
110
- costMillicredits: number;
111
- }
112
-
113
- /** What one step of a run consumed; its cost is its share of the run's, the fixed price aside. */
114
- export interface IReflexRunStep {
115
- /** 0 for the first step that ran. */
116
- position: number;
117
- stepId: string;
118
- status: RunStepStatus;
119
- durationMs: number;
120
- cpuMs: number;
121
- heapPeakBytes: number;
122
- netOutBytes: number;
123
- netInBytes: number;
124
- httpCalls: number;
125
- storeWrites: number;
126
- costMillicredits: number;
127
- }
128
-
129
- /**
130
- * One log line a run wrote: a LOG step, `abyss.log.*` or `console.*`. Secrets masked (`***`); a message
131
- * is cut at 2048 characters, and data whose JSON is longer becomes `{ truncated: true, preview }`. At most
132
- * 100 lines per run are kept; `IReflexRunDetail.droppedLogLines` counts the others.
133
- */
134
- export interface IReflexRunLog {
135
- /** 0 for the first line. */
136
- position: number;
137
- /** The step that wrote it. */
138
- stepId: string;
139
- level: RunLogLevel;
140
- message: string;
141
- /** The value given with the message; null when none was. */
142
- data: unknown;
143
- loggedAt: Date;
144
- }
145
-
146
- /**
147
- * One run with the steps it ran and the lines it logged, in order. Both are empty for a run recorded
148
- * before the measures (and the steps for a running execution).
149
- */
150
- export interface IReflexRunDetail extends IReflexRun {
151
- steps: IReflexRunStep[];
152
- logs: IReflexRunLog[];
153
- /** The log lines written past the 100 kept in `logs`; 0 when none was dropped. */
154
- droppedLogLines: number;
155
- }
156
-
157
- /** The state of a live execution, read by its id (the `executionId` an async route answers with). */
158
- export interface IReflexExecutionState {
159
- id: string;
160
- status: RunStatus;
161
- executionMode: ExecutionMode;
162
- startedAt: Date;
163
- /** When the caller got its answer; for an async execution, the 202. */
164
- responseSentAt: Date | null;
165
- /** Null while it runs. */
166
- finishedAt: Date | null;
167
- /** The status the caller got. */
168
- httpStatus: number;
169
- /** Set when the execution failed. */
170
- errorCode: string | null;
171
- /** Null while it runs, or for an execution recorded before the measures. */
172
- costMillicredits: number | null;
173
- }
1
+ import type {
2
+ ExecutionMode,
3
+ ExecutionProfile,
4
+ RunLogLevel,
5
+ RunMode,
6
+ RunStatus,
7
+ RunStepStatus,
8
+ ScheduledRunOrigin,
9
+ TraceEffectType,
10
+ } from '../../enum';
11
+
12
+ export interface IReflexTraceError {
13
+ code: string;
14
+ message: string;
15
+ }
16
+
17
+ /**
18
+ * One call the run made to the host, in the order they were served. `recorded` is true when the effect
19
+ * was recorded instead of executed (a stubbed HTTP call, a Store write kept aside, a wait not waited).
20
+ */
21
+ export interface IReflexTraceEntry {
22
+ stepId: string;
23
+ type: TraceEffectType;
24
+ /** The host action, for a HOST effect. */
25
+ action?: string;
26
+ request?: unknown;
27
+ response?: unknown;
28
+ error?: IReflexTraceError;
29
+ recorded: boolean;
30
+ }
31
+
32
+ /** What the RESPOND step (or `abyss.respond`) built: the response the caller of the route would get. */
33
+ export interface IReflexTraceResponse {
34
+ status: number;
35
+ headers: Record<string, string>;
36
+ body: unknown;
37
+ }
38
+
39
+ /**
40
+ * Bounded: past 100 entries, or a value of more than 4 KB, the trace is cut and says so (`truncated`).
41
+ * Every secret value the run was given or read is masked (`***`).
42
+ */
43
+ export interface IReflexRunTrace {
44
+ entries: IReflexTraceEntry[];
45
+ outcome: {
46
+ status: RunStatus;
47
+ output?: unknown;
48
+ error?: IReflexTraceError & { stepId?: string };
49
+ };
50
+ response?: IReflexTraceResponse;
51
+ truncated: boolean;
52
+ }
53
+
54
+ export interface IReflexRun {
55
+ id: string;
56
+ functionId: string;
57
+ versionId: string | null;
58
+ /**
59
+ * The environment the run took place in: the promoted version's for a LIVE run, the one named in the
60
+ * request for a test run. Null only for a test run recorded before test runs named an environment.
61
+ */
62
+ environmentId: string | null;
63
+ mode: RunMode;
64
+ status: RunStatus;
65
+ durationMs: number;
66
+ /** The effects of a test run; null for a LIVE run, which records no trace (nothing of the caller is kept). */
67
+ trace: IReflexRunTrace | null;
68
+ /** The route that started a LIVE run; null for a test run and for a run a Discord command or component started. */
69
+ routeId: string | null;
70
+ /** The Discord command that started a LIVE run; null otherwise. */
71
+ commandId: string | null;
72
+ /** The Discord component that started a LIVE run; null otherwise. */
73
+ componentId: string | null;
74
+ /** The task that started a LIVE run, by a tick of its cron or a delayed run; null otherwise. */
75
+ taskId: string | null;
76
+ /** How the task started the run: RECURRING for a tick of its cron, DELAYED for a delayed run; null when no task did. */
77
+ scheduledRunOrigin: ScheduledRunOrigin | null;
78
+ /**
79
+ * What started the run, for a screen: `METHOD path` for a route, `/name` for a command, the custom id
80
+ * prefix for a component, the name for a task. Null for a test run, and when the route, command,
81
+ * component or task was deleted.
82
+ */
83
+ originLabel: string | null;
84
+ /** The HTTP status the caller of a LIVE run got; null for a test run. */
85
+ httpStatus: number | null;
86
+ /** The code of the error a failed LIVE run answered (FUNCTION_FAILED, FUNCTION_TIMEOUT, RUNNER_UNAVAILABLE, RUNNER_SATURATED, INTERNAL_ERROR); null otherwise, an interrupted run included. */
87
+ errorCode: string | null;
88
+ /** The execution mode of the function when a LIVE run started; null for a test run. */
89
+ executionMode: ExecutionMode | null;
90
+ /** When the caller of a LIVE run got its answer; null for a test run, or before any answer. */
91
+ responseSentAt: Date | null;
92
+ /**
93
+ * What the run consumed and cost: measured by the runner for a live run and for a test run (with the
94
+ * function's effective settings in the run's environment, and the network of its stubs); null for a running execution, or a run
95
+ * recorded before the measures.
96
+ */
97
+ metrics: IReflexRunMetrics | null;
98
+ createdByUserId: string | null;
99
+ createdAt: Date;
100
+ }
101
+
102
+ /** What a live execution consumed, and what it costs (ADR-0244). */
103
+ export interface IReflexRunMetrics {
104
+ /** The profile it ran with, and the memory that profile allocates. */
105
+ profile: ExecutionProfile;
106
+ memoryLimitMb: number;
107
+ /** Measured by the runner in the isolate. */
108
+ cpuMs: number;
109
+ heapPeakBytes: number;
110
+ /** Measured by the host: bytes sent and received by `fetch`, plus the answer sent to the caller. */
111
+ netOutBytes: number;
112
+ netInBytes: number;
113
+ httpCalls: number;
114
+ storeWrites: number;
115
+ /** In thousandths of a credit; 0 for an interrupted execution, which is offered. */
116
+ costMillicredits: number;
117
+ }
118
+
119
+ /** What one step of a run consumed; its cost is its share of the run's, the fixed price aside. */
120
+ export interface IReflexRunStep {
121
+ /** 0 for the first step that ran. */
122
+ position: number;
123
+ stepId: string;
124
+ status: RunStepStatus;
125
+ durationMs: number;
126
+ cpuMs: number;
127
+ heapPeakBytes: number;
128
+ netOutBytes: number;
129
+ netInBytes: number;
130
+ httpCalls: number;
131
+ storeWrites: number;
132
+ costMillicredits: number;
133
+ }
134
+
135
+ /**
136
+ * One log line a run wrote: a LOG step, `abyss.log.*` or `console.*`. Secrets masked (`***`); a message
137
+ * is cut at 2048 characters, and data whose JSON is longer becomes `{ truncated: true, preview }`. At most
138
+ * 100 lines per run are kept; `IReflexRunDetail.droppedLogLines` counts the others.
139
+ */
140
+ export interface IReflexRunLog {
141
+ /** 0 for the first line. */
142
+ position: number;
143
+ /** The step that wrote it. */
144
+ stepId: string;
145
+ level: RunLogLevel;
146
+ message: string;
147
+ /** The value given with the message; null when none was. */
148
+ data: unknown;
149
+ loggedAt: Date;
150
+ }
151
+
152
+ /**
153
+ * One run with the steps it ran and the lines it logged, in order. Both are empty for a run recorded
154
+ * before the measures (and the steps for a running execution).
155
+ */
156
+ export interface IReflexRunDetail extends IReflexRun {
157
+ steps: IReflexRunStep[];
158
+ logs: IReflexRunLog[];
159
+ /** The log lines written past the 100 kept in `logs`; 0 when none was dropped. */
160
+ droppedLogLines: number;
161
+ }
162
+
163
+ /** The state of a live execution, read by its id (the `executionId` an async route answers with). */
164
+ export interface IReflexExecutionState {
165
+ id: string;
166
+ status: RunStatus;
167
+ executionMode: ExecutionMode;
168
+ startedAt: Date;
169
+ /** When the caller got its answer; for an async execution, the 202. */
170
+ responseSentAt: Date | null;
171
+ /** Null while it runs. */
172
+ finishedAt: Date | null;
173
+ /** The status the caller got. */
174
+ httpStatus: number;
175
+ /** Set when the execution failed. */
176
+ errorCode: string | null;
177
+ /** Null while it runs, or for an execution recorded before the measures. */
178
+ costMillicredits: number | null;
179
+ }
@@ -1,22 +1,22 @@
1
- import type { ConfigurationReadAs, VaultValueSource, VaultVisibility } from '../../enum';
2
-
3
- /**
4
- * A key the functions of a Service read (its draft and its versions in service), and what the Console
5
- * vault gives it in each environment of the application. Never a value.
6
- */
7
- export interface IReflexServiceConfigurationEntry {
8
- key: string;
9
- /** `config` for `config.KEY` / `{{ config.KEY }}`, `secrets` for `secrets.KEY` / `{{ secrets.KEY }}`. */
10
- readAs: ConfigurationReadAs;
11
- /** The Console vault entry of that key in the project; null when there is none. */
12
- secretId: string | null;
13
- /** The visibility of that entry; null when there is none. */
14
- visibility: VaultVisibility | null;
15
- /**
16
- * True when the entry cannot answer this read: a `config` key bound to a SECRET entry, or a `secrets`
17
- * key bound to a VISIBLE one. Every source is then ABSENT, the key never resolves.
18
- */
19
- mismatch: boolean;
20
- /** By environment id of the application. */
21
- sources: Record<string, VaultValueSource>;
22
- }
1
+ import type { ConfigurationReadAs, VaultValueSource, VaultVisibility } from '../../enum';
2
+
3
+ /**
4
+ * A key the functions of a Service read (its draft and its versions in service), and what the Console
5
+ * vault gives it in each environment of the application. Never a value.
6
+ */
7
+ export interface IReflexServiceConfigurationEntry {
8
+ key: string;
9
+ /** `config` for `config.KEY` / `{{ config.KEY }}`, `secrets` for `secrets.KEY` / `{{ secrets.KEY }}`. */
10
+ readAs: ConfigurationReadAs;
11
+ /** The Console vault entry of that key in the project; null when there is none. */
12
+ secretId: string | null;
13
+ /** The visibility of that entry; null when there is none. */
14
+ visibility: VaultVisibility | null;
15
+ /**
16
+ * True when the entry cannot answer this read: a `config` key bound to a SECRET entry, or a `secrets`
17
+ * key bound to a VISIBLE one. Every source is then ABSENT, the key never resolves.
18
+ */
19
+ mismatch: boolean;
20
+ /** By environment id of the application. */
21
+ sources: Record<string, VaultValueSource>;
22
+ }
@@ -1,40 +1,46 @@
1
- import type {
2
- DiscordSyncStatus,
3
- ServiceDeploymentAction,
4
- ServiceDeploymentStatus,
5
- } from '../../enum';
6
- import type { IReflexAccessDeclaration } from './reflex-definition.model';
7
-
8
- /** The accesses granted to one member function when the gesture was made: what the execution plane holds. */
9
- export interface IReflexServiceDeploymentGrant {
10
- functionId: string;
11
- grants: IReflexAccessDeclaration[];
12
- }
13
-
14
- /**
15
- * One gesture on the Service in an environment of the application. The `isCurrent` row is what runs (or
16
- * is paused) there; the others are the history a rollback reads.
17
- */
18
- export interface IReflexServiceDeployment {
19
- id: string;
20
- serviceId: string;
21
- /** The environment of the application (abyss-main's id). */
22
- environmentId: string;
23
- /** The name of that environment, second segment of the address. */
24
- environmentSlug: string;
25
- serviceVersionId: string;
26
- serviceVersionNumber: number;
27
- action: ServiceDeploymentAction;
28
- status: ServiceDeploymentStatus;
29
- grants: IReflexServiceDeploymentGrant[];
30
- /** Push of the interactions address and the commands to Discord; null for a Service that is not a Discord bot. */
31
- discordSync: DiscordSyncStatus | null;
32
- /** Code and message of the Discord refusal when `discordSync` is FAILED (500 characters at most). */
33
- discordSyncError: string | null;
34
- discordSyncedAt: Date | null;
35
- /** The bot was paused by the plan quota (ADR-0277), not by a member: only those resume with the plan. */
36
- pausedForQuota: boolean;
37
- isCurrent: boolean;
38
- byUserId: string;
39
- at: Date;
40
- }
1
+ import type {
2
+ DiscordSyncStatus,
3
+ ScheduleSyncStatus,
4
+ ServiceDeploymentAction,
5
+ ServiceDeploymentStatus,
6
+ } from '../../enum';
7
+ import type { IReflexAccessDeclaration } from './reflex-definition.model';
8
+
9
+ /** The accesses granted to one member function when the gesture was made: what the execution plane holds. */
10
+ export interface IReflexServiceDeploymentGrant {
11
+ functionId: string;
12
+ grants: IReflexAccessDeclaration[];
13
+ }
14
+
15
+ /**
16
+ * One gesture on the Service in an environment of the application. The `isCurrent` row is what runs (or
17
+ * is paused) there; the others are the history a rollback reads.
18
+ */
19
+ export interface IReflexServiceDeployment {
20
+ id: string;
21
+ serviceId: string;
22
+ /** The environment of the application (abyss-main's id). */
23
+ environmentId: string;
24
+ /** The name of that environment, second segment of the address. */
25
+ environmentSlug: string;
26
+ serviceVersionId: string;
27
+ serviceVersionNumber: number;
28
+ action: ServiceDeploymentAction;
29
+ status: ServiceDeploymentStatus;
30
+ grants: IReflexServiceDeploymentGrant[];
31
+ /** Push of the interactions address and the commands to Discord; null for a Service that is not a Discord bot. */
32
+ discordSync: DiscordSyncStatus | null;
33
+ /** Code and message of the Discord refusal when `discordSync` is FAILED (500 characters at most). */
34
+ discordSyncError: string | null;
35
+ discordSyncedAt: Date | null;
36
+ /** Synchronization of the cron tasks of the version with Flow; null when the version has no cron task. */
37
+ scheduleSync: ScheduleSyncStatus | null;
38
+ /** Code and message of the failure when `scheduleSync` is FAILED (500 characters at most). */
39
+ scheduleSyncError: string | null;
40
+ scheduleSyncedAt: Date | null;
41
+ /** The bot was paused by the plan quota (ADR-0277), not by a member: only those resume with the plan. */
42
+ pausedForQuota: boolean;
43
+ isCurrent: boolean;
44
+ byUserId: string;
45
+ at: Date;
46
+ }
@@ -1,55 +1,58 @@
1
- import type { RouteMethod, TriggerAccessMode } from '../../enum';
2
- import type {
3
- IReflexDiscordCommandSnapshot,
4
- IReflexDiscordComponentSnapshot,
5
- } from './reflex-discord.model';
6
- import type { IReflexServiceCors } from './reflex-service.model';
7
-
8
- /** A route as a version of the Service froze it. */
9
- export interface IReflexServiceVersionRoute {
10
- routeId: string;
11
- method: RouteMethod;
12
- path: string;
13
- functionId: string;
14
- accessMode: TriggerAccessMode;
15
- }
16
-
17
- /** The version of a member function a version of the Service runs. */
18
- export interface IReflexServiceVersionFunction {
19
- functionId: string;
20
- functionVersionId: string;
21
- functionVersionNumber: number;
22
- }
23
-
24
- /** What a version of a Discord bot freezes: its commands and components, identifiers included. */
25
- export interface IReflexServiceVersionDiscord {
26
- commands: IReflexDiscordCommandSnapshot[];
27
- components: IReflexDiscordComponentSnapshot[];
28
- }
29
-
30
- /**
31
- * What a version of the Service freezes. Routes sorted by path then method, functions by id: the same
32
- * Service always gives the same snapshot, and the same `hash`.
33
- */
34
- export interface IReflexServiceVersionSnapshot {
35
- routes: IReflexServiceVersionRoute[];
36
- functions: IReflexServiceVersionFunction[];
37
- cors: IReflexServiceCors;
38
- rateLimitPerIpPerMinute: number;
39
- /** Only a `DISCORD_BOT` Service has it (its `routes` are then empty); absent otherwise, so the hash of other versions is unchanged. */
40
- discord?: IReflexServiceVersionDiscord;
41
- }
42
-
43
- export interface IReflexServiceVersion {
44
- id: string;
45
- serviceId: string;
46
- /** 1, 2, 3...: counted per Service. */
47
- number: number;
48
- /** 500 characters at most. */
49
- message: string | null;
50
- snapshot: IReflexServiceVersionSnapshot;
51
- /** SHA-256 of the snapshot as canonical JSON (keys sorted), lowercase hex. */
52
- hash: string;
53
- publishedByUserId: string;
54
- publishedAt: Date;
55
- }
1
+ import type { RouteMethod, TriggerAccessMode } from '../../enum';
2
+ import type {
3
+ IReflexDiscordCommandSnapshot,
4
+ IReflexDiscordComponentSnapshot,
5
+ } from './reflex-discord.model';
6
+ import type { IReflexServiceCors } from './reflex-service.model';
7
+ import type { IReflexTaskSnapshot } from './reflex-task.model';
8
+
9
+ /** A route as a version of the Service froze it. */
10
+ export interface IReflexServiceVersionRoute {
11
+ routeId: string;
12
+ method: RouteMethod;
13
+ path: string;
14
+ functionId: string;
15
+ accessMode: TriggerAccessMode;
16
+ }
17
+
18
+ /** The version of a member function a version of the Service runs. */
19
+ export interface IReflexServiceVersionFunction {
20
+ functionId: string;
21
+ functionVersionId: string;
22
+ functionVersionNumber: number;
23
+ }
24
+
25
+ /** What a version of a Discord bot freezes: its commands and components, identifiers included. */
26
+ export interface IReflexServiceVersionDiscord {
27
+ commands: IReflexDiscordCommandSnapshot[];
28
+ components: IReflexDiscordComponentSnapshot[];
29
+ }
30
+
31
+ /**
32
+ * What a version of the Service freezes. Routes sorted by path then method, functions by id: the same
33
+ * Service always gives the same snapshot, and the same `hash`.
34
+ */
35
+ export interface IReflexServiceVersionSnapshot {
36
+ routes: IReflexServiceVersionRoute[];
37
+ functions: IReflexServiceVersionFunction[];
38
+ cors: IReflexServiceCors;
39
+ rateLimitPerIpPerMinute: number;
40
+ /** Only a `DISCORD_BOT` Service has it (its `routes` are then empty); absent otherwise, so the hash of other versions is unchanged. */
41
+ discord?: IReflexServiceVersionDiscord;
42
+ /** The tasks of the Service, by name; absent when it has none, so the hash of other versions is unchanged. */
43
+ tasks?: IReflexTaskSnapshot[];
44
+ }
45
+
46
+ export interface IReflexServiceVersion {
47
+ id: string;
48
+ serviceId: string;
49
+ /** 1, 2, 3...: counted per Service. */
50
+ number: number;
51
+ /** 500 characters at most. */
52
+ message: string | null;
53
+ snapshot: IReflexServiceVersionSnapshot;
54
+ /** SHA-256 of the snapshot as canonical JSON (keys sorted), lowercase hex. */
55
+ hash: string;
56
+ publishedByUserId: string;
57
+ publishedAt: Date;
58
+ }