@ericminassian/platform-core 0.4.0 → 0.5.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 (53) hide show
  1. package/dist/api.d.ts +367 -226
  2. package/dist/api.js +148 -92
  3. package/dist/api.js.map +1 -1
  4. package/dist/config.d.ts +0 -2
  5. package/dist/config.js.map +1 -1
  6. package/dist/constants.d.ts +0 -17
  7. package/dist/constants.js +0 -17
  8. package/dist/constants.js.map +1 -1
  9. package/dist/explore.d.ts +367 -0
  10. package/dist/explore.js +440 -0
  11. package/dist/explore.js.map +1 -0
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/jobs.d.ts +1 -1
  16. package/dist/jobs.js +1 -1
  17. package/dist/manifest.d.ts +10 -47
  18. package/dist/manifest.js +7 -15
  19. package/dist/manifest.js.map +1 -1
  20. package/dist/naming.d.ts +7 -23
  21. package/dist/naming.js +7 -23
  22. package/dist/naming.js.map +1 -1
  23. package/dist/platform-api.d.ts +3511 -2211
  24. package/dist/platform-api.js +117 -36
  25. package/dist/platform-api.js.map +1 -1
  26. package/dist/runtime-config.d.ts +0 -20
  27. package/dist/runtime-config.js.map +1 -1
  28. package/dist/storage.d.ts +10 -0
  29. package/dist/storage.js +10 -0
  30. package/dist/storage.js.map +1 -1
  31. package/dist/telemetry.d.ts +52 -27
  32. package/dist/telemetry.js +67 -19
  33. package/dist/telemetry.js.map +1 -1
  34. package/dist/web-compute.js +2 -1
  35. package/dist/web-compute.js.map +1 -1
  36. package/package.json +1 -1
  37. package/src/api.ts +176 -110
  38. package/src/config.ts +0 -2
  39. package/src/constants.ts +0 -19
  40. package/src/explore.ts +504 -0
  41. package/src/index.ts +1 -1
  42. package/src/jobs.ts +1 -1
  43. package/src/manifest.ts +15 -48
  44. package/src/naming.ts +7 -25
  45. package/src/platform-api.ts +140 -38
  46. package/src/runtime-config.ts +0 -21
  47. package/src/storage.ts +11 -0
  48. package/src/telemetry.ts +69 -19
  49. package/src/web-compute.ts +3 -1
  50. package/dist/compute.d.ts +0 -52
  51. package/dist/compute.js +0 -65
  52. package/dist/compute.js.map +0 -1
  53. package/src/compute.ts +0 -86
@@ -0,0 +1,440 @@
1
+ /**
2
+ * The explorer's query model. The control plane answers it (the series
3
+ * endpoint) and evaluates alert rules with it; the console builds charts and
4
+ * alert rules from it; the CLI sends it.
5
+ *
6
+ * Every metric is read from the rollups the telemetry processor writes
7
+ * (`telemetryKeys`), except `realtime`, which comes from CloudWatch on
8
+ * demand and so can't be watched by alert rules. Neither can
9
+ * `page_views` and `edge_requests`: the router's access log they come from
10
+ * arrives up to an hour late.
11
+ */
12
+ import { Schema } from 'effect';
13
+ const optional = Schema.optional;
14
+ // ---------------------------------------------------------------------------
15
+ // Resolution
16
+ // ---------------------------------------------------------------------------
17
+ /**
18
+ * Bucket sizes a query can ask for. `1m`, `1h` and `1d` are stored; the
19
+ * others are sums of 1-minute rollups (latency histograms add), so they
20
+ * reach back only as far as minute rollups are kept.
21
+ */
22
+ export const QueryResolution = Schema.Literals(['1m', '5m', '10m', '15m', '30m', '1h', '1d']);
23
+ export const QUERY_RESOLUTION_MS = {
24
+ '1m': 60_000,
25
+ '5m': 300_000,
26
+ '10m': 600_000,
27
+ '15m': 900_000,
28
+ '30m': 1_800_000,
29
+ '1h': 3_600_000,
30
+ '1d': 86_400_000,
31
+ };
32
+ /** About this many buckets per chart when the caller doesn't pick a resolution. */
33
+ export const TARGET_POINTS = 150;
34
+ /**
35
+ * The smallest resolution that keeps `from`..`to` near `TARGET_POINTS`
36
+ * buckets, given how far back minute rollups reach (`minuteHorizonMs` before
37
+ * `now`): a range starting before that horizon can't be built from 1-minute
38
+ * rows, so it uses hours (or days past 14 days).
39
+ */
40
+ export function autoQueryResolution(from, to, now, minuteHorizonMs) {
41
+ const span = Math.max(to - from, 60_000);
42
+ const minuteOk = from >= now - minuteHorizonMs;
43
+ const ladder = minuteOk
44
+ ? ['1m', '5m', '10m', '15m', '30m', '1h', '1d']
45
+ : ['1h', '1d'];
46
+ for (const res of ladder)
47
+ if (span / QUERY_RESOLUTION_MS[res] <= TARGET_POINTS * 1.5)
48
+ return res;
49
+ return '1d';
50
+ }
51
+ // ---------------------------------------------------------------------------
52
+ // Queries
53
+ // ---------------------------------------------------------------------------
54
+ /**
55
+ * What a query measures:
56
+ * - `requests`: HTTP requests (stage-wide, or of routes) the stage's server handled
57
+ * - `page_views`: pages the router served for the stage's host (`isPageView`)
58
+ * - `edge_requests`: every request the router served for it: files, server, stores
59
+ * - `latency`: their duration
60
+ * - `cold_starts`: requests served by a fresh server process
61
+ * - `jobs`: queue, event, cron and invoke runs
62
+ * - `job_duration`: their duration
63
+ * - `custom`: the app's `Metrics.count`/`value` series
64
+ * - `rate_limit`: `RateLimits` checks
65
+ * - `realtime`: AppSync Events activity (CloudWatch)
66
+ */
67
+ export const SeriesMetric = Schema.Literals([
68
+ 'requests',
69
+ 'page_views',
70
+ 'edge_requests',
71
+ 'latency',
72
+ 'cold_starts',
73
+ 'jobs',
74
+ 'job_duration',
75
+ 'custom',
76
+ 'rate_limit',
77
+ 'realtime',
78
+ ]);
79
+ /**
80
+ * How each bucket is summarized:
81
+ * - `count`: how many (requests, runs, checks, recorded values)
82
+ * - `rate`: `count` per second
83
+ * - `percent`: the share, 0–100, of the metric's events that match the
84
+ * status or outcome filter, among all of them in the bucket (5xx % of
85
+ * requests, failed % of runs, denied % of checks)
86
+ * - `sum`, `avg`, `max`: of recorded values (custom metrics, realtime)
87
+ * - `p50`…`p99`: latency percentiles, from the rollups' fixed-bucket histograms
88
+ * (each is the upper bound of the bucket holding it)
89
+ * - `histogram`: every latency bucket's count, for heatmaps
90
+ */
91
+ export const SeriesStat = Schema.Literals([
92
+ 'count',
93
+ 'rate',
94
+ 'percent',
95
+ 'sum',
96
+ 'avg',
97
+ 'max',
98
+ 'p50',
99
+ 'p90',
100
+ 'p95',
101
+ 'p99',
102
+ 'histogram',
103
+ ]);
104
+ export const StatusClass = Schema.Literals(['2xx', '3xx', '4xx', '5xx']);
105
+ export const STATUS_CLASSES = ['2xx', '3xx', '4xx', '5xx'];
106
+ /** Splits a query into one line per value of this dimension. */
107
+ export const SeriesGroupBy = Schema.Literals(['status', 'route', 'job', 'outcome', 'name']);
108
+ export const SeriesOutcome = Schema.Literals(['ok', 'error', 'allowed', 'denied']);
109
+ const nonEmpty = Schema.String.check(Schema.isNonEmpty());
110
+ export const SeriesFilter = Schema.Struct({
111
+ /** Routes as rollups key them: `METHOD /pattern`, e.g. `GET /api/items/:id`. */
112
+ routes: optional(Schema.Array(nonEmpty)),
113
+ /** `requests` and `edge_requests` only. */
114
+ status: optional(Schema.Array(StatusClass)),
115
+ /** Jobs as `kind:name`, e.g. `queue:refresh`, `cron:digest`. */
116
+ jobs: optional(Schema.Array(nonEmpty)),
117
+ /** Custom metric names or rate limit names. */
118
+ names: optional(Schema.Array(nonEmpty)),
119
+ /** `jobs`: `ok` or `error`; `rate_limit`: `allowed` or `denied`. */
120
+ outcome: optional(SeriesOutcome),
121
+ /** `realtime`: `events`, `publishes`, `subscribes` or `errors`. */
122
+ measure: optional(nonEmpty),
123
+ });
124
+ export const SeriesQuery = Schema.Struct({
125
+ metric: SeriesMetric,
126
+ stat: SeriesStat,
127
+ filter: optional(SeriesFilter),
128
+ groupBy: optional(SeriesGroupBy),
129
+ /** Another stage than the page's. */
130
+ stage: optional(nonEmpty),
131
+ });
132
+ /** The statistics each metric answers; the first is its default. */
133
+ export const METRIC_STATS = {
134
+ requests: ['count', 'rate', 'percent'],
135
+ page_views: ['count', 'rate'],
136
+ edge_requests: ['count', 'rate', 'percent'],
137
+ latency: ['p95', 'p50', 'p90', 'p99', 'histogram'],
138
+ cold_starts: ['count', 'percent'],
139
+ jobs: ['count', 'rate', 'percent'],
140
+ job_duration: ['p95', 'p50', 'p90', 'p99', 'histogram'],
141
+ custom: ['sum', 'avg', 'count', 'max'],
142
+ rate_limit: ['count', 'percent'],
143
+ realtime: ['sum'],
144
+ };
145
+ /** The dimensions each metric can be grouped by. */
146
+ export const METRIC_GROUP_BY = {
147
+ requests: ['status', 'route'],
148
+ page_views: [],
149
+ edge_requests: ['status'],
150
+ latency: ['route'],
151
+ cold_starts: [],
152
+ jobs: ['job', 'outcome'],
153
+ job_duration: ['job'],
154
+ custom: ['name'],
155
+ rate_limit: ['name', 'outcome'],
156
+ realtime: [],
157
+ };
158
+ /** Metrics alert rules can watch: those read from rollups written as their events happen. */
159
+ export const ALERT_METRICS = [
160
+ 'requests',
161
+ 'latency',
162
+ 'cold_starts',
163
+ 'jobs',
164
+ 'job_duration',
165
+ 'custom',
166
+ 'rate_limit',
167
+ ];
168
+ export const REALTIME_MEASURES = ['events', 'publishes', 'subscribes', 'errors'];
169
+ /**
170
+ * Why a query can't be answered, or undefined when it can. `alert` also
171
+ * refuses what an alert rule can't watch: CloudWatch metrics, histograms,
172
+ * groups, and another stage than the rule's.
173
+ */
174
+ export function checkSeriesQuery(q, options = {}) {
175
+ if (!METRIC_STATS[q.metric].includes(q.stat)) {
176
+ return `${q.metric} answers ${METRIC_STATS[q.metric].join(', ')}, not ${q.stat}`;
177
+ }
178
+ if (q.groupBy && !METRIC_GROUP_BY[q.metric].includes(q.groupBy)) {
179
+ const groups = METRIC_GROUP_BY[q.metric];
180
+ return groups.length
181
+ ? `${q.metric} can be grouped by ${groups.join(' or ')}, not ${q.groupBy}`
182
+ : `${q.metric} can't be grouped`;
183
+ }
184
+ const f = q.filter ?? {};
185
+ if (f.status?.length && q.metric !== 'requests' && q.metric !== 'edge_requests') {
186
+ return 'only requests and edge requests filter by status';
187
+ }
188
+ if (f.routes?.length && q.metric !== 'requests' && q.metric !== 'latency' && q.metric !== 'cold_starts') {
189
+ return 'only requests, latency and cold starts filter by route';
190
+ }
191
+ if (f.jobs?.length && q.metric !== 'jobs' && q.metric !== 'job_duration')
192
+ return 'only jobs filter by job';
193
+ if (f.outcome) {
194
+ const allowed = q.metric === 'jobs' ? ['ok', 'error'] : q.metric === 'rate_limit' ? ['allowed', 'denied'] : [];
195
+ if (!allowed.includes(f.outcome)) {
196
+ return allowed.length
197
+ ? `${q.metric} outcomes are ${allowed.join(' or ')}`
198
+ : `${q.metric} doesn't filter by outcome`;
199
+ }
200
+ }
201
+ if (f.names?.length && q.metric !== 'custom' && q.metric !== 'rate_limit') {
202
+ return 'only custom metrics and rate limits filter by name';
203
+ }
204
+ if (q.metric === 'custom' && !f.names?.length && q.groupBy !== 'name') {
205
+ return 'a custom metric query names its metric, or groups by name';
206
+ }
207
+ if (q.metric === 'realtime' && !REALTIME_MEASURES.some((m) => m === f.measure)) {
208
+ return `realtime measures one of ${REALTIME_MEASURES.join(', ')}`;
209
+ }
210
+ if (q.metric !== 'realtime' && f.measure)
211
+ return 'only realtime queries take a measure';
212
+ if (options.alert) {
213
+ if (!ALERT_METRICS.includes(q.metric))
214
+ return `alert rules can't watch ${q.metric}`;
215
+ if (q.stat === 'histogram')
216
+ return 'alert rules watch one number, not a histogram';
217
+ if (q.groupBy)
218
+ return 'alert rules watch one series; filter instead of grouping';
219
+ if (q.stage)
220
+ return "an alert rule's query reads the rule's own stage";
221
+ }
222
+ return undefined;
223
+ }
224
+ /** The unit a query's values are in (a custom metric's own unit comes with its series). */
225
+ const STAT_UNIT = {
226
+ count: 'count',
227
+ rate: 'per_second',
228
+ percent: 'percent',
229
+ sum: 'count',
230
+ avg: 'count',
231
+ max: 'count',
232
+ p50: 'ms',
233
+ p90: 'ms',
234
+ p95: 'ms',
235
+ p99: 'ms',
236
+ histogram: 'ms',
237
+ };
238
+ export function seriesUnit(q) {
239
+ return STAT_UNIT[q.stat];
240
+ }
241
+ const METRIC_NOUN = {
242
+ requests: 'requests',
243
+ page_views: 'page views',
244
+ edge_requests: 'edge requests',
245
+ latency: 'latency',
246
+ cold_starts: 'cold starts',
247
+ jobs: 'job runs',
248
+ job_duration: 'job duration',
249
+ custom: 'custom metric',
250
+ rate_limit: 'rate limit checks',
251
+ realtime: 'realtime',
252
+ };
253
+ /**
254
+ * A short label for a query, as charts, alert emails and the CLI show it:
255
+ * `5xx % of requests`, `p95 latency of GET /api/x`, `failed % of job runs`.
256
+ */
257
+ export function describeQuery(q) {
258
+ const f = q.filter ?? {};
259
+ const noun = METRIC_NOUN[q.metric];
260
+ const scope = [
261
+ f.routes?.length ? (f.routes.length === 1 ? f.routes[0] : `${f.routes.length} routes`) : undefined,
262
+ f.jobs?.length ? (f.jobs.length === 1 ? f.jobs[0] : `${f.jobs.length} jobs`) : undefined,
263
+ ].filter(Boolean);
264
+ const of = scope.length ? ` of ${scope.join(', ')}` : '';
265
+ const by = q.groupBy ? ` by ${q.groupBy}` : '';
266
+ const where = q.stage ? ` (${q.stage})` : '';
267
+ const subset = f.status?.length
268
+ ? f.status.join('+')
269
+ : f.outcome === 'error'
270
+ ? 'failed'
271
+ : f.outcome
272
+ ? f.outcome
273
+ : undefined;
274
+ const generic = () => {
275
+ if (q.stat === 'percent')
276
+ return `${subset ?? 'all'} % of ${noun}`;
277
+ if (q.stat === 'rate')
278
+ return `${subset ? `${subset} ` : ''}${noun} per second`;
279
+ if (q.stat === 'count')
280
+ return `${subset ? `${subset} ` : ''}${noun}`;
281
+ if (q.stat === 'histogram')
282
+ return `${noun} distribution`;
283
+ return `${q.stat} ${noun}`;
284
+ };
285
+ let head;
286
+ switch (q.metric) {
287
+ case 'custom':
288
+ head = `${q.stat} of ${f.names?.length ? f.names.join(', ') : 'custom metrics'}`;
289
+ break;
290
+ case 'realtime':
291
+ head = `realtime ${f.measure ?? 'events'}`;
292
+ break;
293
+ case 'rate_limit':
294
+ head =
295
+ q.stat === 'percent'
296
+ ? `${subset ?? 'denied'} % of rate limit checks`
297
+ : `${subset ? `${subset} ` : ''}rate limit checks`;
298
+ if (f.names?.length)
299
+ head += ` (${f.names.join(', ')})`;
300
+ break;
301
+ case 'requests':
302
+ case 'page_views':
303
+ case 'edge_requests':
304
+ case 'latency':
305
+ case 'cold_starts':
306
+ case 'jobs':
307
+ case 'job_duration':
308
+ head = generic();
309
+ break;
310
+ }
311
+ return `${head}${of}${by}${where}`;
312
+ }
313
+ // ---------------------------------------------------------------------------
314
+ // Charts and filters
315
+ // ---------------------------------------------------------------------------
316
+ /** A query of an explorer chart, with the id expressions refer to it by (`a`, `b`, …). */
317
+ export const NamedSeriesQuery = Schema.Struct({
318
+ id: Schema.String.check(Schema.isPattern(/^[a-z][a-z0-9]{0,7}$/)),
319
+ ...SeriesQuery.fields,
320
+ label: optional(Schema.String),
321
+ /** Charted only through expressions. */
322
+ hidden: optional(Schema.Boolean),
323
+ });
324
+ /** Arithmetic over other queries' values in the same bucket, e.g. `100 * a / b` (evaluated by the console). */
325
+ export const SeriesExpression = Schema.Struct({
326
+ id: Schema.String.check(Schema.isPattern(/^[a-z][a-z0-9]{0,7}$/)),
327
+ expr: Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(200)),
328
+ label: optional(Schema.String),
329
+ hidden: optional(Schema.Boolean),
330
+ });
331
+ export const ChartKind = Schema.Literals(['line', 'area', 'bar', 'heatmap']);
332
+ export const MetricsView = Schema.Struct({
333
+ kind: Schema.Literal('metrics'),
334
+ queries: Schema.Array(NamedSeriesQuery).check(Schema.isMinLength(1), Schema.isMaxLength(8)),
335
+ expressions: optional(Schema.Array(SeriesExpression).check(Schema.isMaxLength(8))),
336
+ chart: ChartKind,
337
+ scale: optional(Schema.Literals(['linear', 'log'])),
338
+ /** A line drawn across the chart, e.g. an alert threshold. */
339
+ threshold: optional(Schema.Finite),
340
+ });
341
+ export const LogLevelName = Schema.Literals(['error', 'warn', 'info', 'debug', 'system']);
342
+ /**
343
+ * Structured log filters. Any of them makes a search run on Logs Insights
344
+ * (CloudWatch filter patterns can't combine text with JSON fields).
345
+ */
346
+ export const LogFilters = Schema.Struct({
347
+ levels: optional(Schema.Array(LogLevelName)),
348
+ /** `web` or `worker`. */
349
+ streams: optional(Schema.Array(nonEmpty)),
350
+ /** Route patterns (without the method), e.g. `/api/items/:id`. */
351
+ routes: optional(Schema.Array(nonEmpty)),
352
+ status: optional(Schema.Array(StatusClass)),
353
+ /** Deployment ids. */
354
+ revs: optional(Schema.Array(nonEmpty)),
355
+ trace: optional(nonEmpty),
356
+ });
357
+ export const TraceFilters = Schema.Struct({
358
+ kind: optional(Schema.Literals(['req', 'job'])),
359
+ /** `METHOD /pattern`. */
360
+ routes: optional(Schema.Array(nonEmpty)),
361
+ /** `kind:name`. */
362
+ jobs: optional(Schema.Array(nonEmpty)),
363
+ /** `error`: 5xx requests and failed jobs; `ok`: the rest. */
364
+ outcome: optional(Schema.Literals(['ok', 'error'])),
365
+ minMs: optional(Schema.Finite),
366
+ /** Only traces whose spans were written (failed, slow or sampled). */
367
+ recorded: optional(Schema.Boolean),
368
+ });
369
+ // ---------------------------------------------------------------------------
370
+ // Alert rules
371
+ // ---------------------------------------------------------------------------
372
+ export const AlertState = Schema.Literals(['ok', 'alarm', 'no_data']);
373
+ /** Minutes an alert rule's window can cover. */
374
+ export const ALERT_WINDOWS = [1, 5, 10, 15, 30, 60];
375
+ /** How long the evaluator waits for a minute's telemetry to arrive before reading it. */
376
+ export const ALERT_LAG_MINUTES = 2;
377
+ export const MAX_ALERT_RULES_PER_APP = 25;
378
+ /** How long alert state changes are kept. */
379
+ export const ALERT_HISTORY_DAYS = 90;
380
+ const name = Schema.Trim.check(Schema.isNonEmpty(), Schema.isMaxLength(80));
381
+ export const AlertCondition = Schema.Struct({
382
+ op: Schema.Literals(['above', 'below']),
383
+ threshold: Schema.Finite,
384
+ /** The query is summarized over the last this many minutes (sums, shares and histograms of the window). */
385
+ minutes: Schema.Literals(ALERT_WINDOWS),
386
+ });
387
+ /**
388
+ * A window with no data (no requests behind a percentage or percentile, no
389
+ * values of a custom metric): `ok` and `alarm` treat it as that state,
390
+ * `keep` keeps the current one. Counts are never missing: no events is 0.
391
+ */
392
+ export const AlertMissingData = Schema.Literals(['ok', 'alarm', 'keep']);
393
+ export const AlertRuleInput = Schema.Struct({
394
+ name,
395
+ stage: nonEmpty,
396
+ query: SeriesQuery,
397
+ condition: AlertCondition,
398
+ missing: AlertMissingData,
399
+ /** Email the platform's alerts topic when the rule fires and when it recovers. */
400
+ notify: Schema.Boolean,
401
+ enabled: Schema.Boolean,
402
+ });
403
+ export const AlertRule = Schema.Struct({
404
+ id: Schema.String,
405
+ app: Schema.String,
406
+ ...AlertRuleInput.fields,
407
+ state: AlertState,
408
+ /** When `state` last changed. */
409
+ stateSince: optional(Schema.String),
410
+ /** The window's value at the last evaluation (null: no data). */
411
+ value: optional(Schema.NullOr(Schema.Finite)),
412
+ evaluatedAt: optional(Schema.String),
413
+ createdBy: Schema.String,
414
+ createdAt: Schema.String,
415
+ updatedAt: Schema.String,
416
+ });
417
+ export const AlertEvent = Schema.Struct({
418
+ ts: Schema.String,
419
+ rule: Schema.String,
420
+ name: Schema.String,
421
+ stage: Schema.String,
422
+ from: AlertState,
423
+ to: AlertState,
424
+ value: Schema.NullOr(Schema.Finite),
425
+ threshold: Schema.Finite,
426
+ });
427
+ export const AlertHistoryResponse = Schema.Struct({ events: Schema.Array(AlertEvent) });
428
+ export const breaches = (value, c) => c.op === 'above' ? value > c.threshold : value < c.threshold;
429
+ /** The state a rule moves to given its window's value (null: no data). */
430
+ export function nextAlertState(current, value, rule) {
431
+ if (value === null) {
432
+ if (rule.missing === 'ok')
433
+ return 'ok';
434
+ if (rule.missing === 'alarm')
435
+ return 'alarm';
436
+ return current === 'alarm' || current === 'ok' ? current : 'no_data';
437
+ }
438
+ return breaches(value, rule.condition) ? 'alarm' : 'ok';
439
+ }
440
+ //# sourceMappingURL=explore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explore.js","sourceRoot":"","sources":["../src/explore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAEjC,8EAA8E;AA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U;IACd,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC,MAAM;CACzB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;AAGxF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,CAA2C,EAAW,EAAE,CAC9F,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,SAAS,CAAC;AAE/D,0EAA0E;AAC1E,MAAM,UAAU,cAAc,CAC5B,OAAmB,EACnB,KAAoB,EACpB,IAAgF;IAEhF,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QACvC,IAAI,IAAI,CAAC,OAAO,KAAK,OAAO;YAAE,OAAO,OAAO,CAAC;QAC7C,OAAO,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IACvE,CAAC;IACD,OAAO,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1D,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  export * from './api.ts';
2
2
  export * from './auth.ts';
3
3
  export * from './bindings.ts';
4
- export * from './compute.ts';
5
4
  export * from './config.ts';
6
5
  export * from './constants.ts';
7
6
  export * from './cron.ts';
8
7
  export * from './email.ts';
8
+ export * from './explore.ts';
9
9
  export * from './ids.ts';
10
10
  export * from './jobs.ts';
11
11
  export * from './manifest.ts';
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  export * from './api.js';
2
2
  export * from './auth.js';
3
3
  export * from './bindings.js';
4
- export * from './compute.js';
5
4
  export * from './config.js';
6
5
  export * from './constants.js';
7
6
  export * from './cron.js';
8
7
  export * from './email.js';
8
+ export * from './explore.js';
9
9
  export * from './ids.js';
10
10
  export * from './jobs.js';
11
11
  export * from './manifest.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
package/dist/jobs.d.ts CHANGED
@@ -43,7 +43,7 @@ export declare const handlerKey: (kind: HandlerKind, name: string) => string;
43
43
  /**
44
44
  * Name of the one-shot schedule for a retry or delayed send (≤ 64 chars of
45
45
  * Scheduler's alphabet). It leads with `_`, which no cron key (a cron's own
46
- * schedule) or service stop schedule (`<key>--stop`) starts with, then the
46
+ * schedule) starts with, then the
47
47
  * kind and queue or cron key, so the console can count what's waiting per
48
48
  * queue with a name prefix. Event types can be long and contain `:`, so they
49
49
  * are hashed.
package/dist/jobs.js CHANGED
@@ -42,7 +42,7 @@ export const handlerKey = (kind, name) => `${kind}:${name}`;
42
42
  /**
43
43
  * Name of the one-shot schedule for a retry or delayed send (≤ 64 chars of
44
44
  * Scheduler's alphabet). It leads with `_`, which no cron key (a cron's own
45
- * schedule) or service stop schedule (`<key>--stop`) starts with, then the
45
+ * schedule) starts with, then the
46
46
  * kind and queue or cron key, so the console can count what's waiting per
47
47
  * queue with a name prefix. Event types can be long and contain `:`, so they
48
48
  * are hashed.
@@ -1,5 +1,4 @@
1
1
  import { Schema } from 'effect';
2
- import { type FargateCpu } from './compute.ts';
3
2
  import { type WebComputeSetting } from './web-compute.ts';
4
3
  /**
5
4
  * The app's config file, at the app root. `plat` evaluates it and sends the
@@ -9,6 +8,7 @@ export declare const APP_CONFIG_FILE = "plat.config.ts";
9
8
  export declare const ManifestSchema: Schema.Struct<{
10
9
  readonly name: Schema.String;
11
10
  readonly description: Schema.optional<Schema.String>;
11
+ readonly listed: Schema.withDecodingDefault<Schema.Boolean, never>;
12
12
  readonly web: Schema.optional<Schema.Struct<{
13
13
  readonly server: Schema.optional<Schema.String>;
14
14
  readonly static: Schema.optional<Schema.String>;
@@ -69,13 +69,7 @@ export declare const ManifestSchema: Schema.Struct<{
69
69
  readonly name: Schema.optional<Schema.String>;
70
70
  readonly dailyLimit: Schema.optional<Schema.Int>;
71
71
  }>]>, never>;
72
- readonly services: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Struct<{
73
- readonly entry: Schema.String;
74
- readonly cpu: Schema.withDecodingDefault<Schema.Literals<readonly [0.25, 0.5, 1, 2, 4]>, never>;
75
- readonly memoryMb: Schema.withDecodingDefault<Schema.Int, never>;
76
- readonly spot: Schema.withDecodingDefault<Schema.Boolean, never>;
77
- readonly previewMinutes: Schema.withDecodingDefault<Schema.Int, never>;
78
- }>>, never>;
72
+ readonly services: Schema.optional<Schema.Unknown>;
79
73
  }>;
80
74
  /** The evaluated config as JSON: what the CLI sends and deployments store. */
81
75
  export type ManifestInput = typeof ManifestSchema.Encoded;
@@ -194,33 +188,6 @@ export interface StoreConfig {
194
188
  /** Delete files not written for this many days, 1-3650. Checked daily. Default: kept until deleted. */
195
189
  expireAfterDays?: number;
196
190
  }
197
- /**
198
- * A long-running process: it holds connections open (WebSocket or
199
- * server-sent-event sources) and writes what it receives to the db, storage,
200
- * queues or realtime. One instance per stage, restarted when it crashes and
201
- * replaced on each deploy. Unlike everything else it is billed while it runs:
202
- * about $6 a month at the default size on Spot.
203
- */
204
- export interface ServiceConfig {
205
- /** Module whose default export is `defineService(...)` from `@ericminassian/platform`. */
206
- entry: string;
207
- /** vCPUs: 0.25 (default), 0.5, 1, 2 or 4. */
208
- cpu?: FargateCpu;
209
- /**
210
- * Memory in MB, one of the sizes Fargate pairs with `cpu`: 512, 1024 or
211
- * 2048 for 0.25 vCPU; 1024-4096 for 0.5; 2048-8192 for 1; 4096-16384 for 2;
212
- * 8192-30720 for 4 (steps of 1024). Default 512.
213
- */
214
- memoryMb?: number;
215
- /**
216
- * Run on Fargate Spot, about 70% cheaper. AWS may reclaim it with two
217
- * minutes' notice (the service gets SIGTERM) and the platform starts a
218
- * replacement. Default `true`.
219
- */
220
- spot?: boolean;
221
- /** Minutes a preview stage runs it after each deploy before stopping it; 0 means never. Default 30. */
222
- previewMinutes?: number;
223
- }
224
191
  /**
225
192
  * Live updates pushed to browsers. The server and worker publish; browsers
226
193
  * subscribe (they never publish). Events aren't stored: a browser that was
@@ -258,7 +225,13 @@ export interface EmailConfig {
258
225
  export interface AppConfig {
259
226
  /** 3-30 chars of a-z, 0-9 and single hyphens; also the app's host name. */
260
227
  name: string;
228
+ /** One line, up to 200 chars. The public directory shows it next to the app. */
261
229
  description?: string;
230
+ /**
231
+ * Whether the platform's public directory (`GET /v1/public/apps`) lists the
232
+ * prod stage, with its page views. Default true; `false` keeps the app out.
233
+ */
234
+ listed?: boolean;
262
235
  web?: WebConfig;
263
236
  /** Present automatically when any queue, event or cron exists. */
264
237
  worker?: WorkerConfig;
@@ -299,10 +272,6 @@ export interface AppConfig {
299
272
  realtime?: RealtimeConfig;
300
273
  /** Send email with the SDK's `Email` service: `true`, or `{ name, dailyLimit }`. */
301
274
  email?: boolean | EmailConfig;
302
- /** Long-running processes, e.g. stream ingest. Keys are 1-20 chars of a-z, 0-9 and hyphens. */
303
- services?: {
304
- readonly [name: string]: ServiceConfig;
305
- };
306
275
  }
307
276
  /**
308
277
  * Maps every key `T` has but `Shape` doesn't to `never`, recursively, so a
@@ -332,6 +301,8 @@ export declare function channel<Event>(): ChannelConfig<Event>;
332
301
  export declare const ResolvedManifest: Schema.Struct<{
333
302
  readonly name: Schema.String;
334
303
  readonly description: Schema.optional<Schema.String>;
304
+ /** Listed in the public directory (prod only). Deployments recorded before it existed were. */
305
+ readonly listed: Schema.withDecodingDefault<Schema.Boolean, never>;
335
306
  readonly web: Schema.optional<Schema.Struct<{
336
307
  readonly server: Schema.optional<Schema.String>;
337
308
  readonly static: Schema.optional<Schema.String>;
@@ -406,14 +377,6 @@ export declare const ResolvedManifest: Schema.Struct<{
406
377
  readonly name: Schema.optional<Schema.String>;
407
378
  readonly dailyLimit: Schema.Finite;
408
379
  }>>;
409
- /** Long-running services, with defaults applied. */
410
- readonly services: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Struct<{
411
- readonly entry: Schema.String;
412
- readonly cpu: Schema.withDecodingDefault<Schema.Literals<readonly [0.25, 0.5, 1, 2, 4]>, never>;
413
- readonly memoryMb: Schema.withDecodingDefault<Schema.Int, never>;
414
- readonly spot: Schema.withDecodingDefault<Schema.Boolean, never>;
415
- readonly previewMinutes: Schema.withDecodingDefault<Schema.Int, never>;
416
- }>>, never>;
417
380
  }>;
418
381
  export type ResolvedManifest = typeof ResolvedManifest.Type;
419
382
  export declare class ManifestError extends Error {