@taggor/contract 0.4.0 → 0.6.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/contract-version.d.ts +17 -12
- package/dist/contract-version.d.ts.map +1 -1
- package/dist/contract-version.js +24 -17
- 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 +14 -44
- package/dist/data-api.d.ts.map +1 -1
- package/dist/data-api.js +20 -54
- 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 +63 -89
- package/dist/diagnostic-catalog.d.ts.map +1 -1
- package/dist/diagnostic-catalog.js +63 -87
- 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 +81 -7
- package/dist/error-catalog.d.ts.map +1 -1
- package/dist/error-catalog.js +121 -51
- package/dist/error-catalog.js.map +1 -1
- package/dist/error-titles-pt-br.d.ts +13 -0
- package/dist/error-titles-pt-br.d.ts.map +1 -0
- package/dist/error-titles-pt-br.js +99 -0
- package/dist/error-titles-pt-br.js.map +1 -0
- package/dist/event-params.d.ts +41 -0
- package/dist/event-params.d.ts.map +1 -0
- package/dist/event-params.js +92 -0
- package/dist/event-params.js.map +1 -0
- 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 +11 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -8
- 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 +20 -28
- 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 +19 -40
- package/dist/limit-catalog.d.ts.map +1 -1
- package/dist/limit-catalog.js +34 -55
- package/dist/limit-catalog.js.map +1 -1
- package/dist/limits.d.ts +22 -34
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +23 -35
- package/dist/limits.js.map +1 -1
- package/dist/locale-tag.d.ts +3 -3
- package/dist/locale-tag.js +3 -3
- 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 +44 -24
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +41 -61
- package/dist/manifest.js.map +1 -1
- package/dist/metering.d.ts +33 -21
- package/dist/metering.d.ts.map +1 -1
- package/dist/metering.js +33 -21
- 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 +33 -62
- package/dist/plan-pricing.d.ts.map +1 -1
- package/dist/plan-pricing.js +20 -67
- 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 +7 -14
- package/{schema → dist/schema}/data-api.v1.json +4 -39
- 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 +3 -10
- package/dist/site-manifest.d.ts.map +1 -1
- package/dist/site-manifest.js +12 -15
- 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 +2 -2
- package/dist/ssr-cap.d.ts.map +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.d.ts.map +1 -1
- package/dist/url-value.js +7 -7
- package/dist/url-value.js.map +1 -1
- 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 +25 -25
- package/dist/zod-free.d.ts.map +1 -1
- package/dist/zod-free.js +26 -26
- package/dist/zod-free.js.map +1 -1
- package/package.json +9 -10
- package/dist/consent-text.d.ts +0 -31
- package/dist/consent-text.d.ts.map +0 -1
- package/dist/consent-text.js +0 -41
- package/dist/consent-text.js.map +0 -1
- 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}/library-manifest.v1.json +0 -0
- /package/{schema → dist/schema}/taggor-config.v1.json +0 -0
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":[],"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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":"","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,q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AAK,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAOjE;AAID;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,IAAI,GAAG,MAAM,CAGxD;AAED,uDAAuD;AACvD,eAAO,MAAM,eAAe,QAAa,CAAC;AAE1C,kFAAkF;AAClF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,sFAAsF;IACtF,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,qBAAqB,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,GAAG,gBAAgB,CAIzF;AAED,sGAAsG;AACtG,MAAM,WAAW,UAAU;IACzB,+FAA+F;IAC/F,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,oGAAoG;IACpG,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,wBAAwB,EAAE,MAAM,CAAC;CAC3C;AAID;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAA0B,CAAC;AAEvF;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,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,GAA+B,WAAW,CAAC,OAAO,CAAC,CAAC;AAE/D;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAyC,UAAU,CAAC,KAAK,CAAC,CAAC;AAElF;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAA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,CAAC,MAAM,eAAe,GAAG,CAAC,GAAG,MAAM,CAAC;AAS1C;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,qBAA2B,EAAE,GAAS;IACrE,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,GAAG,eAAe,CAAC,CAAC;IAC7E,MAAM,iBAAiB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAC9F,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC;AACzC,CAAC;AAiCD,MAAM,UAAU,GAA+B,WAAW,CAAC,OAAO,CAAC,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAyC,UAAU,CAAC,UAAU,CAAC,CAAC;AAEvF;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,MAA0B;IACrD,OAAO,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;AACjE,CAAC"}
|
package/dist/plan-pricing.d.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What each plan COSTS, the technical site ceiling and the overage rates and rules. Zod-free, frozen, same style as `plan-usage.ts` and `plan-limits.ts`.
|
|
3
|
+
*
|
|
4
|
+
* Why it lives in the contract: the billing catalog (`apps/api/src/domain/billing/plans.ts`) and the
|
|
5
|
+
* public site both need these numbers, and a number written twice drifts. The billing catalog
|
|
6
|
+
* composes its rows from here; the site reads them through its figures registry, so no plan price
|
|
7
|
+
* is typed by hand in site copy.
|
|
8
|
+
*
|
|
9
|
+
* ALL NUMBERS ARE PROVISIONAL until the plans and prices are final.
|
|
10
|
+
* Money is US dollar cents.
|
|
11
|
+
* Nothing here charges or cuts; it is a table.
|
|
12
|
+
*
|
|
13
|
+
* The overage rate table below (`OVERAGE_RATES`) is the ONE place
|
|
14
|
+
* the price of a unit above the plan is written; the site, the portal, the API and the Stripe
|
|
15
|
+
* prices read it. Rates are provisional until the prices are final.
|
|
16
|
+
*/
|
|
1
17
|
import type { PlanId } from "./plan-limits.js";
|
|
2
18
|
import { type OverageMetric } from "./limit-catalog.js";
|
|
3
19
|
/** An amount in US dollar cents, per month and per year (billed once a year). */
|
|
@@ -5,23 +21,15 @@ export interface PlanMoney {
|
|
|
5
21
|
readonly monthly: number;
|
|
6
22
|
readonly annual: number;
|
|
7
23
|
}
|
|
8
|
-
/** The
|
|
9
|
-
export interface PlanSiteExtension {
|
|
10
|
-
/** Sites in the plan's price (the plan's `maxSites` quota). */
|
|
11
|
-
readonly includedSites: number;
|
|
12
|
-
/** The most sites with add-ons. */
|
|
13
|
-
readonly maxSites: number;
|
|
14
|
-
readonly extraSitePriceUsdCents: PlanMoney;
|
|
15
|
-
/** What each extra site adds to the monthly renders ceiling. */
|
|
16
|
-
readonly rendersPerExtraSite: number;
|
|
17
|
-
/** What each extra site adds to the monthly submissions ceiling. */
|
|
18
|
-
readonly submissionsPerExtraSite: number;
|
|
19
|
-
}
|
|
20
|
-
/** The price of one plan and its site extension (null when the plan has none). */
|
|
24
|
+
/** The price of one plan. */
|
|
21
25
|
export interface PlanPricing {
|
|
22
26
|
readonly priceUsdCents: PlanMoney;
|
|
23
|
-
readonly siteExtension: PlanSiteExtension | null;
|
|
24
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* The most live sites a workspace may hold while the overage bills the sites past its plan (Pro and
|
|
30
|
+
* Agency pay US$ 1 a site a month), so "billed, never refused" still has a technical end.
|
|
31
|
+
*/
|
|
32
|
+
export declare const BILLABLE_SITES_CEILING = 500;
|
|
25
33
|
/** The pricing of every plan, by plan id. Frozen. */
|
|
26
34
|
export declare const planPricing: Readonly<Record<PlanId, PlanPricing>>;
|
|
27
35
|
/** A plan that pays: the only ones that can have an overage. */
|
|
@@ -41,25 +49,24 @@ export interface OverageRate {
|
|
|
41
49
|
readonly microUsdPerUnit: Readonly<Record<PaidPlanId, number>>;
|
|
42
50
|
}
|
|
43
51
|
/**
|
|
44
|
-
* THE SEED of the rate table
|
|
52
|
+
* THE SEED of the rate table: the tariffs live in the database
|
|
45
53
|
* (`overage_rates`, versions with an effective date, edited by staff with a reason) and this table
|
|
46
54
|
* is only what migration 0081 inserted as version 1 and what every reader falls back to when the
|
|
47
55
|
* database cannot be read. A test compares it with the migration; nothing else reads it for a price.
|
|
48
56
|
*
|
|
49
|
-
* The tariffs
|
|
57
|
+
* The tariffs (provisional), in micro USD per unit:
|
|
50
58
|
* renders US$ 0,02 per 1.000; SSR renders US$ 0,015 per 1.000; SSR version-day US$ 0,01 (no
|
|
51
59
|
* included amount in v1); build over the weekly limit US$ 0,01; stored submission US$ 0,25 per
|
|
52
|
-
* 1.000; storage US$ 1,00 per GB-month (1000 per MB,
|
|
53
|
-
* add-on price, billed on the plan subscription, so its overage rate is informational).
|
|
60
|
+
* 1.000; storage US$ 1,00 per GB-month (1000 per MB, on the average of the cycle's daily readings); extra site US$ 1 on Pro and on Agency.
|
|
54
61
|
*/
|
|
55
62
|
export declare const OVERAGE_RATES: Readonly<Record<OverageMetric, OverageRate>>;
|
|
56
63
|
/** The metrics in a fixed order (ledger and Stripe meters follow it). */
|
|
57
64
|
export declare const OVERAGE_METRIC_LIST: readonly OverageMetric[];
|
|
58
65
|
/**
|
|
59
|
-
* The rules around the money of an overage
|
|
66
|
+
* The rules around the money of an overage, numbers only:
|
|
60
67
|
* - `minInvoiceUsdCents`: below it the amount carries to the next month.
|
|
61
68
|
* - `lagHours`: the ledger bills what was counted at least this long ago, never the live count.
|
|
62
|
-
* - NO default spending limit
|
|
69
|
+
* - NO default spending limit: the customer pays what they use. A
|
|
63
70
|
* spending LIMIT is OPTIONAL, set by the customer or by staff, between `spendCapMinUsdCents` and
|
|
64
71
|
* `spendCapMaxUsdCents` (staff: `staffSpendCapMaxUsdCents`). It is a trigger, not a ceiling on the
|
|
65
72
|
* bill: Taggor TRIES to stop the use when the overage reaches it, WITHOUT guarantee, and what was
|
|
@@ -68,8 +75,7 @@ export declare const OVERAGE_METRIC_LIST: readonly OverageMetric[];
|
|
|
68
75
|
* e-mail per milestone per cycle. `spendMilestonePercents` are the named steps of the DEFAULT list
|
|
69
76
|
* (percent of the plan's monthly price: 50%, 100%, 200%, 500%); from there it keeps going, doubling
|
|
70
77
|
* from `spendMilestoneDoublingFrom` (1000%, 2000%, 4000%...) up to `maxSpendMilestones` milestones
|
|
71
|
-
* in all (`defaultSpendMilestonePercents`), so a runaway use keeps warning past 500
|
|
72
|
-
* review M4). The customer may set their own list of up to `maxSpendMilestones` amounts, each at
|
|
78
|
+
* in all (`defaultSpendMilestonePercents`), so a runaway use keeps warning past 500%. The customer may set their own list of up to `maxSpendMilestones` amounts, each at
|
|
73
79
|
* most `spendMilestoneMaxUsdCents`.
|
|
74
80
|
* - `dunningDays`: how long an unpaid overage invoice is chased before new overage is suspended.
|
|
75
81
|
* - `freeCutMultiple`: Free is cut at this multiple of its number (1x, no grace).
|
|
@@ -101,45 +107,10 @@ export declare function defaultSpendMilestonePercents(): readonly number[];
|
|
|
101
107
|
*/
|
|
102
108
|
export declare function overageMicroUsdPerUnit(metric: OverageMetric, planId: PlanId): number | null;
|
|
103
109
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* flag per site, `usage-guard.ts`) no longer holds anything back, it only keeps the Free plan from
|
|
109
|
-
* being cut by forged traffic and warns the customer of an unusual day, and the safety net for a wrong
|
|
110
|
-
* bill is the credit on request (runbook). The switch stays in ONE place: the billing code of the API
|
|
111
|
-
* derives its `OVERAGE_BILLING_FROM_*` constants from it, and the site, the portal and the CLI choose
|
|
112
|
-
* their wording by `isOverageMetricBilled`, so a switch changes the code and every text together. A
|
|
113
|
-
* gate only has an effect while the API's overage mode is not `off`. Changing it is an
|
|
114
|
-
* ADR-level decision, never a drive-by edit.
|
|
115
|
-
*/
|
|
116
|
-
export interface OverageBillingGates {
|
|
117
|
-
/** The renders metric (`loader_hits`). */
|
|
118
|
-
readonly loaderHits: boolean;
|
|
119
|
-
/** The submissions metric and the storage that follows it. */
|
|
120
|
-
readonly submissions: boolean;
|
|
121
|
-
}
|
|
122
|
-
/** The gates as the code ships them: both on (TAG-1629); frozen, the literal types are `true`. */
|
|
123
|
-
export declare const OVERAGE_BILLING_GATES: Readonly<{
|
|
124
|
-
readonly loaderHits: true;
|
|
125
|
-
readonly submissions: true;
|
|
126
|
-
}>;
|
|
127
|
-
/**
|
|
128
|
-
* Whether the excess of a metric is billed automatically (and so spends the customer's cap, raises a
|
|
129
|
-
* cap notice and counts in the cost estimate). Renders when `gates.loaderHits`; submissions and
|
|
130
|
-
* storage when `gates.submissions`; builds, extra sites and SSR always.
|
|
131
|
-
* Inputs: a metric and the gates (default: as shipped). Output: a boolean. Pure.
|
|
132
|
-
*/
|
|
133
|
-
export declare function isOverageMetricBilled(metric: OverageMetric, gates?: OverageBillingGates): boolean;
|
|
134
|
-
/**
|
|
135
|
-
* Whether going past a catalog limit is billed automatically today on a paid plan: the limit is
|
|
136
|
-
* `metered` on Pro (Agency matches) and its metric is billed (`isOverageMetricBilled`). A limit that
|
|
137
|
-
* is `hard` on every plan (a security or per-build cap), an unknown name and a metered limit whose
|
|
138
|
-
* metric's gate is off are all false. The portal and the CLI
|
|
139
|
-
* word a limit row with it.
|
|
140
|
-
* Inputs: a limit name (any string) and the gates (default: as shipped). Output: a boolean. Pure.
|
|
110
|
+
* Whether going past a catalog limit is billed automatically on a paid plan: the limit is
|
|
111
|
+
* `metered` on Pro (Agency matches). A limit that is `hard` on every plan (a security or per-build
|
|
112
|
+
* cap) and an unknown name are false. The portal and the CLI word a limit row with it.
|
|
113
|
+
* Inputs: a limit name (any string). Output: a boolean. Pure.
|
|
141
114
|
*/
|
|
142
|
-
export declare function isLimitOverageBilled(name: string
|
|
143
|
-
/** The metrics billed today, in the fixed metric order: derived from the gates, never typed. */
|
|
144
|
-
export declare const BILLED_OVERAGE_METRICS: readonly OverageMetric[];
|
|
115
|
+
export declare function isLimitOverageBilled(name: string): boolean;
|
|
145
116
|
//# sourceMappingURL=plan-pricing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-pricing.d.ts","sourceRoot":"","sources":["../src/plan-pricing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plan-pricing.d.ts","sourceRoot":"","sources":["../src/plan-pricing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAkC,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExF,iFAAiF;AACjF,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,6BAA6B;AAC7B,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC;CACnC;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAU1C,qDAAqD;AACrD,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAI5D,CAAC;AAEH,gEAAgE;AAChE,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjD;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,IAAI,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;CAChE;AAKD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,CA4BrE,CAAC;AAEH,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,EAAE,SAAS,aAAa,EAAoB,CAAC;AAE7E;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;EAaxB,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,6BAA6B,IAAI,SAAS,MAAM,EAAE,CAUjE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI3F;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1D"}
|
package/dist/plan-pricing.js
CHANGED
|
@@ -1,36 +1,14 @@
|
|
|
1
|
+
import { LIMIT_CATALOG, OVERAGE_METRICS } from "./limit-catalog.js";
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Why it lives in the contract: the billing catalog (`apps/api/src/domain/billing/plans.ts`) and the
|
|
6
|
-
* public site both need these numbers, and a number written twice drifts. The billing catalog
|
|
7
|
-
* composes its rows from here; the site reads them through its figures registry, so no plan price
|
|
8
|
-
* is typed by hand in site copy.
|
|
9
|
-
*
|
|
10
|
-
* ALL NUMBERS ARE PROVISIONAL until the owner approves the plans and prices
|
|
11
|
-
* (DECISOES.md, decisions 67 to 69). Money is US dollar cents (decision 68 item 1).
|
|
12
|
-
* Nothing here charges or cuts; it is a table.
|
|
13
|
-
*
|
|
14
|
-
* TAG-1628 (decision 84, ADR 0067): the overage rate table below (`OVERAGE_RATES`) is the ONE place
|
|
15
|
-
* the price of a unit above the plan is written; the site, the portal, the API and the Stripe
|
|
16
|
-
* prices read it. Rates are PROVISIONAL until the owner answers pendency 76.
|
|
3
|
+
* The most live sites a workspace may hold while the overage bills the sites past its plan (Pro and
|
|
4
|
+
* Agency pay US$ 1 a site a month), so "billed, never refused" still has a technical end.
|
|
17
5
|
*/
|
|
18
|
-
|
|
19
|
-
import { LIMIT_CATALOG, OVERAGE_METRICS } from "./limit-catalog.js";
|
|
6
|
+
export const BILLABLE_SITES_CEILING = 500;
|
|
20
7
|
const money = (monthly, annual) => Object.freeze({ monthly, annual });
|
|
21
8
|
const table = {
|
|
22
|
-
free: { priceUsdCents: money(0, 0)
|
|
23
|
-
pro: { priceUsdCents: money(1400, 14_000)
|
|
24
|
-
agency: {
|
|
25
|
-
priceUsdCents: money(4900, 49_000),
|
|
26
|
-
siteExtension: Object.freeze({
|
|
27
|
-
includedSites: planQuotas.agency.maxSites,
|
|
28
|
-
maxSites: 500,
|
|
29
|
-
extraSitePriceUsdCents: money(200, 2000),
|
|
30
|
-
rendersPerExtraSite: 100_000,
|
|
31
|
-
submissionsPerExtraSite: 4000,
|
|
32
|
-
}),
|
|
33
|
-
},
|
|
9
|
+
free: { priceUsdCents: money(0, 0) },
|
|
10
|
+
pro: { priceUsdCents: money(1400, 14_000) },
|
|
11
|
+
agency: { priceUsdCents: money(4900, 49_000) },
|
|
34
12
|
};
|
|
35
13
|
/** The pricing of every plan, by plan id. Frozen. */
|
|
36
14
|
export const planPricing = Object.freeze({
|
|
@@ -40,16 +18,15 @@ export const planPricing = Object.freeze({
|
|
|
40
18
|
});
|
|
41
19
|
const bothPaid = (value) => Object.freeze({ pro: value, agency: value });
|
|
42
20
|
/**
|
|
43
|
-
* THE SEED of the rate table
|
|
21
|
+
* THE SEED of the rate table: the tariffs live in the database
|
|
44
22
|
* (`overage_rates`, versions with an effective date, edited by staff with a reason) and this table
|
|
45
23
|
* is only what migration 0081 inserted as version 1 and what every reader falls back to when the
|
|
46
24
|
* database cannot be read. A test compares it with the migration; nothing else reads it for a price.
|
|
47
25
|
*
|
|
48
|
-
* The tariffs
|
|
26
|
+
* The tariffs (provisional), in micro USD per unit:
|
|
49
27
|
* renders US$ 0,02 per 1.000; SSR renders US$ 0,015 per 1.000; SSR version-day US$ 0,01 (no
|
|
50
28
|
* included amount in v1); build over the weekly limit US$ 0,01; stored submission US$ 0,25 per
|
|
51
|
-
* 1.000; storage US$ 1,00 per GB-month (1000 per MB,
|
|
52
|
-
* add-on price, billed on the plan subscription, so its overage rate is informational).
|
|
29
|
+
* 1.000; storage US$ 1,00 per GB-month (1000 per MB, on the average of the cycle's daily readings); extra site US$ 1 on Pro and on Agency.
|
|
53
30
|
*/
|
|
54
31
|
export const OVERAGE_RATES = Object.freeze({
|
|
55
32
|
renders: Object.freeze({ metric: "renders", unit: "unit", microUsdPerUnit: bothPaid(20) }),
|
|
@@ -77,16 +54,16 @@ export const OVERAGE_RATES = Object.freeze({
|
|
|
77
54
|
extra_sites: Object.freeze({
|
|
78
55
|
metric: "extra_sites",
|
|
79
56
|
unit: "unit",
|
|
80
|
-
microUsdPerUnit:
|
|
57
|
+
microUsdPerUnit: bothPaid(1_000_000),
|
|
81
58
|
}),
|
|
82
59
|
});
|
|
83
60
|
/** The metrics in a fixed order (ledger and Stripe meters follow it). */
|
|
84
61
|
export const OVERAGE_METRIC_LIST = OVERAGE_METRICS;
|
|
85
62
|
/**
|
|
86
|
-
* The rules around the money of an overage
|
|
63
|
+
* The rules around the money of an overage, numbers only:
|
|
87
64
|
* - `minInvoiceUsdCents`: below it the amount carries to the next month.
|
|
88
65
|
* - `lagHours`: the ledger bills what was counted at least this long ago, never the live count.
|
|
89
|
-
* - NO default spending limit
|
|
66
|
+
* - NO default spending limit: the customer pays what they use. A
|
|
90
67
|
* spending LIMIT is OPTIONAL, set by the customer or by staff, between `spendCapMinUsdCents` and
|
|
91
68
|
* `spendCapMaxUsdCents` (staff: `staffSpendCapMaxUsdCents`). It is a trigger, not a ceiling on the
|
|
92
69
|
* bill: Taggor TRIES to stop the use when the overage reaches it, WITHOUT guarantee, and what was
|
|
@@ -95,8 +72,7 @@ export const OVERAGE_METRIC_LIST = OVERAGE_METRICS;
|
|
|
95
72
|
* e-mail per milestone per cycle. `spendMilestonePercents` are the named steps of the DEFAULT list
|
|
96
73
|
* (percent of the plan's monthly price: 50%, 100%, 200%, 500%); from there it keeps going, doubling
|
|
97
74
|
* from `spendMilestoneDoublingFrom` (1000%, 2000%, 4000%...) up to `maxSpendMilestones` milestones
|
|
98
|
-
* in all (`defaultSpendMilestonePercents`), so a runaway use keeps warning past 500
|
|
99
|
-
* review M4). The customer may set their own list of up to `maxSpendMilestones` amounts, each at
|
|
75
|
+
* in all (`defaultSpendMilestonePercents`), so a runaway use keeps warning past 500%. The customer may set their own list of up to `maxSpendMilestones` amounts, each at
|
|
100
76
|
* most `spendMilestoneMaxUsdCents`.
|
|
101
77
|
* - `dunningDays`: how long an unpaid overage invoice is chased before new overage is suspended.
|
|
102
78
|
* - `freeCutMultiple`: Free is cut at this multiple of its number (1x, no grace).
|
|
@@ -137,36 +113,13 @@ export function overageMicroUsdPerUnit(metric, planId) {
|
|
|
137
113
|
const rates = OVERAGE_RATES[metric].microUsdPerUnit;
|
|
138
114
|
return rates[planId] ?? null;
|
|
139
115
|
}
|
|
140
|
-
/** The gates as the code ships them: both on (TAG-1629); frozen, the literal types are `true`. */
|
|
141
|
-
export const OVERAGE_BILLING_GATES = Object.freeze({
|
|
142
|
-
loaderHits: true,
|
|
143
|
-
submissions: true,
|
|
144
|
-
});
|
|
145
|
-
/**
|
|
146
|
-
* Whether the excess of a metric is billed automatically (and so spends the customer's cap, raises a
|
|
147
|
-
* cap notice and counts in the cost estimate). Renders when `gates.loaderHits`; submissions and
|
|
148
|
-
* storage when `gates.submissions`; builds, extra sites and SSR always.
|
|
149
|
-
* Inputs: a metric and the gates (default: as shipped). Output: a boolean. Pure.
|
|
150
|
-
*/
|
|
151
|
-
export function isOverageMetricBilled(metric, gates = OVERAGE_BILLING_GATES) {
|
|
152
|
-
if (metric === "renders")
|
|
153
|
-
return gates.loaderHits;
|
|
154
|
-
if (metric === "submissions" || metric === "storage")
|
|
155
|
-
return gates.submissions;
|
|
156
|
-
return true;
|
|
157
|
-
}
|
|
158
116
|
/**
|
|
159
|
-
* Whether going past a catalog limit is billed automatically
|
|
160
|
-
* `metered` on Pro (Agency matches)
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
* word a limit row with it.
|
|
164
|
-
* Inputs: a limit name (any string) and the gates (default: as shipped). Output: a boolean. Pure.
|
|
117
|
+
* Whether going past a catalog limit is billed automatically on a paid plan: the limit is
|
|
118
|
+
* `metered` on Pro (Agency matches). A limit that is `hard` on every plan (a security or per-build
|
|
119
|
+
* cap) and an unknown name are false. The portal and the CLI word a limit row with it.
|
|
120
|
+
* Inputs: a limit name (any string). Output: a boolean. Pure.
|
|
165
121
|
*/
|
|
166
|
-
export function isLimitOverageBilled(name
|
|
167
|
-
|
|
168
|
-
return policy?.mode === "metered" && isOverageMetricBilled(policy.metric, gates);
|
|
122
|
+
export function isLimitOverageBilled(name) {
|
|
123
|
+
return LIMIT_CATALOG.find((spec) => spec.name === name)?.policy.pro.mode === "metered";
|
|
169
124
|
}
|
|
170
|
-
/** The metrics billed today, in the fixed metric order: derived from the gates, never typed. */
|
|
171
|
-
export const BILLED_OVERAGE_METRICS = Object.freeze(OVERAGE_METRICS.filter((metric) => isOverageMetricBilled(metric)));
|
|
172
125
|
//# sourceMappingURL=plan-pricing.js.map
|
package/dist/plan-pricing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-pricing.js","sourceRoot":"","sources":["../src/plan-pricing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plan-pricing.js","sourceRoot":"","sources":["../src/plan-pricing.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAsB,MAAM,oBAAoB,CAAC;AA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