@taggor/contract 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.
- package/dist/.tsbuildinfo +1 -1
- package/dist/artifact-keys.d.ts +11 -11
- package/dist/artifact-keys.d.ts.map +1 -1
- package/dist/artifact-keys.js +11 -11
- package/dist/artifact-keys.js.map +1 -1
- package/dist/assets.d.ts +5 -5
- package/dist/assets.js +5 -5
- package/dist/bounded-path.d.ts +2 -2
- package/dist/bounded-path.js +2 -2
- package/dist/bounded.d.ts +2 -2
- package/dist/bounded.js +2 -2
- package/dist/build-diagnostic.d.ts +5 -5
- package/dist/build-diagnostic.js +5 -5
- package/dist/component-types.d.ts +7 -7
- package/dist/component-types.js +4 -4
- package/dist/component-types.js.map +1 -1
- package/dist/consent-text.d.ts +1 -1
- package/dist/consent-text.js +1 -1
- package/dist/contract-version.d.ts +13 -12
- package/dist/contract-version.d.ts.map +1 -1
- package/dist/contract-version.js +13 -12
- package/dist/contract-version.js.map +1 -1
- package/dist/credential-fields.d.ts +1 -1
- package/dist/credential-fields.js +1 -1
- package/dist/css-tokens.d.ts +1 -1
- package/dist/css-tokens.js +1 -1
- package/dist/css-value.d.ts +4 -4
- package/dist/css-value.js +4 -4
- package/dist/data-api.d.ts +11 -11
- package/dist/data-api.js +14 -14
- package/dist/data-api.js.map +1 -1
- package/dist/denylist-keys.d.ts +1 -1
- package/dist/denylist-keys.js +4 -4
- package/dist/diagnostic-catalog.d.ts +44 -36
- package/dist/diagnostic-catalog.d.ts.map +1 -1
- package/dist/diagnostic-catalog.js +44 -40
- package/dist/diagnostic-catalog.js.map +1 -1
- package/dist/dom-members.snapshot.d.ts +4 -4
- package/dist/dom-members.snapshot.js +8 -8
- package/dist/early-loading.d.ts +1 -1
- package/dist/early-loading.js +1 -1
- package/dist/error-catalog.d.ts +67 -7
- package/dist/error-catalog.d.ts.map +1 -1
- package/dist/error-catalog.js +105 -49
- package/dist/error-catalog.js.map +1 -1
- package/dist/executable-config.d.ts +1 -1
- package/dist/freeze.d.ts +2 -2
- package/dist/freeze.js +2 -2
- package/dist/gunzip.d.ts +3 -3
- package/dist/gunzip.js +4 -4
- package/dist/gunzip.js.map +1 -1
- package/dist/hostname.d.ts +5 -6
- package/dist/hostname.d.ts.map +1 -1
- package/dist/hostname.js +7 -8
- package/dist/hostname.js.map +1 -1
- package/dist/human-actions.d.ts +3 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/json-schema.d.ts +15 -15
- package/dist/json-schema.d.ts.map +1 -1
- package/dist/json-schema.js +22 -22
- package/dist/json-schema.js.map +1 -1
- package/dist/key-checksum.d.ts +1 -1
- package/dist/key-checksum.js +1 -1
- package/dist/libraries.d.ts +4 -4
- package/dist/libraries.d.ts.map +1 -1
- package/dist/libraries.js +4 -4
- package/dist/libraries.js.map +1 -1
- package/dist/limit-catalog.d.ts +17 -17
- package/dist/limit-catalog.d.ts.map +1 -1
- package/dist/limit-catalog.js +30 -30
- package/dist/limit-catalog.js.map +1 -1
- package/dist/limits.d.ts +15 -15
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +16 -16
- package/dist/limits.js.map +1 -1
- package/dist/locale-tag.d.ts +2 -2
- package/dist/locale-tag.js +2 -2
- package/dist/make-diagnostic.d.ts +2 -3
- package/dist/make-diagnostic.d.ts.map +1 -1
- package/dist/make-diagnostic.js.map +1 -1
- package/dist/manifest-compat-diagnostics.d.ts +1 -1
- package/dist/manifest-compat.js +1 -1
- package/dist/manifest.d.ts +21 -22
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +31 -32
- package/dist/manifest.js.map +1 -1
- package/dist/metering.d.ts +17 -18
- package/dist/metering.d.ts.map +1 -1
- package/dist/metering.js +17 -18
- package/dist/metering.js.map +1 -1
- package/dist/migrate.d.ts +1 -1
- package/dist/migrate.js +5 -5
- package/dist/migrate.js.map +1 -1
- package/dist/money.d.ts +2 -2
- package/dist/money.js +2 -2
- package/dist/names.d.ts +4 -4
- package/dist/names.js +4 -4
- package/dist/overage-pricing.d.ts +1 -1
- package/dist/overage-pricing.js +1 -1
- package/dist/plan-ids.d.ts +1 -1
- package/dist/plan-ids.js +1 -1
- package/dist/plan-limits.d.ts +13 -13
- package/dist/plan-limits.d.ts.map +1 -1
- package/dist/plan-limits.js +8 -8
- package/dist/plan-limits.js.map +1 -1
- package/dist/plan-pricing.d.ts +10 -12
- package/dist/plan-pricing.d.ts.map +1 -1
- package/dist/plan-pricing.js +12 -14
- package/dist/plan-pricing.js.map +1 -1
- package/dist/plan-usage.d.ts +18 -18
- package/dist/plan-usage.d.ts.map +1 -1
- package/dist/plan-usage.js +19 -20
- package/dist/plan-usage.js.map +1 -1
- package/dist/preview-token.js +2 -2
- package/dist/prop-names.d.ts +5 -5
- package/dist/prop-names.d.ts.map +1 -1
- package/dist/prop-names.js +10 -10
- package/dist/prop-names.js.map +1 -1
- package/dist/prop-type-docs.js +1 -1
- package/dist/prop-types.d.ts +6 -6
- package/dist/prop-types.js +16 -16
- package/dist/prop-types.js.map +1 -1
- package/dist/props.d.ts +5 -5
- package/dist/props.js +6 -6
- package/dist/props.js.map +1 -1
- package/dist/proto-guard.js +3 -3
- package/dist/proto-guard.js.map +1 -1
- package/dist/runtime-errors.d.ts +2 -2
- package/dist/runtime-errors.js +2 -2
- package/dist/runtime-pointers.d.ts +2 -2
- package/dist/runtime-pointers.js +2 -2
- package/{schema → dist/schema}/component-manifest.v1.json +5 -5
- package/dist/secret-scan.d.ts +10 -10
- package/dist/secret-scan.d.ts.map +1 -1
- package/dist/secret-scan.js +15 -16
- package/dist/secret-scan.js.map +1 -1
- package/dist/semver.d.ts +2 -2
- package/dist/semver.js +2 -2
- package/dist/server-key.js +1 -1
- package/dist/site-manifest-keys.d.ts +11 -11
- package/dist/site-manifest-keys.d.ts.map +1 -1
- package/dist/site-manifest-keys.js +18 -18
- package/dist/site-manifest-keys.js.map +1 -1
- package/dist/site-manifest.d.ts +2 -2
- package/dist/site-manifest.js +9 -9
- package/dist/site-manifest.js.map +1 -1
- package/dist/source-archive.d.ts +13 -13
- package/dist/source-archive.js +25 -25
- package/dist/source-archive.js.map +1 -1
- package/dist/source-package-corpus.d.ts +3 -4
- package/dist/source-package-corpus.d.ts.map +1 -1
- package/dist/source-package-corpus.js +4 -6
- package/dist/source-package-corpus.js.map +1 -1
- package/dist/source-package.d.ts +17 -17
- package/dist/source-package.d.ts.map +1 -1
- package/dist/source-package.js +15 -15
- package/dist/source-package.js.map +1 -1
- package/dist/source-secrets.js +1 -1
- package/dist/ssr-cap.d.ts +1 -1
- package/dist/ssr-cap.js +4 -4
- package/dist/ssr-kv.d.ts +1 -1
- package/dist/ssr-kv.js +1 -1
- package/dist/ssr-render.d.ts +2 -2
- package/dist/ssr-render.d.ts.map +1 -1
- package/dist/ssr-render.js +3 -3
- package/dist/ssr-render.js.map +1 -1
- package/dist/ssr-version-ledger.js +3 -3
- package/dist/style-references.d.ts +2 -3
- package/dist/style-references.d.ts.map +1 -1
- package/dist/style-references.js +10 -11
- package/dist/style-references.js.map +1 -1
- package/dist/support-contact.d.ts +11 -0
- package/dist/support-contact.d.ts.map +1 -0
- package/dist/support-contact.js +11 -0
- package/dist/support-contact.js.map +1 -0
- package/dist/tag-name.d.ts +6 -6
- package/dist/tag-name.d.ts.map +1 -1
- package/dist/tag-name.js +7 -7
- package/dist/tag-name.js.map +1 -1
- package/dist/tar-writer.js +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/dist/text-codec.d.ts +2 -2
- package/dist/text-codec.js +2 -2
- package/dist/url-value.d.ts +1 -1
- package/dist/url-value.js +6 -6
- package/dist/usage-guard.d.ts +16 -16
- package/dist/usage-guard.js +15 -15
- package/dist/usage-mirror.d.ts +5 -5
- package/dist/value-check.d.ts +6 -6
- package/dist/value-check.js +20 -20
- package/dist/value-check.js.map +1 -1
- package/dist/value-patterns.js +2 -2
- package/dist/value-schema.d.ts +3 -3
- package/dist/value-schema.d.ts.map +1 -1
- package/dist/value-schema.js +4 -4
- package/dist/value-schema.js.map +1 -1
- package/dist/zod-free.d.ts +24 -23
- package/dist/zod-free.d.ts.map +1 -1
- package/dist/zod-free.js +25 -24
- package/dist/zod-free.js.map +1 -1
- package/package.json +9 -10
- package/schema/DEPLOYED +0 -12
- package/schema/published/SHA256SUMS +0 -41
- package/schema/published/build-diagnostic/v1.10.json +0 -83
- package/schema/published/build-diagnostic/v1.11.json +0 -83
- package/schema/published/build-diagnostic/v1.3.json +0 -83
- package/schema/published/build-diagnostic/v1.4.json +0 -83
- package/schema/published/build-diagnostic/v1.5.json +0 -83
- package/schema/published/build-diagnostic/v1.6.json +0 -83
- package/schema/published/build-diagnostic/v1.7.json +0 -83
- package/schema/published/build-diagnostic/v1.8.json +0 -83
- package/schema/published/build-diagnostic/v1.9.json +0 -83
- package/schema/published/component-manifest/v1.10.json +0 -1443
- package/schema/published/component-manifest/v1.11.json +0 -1443
- package/schema/published/component-manifest/v1.3.json +0 -1411
- package/schema/published/component-manifest/v1.4.json +0 -1419
- package/schema/published/component-manifest/v1.5.json +0 -1437
- package/schema/published/component-manifest/v1.6.json +0 -1437
- package/schema/published/component-manifest/v1.7.json +0 -1437
- package/schema/published/component-manifest/v1.8.json +0 -1437
- package/schema/published/component-manifest/v1.9.json +0 -1437
- package/schema/published/data-api/v1.10.json +0 -282
- package/schema/published/data-api/v1.11.json +0 -282
- package/schema/published/data-api/v1.3.json +0 -281
- package/schema/published/data-api/v1.4.json +0 -281
- package/schema/published/data-api/v1.5.json +0 -281
- package/schema/published/data-api/v1.6.json +0 -281
- package/schema/published/data-api/v1.7.json +0 -281
- package/schema/published/data-api/v1.8.json +0 -282
- package/schema/published/data-api/v1.9.json +0 -282
- package/schema/published/library-manifest/v1.10.json +0 -68
- package/schema/published/library-manifest/v1.11.json +0 -68
- package/schema/published/library-manifest/v1.5.json +0 -68
- package/schema/published/library-manifest/v1.6.json +0 -68
- package/schema/published/library-manifest/v1.7.json +0 -68
- package/schema/published/library-manifest/v1.8.json +0 -68
- package/schema/published/library-manifest/v1.9.json +0 -68
- package/schema/published/taggor-config/v1.10.json +0 -56
- package/schema/published/taggor-config/v1.11.json +0 -56
- package/schema/published/taggor-config/v1.5.json +0 -56
- package/schema/published/taggor-config/v1.6.json +0 -56
- package/schema/published/taggor-config/v1.7.json +0 -56
- package/schema/published/taggor-config/v1.8.json +0 -56
- package/schema/published/taggor-config/v1.9.json +0 -56
- /package/{schema → dist/schema}/build-diagnostic.v1.json +0 -0
- /package/{schema → dist/schema}/data-api.v1.json +0 -0
- /package/{schema → dist/schema}/library-manifest.v1.json +0 -0
- /package/{schema → dist/schema}/taggor-config.v1.json +0 -0
package/dist/metering.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The metering contract of the loader hit point
|
|
2
|
+
* The metering contract of the loader hit point: the one place that names what the edge
|
|
3
3
|
* writes per loader delivery and what counts toward a plan's usage, shared by the writer
|
|
4
|
-
* (apps/edge, domain/loader-hit.ts) and the readers (the API's usage reader
|
|
5
|
-
* build the quotas on it).
|
|
4
|
+
* (apps/edge, domain/loader-hit.ts) and the readers (the API's usage reader, which builds the quotas on it).
|
|
6
5
|
*
|
|
7
|
-
* Point layout of the `loader_hits` dataset (
|
|
6
|
+
* Point layout of the `loader_hits` dataset (a request writes a DELIVERY point, with no ASN and no
|
|
8
7
|
* visitor identifier, and a separate NETWORK point, with the ASN and `doubles[0] = 0`; `blobs[3]` is reserved and
|
|
9
|
-
* always empty, it held the visitor hash
|
|
8
|
+
* always empty, it held the visitor hash; only the delivery count under a honored `Sec-GPC: 1`), append-only (a reader of an older layout keeps
|
|
10
9
|
* working): `indexes[0]` site key; `blobs[0]` hostname; `blobs[1]` allowance; `blobs[2]` traffic
|
|
11
10
|
* class; `doubles[0]` 1 (a delivery; sampling weights come from `_sample_interval`);
|
|
12
|
-
* `doubles[1]` the number of components the delivered manifest offered;
|
|
11
|
+
* `doubles[1]` the number of components the delivered manifest offered; also
|
|
13
12
|
* `blobs[3]` reserved (always empty) and `blobs[4]` the ASN of a network point (the anomaly guard, `usage-guard.ts`).
|
|
14
13
|
*
|
|
15
14
|
* Privacy (golden rule 6): none of it identifies a visitor. The traffic class is derived from the
|
|
@@ -17,7 +16,7 @@
|
|
|
17
16
|
*/
|
|
18
17
|
/**
|
|
19
18
|
* The header the API sets when it reads a site's loader itself (`?preload=true` needs the runtime
|
|
20
|
-
* version the loader names
|
|
19
|
+
* version the loader names). The edge does not record a hit point for such a request: it
|
|
21
20
|
* is not a page loading the snippet, and counting it would make the installation check say
|
|
22
21
|
* "detected" before any page has the snippet. No secret guards it on purpose: sending it can only
|
|
23
22
|
* LOWER the counts of the caller's own non-visitor requests (a real visitor never sends it, and
|
|
@@ -46,7 +45,7 @@ export declare function countsTowardUsage(allowance: HostAllowance, traffic: Tra
|
|
|
46
45
|
*/
|
|
47
46
|
export declare function usageMonthStart(date: Date): Date;
|
|
48
47
|
/**
|
|
49
|
-
* The kinds of event the browser can report to `POST /e/<siteKey
|
|
48
|
+
* The kinds of event the browser can report to `POST /e/<siteKey>`, the layout of the
|
|
50
49
|
* `component_events` dataset (append-only): `indexes[0]` site key; `blobs[0]` kind; `blobs[1]` the
|
|
51
50
|
* component tag; `blobs[2]` the published version hash; `blobs[3]` the hostname of the page's
|
|
52
51
|
* `Origin`; `blobs[4]` traffic class; `blobs[5]` the event name (`""` for `render`);
|
|
@@ -59,7 +58,7 @@ export declare function usageMonthStart(date: Date): Date;
|
|
|
59
58
|
export declare const COMPONENT_EVENT_KINDS: readonly ["render", "interaction", "custom", "error"];
|
|
60
59
|
export type ComponentEventKind = (typeof COMPONENT_EVENT_KINDS)[number];
|
|
61
60
|
/**
|
|
62
|
-
* The server-render points of `GET /r/<siteKey>/<tag
|
|
61
|
+
* The server-render points of `GET /r/<siteKey>/<tag>`, written by the
|
|
63
62
|
* edge itself into the same `component_events` dataset with the same layout: `indexes[0]` site key;
|
|
64
63
|
* `blobs[0]` the kind; `blobs[1]` the component tag; `blobs[2]` the version hash; every other blob
|
|
65
64
|
* `""` (no hostname, traffic class, name, country nor device: the caller is the customer's server,
|
|
@@ -74,32 +73,32 @@ export type ComponentEventKind = (typeof COMPONENT_EVENT_KINDS)[number];
|
|
|
74
73
|
export declare const SSR_POINT_KINDS: readonly ["ssr_render", "ssr_hit"];
|
|
75
74
|
export type SsrPointKind = (typeof SSR_POINT_KINDS)[number];
|
|
76
75
|
/**
|
|
77
|
-
* The kind of a render that gave no fragment
|
|
76
|
+
* The kind of a render that gave no fragment: written by the edge with the same layout,
|
|
78
77
|
* for staff queries and alerts. Not in `SSR_POINT_KINDS` on purpose: that list is what the API's
|
|
79
78
|
* usage reader asks for, and a failed render is never counted or billed.
|
|
80
79
|
*/
|
|
81
80
|
export declare const SSR_FAILED_POINT_KIND = "ssr_failed";
|
|
82
81
|
/**
|
|
83
|
-
* The coarse device class of an event
|
|
82
|
+
* The coarse device class of an event, derived from the `User-Agent` on the edge, which
|
|
84
83
|
* keeps only the class: `mobile` (a phone), `tablet`, `desktop`, or `other` (a bot, a library, no
|
|
85
84
|
* header, anything not recognized). Four values, so the dataset's cardinality stays four.
|
|
86
85
|
*/
|
|
87
86
|
export declare const DEVICE_CLASSES: readonly ["mobile", "desktop", "tablet", "other"];
|
|
88
87
|
export type DeviceClass = (typeof DEVICE_CLASSES)[number];
|
|
89
88
|
/**
|
|
90
|
-
* The smallest `eventSampleRate` a manifest may declare
|
|
89
|
+
* The smallest `eventSampleRate` a manifest may declare: one event in a thousand, so the
|
|
91
90
|
* weight of a sent event (`1 / rate`) never passes 1000 and one forged or lucky event cannot stand
|
|
92
91
|
* for an unbounded count.
|
|
93
92
|
*/
|
|
94
93
|
export declare const EVENT_SAMPLE_RATE_MIN = 0.001;
|
|
95
94
|
/**
|
|
96
|
-
* The kinds the browser never samples
|
|
95
|
+
* The kinds the browser never samples: the render count, the `error` reports of the
|
|
97
96
|
* runtime (rare, and a sample would hide a failing release). Only `interaction` and `custom` follow `eventSampleRate`.
|
|
98
97
|
*/
|
|
99
98
|
export declare const UNSAMPLED_EVENT_KINDS: readonly ComponentEventKind[];
|
|
100
99
|
/**
|
|
101
|
-
* Whether the browser sends one event of this kind, given the component's `eventSampleRate
|
|
102
|
-
*
|
|
100
|
+
* Whether the browser sends one event of this kind, given the component's `eventSampleRate`.
|
|
101
|
+
* A kind that is never sampled, an undeclared rate and a rate outside its bounds always
|
|
103
102
|
* send (a bad value must never silently drop events). Otherwise the event is sent with
|
|
104
103
|
* probability `rate`.
|
|
105
104
|
* Inputs: the kind, the declared rate (or `undefined`) and a draw in `[0, 1)` (`Math.random()` in
|
|
@@ -107,7 +106,7 @@ export declare const UNSAMPLED_EVENT_KINDS: readonly ComponentEventKind[];
|
|
|
107
106
|
*/
|
|
108
107
|
export declare function shouldSendEvent(kind: ComponentEventKind, rate: number | undefined, draw: number): boolean;
|
|
109
108
|
/**
|
|
110
|
-
* How many real events one stored event stands for
|
|
109
|
+
* How many real events one stored event stands for: `1 / rate` for a sampled kind, and 1
|
|
111
110
|
* for a kind that is never sampled or a rate that is not usable. The edge writes it as
|
|
112
111
|
* `doubles[0]` from the rate of the STORED manifest, never from the request, so a visitor cannot
|
|
113
112
|
* claim a weight; summing the weights over the sent events estimates the real total.
|
|
@@ -116,8 +115,8 @@ export declare function shouldSendEvent(kind: ComponentEventKind, rate: number |
|
|
|
116
115
|
*/
|
|
117
116
|
export declare function eventWeight(kind: ComponentEventKind, rate: number | undefined): number;
|
|
118
117
|
/**
|
|
119
|
-
* The most beacons of one kind (`interaction` or `custom`) a component sends in one page view
|
|
120
|
-
*
|
|
118
|
+
* The most beacons of one kind (`interaction` or `custom`) a component sends in one page view,
|
|
119
|
+
* counted in the SDK's data transport: a component that emits on every keystroke or
|
|
121
120
|
* slider move cannot flood the visitor's network or the dataset. Sampling (`shouldSendEvent`)
|
|
122
121
|
* applies on top; the edge's flood keys stay the technical protection.
|
|
123
122
|
*/
|
package/dist/metering.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metering.d.ts","sourceRoot":"","sources":["../src/metering.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"metering.d.ts","sourceRoot":"","sources":["../src/metering.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAE7D,qGAAqG;AACrG,eAAO,MAAM,eAAe,4CAA6C,CAAC;AAC1E,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,+FAA+F;AAC/F,eAAO,MAAM,eAAe,2BAA4B,CAAC;AACzD,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAE1F;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAEhD;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,uDAAwD,CAAC;AAC3F,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,oCAAqC,CAAC;AAClE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,cAAc,mDAAoD,CAAC;AAChF,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,kBAAkB,EAAwB,CAAC;AAOxF;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,kBAAkB,EACxB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,EAAE,MAAM,GACX,OAAO,CAGT;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGtF;AAED;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,KAAK,CAAC"}
|
package/dist/metering.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The metering contract of the loader hit point
|
|
2
|
+
* The metering contract of the loader hit point: the one place that names what the edge
|
|
3
3
|
* writes per loader delivery and what counts toward a plan's usage, shared by the writer
|
|
4
|
-
* (apps/edge, domain/loader-hit.ts) and the readers (the API's usage reader
|
|
5
|
-
* build the quotas on it).
|
|
4
|
+
* (apps/edge, domain/loader-hit.ts) and the readers (the API's usage reader, which builds the quotas on it).
|
|
6
5
|
*
|
|
7
|
-
* Point layout of the `loader_hits` dataset (
|
|
6
|
+
* Point layout of the `loader_hits` dataset (a request writes a DELIVERY point, with no ASN and no
|
|
8
7
|
* visitor identifier, and a separate NETWORK point, with the ASN and `doubles[0] = 0`; `blobs[3]` is reserved and
|
|
9
|
-
* always empty, it held the visitor hash
|
|
8
|
+
* always empty, it held the visitor hash; only the delivery count under a honored `Sec-GPC: 1`), append-only (a reader of an older layout keeps
|
|
10
9
|
* working): `indexes[0]` site key; `blobs[0]` hostname; `blobs[1]` allowance; `blobs[2]` traffic
|
|
11
10
|
* class; `doubles[0]` 1 (a delivery; sampling weights come from `_sample_interval`);
|
|
12
|
-
* `doubles[1]` the number of components the delivered manifest offered;
|
|
11
|
+
* `doubles[1]` the number of components the delivered manifest offered; also
|
|
13
12
|
* `blobs[3]` reserved (always empty) and `blobs[4]` the ASN of a network point (the anomaly guard, `usage-guard.ts`).
|
|
14
13
|
*
|
|
15
14
|
* Privacy (golden rule 6): none of it identifies a visitor. The traffic class is derived from the
|
|
@@ -17,7 +16,7 @@
|
|
|
17
16
|
*/
|
|
18
17
|
/**
|
|
19
18
|
* The header the API sets when it reads a site's loader itself (`?preload=true` needs the runtime
|
|
20
|
-
* version the loader names
|
|
19
|
+
* version the loader names). The edge does not record a hit point for such a request: it
|
|
21
20
|
* is not a page loading the snippet, and counting it would make the installation check say
|
|
22
21
|
* "detected" before any page has the snippet. No secret guards it on purpose: sending it can only
|
|
23
22
|
* LOWER the counts of the caller's own non-visitor requests (a real visitor never sends it, and
|
|
@@ -48,7 +47,7 @@ export function usageMonthStart(date) {
|
|
|
48
47
|
return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1));
|
|
49
48
|
}
|
|
50
49
|
/**
|
|
51
|
-
* The kinds of event the browser can report to `POST /e/<siteKey
|
|
50
|
+
* The kinds of event the browser can report to `POST /e/<siteKey>`, the layout of the
|
|
52
51
|
* `component_events` dataset (append-only): `indexes[0]` site key; `blobs[0]` kind; `blobs[1]` the
|
|
53
52
|
* component tag; `blobs[2]` the published version hash; `blobs[3]` the hostname of the page's
|
|
54
53
|
* `Origin`; `blobs[4]` traffic class; `blobs[5]` the event name (`""` for `render`);
|
|
@@ -60,7 +59,7 @@ export function usageMonthStart(date) {
|
|
|
60
59
|
*/
|
|
61
60
|
export const COMPONENT_EVENT_KINDS = ["render", "interaction", "custom", "error"];
|
|
62
61
|
/**
|
|
63
|
-
* The server-render points of `GET /r/<siteKey>/<tag
|
|
62
|
+
* The server-render points of `GET /r/<siteKey>/<tag>`, written by the
|
|
64
63
|
* edge itself into the same `component_events` dataset with the same layout: `indexes[0]` site key;
|
|
65
64
|
* `blobs[0]` the kind; `blobs[1]` the component tag; `blobs[2]` the version hash; every other blob
|
|
66
65
|
* `""` (no hostname, traffic class, name, country nor device: the caller is the customer's server,
|
|
@@ -74,25 +73,25 @@ export const COMPONENT_EVENT_KINDS = ["render", "interaction", "custom", "error"
|
|
|
74
73
|
*/
|
|
75
74
|
export const SSR_POINT_KINDS = ["ssr_render", "ssr_hit"];
|
|
76
75
|
/**
|
|
77
|
-
* The kind of a render that gave no fragment
|
|
76
|
+
* The kind of a render that gave no fragment: written by the edge with the same layout,
|
|
78
77
|
* for staff queries and alerts. Not in `SSR_POINT_KINDS` on purpose: that list is what the API's
|
|
79
78
|
* usage reader asks for, and a failed render is never counted or billed.
|
|
80
79
|
*/
|
|
81
80
|
export const SSR_FAILED_POINT_KIND = "ssr_failed";
|
|
82
81
|
/**
|
|
83
|
-
* The coarse device class of an event
|
|
82
|
+
* The coarse device class of an event, derived from the `User-Agent` on the edge, which
|
|
84
83
|
* keeps only the class: `mobile` (a phone), `tablet`, `desktop`, or `other` (a bot, a library, no
|
|
85
84
|
* header, anything not recognized). Four values, so the dataset's cardinality stays four.
|
|
86
85
|
*/
|
|
87
86
|
export const DEVICE_CLASSES = ["mobile", "desktop", "tablet", "other"];
|
|
88
87
|
/**
|
|
89
|
-
* The smallest `eventSampleRate` a manifest may declare
|
|
88
|
+
* The smallest `eventSampleRate` a manifest may declare: one event in a thousand, so the
|
|
90
89
|
* weight of a sent event (`1 / rate`) never passes 1000 and one forged or lucky event cannot stand
|
|
91
90
|
* for an unbounded count.
|
|
92
91
|
*/
|
|
93
92
|
export const EVENT_SAMPLE_RATE_MIN = 0.001;
|
|
94
93
|
/**
|
|
95
|
-
* The kinds the browser never samples
|
|
94
|
+
* The kinds the browser never samples: the render count, the `error` reports of the
|
|
96
95
|
* runtime (rare, and a sample would hide a failing release). Only `interaction` and `custom` follow `eventSampleRate`.
|
|
97
96
|
*/
|
|
98
97
|
export const UNSAMPLED_EVENT_KINDS = ["render", "error"];
|
|
@@ -101,8 +100,8 @@ function usableRate(rate) {
|
|
|
101
100
|
return typeof rate === "number" && rate >= EVENT_SAMPLE_RATE_MIN && rate <= 1;
|
|
102
101
|
}
|
|
103
102
|
/**
|
|
104
|
-
* Whether the browser sends one event of this kind, given the component's `eventSampleRate
|
|
105
|
-
*
|
|
103
|
+
* Whether the browser sends one event of this kind, given the component's `eventSampleRate`.
|
|
104
|
+
* A kind that is never sampled, an undeclared rate and a rate outside its bounds always
|
|
106
105
|
* send (a bad value must never silently drop events). Otherwise the event is sent with
|
|
107
106
|
* probability `rate`.
|
|
108
107
|
* Inputs: the kind, the declared rate (or `undefined`) and a draw in `[0, 1)` (`Math.random()` in
|
|
@@ -114,7 +113,7 @@ export function shouldSendEvent(kind, rate, draw) {
|
|
|
114
113
|
return draw < rate;
|
|
115
114
|
}
|
|
116
115
|
/**
|
|
117
|
-
* How many real events one stored event stands for
|
|
116
|
+
* How many real events one stored event stands for: `1 / rate` for a sampled kind, and 1
|
|
118
117
|
* for a kind that is never sampled or a rate that is not usable. The edge writes it as
|
|
119
118
|
* `doubles[0]` from the rate of the STORED manifest, never from the request, so a visitor cannot
|
|
120
119
|
* claim a weight; summing the weights over the sent events estimates the real total.
|
|
@@ -127,8 +126,8 @@ export function eventWeight(kind, rate) {
|
|
|
127
126
|
return 1 / rate;
|
|
128
127
|
}
|
|
129
128
|
/**
|
|
130
|
-
* The most beacons of one kind (`interaction` or `custom`) a component sends in one page view
|
|
131
|
-
*
|
|
129
|
+
* The most beacons of one kind (`interaction` or `custom`) a component sends in one page view,
|
|
130
|
+
* counted in the SDK's data transport: a component that emits on every keystroke or
|
|
132
131
|
* slider move cannot flood the visitor's network or the dataset. Sampling (`shouldSendEvent`)
|
|
133
132
|
* applies on top; the edge's flood keys stay the technical protection.
|
|
134
133
|
*/
|
package/dist/metering.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metering.js","sourceRoot":"","sources":["../src/metering.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
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OAAO,CAAC,CAAC;AAExF,uFAAuF;AACvF,SAAS,UAAU,CAAC,IAAwB;IAC1C,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,IAAI,qBAAqB,IAAI,IAAI,IAAI,CAAC,CAAC;AAChF,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAwB,EACxB,IAAwB,EACxB,IAAY;IAEZ,IAAI,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3E,OAAO,IAAI,GAAG,IAAI,CAAC;AACrB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,IAAwB,EAAE,IAAwB;IAC5E,IAAI,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACxE,OAAO,CAAC,GAAG,IAAI,CAAC;AAClB,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC"}
|
package/dist/migrate.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface ManifestMigration {
|
|
|
16
16
|
*/
|
|
17
17
|
export declare const MANIFEST_MIGRATIONS: readonly ManifestMigration[];
|
|
18
18
|
/**
|
|
19
|
-
* Why `migrateManifest` refused, stable for callers and logs
|
|
19
|
+
* Why `migrateManifest` refused, stable for callers and logs:
|
|
20
20
|
* - `not-an-object`: the input (or what its `toJSON` produced) is not a JSON object;
|
|
21
21
|
* - `proto-key`, `too-large`: see `findOwnProtoKey`, checked on the input and again on the copy;
|
|
22
22
|
* - `unreadable`: reading or copying the input threw (a throwing getter, proxy or `toJSON`, a
|
package/dist/migrate.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Migration of manifests between contract majors
|
|
2
|
+
* Migration of manifests between contract majors.
|
|
3
3
|
*
|
|
4
4
|
* When a major ships, the change that bumps `CONTRACT_MAJOR` adds one step `from: N, to: N + 1`
|
|
5
5
|
* to `MANIFEST_MIGRATIONS`: a pure function from a manifest of major N to an equivalent manifest
|
|
6
6
|
* of major N + 1 (renames, removed fields mapped to their replacement, new required fields given
|
|
7
7
|
* their old implicit value). `migrateManifest` chains the steps. The compatibility test
|
|
8
|
-
* (compat.test.ts) runs every
|
|
8
|
+
* (compat.test.ts) runs every sample of an older major through it and requires the result to
|
|
9
9
|
* pass the current schema, so a major cannot ship without its migration.
|
|
10
10
|
*
|
|
11
11
|
* A migration is applied when a manifest is read for a new build or for display, never written
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* explicit action of the customer (golden rule 3).
|
|
14
14
|
*
|
|
15
15
|
* The input is untrusted (golden rule 5) and the runtime may call this on a host page (golden rule
|
|
16
|
-
* 2), so it never throws
|
|
16
|
+
* 2), so it never throws: every refusal is a result with a stable `reason`.
|
|
17
17
|
*
|
|
18
18
|
* Zod-free and pure. The output is not validated here: callers parse it (`parseManifest`).
|
|
19
19
|
*/
|
|
@@ -38,7 +38,7 @@ const SAFE_ERROR_NAME = /^[A-Za-z][A-Za-z0-9]{0,63}$/;
|
|
|
38
38
|
* Name of a caught value, for a message that never echoes input data. The value may come from the
|
|
39
39
|
* input (a throwing `toJSON` or getter): `instanceof` runs a Proxy's `getPrototypeOf` trap and
|
|
40
40
|
* `.name` may be a getter, both of which can throw, so they run inside a try and the name is
|
|
41
|
-
* echoed only when it is a short identifier
|
|
41
|
+
* echoed only when it is a short identifier.
|
|
42
42
|
*/
|
|
43
43
|
function errorName(error) {
|
|
44
44
|
try {
|
|
@@ -111,7 +111,7 @@ export function migrateManifest(input, options = {}) {
|
|
|
111
111
|
try {
|
|
112
112
|
// The first scan refuses what is too large before JSON.stringify walks it (a sparse array of
|
|
113
113
|
// length 2**32 - 1 used to throw a RangeError here); the second one checks what the copy
|
|
114
|
-
// really holds, since a toJSON may produce anything
|
|
114
|
+
// really holds, since a toJSON may produce anything.
|
|
115
115
|
const scanned = checkDocument(input, "manifest");
|
|
116
116
|
if (!scanned.ok)
|
|
117
117
|
return scanned;
|
package/dist/migrate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../src/migrate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAezE;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAiC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAqDnF,SAAS,UAAU,CAAC,KAAc;IAChC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAID,SAAS,OAAO,CAAC,MAAgC,EAAE,OAAe;IAChE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AACxC,CAAC;AAED,oEAAoE;AACpE,MAAM,eAAe,GAAG,6BAA6B,CAAC;AAEtD;;;;;GAKG;AACH,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,CAAC;QACH,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,MAAM,IAAI,GAAY,KAAK,CAAC,IAAI,CAAC;YACjC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,OAAO,IAAI,CAAC;QAC1E,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,0DAA0D;IAC5D,CAAC;IACD,OAAO,SAAS,CAA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iB,CAAC,CAAC;YACnD,CAAC,CAAC,SAAS,CAAC;QACd,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,eAAe,EAAE,KAAK,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC;YAChE,OAAO,OAAO,CACZ,UAAU,EACV,uBAAuB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,mCAAmC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CACrG,CAAC;QACJ,CAAC;QACD,QAAQ,GAAG,QAAQ,CAAC;IACtB,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC;AACjE,CAAC"}
|
package/dist/money.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The one formatter of US dollar amounts for every surface
|
|
2
|
+
* The one formatter of US dollar amounts for every surface: the portal, the staff
|
|
3
3
|
* backoffice, the CLI and the public site read money through these functions, so a figure is written
|
|
4
|
-
* the same way everywhere and its rounding is defined once. Money is always US dollars
|
|
4
|
+
* the same way everywhere and its rounding is defined once. Money is always US dollars.
|
|
5
5
|
*
|
|
6
6
|
* Rounding rule: an amount of micro dollars is shown in whole cents rounded DOWN, because an estimate
|
|
7
7
|
* must never overstate a bill (the CLOSE bills the ledger, not this text). A price per unit
|
package/dist/money.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The one formatter of US dollar amounts for every surface
|
|
2
|
+
* The one formatter of US dollar amounts for every surface: the portal, the staff
|
|
3
3
|
* backoffice, the CLI and the public site read money through these functions, so a figure is written
|
|
4
|
-
* the same way everywhere and its rounding is defined once. Money is always US dollars
|
|
4
|
+
* the same way everywhere and its rounding is defined once. Money is always US dollars.
|
|
5
5
|
*
|
|
6
6
|
* Rounding rule: an amount of micro dollars is shown in whole cents rounded DOWN, because an estimate
|
|
7
7
|
* must never overstate a bill (the CLOSE bills the ledger, not this text). A price per unit
|
package/dist/names.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Identifier schemas of component contract v1
|
|
3
|
-
* variable, collection and field names. Custom element tags live in `tag-name.ts
|
|
2
|
+
* Identifier schemas of component contract v1: component name, prop, event, slot, part, CSS
|
|
3
|
+
* variable, collection and field names. Custom element tags live in `tag-name.ts`.
|
|
4
4
|
*
|
|
5
5
|
* Every rule is a plain regular expression, so the generated JSON Schema enforces exactly what Zod
|
|
6
6
|
* enforces (no refinement that only Zod would see). Lookaheads carry the deny lists (prop names
|
|
7
7
|
* that would collide with the host element). The prop name rules themselves live in the Zod-free
|
|
8
|
-
* `prop-names.ts
|
|
8
|
+
* `prop-names.ts`, which the runtime may import.
|
|
9
9
|
*/
|
|
10
10
|
import * as z from "zod";
|
|
11
11
|
/** Kebab-case member name: events, slots, parts, collections, track events, component name. */
|
|
12
12
|
export declare const KEBAB_NAME_PATTERN: RegExp;
|
|
13
13
|
/**
|
|
14
|
-
* `Object.prototype` members a field name must not be
|
|
14
|
+
* `Object.prototype` members a field name must not be: validators and consumers read
|
|
15
15
|
* `value[name]`, which finds the inherited member when the field is absent (Zod's object schema
|
|
16
16
|
* then rejects every value without a `toString` field, and component code may call it).
|
|
17
17
|
*/
|
package/dist/names.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Identifier schemas of component contract v1
|
|
3
|
-
* variable, collection and field names. Custom element tags live in `tag-name.ts
|
|
2
|
+
* Identifier schemas of component contract v1: component name, prop, event, slot, part, CSS
|
|
3
|
+
* variable, collection and field names. Custom element tags live in `tag-name.ts`.
|
|
4
4
|
*
|
|
5
5
|
* Every rule is a plain regular expression, so the generated JSON Schema enforces exactly what Zod
|
|
6
6
|
* enforces (no refinement that only Zod would see). Lookaheads carry the deny lists (prop names
|
|
7
7
|
* that would collide with the host element). The prop name rules themselves live in the Zod-free
|
|
8
|
-
* `prop-names.ts
|
|
8
|
+
* `prop-names.ts`, which the runtime may import.
|
|
9
9
|
*/
|
|
10
10
|
import * as z from "zod";
|
|
11
11
|
import { DOM_MEMBER_SNAPSHOT } from "./dom-members.snapshot.js";
|
|
@@ -28,7 +28,7 @@ const KEBAB_BODY = "[a-z][a-z0-9]*(?:-[a-z0-9]+)*";
|
|
|
28
28
|
/** Kebab-case member name: events, slots, parts, collections, track events, component name. */
|
|
29
29
|
export const KEBAB_NAME_PATTERN = new RegExp(`^${KEBAB_BODY}$`);
|
|
30
30
|
/**
|
|
31
|
-
* `Object.prototype` members a field name must not be
|
|
31
|
+
* `Object.prototype` members a field name must not be: validators and consumers read
|
|
32
32
|
* `value[name]`, which finds the inherited member when the field is absent (Zod's object schema
|
|
33
33
|
* then rejects every value without a `toString` field, and component code may call it).
|
|
34
34
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The overage rate table as DATA
|
|
2
|
+
* The overage rate table as DATA: one row per
|
|
3
3
|
* (metric, paid plan, version) with the instant it starts to apply, in micro US dollars. The rows
|
|
4
4
|
* live in the database (`overage_rates`) and staff edits them; `OVERAGE_RATES` in `plan-pricing.ts`
|
|
5
5
|
* is only the seed of version 1. This module is the pure part every reader shares: the row shape,
|
package/dist/overage-pricing.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The overage rate table as DATA
|
|
2
|
+
* The overage rate table as DATA: one row per
|
|
3
3
|
* (metric, paid plan, version) with the instant it starts to apply, in micro US dollars. The rows
|
|
4
4
|
* live in the database (`overage_rates`) and staff edits them; `OVERAGE_RATES` in `plan-pricing.ts`
|
|
5
5
|
* is only the seed of version 1. This module is the pure part every reader shares: the row shape,
|
package/dist/plan-ids.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The plan ids, apart from every table that has a row per plan
|
|
2
|
+
* The plan ids, apart from every table that has a row per plan: the limit catalog
|
|
3
3
|
* (`limit-catalog.ts`) and `planLimits` both need them, and neither may import the other first.
|
|
4
4
|
* Zod-free.
|
|
5
5
|
*/
|
package/dist/plan-ids.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The plan ids, apart from every table that has a row per plan
|
|
2
|
+
* The plan ids, apart from every table that has a row per plan: the limit catalog
|
|
3
3
|
* (`limit-catalog.ts`) and `planLimits` both need them, and neither may import the other first.
|
|
4
4
|
* Zod-free.
|
|
5
5
|
*/
|
package/dist/plan-limits.d.ts
CHANGED
|
@@ -15,15 +15,15 @@ export interface PlanLimits {
|
|
|
15
15
|
/** What visitors download: the bundle and the CSS together. */
|
|
16
16
|
readonly maxOutputBytes: number;
|
|
17
17
|
/**
|
|
18
|
-
* One asset file a component imports (
|
|
18
|
+
* One asset file a component imports (an image or a WOFF2 font, as stored), at most the
|
|
19
19
|
* contract's `ASSET_LIMITS.assetMaxBytes`; over it the build fails with `ASSET_TOO_LARGE`.
|
|
20
20
|
*/
|
|
21
21
|
readonly maxAssetBytes: number;
|
|
22
|
-
/** All the asset files one component imports together (
|
|
22
|
+
/** All the asset files one component imports together (`ASSET_TOO_LARGE`). */
|
|
23
23
|
readonly maxAssetsBytes: number;
|
|
24
24
|
/**
|
|
25
|
-
* Builds a workspace may queue in a rolling 7-day window (the API's `POST /builds
|
|
26
|
-
* one limit, one window, no hourly or daily sublimit beside it
|
|
25
|
+
* Builds a workspace may queue in a rolling 7-day window (the API's `POST /builds`):
|
|
26
|
+
* one limit, one window, no hourly or daily sublimit beside it.
|
|
27
27
|
*/
|
|
28
28
|
readonly buildsPerWeek: number;
|
|
29
29
|
/** Builds of one workspace running at once; always fewer than the container instances. */
|
|
@@ -73,7 +73,7 @@ export declare function planAbove(limit: PlanLimitName, current: number, plans?:
|
|
|
73
73
|
* Inputs: the current time. Output: seconds. Errors: none. Side effects: none.
|
|
74
74
|
*/
|
|
75
75
|
export declare function secondsUntilNextUtcDay(now: Date): number;
|
|
76
|
-
/** The window of `buildsPerWeek`: a rolling 7 days
|
|
76
|
+
/** The window of `buildsPerWeek`: a rolling 7 days. */
|
|
77
77
|
export declare const BUILD_WINDOW_MS: number;
|
|
78
78
|
/** When a full build window frees a place, and how long a client waits for it. */
|
|
79
79
|
export interface BuildWindowReset {
|
|
@@ -93,31 +93,31 @@ export interface BuildWindowReset {
|
|
|
93
93
|
export declare function buildWindowReset(freeingBuildCreatedAt: Date, now: Date): BuildWindowReset;
|
|
94
94
|
/** What each plan allows a workspace to HOLD (as opposed to `PlanLimits`, what one build may use). */
|
|
95
95
|
export interface PlanQuotas {
|
|
96
|
-
/** Sites (not deleted) at once; `POST /v1/sites` answers 409 `site_quota_exceeded` past it
|
|
96
|
+
/** Sites (not deleted) at once; `POST /v1/sites` answers 409 `site_quota_exceeded` past it. */
|
|
97
97
|
readonly maxSites: number;
|
|
98
|
-
/** Unrevoked API keys at once; `POST /v1/api-keys` answers 409 `api_key_quota_exceeded` past it
|
|
98
|
+
/** Unrevoked API keys at once; `POST /v1/api-keys` answers 409 `api_key_quota_exceeded` past it. */
|
|
99
99
|
readonly activeApiKeys: number;
|
|
100
100
|
/**
|
|
101
|
-
* Unrevoked API keys one admin or member may have created at once
|
|
101
|
+
* Unrevoked API keys one admin or member may have created at once; an owner is bound
|
|
102
102
|
* by `activeApiKeys` only. Past it, `POST /v1/api-keys` answers 409 `api_key_quota_exceeded`.
|
|
103
103
|
*/
|
|
104
104
|
readonly activeApiKeysPerCreator: number;
|
|
105
105
|
/**
|
|
106
|
-
* Places of `activeApiKeys` that only an owner may fill
|
|
106
|
+
* Places of `activeApiKeys` that only an owner may fill, so no admin or member, even
|
|
107
107
|
* several together, can leave the owner without a place to create a key.
|
|
108
108
|
*/
|
|
109
109
|
readonly ownerReservedApiKeys: number;
|
|
110
110
|
/**
|
|
111
|
-
* Components attached to one site at once
|
|
112
|
-
* `site_component_limit`.
|
|
111
|
+
* Components attached to one site at once; an attach past it answers 409
|
|
112
|
+
* `site_component_limit`. Provisional until the plans are final. It only
|
|
113
113
|
* stops a NEW attach: after a downgrade, what is attached stays served (golden rule 2). The
|
|
114
114
|
* highest value is the platform ceiling `SITE_MANIFEST_MAX_COMPONENTS` (site-manifest.ts).
|
|
115
115
|
*/
|
|
116
116
|
readonly componentsPerSite: number;
|
|
117
117
|
/**
|
|
118
|
-
* Network origins one version may declare in `permissions.connect` (
|
|
118
|
+
* Network origins one version may declare in `permissions.connect` (the old trust
|
|
119
119
|
* level's `connectOrigins`); a version past it is refused with 402 `plan_limit_reached` before
|
|
120
|
-
* the INSERT.
|
|
120
|
+
* the INSERT. Provisional until the plans are final.
|
|
121
121
|
*/
|
|
122
122
|
readonly connectOriginsPerVersion: number;
|
|
123
123
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-limits.d.ts","sourceRoot":"","sources":["../src/plan-limits.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,QAAQ,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;AAEjC,4FAA4F;AAC5F,eAAO,MAAM,eAAe,EAAE,MAAe,CAAC;AAE9C,qEAAqE;AACrE,MAAM,WAAW,UAAU;IACzB,qEAAqE;IACrE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,qCAAqC;IACrC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,2CAA2C;IAC3C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,kGAAkG;IAClG,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,+DAA+D;IAC/D,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,
|
|
1
|
+
{"version":3,"file":"plan-limits.d.ts","sourceRoot":"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,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAEnE"}
|
package/dist/plan-limits.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `planLimits
|
|
2
|
+
* `planLimits`: the single table of what each plan allows a workspace to build. Zod-free.
|
|
3
3
|
*
|
|
4
4
|
* The builder reads it for every build (timeout, source size, files, dependencies, output size,
|
|
5
|
-
* asset sizes
|
|
6
|
-
* rolling week, `POST /builds` answers 429 with `Retry-After` past it
|
|
5
|
+
* asset sizes, builds at once) and the API reads it before queueing one (builds per
|
|
6
|
+
* rolling week, `POST /builds` answers 429 with `Retry-After` past it). Billing reuses the same rows for its
|
|
7
7
|
* entitlements, so a limit lives here once. It sits in the contract because both the API and the
|
|
8
8
|
* builder already depend on it, and the customer's agent sees these numbers in the
|
|
9
9
|
* `LIMIT_EXCEEDED` diagnostics.
|
|
10
10
|
*
|
|
11
|
-
* The values are provisional until the
|
|
12
|
-
* there is one plan, `free`, with the limits every build already had
|
|
11
|
+
* The values are provisional until the plans and prices are final: today
|
|
12
|
+
* there is one plan, `free`, with the limits every build already had, so
|
|
13
13
|
* nothing gets stricter. The builder's platform ceilings (`BUILD_LIMIT_BOUNDS`, tuned with the
|
|
14
14
|
* `TAGGOR_BUILD_MAX_*` variables) still cap every plan: a plan only lowers a limit, never raises
|
|
15
15
|
* it past what one container instance holds.
|
|
@@ -20,8 +20,8 @@ import { PLAN_IDS } from "./plan-ids.js";
|
|
|
20
20
|
export { PLAN_IDS };
|
|
21
21
|
/** The plan of a workspace without one (and of every build until workspaces have plans). */
|
|
22
22
|
export const DEFAULT_PLAN_ID = "free";
|
|
23
|
-
// The rows come from the limit catalog (`limit-catalog.ts`), the one place that holds the numbers
|
|
24
|
-
//
|
|
23
|
+
// The rows come from the limit catalog (`limit-catalog.ts`), the one place that holds the numbers.
|
|
24
|
+
// The types check that the catalog's `build` group is exactly `PlanLimits`.
|
|
25
25
|
const table = catalogRows("build");
|
|
26
26
|
/**
|
|
27
27
|
* The limits of every plan, by plan id.
|
|
@@ -76,7 +76,7 @@ export function secondsUntilNextUtcDay(now) {
|
|
|
76
76
|
const nextMidnight = (Math.floor(now.getTime() / DAY_MS) + 1) * DAY_MS;
|
|
77
77
|
return Math.max(1, Math.ceil((nextMidnight - now.getTime()) / 1000));
|
|
78
78
|
}
|
|
79
|
-
/** The window of `buildsPerWeek`: a rolling 7 days
|
|
79
|
+
/** The window of `buildsPerWeek`: a rolling 7 days. */
|
|
80
80
|
export const BUILD_WINDOW_MS = 7 * DAY_MS;
|
|
81
81
|
/**
|
|
82
82
|
* When the rolling 7-day window frees one place (`POST /builds` answers 429 with
|
package/dist/plan-limits.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-limits.js","sourceRoot":"","sources":["../src/plan-limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAe,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,QAAQ,EAAe,CAAC;AAEjC,4FAA4F;AAC5F,MAAM,CAAC,MAAM,eAAe,GAAW,MAAM,CAAC;AAiC9C,
|
|
1
|
+
{"version":3,"file":"plan-limits.js","sourceRoot":"","sources":["../src/plan-limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAe,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,QAAQ,EAAe,CAAC;AAEjC,4FAA4F;AAC5F,MAAM,CAAC,MAAM,eAAe,GAAW,MAAM,CAAC;AAiC9C,mGAAmG;AACnG,4EAA4E;AAC5E,MAAM,KAAK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