@abyss-project/reflex 6.0.4 → 6.1.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.
- package/dist/api/function-run.api.d.ts +2 -1
- package/dist/api/function-run.api.js +3 -1
- package/dist/api/function-run.api.js.map +1 -1
- package/dist/api/function-settings.api.d.ts +3 -1
- package/dist/api/function-settings.api.js +7 -1
- package/dist/api/function-settings.api.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/types/enum/reflex-error-code.enum.d.ts +2 -1
- package/dist/types/enum/reflex-error-code.enum.js +1 -0
- package/dist/types/enum/reflex-error-code.enum.js.map +1 -1
- package/dist/types/interface/api/requests/application-run-settings.request.d.ts +1 -0
- package/dist/types/interface/api/requests/function-run.request.d.ts +8 -0
- package/dist/types/interface/api/requests/function-settings.request.d.ts +12 -0
- package/dist/types/interface/api/requests/service.request.d.ts +1 -0
- package/dist/types/interface/api/responses/function-run.response.d.ts +4 -0
- package/dist/types/interface/api/responses/function-settings.response.d.ts +5 -1
- package/dist/types/interface/models/index.d.ts +2 -0
- package/dist/types/interface/models/index.js +2 -0
- package/dist/types/interface/models/index.js.map +1 -1
- package/dist/types/interface/models/reflex-run-retention.model.d.ts +13 -0
- package/dist/types/interface/models/reflex-run-retention.model.js +8 -0
- package/dist/types/interface/models/reflex-run-retention.model.js.map +1 -0
- package/dist/types/interface/models/reflex-run-settings.model.d.ts +4 -0
- package/dist/types/interface/models/reflex-run.model.d.ts +5 -0
- package/dist/types/interface/models/reflex-service-deployment.model.d.ts +2 -2
- package/dist/types/interface/models/reflex-service-limits.model.d.ts +5 -2
- package/dist/types/interface/models/reflex-service.model.d.ts +1 -0
- package/dist/types/interface/models/reflex-storage-surplus.model.d.ts +11 -0
- package/dist/types/interface/models/reflex-storage-surplus.model.js +3 -0
- package/dist/types/interface/models/reflex-storage-surplus.model.js.map +1 -0
- package/package.json +10 -15
- package/src/api/application-run-settings.api.test.ts +62 -51
- package/src/api/function-run.api.ts +53 -38
- package/src/api/function-settings.api.ts +96 -74
- package/src/api/function.api.test.ts +55 -0
- package/src/api/index.ts +26 -26
- package/src/api/service-completion-webhook.api.test.ts +97 -97
- package/src/api/service-completion-webhook.api.ts +39 -39
- package/src/api/service-consumer.api.test.ts +104 -104
- package/src/api/service-consumer.api.ts +90 -90
- package/src/api/service-discord.api.test.ts +178 -178
- package/src/api/service-discord.api.ts +222 -222
- package/src/api/service-limits.api.test.ts +100 -100
- package/src/api/service-limits.api.ts +37 -37
- package/src/api/service-openapi.api.test.ts +52 -52
- package/src/api/service-openapi.api.ts +21 -21
- package/src/api/service-route.api.ts +74 -74
- package/src/api/service.api.test.ts +220 -215
- package/src/index.test.ts +104 -104
- package/src/index.ts +12 -0
- package/src/types/enum/access-grant-status.enum.ts +12 -12
- package/src/types/enum/access-kind.enum.ts +7 -7
- package/src/types/enum/access-request-status.enum.ts +11 -11
- package/src/types/enum/bot-event-block-reason.enum.ts +7 -7
- package/src/types/enum/configuration-read-as.enum.ts +5 -5
- package/src/types/enum/discord-activity-type.enum.ts +9 -9
- package/src/types/enum/discord-channel-type.enum.ts +11 -11
- package/src/types/enum/discord-component-kind.enum.ts +7 -7
- package/src/types/enum/discord-event-drop-reason.enum.ts +13 -13
- package/src/types/enum/discord-event-filter-name.enum.ts +11 -11
- package/src/types/enum/discord-event-status.enum.ts +13 -13
- package/src/types/enum/discord-event-type.enum.ts +7 -7
- package/src/types/enum/discord-gateway-failure-code.enum.ts +11 -11
- package/src/types/enum/discord-gateway-state.enum.ts +11 -11
- package/src/types/enum/discord-host-action.enum.ts +35 -35
- package/src/types/enum/discord-locale.enum.ts +35 -35
- package/src/types/enum/discord-option-type.enum.ts +12 -12
- package/src/types/enum/discord-presence-status.enum.ts +8 -8
- package/src/types/enum/discord-sync-status.enum.ts +6 -6
- package/src/types/enum/discord-token-state.enum.ts +11 -11
- package/src/types/enum/execution-mode.enum.ts +9 -9
- package/src/types/enum/execution-profile.enum.ts +20 -20
- package/src/types/enum/execution-settings-source.enum.ts +9 -9
- package/src/types/enum/health-status.enum.ts +4 -4
- package/src/types/enum/insights-period.enum.ts +8 -8
- package/src/types/enum/log-cap-mode.enum.ts +6 -6
- package/src/types/enum/log-drop-cause.enum.ts +8 -8
- package/src/types/enum/reflex-alert-metric.enum.ts +5 -5
- package/src/types/enum/reflex-alert-notification-state.enum.ts +6 -6
- package/src/types/enum/reflex-alert-scope.enum.ts +6 -6
- package/src/types/enum/reflex-error-code.enum.ts +5 -0
- package/src/types/enum/route-method.enum.ts +9 -9
- package/src/types/enum/run-log-level.enum.ts +6 -6
- package/src/types/enum/run-mode.enum.ts +11 -11
- package/src/types/enum/run-step-status.enum.ts +7 -7
- package/src/types/enum/schedule-sync-status.enum.ts +6 -6
- package/src/types/enum/scheduled-run-origin.enum.ts +5 -5
- package/src/types/enum/scheduled-run-status.enum.ts +17 -17
- package/src/types/enum/service-deployment-action.enum.ts +11 -11
- package/src/types/enum/service-deployment-status.enum.ts +5 -5
- package/src/types/enum/service-type.enum.ts +9 -9
- package/src/types/enum/service-version-change-kind.enum.ts +6 -6
- package/src/types/enum/trace-effect-type.enum.ts +12 -12
- package/src/types/enum/trigger-access-mode.enum.ts +12 -12
- package/src/types/enum/trigger-kind.enum.ts +8 -8
- package/src/types/enum/vault-value-source.enum.ts +12 -12
- package/src/types/enum/vault-visibility.enum.ts +5 -5
- package/src/types/index.ts +2 -2
- package/src/types/interface/api/index.ts +3 -3
- package/src/types/interface/api/requests/alert-rule.request.ts +53 -53
- package/src/types/interface/api/requests/application-insights.request.ts +18 -18
- package/src/types/interface/api/requests/application-run-settings.request.ts +13 -11
- package/src/types/interface/api/requests/function-access.request.ts +51 -51
- package/src/types/interface/api/requests/function-run.request.ts +10 -0
- package/src/types/interface/api/requests/function-settings.request.ts +50 -34
- package/src/types/interface/api/requests/function-template.request.ts +29 -29
- package/src/types/interface/api/requests/function-version.request.ts +38 -38
- package/src/types/interface/api/requests/function.request.ts +36 -36
- package/src/types/interface/api/requests/route-stats.request.ts +22 -22
- package/src/types/interface/api/requests/service-configuration.request.ts +4 -4
- package/src/types/interface/api/requests/service-deployment.request.ts +49 -49
- package/src/types/interface/api/requests/service-discord-event.request.ts +68 -68
- package/src/types/interface/api/requests/service-insights.request.ts +31 -31
- package/src/types/interface/api/requests/service-task.request.ts +80 -80
- package/src/types/interface/api/requests/service-version.request.ts +24 -24
- package/src/types/interface/api/requests/service.request.ts +48 -46
- package/src/types/interface/api/response.ts +4 -4
- package/src/types/interface/api/responses/alert-rule.response.ts +24 -24
- package/src/types/interface/api/responses/application-insights.response.ts +11 -11
- package/src/types/interface/api/responses/application-run-settings.response.ts +8 -8
- package/src/types/interface/api/responses/function-access.response.ts +45 -45
- package/src/types/interface/api/responses/function-run.response.ts +23 -18
- package/src/types/interface/api/responses/function-settings.response.ts +7 -0
- package/src/types/interface/api/responses/function-template.response.ts +21 -21
- package/src/types/interface/api/responses/function-version.response.ts +42 -42
- package/src/types/interface/api/responses/function.response.ts +25 -25
- package/src/types/interface/api/responses/route-stats.response.ts +15 -15
- package/src/types/interface/api/responses/service-configuration.response.ts +8 -8
- package/src/types/interface/api/responses/service-deployment.response.ts +32 -32
- package/src/types/interface/api/responses/service-discord-event.response.ts +24 -24
- package/src/types/interface/api/responses/service-insights.response.ts +11 -11
- package/src/types/interface/api/responses/service-task.response.ts +57 -57
- package/src/types/interface/api/responses/service-version.response.ts +112 -112
- package/src/types/interface/api/responses/service.response.ts +31 -31
- package/src/types/interface/health.response.ts +7 -7
- package/src/types/interface/index.ts +3 -3
- package/src/types/interface/models/index.ts +2 -0
- package/src/types/interface/models/reflex-access-grant.model.ts +14 -14
- package/src/types/interface/models/reflex-access-request.model.ts +15 -15
- package/src/types/interface/models/reflex-alert-rule.model.ts +56 -56
- package/src/types/interface/models/reflex-definition.model.ts +31 -31
- package/src/types/interface/models/reflex-discord-event-log.model.ts +58 -58
- package/src/types/interface/models/reflex-discord-event.model.ts +79 -79
- package/src/types/interface/models/reflex-discord.model.ts +196 -196
- package/src/types/interface/models/reflex-function-template.model.ts +18 -18
- package/src/types/interface/models/reflex-function-version.model.ts +19 -19
- package/src/types/interface/models/reflex-function.model.ts +30 -30
- package/src/types/interface/models/reflex-insights.model.ts +215 -215
- package/src/types/interface/models/reflex-price-list.model.ts +20 -20
- package/src/types/interface/models/reflex-run-retention.model.ts +24 -0
- package/src/types/interface/models/reflex-run-settings.model.ts +39 -28
- package/src/types/interface/models/reflex-run.model.ts +10 -0
- package/src/types/interface/models/reflex-service-configuration.model.ts +22 -22
- package/src/types/interface/models/reflex-service-deployment.model.ts +48 -46
- package/src/types/interface/models/reflex-service-limits.model.ts +17 -8
- package/src/types/interface/models/reflex-service.model.ts +47 -45
- package/src/types/interface/models/reflex-step-stats.model.ts +35 -35
- package/src/types/interface/models/reflex-storage-surplus.model.ts +23 -0
- package/src/types/interface/models/reflex-task.model.ts +97 -97
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The retention tiers of the runs a customer may choose, in days (AbyssReflex L3a, #893). The plan's retention is
|
|
3
|
+
* the default; a tier is chosen per application, and per function over it. Same list as the database CHECKs.
|
|
4
|
+
*/
|
|
5
|
+
export const REFLEX_RUN_RETENTION_TIER_DAYS = [3, 7, 15, 30, 90, 180, 365] as const;
|
|
6
|
+
|
|
7
|
+
/** Bounds of the number of versions the purge keeps, per function and per Service. */
|
|
8
|
+
export const REFLEX_VERSIONS_KEPT = { default: 20, min: 5, max: 100 } as const;
|
|
9
|
+
|
|
10
|
+
/** The detail of a run (detail, steps, log lines) moves to the archive past this age, in days, when its tier allows it. */
|
|
11
|
+
export const REFLEX_RUN_ARCHIVE_AFTER_DAYS = 30;
|
|
12
|
+
|
|
13
|
+
/** The runs of a tier under this number of days are never archived: they are purged before they would be. */
|
|
14
|
+
export const REFLEX_RUN_ARCHIVE_MIN_TIER_DAYS = 90;
|
|
15
|
+
|
|
16
|
+
/** The run retention of a function: its own tier, the one it inherits, and how many versions are kept. */
|
|
17
|
+
export interface IReflexFunctionRunRetention {
|
|
18
|
+
/** The tier of the function itself, one of `REFLEX_RUN_RETENTION_TIER_DAYS`; null follows the application. */
|
|
19
|
+
runRetentionDays: number | null;
|
|
20
|
+
/** The tier the function follows when it has none: the application's, else null for the plan's retention. Read only. */
|
|
21
|
+
inheritedDays: number | null;
|
|
22
|
+
/** How many versions of the function the purge keeps, `REFLEX_VERSIONS_KEPT.min` to `REFLEX_VERSIONS_KEPT.max`. */
|
|
23
|
+
versionsKept: number;
|
|
24
|
+
}
|
|
@@ -1,28 +1,39 @@
|
|
|
1
|
-
import type { LogCapMode } from '../../enum';
|
|
2
|
-
|
|
3
|
-
/** Technical bounds of the log lines of a run, whatever the product cap. */
|
|
4
|
-
export const REFLEX_LOG_LIMITS = {
|
|
5
|
-
/** Lines kept per run; past it the lines are counted, not kept. */
|
|
6
|
-
maxLinesPerRun: 10_000,
|
|
7
|
-
/** Bytes of log lines kept per run; the first of the two bounds reached wins. */
|
|
8
|
-
maxBytesPerRun: 4_194_304,
|
|
9
|
-
/** Bounds of a product cap (application or function). */
|
|
10
|
-
cap: { min: 1, max: 10_000 },
|
|
11
|
-
} as const;
|
|
12
|
-
|
|
13
|
-
/** The run settings of an application. */
|
|
14
|
-
export interface IReflexApplicationRunSettings {
|
|
15
|
-
applicationId: string;
|
|
16
|
-
/** Cap of log lines per run for every function of the application that inherits it; null for no cap. */
|
|
17
|
-
maxLogLinesPerRun: number | null;
|
|
18
|
-
/** How long runs are kept, from the Monitor plan; null until the first synchronization answered. Read only. */
|
|
19
|
-
retentionDays: number | null;
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
lines
|
|
28
|
-
|
|
1
|
+
import type { LogCapMode } from '../../enum';
|
|
2
|
+
|
|
3
|
+
/** Technical bounds of the log lines of a run, whatever the product cap. */
|
|
4
|
+
export const REFLEX_LOG_LIMITS = {
|
|
5
|
+
/** Lines kept per run; past it the lines are counted, not kept. */
|
|
6
|
+
maxLinesPerRun: 10_000,
|
|
7
|
+
/** Bytes of log lines kept per run; the first of the two bounds reached wins. */
|
|
8
|
+
maxBytesPerRun: 4_194_304,
|
|
9
|
+
/** Bounds of a product cap (application or function). */
|
|
10
|
+
cap: { min: 1, max: 10_000 },
|
|
11
|
+
} as const;
|
|
12
|
+
|
|
13
|
+
/** The run settings of an application. */
|
|
14
|
+
export interface IReflexApplicationRunSettings {
|
|
15
|
+
applicationId: string;
|
|
16
|
+
/** Cap of log lines per run for every function of the application that inherits it; null for no cap. */
|
|
17
|
+
maxLogLinesPerRun: number | null;
|
|
18
|
+
/** How long runs are kept, from the Monitor plan; null until the first synchronization answered. Read only. */
|
|
19
|
+
retentionDays: number | null;
|
|
20
|
+
/**
|
|
21
|
+
* The retention tier the customer chose for the runs of the application, one of `REFLEX_RUN_RETENTION_TIER_DAYS`;
|
|
22
|
+
* null follows the plan (`retentionDays`). A function's own tier wins over it.
|
|
23
|
+
*/
|
|
24
|
+
runRetentionDays: number | null;
|
|
25
|
+
/** The owner's storage is cut: the runs recorded now keep no detail, steps or log lines. Read only. */
|
|
26
|
+
historyMinimal: boolean;
|
|
27
|
+
/** Bytes the runs of the application hold online (detail, steps, log lines). Read only. */
|
|
28
|
+
storedBytesOnline: number;
|
|
29
|
+
/** Bytes the runs of the application hold in the customer's archive. Read only. */
|
|
30
|
+
storedBytesArchive: number;
|
|
31
|
+
/** Whether the application has Monitor activated. Read only. */
|
|
32
|
+
monitorActivated: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** The log cap of a function; `lines` is set if and only if `mode` is LIMIT. */
|
|
36
|
+
export interface IReflexFunctionLogCap {
|
|
37
|
+
mode: LogCapMode;
|
|
38
|
+
lines: number | null;
|
|
39
|
+
}
|
|
@@ -184,6 +184,16 @@ export interface IReflexRun {
|
|
|
184
184
|
delivery?: IReflexCompletionDelivery;
|
|
185
185
|
createdByUserId: string | null;
|
|
186
186
|
createdAt: Date;
|
|
187
|
+
/** When the run is purged (its start plus the retention in force); null for a test run, and while no retention is known. */
|
|
188
|
+
expiresAt: string | null;
|
|
189
|
+
/** A favorite run is never purged. */
|
|
190
|
+
isFavorite: boolean;
|
|
191
|
+
/** The run was recorded while the owner's storage was cut: no detail, steps or log lines were kept. */
|
|
192
|
+
historyMinimal: boolean;
|
|
193
|
+
/** Bytes the run holds online (detail, steps, log lines); null for a test run, and for a run whose size was never computed. */
|
|
194
|
+
storedBytes: number | null;
|
|
195
|
+
/** When the detail, steps and log lines moved to the customer's archive; null while they are online. */
|
|
196
|
+
detailArchivedAt: string | null;
|
|
187
197
|
}
|
|
188
198
|
|
|
189
199
|
/** The consumer of a Service that called a route, as the edge passed it to the function. */
|
|
@@ -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
|
+
}
|