@ericminassian/platform-core 0.4.0 → 0.4.1

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/src/storage.ts CHANGED
@@ -44,6 +44,17 @@ export const STORAGE_CACHE_HOST = '__storage';
44
44
  /** `Cache-Control` the edge adds to a public file that carries none: browsers revalidate it. */
45
45
  export const STORAGE_DEFAULT_CACHE_CONTROL = 'no-cache';
46
46
 
47
+ /**
48
+ * `plat dev` only: where its router relays browser uploads to the AWS Emulator,
49
+ * with the presigned URL in `?to=`. The emulator refuses a presigned request
50
+ * that carries an `Origin` header (`InvalidAccessKeyId`), which every browser
51
+ * upload sends and S3 accepts; the router forwards the PUT without it. The SDK
52
+ * returns relay URLs when `DEV_UPLOAD_RELAY_ENV` is set, which only `plat dev`
53
+ * does (`plat test` and deployed stages get the presigned URL itself).
54
+ */
55
+ export const DEV_UPLOAD_PATH = '/__plat_dev/upload';
56
+ export const DEV_UPLOAD_RELAY_ENV = 'PLATFORM_DEV_UPLOAD_RELAY';
57
+
47
58
  /**
48
59
  * Whether the edge serves `key` (as it appears in a URL path, so still
49
60
  * percent-encoded): not empty, and without `.` or `..` segments. S3 decodes
package/src/telemetry.ts CHANGED
@@ -259,18 +259,27 @@ export function bucketStart(ts: number, res: Resolution): number {
259
259
  * resolution; `sk` starts with the bucket time so a Query with `BETWEEN`
260
260
  * returns a time range.
261
261
  *
262
+ * Every rollup family is written at `1m`, `1h` and `1d` (`RESOLUTION_TTL_DAYS`).
263
+ * Route, job, custom metric and rate limit rows have had minute buckets only
264
+ * since November 2026; before, they started at `1h`.
265
+ *
262
266
  * - `m#<app>#<stage>#<res>` sk `<iso>` whole-stage HTTP: req, s2xx, s3xx, s4xx, s5xx, lat[], cold,
263
267
  * dur (ms handling them, summed), and process starts:
264
268
  * webStarts (webInits of them reported webInitMs, summed),
265
269
  * workerStarts, serviceStarts
266
- * - `r#<app>#<stage>#<res>` sk `<iso>#<route>` per-route HTTP (same fields, plus method)
270
+ * - `r#<app>#<stage>#<res>` sk `<iso>#<METHOD> <route>` per-route HTTP: req, s2xx, s3xx, s4xx, s5xx, lat[],
271
+ * cold, method, route. Rows from before November 2026 have no
272
+ * s2xx, s3xx or cold: their req − s4xx − s5xx were 2xx
267
273
  * - `j#<app>#<stage>#<res>` sk `<iso>#<kind>:<name>` jobs: ok, error, lat[]; `service:<name>` rows also
268
274
  * count `starts` (containers of that service starting)
269
- * - `c#<app>#<stage>#<res>` sk `<iso>#<metric>` custom metrics: count, sum (and the unit)
275
+ * - `c#<app>#<stage>#<res>` sk `<iso>#<metric>` custom metrics: count, sum, max (and the unit); rows from
276
+ * before November 2026 have no max
270
277
  * - `l#<app>#<stage>#<res>` sk `<iso>#<limit>` rate limit checks: allowed, denied
271
278
  * - `e#<app>#<stage>` sk `<fingerprint>` error groups: count, firstSeen, lastSeen, sample, status
272
279
  * - `u#<app>#<stage>` sk `<iso>` uptime: ok, source (`traffic`: req, s5xx; `check`, or none on
273
280
  * rows before traffic counted: status, ms)
281
+ * - `a#<app>#<stage>` sk `<iso>#<ruleId>` alert rule state changes (`AlertEvent` fields but `ts`),
282
+ * kept `ALERT_HISTORY_DAYS`
274
283
  */
275
284
  export const telemetryKeys = {
276
285
  stage: (app: string, stage: string, res: Resolution) => `m#${app}#${stage}#${res}`,
@@ -280,6 +289,7 @@ export const telemetryKeys = {
280
289
  limit: (app: string, stage: string, res: Resolution) => `l#${app}#${stage}#${res}`,
281
290
  errors: (app: string, stage: string) => `e#${app}#${stage}`,
282
291
  uptime: (app: string, stage: string) => `u#${app}#${stage}`,
292
+ alerts: (app: string, stage: string) => `a#${app}#${stage}`,
283
293
  /**
284
294
  * Email usage: sk `YYYY-MM-DD` (UTC), `n` recipients sent. The SDK writes it
285
295
  * with the stage role, whose IAM grant covers only this partition.