@abyss-project/reflex 6.0.4 → 6.0.5

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 (149) hide show
  1. package/.eslintrc.js +32 -32
  2. package/.prettierrc +5 -5
  3. package/README.md +15 -15
  4. package/dist/types/interface/models/reflex-service-limits.model.d.ts +5 -2
  5. package/jest.config.ts +11 -11
  6. package/package.json +1 -1
  7. package/src/api/alert-rule.api.test.ts +72 -72
  8. package/src/api/alert-rule.api.ts +57 -57
  9. package/src/api/application-insights.api.test.ts +42 -42
  10. package/src/api/application-insights.api.ts +38 -38
  11. package/src/api/application-run-settings.api.test.ts +51 -51
  12. package/src/api/application-run-settings.api.ts +30 -30
  13. package/src/api/function-access.api.ts +87 -87
  14. package/src/api/function-insights.api.test.ts +27 -27
  15. package/src/api/function-insights.api.ts +18 -18
  16. package/src/api/function-run.api.ts +38 -38
  17. package/src/api/function-settings.api.ts +74 -74
  18. package/src/api/function-template.api.test.ts +72 -72
  19. package/src/api/function-template.api.ts +52 -52
  20. package/src/api/function-test.api.ts +34 -34
  21. package/src/api/function-version.api.ts +66 -66
  22. package/src/api/function.api.ts +62 -62
  23. package/src/api/health.api.ts +10 -10
  24. package/src/api/route-stats.api.test.ts +45 -45
  25. package/src/api/route-stats.api.ts +36 -36
  26. package/src/api/service-configuration.api.ts +16 -16
  27. package/src/api/service-deployment.api.ts +79 -79
  28. package/src/api/service-discord-event.api.test.ts +106 -106
  29. package/src/api/service-discord-event.api.ts +78 -78
  30. package/src/api/service-insights.api.test.ts +36 -36
  31. package/src/api/service-insights.api.ts +42 -42
  32. package/src/api/service-task.api.test.ts +140 -140
  33. package/src/api/service-task.api.ts +141 -141
  34. package/src/api/service-version.api.ts +54 -54
  35. package/src/api/service.api.test.ts +215 -215
  36. package/src/api/service.api.ts +55 -55
  37. package/src/discord/discord-event-filter-cases.ts +261 -261
  38. package/src/discord/discord-event-filters.test.ts +91 -91
  39. package/src/discord/discord-event-filters.ts +95 -95
  40. package/src/discord/discord-event-intents.test.ts +112 -112
  41. package/src/discord/discord-event-intents.ts +55 -55
  42. package/src/discord/index.ts +3 -3
  43. package/src/insights/index.ts +1 -1
  44. package/src/insights/percentiles.test.ts +75 -75
  45. package/src/insights/percentiles.ts +37 -37
  46. package/src/types/enum/access-grant-status.enum.ts +12 -12
  47. package/src/types/enum/access-kind.enum.ts +7 -7
  48. package/src/types/enum/access-request-status.enum.ts +11 -11
  49. package/src/types/enum/bot-event-block-reason.enum.ts +7 -7
  50. package/src/types/enum/configuration-read-as.enum.ts +5 -5
  51. package/src/types/enum/discord-activity-type.enum.ts +9 -9
  52. package/src/types/enum/discord-channel-type.enum.ts +11 -11
  53. package/src/types/enum/discord-component-kind.enum.ts +7 -7
  54. package/src/types/enum/discord-event-drop-reason.enum.ts +13 -13
  55. package/src/types/enum/discord-event-filter-name.enum.ts +11 -11
  56. package/src/types/enum/discord-event-status.enum.ts +13 -13
  57. package/src/types/enum/discord-event-type.enum.ts +7 -7
  58. package/src/types/enum/discord-gateway-failure-code.enum.ts +11 -11
  59. package/src/types/enum/discord-gateway-state.enum.ts +11 -11
  60. package/src/types/enum/discord-host-action.enum.ts +35 -35
  61. package/src/types/enum/discord-locale.enum.ts +35 -35
  62. package/src/types/enum/discord-option-type.enum.ts +12 -12
  63. package/src/types/enum/discord-presence-status.enum.ts +8 -8
  64. package/src/types/enum/discord-sync-status.enum.ts +6 -6
  65. package/src/types/enum/discord-token-state.enum.ts +11 -11
  66. package/src/types/enum/execution-mode.enum.ts +9 -9
  67. package/src/types/enum/execution-profile.enum.ts +20 -20
  68. package/src/types/enum/execution-settings-source.enum.ts +9 -9
  69. package/src/types/enum/health-status.enum.ts +4 -4
  70. package/src/types/enum/insights-period.enum.ts +8 -8
  71. package/src/types/enum/log-cap-mode.enum.ts +6 -6
  72. package/src/types/enum/log-drop-cause.enum.ts +8 -8
  73. package/src/types/enum/reflex-alert-metric.enum.ts +5 -5
  74. package/src/types/enum/reflex-alert-notification-state.enum.ts +6 -6
  75. package/src/types/enum/reflex-alert-scope.enum.ts +6 -6
  76. package/src/types/enum/route-method.enum.ts +9 -9
  77. package/src/types/enum/run-log-level.enum.ts +6 -6
  78. package/src/types/enum/run-mode.enum.ts +11 -11
  79. package/src/types/enum/run-step-status.enum.ts +7 -7
  80. package/src/types/enum/schedule-sync-status.enum.ts +6 -6
  81. package/src/types/enum/scheduled-run-origin.enum.ts +5 -5
  82. package/src/types/enum/scheduled-run-status.enum.ts +17 -17
  83. package/src/types/enum/service-deployment-action.enum.ts +11 -11
  84. package/src/types/enum/service-deployment-status.enum.ts +5 -5
  85. package/src/types/enum/service-type.enum.ts +9 -9
  86. package/src/types/enum/service-version-change-kind.enum.ts +6 -6
  87. package/src/types/enum/trace-effect-type.enum.ts +12 -12
  88. package/src/types/enum/trigger-access-mode.enum.ts +12 -12
  89. package/src/types/enum/trigger-kind.enum.ts +8 -8
  90. package/src/types/enum/vault-value-source.enum.ts +12 -12
  91. package/src/types/enum/vault-visibility.enum.ts +5 -5
  92. package/src/types/index.ts +2 -2
  93. package/src/types/interface/api/index.ts +3 -3
  94. package/src/types/interface/api/requests/alert-rule.request.ts +53 -53
  95. package/src/types/interface/api/requests/application-insights.request.ts +18 -18
  96. package/src/types/interface/api/requests/application-run-settings.request.ts +11 -11
  97. package/src/types/interface/api/requests/function-access.request.ts +51 -51
  98. package/src/types/interface/api/requests/function-settings.request.ts +34 -34
  99. package/src/types/interface/api/requests/function-template.request.ts +29 -29
  100. package/src/types/interface/api/requests/function-version.request.ts +38 -38
  101. package/src/types/interface/api/requests/function.request.ts +36 -36
  102. package/src/types/interface/api/requests/route-stats.request.ts +22 -22
  103. package/src/types/interface/api/requests/service-configuration.request.ts +4 -4
  104. package/src/types/interface/api/requests/service-deployment.request.ts +49 -49
  105. package/src/types/interface/api/requests/service-discord-event.request.ts +68 -68
  106. package/src/types/interface/api/requests/service-insights.request.ts +31 -31
  107. package/src/types/interface/api/requests/service-task.request.ts +80 -80
  108. package/src/types/interface/api/requests/service-version.request.ts +24 -24
  109. package/src/types/interface/api/requests/service.request.ts +46 -46
  110. package/src/types/interface/api/response.ts +4 -4
  111. package/src/types/interface/api/responses/alert-rule.response.ts +24 -24
  112. package/src/types/interface/api/responses/application-insights.response.ts +11 -11
  113. package/src/types/interface/api/responses/application-run-settings.response.ts +8 -8
  114. package/src/types/interface/api/responses/function-access.response.ts +45 -45
  115. package/src/types/interface/api/responses/function-run.response.ts +18 -18
  116. package/src/types/interface/api/responses/function-template.response.ts +21 -21
  117. package/src/types/interface/api/responses/function-version.response.ts +42 -42
  118. package/src/types/interface/api/responses/function.response.ts +25 -25
  119. package/src/types/interface/api/responses/route-stats.response.ts +15 -15
  120. package/src/types/interface/api/responses/service-configuration.response.ts +8 -8
  121. package/src/types/interface/api/responses/service-deployment.response.ts +32 -32
  122. package/src/types/interface/api/responses/service-discord-event.response.ts +24 -24
  123. package/src/types/interface/api/responses/service-insights.response.ts +11 -11
  124. package/src/types/interface/api/responses/service-task.response.ts +57 -57
  125. package/src/types/interface/api/responses/service-version.response.ts +112 -112
  126. package/src/types/interface/api/responses/service.response.ts +31 -31
  127. package/src/types/interface/health.response.ts +7 -7
  128. package/src/types/interface/index.ts +3 -3
  129. package/src/types/interface/models/reflex-access-grant.model.ts +14 -14
  130. package/src/types/interface/models/reflex-access-request.model.ts +15 -15
  131. package/src/types/interface/models/reflex-alert-rule.model.ts +56 -56
  132. package/src/types/interface/models/reflex-definition.model.ts +31 -31
  133. package/src/types/interface/models/reflex-discord-event-log.model.ts +58 -58
  134. package/src/types/interface/models/reflex-discord-event.model.ts +79 -79
  135. package/src/types/interface/models/reflex-discord.model.ts +196 -196
  136. package/src/types/interface/models/reflex-function-template.model.ts +18 -18
  137. package/src/types/interface/models/reflex-function-version.model.ts +19 -19
  138. package/src/types/interface/models/reflex-function.model.ts +30 -30
  139. package/src/types/interface/models/reflex-insights.model.ts +215 -215
  140. package/src/types/interface/models/reflex-price-list.model.ts +20 -20
  141. package/src/types/interface/models/reflex-run-settings.model.ts +28 -28
  142. package/src/types/interface/models/reflex-service-configuration.model.ts +22 -22
  143. package/src/types/interface/models/reflex-service-deployment.model.ts +46 -46
  144. package/src/types/interface/models/reflex-service-limits.model.ts +17 -8
  145. package/src/types/interface/models/reflex-service.model.ts +45 -45
  146. package/src/types/interface/models/reflex-step-stats.model.ts +35 -35
  147. package/src/types/interface/models/reflex-task.model.ts +97 -97
  148. package/tsconfig.check.json +15 -15
  149. package/tsconfig.json +35 -35
@@ -1,215 +1,215 @@
1
- import { InsightsPeriod } from '../../enum';
2
- import type { TriggerKind } from '../../enum';
3
-
4
- /** The width of one point of a dashboard, by period. */
5
- export const REFLEX_INSIGHTS_PERIOD_STEP_SECONDS: Record<InsightsPeriod, number> = {
6
- [InsightsPeriod.HOUR_1]: 60,
7
- [InsightsPeriod.HOURS_24]: 300,
8
- [InsightsPeriod.DAYS_7]: 3600,
9
- [InsightsPeriod.DAYS_30]: 21600,
10
- [InsightsPeriod.DAYS_90]: 86400,
11
- };
12
-
13
- /** Upper bounds, in thousandths of a credit, of the cost histogram buckets; one open bucket follows (10 in all). */
14
- export const REFLEX_COST_HISTOGRAM_UPPER_BOUNDS = [
15
- 10, 25, 50, 100, 250, 500, 1000, 2500, 5000,
16
- ] as const;
17
-
18
- /**
19
- * Upper bounds, in milliseconds, of the duration histogram buckets of the run rollups; one open bucket follows
20
- * (15 in all).
21
- */
22
- export const DURATION_HISTOGRAM_BOUNDS_MS = [
23
- 10, 25, 50, 100, 200, 300, 500, 750, 1000, 1500, 2500, 5000, 10000, 30000,
24
- ] as const;
25
-
26
- /** A trigger is labeled heavy past this multiple of the median cost per run of the Service. */
27
- export const REFLEX_HEAVY_TRIGGER_FACTOR = 5;
28
-
29
- /** A value over the period and over the one just before it; `previous` is null without data before. */
30
- export interface IReflexInsightsTile {
31
- value: number;
32
- previous: number | null;
33
- }
34
-
35
- export interface IReflexInsightsTiles {
36
- runs: IReflexInsightsTile;
37
- failed: IReflexInsightsTile;
38
- cpuMs: IReflexInsightsTile;
39
- heapPeakBytesMax: IReflexInsightsTile;
40
- netBytes: IReflexInsightsTile;
41
- costMillicredits: IReflexInsightsTile;
42
- }
43
-
44
- /** One point of the series; `at` is the start of its step. */
45
- export interface IReflexInsightsPoint {
46
- at: Date;
47
- runs: number;
48
- failed: number;
49
- durationMsSum: number;
50
- cpuMsSum: number;
51
- netInBytes: number;
52
- netOutBytes: number;
53
- costMillicredits: number;
54
- /** Mean cost of a run, in thousandths of a credit; null when no run. */
55
- costMeanMillicredits: number | null;
56
- /** 95th percentile of the cost of a run: upper bound of the histogram bucket holding it; null when no run. */
57
- costP95Millicredits: number | null;
58
- }
59
-
60
- /** Runs of one kind of trigger, over the period. */
61
- export interface IReflexInsightsKindShare {
62
- kind: TriggerKind;
63
- runs: number;
64
- failed: number;
65
- }
66
-
67
- /** One row of the ranking of the triggers. */
68
- export interface IReflexInsightsRankingRow {
69
- kind: TriggerKind;
70
- triggerId: string;
71
- /** `/name`, `METHOD path`, a prefix or a name; null when the trigger was deleted. */
72
- label: string | null;
73
- runs: number;
74
- failed: number;
75
- costMillicreditsTotal: number;
76
- costMillicreditsPerRun: number;
77
- cpuMsMean: number;
78
- durationMsMean: number;
79
- /** Cost per run past `REFLEX_HEAVY_TRIGGER_FACTOR` times the median of the Service. */
80
- heavy: boolean;
81
- }
82
-
83
- /** The dashboard of a Service or of a function. */
84
- export interface IReflexInsights {
85
- period: InsightsPeriod;
86
- from: Date;
87
- to: Date;
88
- stepSeconds: number;
89
- tiles: IReflexInsightsTiles;
90
- series: IReflexInsightsPoint[];
91
- byKind: IReflexInsightsKindShare[];
92
- /** Top 10 of the triggers, by total credits; the screen sorts the rows it holds. */
93
- ranking: IReflexInsightsRankingRow[];
94
- }
95
-
96
- /** Events received by the Gateway in one step, with the reason of each one it did not keep. */
97
- export interface IReflexEventInsightsPoint {
98
- at: Date;
99
- received: number;
100
- queued: number;
101
- executed: number;
102
- failed: number;
103
- duplicates: number;
104
- filtered: number;
105
- droppedRate: number;
106
- droppedMonthlyCap: number;
107
- droppedCredits: number;
108
- expired: number;
109
- /** Events rejected by each filter, by filter name. */
110
- filteredBy: Record<string, number>;
111
- }
112
-
113
- /** The dashboard of the events of a bot. */
114
- export interface IReflexEventInsights {
115
- period: InsightsPeriod;
116
- from: Date;
117
- to: Date;
118
- stepSeconds: number;
119
- series: IReflexEventInsightsPoint[];
120
- /** The rate of the bot, for the rate line. */
121
- eventsPerMinute: number;
122
- peakPerMinute: number;
123
- minutesAtCap: number;
124
- /** Credits of the month and the spend of the month against the cap. */
125
- creditsMonthMillicredits: number;
126
- spendCents: number;
127
- monthlySpendCapCents: number;
128
- }
129
-
130
- /**
131
- * A percentile of a duration read on a histogram: the upper bound of the bucket holding it. `open` when it falls in
132
- * the open bucket: the duration is then past `upperBoundMs` (the last bound), shown "> 30 s".
133
- */
134
- export interface IReflexDurationPercentile {
135
- upperBoundMs: number;
136
- open: boolean;
137
- }
138
-
139
- /** The requests of a route or a Service by class of HTTP status. */
140
- export interface IReflexHttpClasses {
141
- http2xx: number;
142
- http3xx: number;
143
- http4xx: number;
144
- http5xx: number;
145
- }
146
-
147
- /** One point of the short series of a route. */
148
- export interface IReflexRouteStatsPoint {
149
- at: Date;
150
- runs: number;
151
- failed: number;
152
- }
153
-
154
- /** One row of the statistics of the routes of a Service. */
155
- export interface IReflexRouteStatsRow extends IReflexHttpClasses {
156
- routeId: string;
157
- /** `METHOD path`; null when the route was deleted. */
158
- label: string | null;
159
- runs: number;
160
- failed: number;
161
- /** Null when no run of the period has a duration in the histogram. */
162
- p50: IReflexDurationPercentile | null;
163
- p95: IReflexDurationPercentile | null;
164
- p99: IReflexDurationPercentile | null;
165
- series: IReflexRouteStatsPoint[];
166
- }
167
-
168
- /** One point of the dashboard of a route. */
169
- export interface IReflexRouteInsightsPoint extends IReflexHttpClasses {
170
- at: Date;
171
- runs: number;
172
- failed: number;
173
- p50: IReflexDurationPercentile | null;
174
- p95: IReflexDurationPercentile | null;
175
- p99: IReflexDurationPercentile | null;
176
- }
177
-
178
- /** The dashboard of a route. */
179
- export interface IReflexRouteInsights {
180
- period: InsightsPeriod;
181
- from: Date;
182
- to: Date;
183
- stepSeconds: number;
184
- series: IReflexRouteInsightsPoint[];
185
- }
186
-
187
- /** Runs of one Service over the period. */
188
- export interface IReflexApplicationServiceShare {
189
- serviceId: string;
190
- runs: number;
191
- failed: number;
192
- costMillicredits: number;
193
- }
194
-
195
- /** The overview of an application: every Service together. */
196
- export interface IReflexApplicationInsights {
197
- period: InsightsPeriod;
198
- from: Date;
199
- to: Date;
200
- stepSeconds: number;
201
- tiles: IReflexInsightsTiles;
202
- series: IReflexInsightsPoint[];
203
- byService: IReflexApplicationServiceShare[];
204
- /** Top 10 of the triggers of the application, by total credits. */
205
- ranking: IReflexInsightsRankingRow[];
206
- }
207
-
208
- /** One day of the calendar of an application. */
209
- export interface IReflexCalendarDay {
210
- /** The day in UTC, `YYYY-MM-DD`. */
211
- day: string;
212
- runs: number;
213
- failed: number;
214
- millicredits: number;
215
- }
1
+ import { InsightsPeriod } from '../../enum';
2
+ import type { TriggerKind } from '../../enum';
3
+
4
+ /** The width of one point of a dashboard, by period. */
5
+ export const REFLEX_INSIGHTS_PERIOD_STEP_SECONDS: Record<InsightsPeriod, number> = {
6
+ [InsightsPeriod.HOUR_1]: 60,
7
+ [InsightsPeriod.HOURS_24]: 300,
8
+ [InsightsPeriod.DAYS_7]: 3600,
9
+ [InsightsPeriod.DAYS_30]: 21600,
10
+ [InsightsPeriod.DAYS_90]: 86400,
11
+ };
12
+
13
+ /** Upper bounds, in thousandths of a credit, of the cost histogram buckets; one open bucket follows (10 in all). */
14
+ export const REFLEX_COST_HISTOGRAM_UPPER_BOUNDS = [
15
+ 10, 25, 50, 100, 250, 500, 1000, 2500, 5000,
16
+ ] as const;
17
+
18
+ /**
19
+ * Upper bounds, in milliseconds, of the duration histogram buckets of the run rollups; one open bucket follows
20
+ * (15 in all).
21
+ */
22
+ export const DURATION_HISTOGRAM_BOUNDS_MS = [
23
+ 10, 25, 50, 100, 200, 300, 500, 750, 1000, 1500, 2500, 5000, 10000, 30000,
24
+ ] as const;
25
+
26
+ /** A trigger is labeled heavy past this multiple of the median cost per run of the Service. */
27
+ export const REFLEX_HEAVY_TRIGGER_FACTOR = 5;
28
+
29
+ /** A value over the period and over the one just before it; `previous` is null without data before. */
30
+ export interface IReflexInsightsTile {
31
+ value: number;
32
+ previous: number | null;
33
+ }
34
+
35
+ export interface IReflexInsightsTiles {
36
+ runs: IReflexInsightsTile;
37
+ failed: IReflexInsightsTile;
38
+ cpuMs: IReflexInsightsTile;
39
+ heapPeakBytesMax: IReflexInsightsTile;
40
+ netBytes: IReflexInsightsTile;
41
+ costMillicredits: IReflexInsightsTile;
42
+ }
43
+
44
+ /** One point of the series; `at` is the start of its step. */
45
+ export interface IReflexInsightsPoint {
46
+ at: Date;
47
+ runs: number;
48
+ failed: number;
49
+ durationMsSum: number;
50
+ cpuMsSum: number;
51
+ netInBytes: number;
52
+ netOutBytes: number;
53
+ costMillicredits: number;
54
+ /** Mean cost of a run, in thousandths of a credit; null when no run. */
55
+ costMeanMillicredits: number | null;
56
+ /** 95th percentile of the cost of a run: upper bound of the histogram bucket holding it; null when no run. */
57
+ costP95Millicredits: number | null;
58
+ }
59
+
60
+ /** Runs of one kind of trigger, over the period. */
61
+ export interface IReflexInsightsKindShare {
62
+ kind: TriggerKind;
63
+ runs: number;
64
+ failed: number;
65
+ }
66
+
67
+ /** One row of the ranking of the triggers. */
68
+ export interface IReflexInsightsRankingRow {
69
+ kind: TriggerKind;
70
+ triggerId: string;
71
+ /** `/name`, `METHOD path`, a prefix or a name; null when the trigger was deleted. */
72
+ label: string | null;
73
+ runs: number;
74
+ failed: number;
75
+ costMillicreditsTotal: number;
76
+ costMillicreditsPerRun: number;
77
+ cpuMsMean: number;
78
+ durationMsMean: number;
79
+ /** Cost per run past `REFLEX_HEAVY_TRIGGER_FACTOR` times the median of the Service. */
80
+ heavy: boolean;
81
+ }
82
+
83
+ /** The dashboard of a Service or of a function. */
84
+ export interface IReflexInsights {
85
+ period: InsightsPeriod;
86
+ from: Date;
87
+ to: Date;
88
+ stepSeconds: number;
89
+ tiles: IReflexInsightsTiles;
90
+ series: IReflexInsightsPoint[];
91
+ byKind: IReflexInsightsKindShare[];
92
+ /** Top 10 of the triggers, by total credits; the screen sorts the rows it holds. */
93
+ ranking: IReflexInsightsRankingRow[];
94
+ }
95
+
96
+ /** Events received by the Gateway in one step, with the reason of each one it did not keep. */
97
+ export interface IReflexEventInsightsPoint {
98
+ at: Date;
99
+ received: number;
100
+ queued: number;
101
+ executed: number;
102
+ failed: number;
103
+ duplicates: number;
104
+ filtered: number;
105
+ droppedRate: number;
106
+ droppedMonthlyCap: number;
107
+ droppedCredits: number;
108
+ expired: number;
109
+ /** Events rejected by each filter, by filter name. */
110
+ filteredBy: Record<string, number>;
111
+ }
112
+
113
+ /** The dashboard of the events of a bot. */
114
+ export interface IReflexEventInsights {
115
+ period: InsightsPeriod;
116
+ from: Date;
117
+ to: Date;
118
+ stepSeconds: number;
119
+ series: IReflexEventInsightsPoint[];
120
+ /** The rate of the bot, for the rate line. */
121
+ eventsPerMinute: number;
122
+ peakPerMinute: number;
123
+ minutesAtCap: number;
124
+ /** Credits of the month and the spend of the month against the cap. */
125
+ creditsMonthMillicredits: number;
126
+ spendCents: number;
127
+ monthlySpendCapCents: number;
128
+ }
129
+
130
+ /**
131
+ * A percentile of a duration read on a histogram: the upper bound of the bucket holding it. `open` when it falls in
132
+ * the open bucket: the duration is then past `upperBoundMs` (the last bound), shown "> 30 s".
133
+ */
134
+ export interface IReflexDurationPercentile {
135
+ upperBoundMs: number;
136
+ open: boolean;
137
+ }
138
+
139
+ /** The requests of a route or a Service by class of HTTP status. */
140
+ export interface IReflexHttpClasses {
141
+ http2xx: number;
142
+ http3xx: number;
143
+ http4xx: number;
144
+ http5xx: number;
145
+ }
146
+
147
+ /** One point of the short series of a route. */
148
+ export interface IReflexRouteStatsPoint {
149
+ at: Date;
150
+ runs: number;
151
+ failed: number;
152
+ }
153
+
154
+ /** One row of the statistics of the routes of a Service. */
155
+ export interface IReflexRouteStatsRow extends IReflexHttpClasses {
156
+ routeId: string;
157
+ /** `METHOD path`; null when the route was deleted. */
158
+ label: string | null;
159
+ runs: number;
160
+ failed: number;
161
+ /** Null when no run of the period has a duration in the histogram. */
162
+ p50: IReflexDurationPercentile | null;
163
+ p95: IReflexDurationPercentile | null;
164
+ p99: IReflexDurationPercentile | null;
165
+ series: IReflexRouteStatsPoint[];
166
+ }
167
+
168
+ /** One point of the dashboard of a route. */
169
+ export interface IReflexRouteInsightsPoint extends IReflexHttpClasses {
170
+ at: Date;
171
+ runs: number;
172
+ failed: number;
173
+ p50: IReflexDurationPercentile | null;
174
+ p95: IReflexDurationPercentile | null;
175
+ p99: IReflexDurationPercentile | null;
176
+ }
177
+
178
+ /** The dashboard of a route. */
179
+ export interface IReflexRouteInsights {
180
+ period: InsightsPeriod;
181
+ from: Date;
182
+ to: Date;
183
+ stepSeconds: number;
184
+ series: IReflexRouteInsightsPoint[];
185
+ }
186
+
187
+ /** Runs of one Service over the period. */
188
+ export interface IReflexApplicationServiceShare {
189
+ serviceId: string;
190
+ runs: number;
191
+ failed: number;
192
+ costMillicredits: number;
193
+ }
194
+
195
+ /** The overview of an application: every Service together. */
196
+ export interface IReflexApplicationInsights {
197
+ period: InsightsPeriod;
198
+ from: Date;
199
+ to: Date;
200
+ stepSeconds: number;
201
+ tiles: IReflexInsightsTiles;
202
+ series: IReflexInsightsPoint[];
203
+ byService: IReflexApplicationServiceShare[];
204
+ /** Top 10 of the triggers of the application, by total credits. */
205
+ ranking: IReflexInsightsRankingRow[];
206
+ }
207
+
208
+ /** One day of the calendar of an application. */
209
+ export interface IReflexCalendarDay {
210
+ /** The day in UTC, `YYYY-MM-DD`. */
211
+ day: string;
212
+ runs: number;
213
+ failed: number;
214
+ millicredits: number;
215
+ }
@@ -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,28 +1,28 @@
1
- import type { LogCapMode } from '../../enum';
2
-
3
- /** Technical bounds of the log lines of a run, whatever the product cap. */
4
- export const REFLEX_LOG_LIMITS = {
5
- /** Lines kept per run; past it the lines are counted, not kept. */
6
- maxLinesPerRun: 10_000,
7
- /** Bytes of log lines kept per run; the first of the two bounds reached wins. */
8
- maxBytesPerRun: 4_194_304,
9
- /** Bounds of a product cap (application or function). */
10
- cap: { min: 1, max: 10_000 },
11
- } as const;
12
-
13
- /** The run settings of an application. */
14
- export interface IReflexApplicationRunSettings {
15
- applicationId: string;
16
- /** Cap of log lines per run for every function of the application that inherits it; null for no cap. */
17
- maxLogLinesPerRun: number | null;
18
- /** How long runs are kept, from the Monitor plan; null until the first synchronization answered. Read only. */
19
- retentionDays: number | null;
20
- /** Whether the application has Monitor activated. Read only. */
21
- monitorActivated: boolean;
22
- }
23
-
24
- /** The log cap of a function; `lines` is set if and only if `mode` is LIMIT. */
25
- export interface IReflexFunctionLogCap {
26
- mode: LogCapMode;
27
- lines: number | null;
28
- }
1
+ import type { LogCapMode } from '../../enum';
2
+
3
+ /** Technical bounds of the log lines of a run, whatever the product cap. */
4
+ export const REFLEX_LOG_LIMITS = {
5
+ /** Lines kept per run; past it the lines are counted, not kept. */
6
+ maxLinesPerRun: 10_000,
7
+ /** Bytes of log lines kept per run; the first of the two bounds reached wins. */
8
+ maxBytesPerRun: 4_194_304,
9
+ /** Bounds of a product cap (application or function). */
10
+ cap: { min: 1, max: 10_000 },
11
+ } as const;
12
+
13
+ /** The run settings of an application. */
14
+ export interface IReflexApplicationRunSettings {
15
+ applicationId: string;
16
+ /** Cap of log lines per run for every function of the application that inherits it; null for no cap. */
17
+ maxLogLinesPerRun: number | null;
18
+ /** How long runs are kept, from the Monitor plan; null until the first synchronization answered. Read only. */
19
+ retentionDays: number | null;
20
+ /** Whether the application has Monitor activated. Read only. */
21
+ monitorActivated: boolean;
22
+ }
23
+
24
+ /** The log cap of a function; `lines` is set if and only if `mode` is LIMIT. */
25
+ export interface IReflexFunctionLogCap {
26
+ mode: LogCapMode;
27
+ lines: number | null;
28
+ }
@@ -1,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,46 +1,46 @@
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
+ 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
+ }