@volter/twin-polar 2.0.37 → 3.0.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/README.md +24 -27
- package/dist/generated/pack-facts.json +69 -0
- package/dist/journeys/coverage.json +223 -0
- package/dist/journeys/customer-life.json +1222 -0
- package/dist/journeys/customer-life.outline.md +69 -0
- package/dist/journeys/customer-life.outline.verdict.json +41 -0
- package/dist/journeys/customer-life.verdict.json +71 -0
- package/dist/journeys/decisions.json +149 -0
- package/dist/journeys/demand.json +45 -0
- package/dist/journeys/score.json +249 -0
- package/dist/journeys/unreachable.json +13 -0
- package/dist/journeys/vendor-examples.json +9621 -0
- package/dist/journeys/vendor-examples.verdict.json +33 -0
- package/dist/spec/SOURCE.md +25 -0
- package/dist/spec/doc-examples.json +681 -0
- package/dist/spec/openapi.json.gz +0 -0
- package/dist/spec/sources.json +71 -0
- package/dist/src/cli.js +7 -16
- package/dist/src/fetch.d.ts +2 -0
- package/dist/src/fetch.js +24 -0
- package/dist/src/generated/surface.gen.json +1 -0
- package/dist/src/generated/ui.gen.json +1 -0
- package/dist/src/index.d.ts +5 -9
- package/dist/src/index.js +10 -55
- package/dist/src/manifest.d.ts +2 -0
- package/dist/src/manifest.js +123 -0
- package/dist/src/screens/checkout.d.ts +2 -0
- package/dist/src/screens/checkout.js +25 -0
- package/dist/src/screens/portal.d.ts +2 -0
- package/dist/src/screens/portal.js +18 -0
- package/dist/src/semantics/around.d.ts +2 -0
- package/dist/src/semantics/around.js +25 -0
- package/dist/src/semantics/checkouts.d.ts +14 -0
- package/dist/src/semantics/checkouts.js +131 -0
- package/dist/src/semantics/clock.d.ts +2 -0
- package/dist/src/semantics/clock.js +22 -0
- package/dist/src/semantics/customer-sessions.d.ts +2 -0
- package/dist/src/semantics/customer-sessions.js +12 -0
- package/dist/src/semantics/customers.d.ts +9 -0
- package/dist/src/semantics/customers.js +61 -0
- package/dist/src/semantics/doors.d.ts +11 -0
- package/dist/src/semantics/doors.js +47 -0
- package/dist/src/semantics/events.d.ts +12 -0
- package/dist/src/semantics/events.js +60 -0
- package/dist/src/semantics/index.d.ts +2 -0
- package/dist/src/semantics/index.js +27 -0
- package/dist/src/semantics/orders.d.ts +4 -0
- package/dist/src/semantics/orders.js +11 -0
- package/dist/src/semantics/products.d.ts +5 -0
- package/dist/src/semantics/products.js +43 -0
- package/dist/src/semantics/shared.d.ts +82 -0
- package/dist/src/semantics/shared.js +327 -0
- package/dist/src/semantics/states.d.ts +27 -0
- package/dist/src/semantics/states.js +43 -0
- package/dist/src/semantics/subscriptions.d.ts +4 -0
- package/dist/src/semantics/subscriptions.js +15 -0
- package/dist/src/semantics/tenant.d.ts +2 -0
- package/dist/src/semantics/tenant.js +2 -0
- package/dist/src/semantics/webhooks.d.ts +4 -0
- package/dist/src/semantics/webhooks.js +30 -0
- package/dist/src/server.d.ts +7 -0
- package/dist/src/server.js +7 -0
- package/generated/pack-facts.json +69 -0
- package/journeys/coverage.json +223 -0
- package/journeys/customer-life.json +1222 -0
- package/journeys/customer-life.outline.md +69 -0
- package/journeys/customer-life.outline.verdict.json +41 -0
- package/journeys/customer-life.verdict.json +71 -0
- package/journeys/decisions.json +149 -0
- package/journeys/demand.json +45 -0
- package/journeys/score.json +249 -0
- package/journeys/unreachable.json +13 -0
- package/journeys/vendor-examples.json +9621 -0
- package/journeys/vendor-examples.verdict.json +33 -0
- package/package.json +19 -31
- package/spec/SOURCE.md +25 -0
- package/spec/doc-examples.json +681 -0
- package/spec/openapi.json.gz +0 -0
- package/spec/sources.json +71 -0
- package/src/cli.ts +7 -14
- package/src/fetch.ts +25 -0
- package/src/generated/surface.gen.json +1 -0
- package/src/generated/ui.gen.json +1 -0
- package/src/index.ts +11 -85
- package/src/manifest.ts +135 -0
- package/src/screens/checkout.ts +33 -0
- package/src/screens/portal.ts +20 -0
- package/src/semantics/around.ts +25 -0
- package/src/semantics/checkouts.ts +133 -0
- package/src/semantics/clock.ts +24 -0
- package/src/semantics/customer-sessions.ts +13 -0
- package/src/semantics/customers.ts +68 -0
- package/src/semantics/doors.ts +51 -0
- package/src/semantics/events.ts +62 -0
- package/src/semantics/index.ts +31 -0
- package/src/semantics/orders.ts +15 -0
- package/src/semantics/products.ts +45 -0
- package/src/semantics/shared.ts +352 -0
- package/src/semantics/states.ts +50 -0
- package/src/semantics/subscriptions.ts +18 -0
- package/src/semantics/tenant.ts +5 -0
- package/src/semantics/webhooks.ts +29 -0
- package/src/server.ts +8 -0
- package/dist/src/polar-budget.d.ts +0 -83
- package/dist/src/polar-budget.js +0 -413
- package/dist/src/polar-capabilities.d.ts +0 -4
- package/dist/src/polar-capabilities.js +0 -389
- package/dist/src/polar-conformance.d.ts +0 -7
- package/dist/src/polar-conformance.js +0 -25
- package/dist/src/polar-connector.d.ts +0 -113
- package/dist/src/polar-connector.js +0 -146
- package/dist/src/polar-server.d.ts +0 -14
- package/dist/src/polar-server.js +0 -52
- package/dist/src/polar-twin.d.ts +0 -24
- package/dist/src/polar-twin.js +0 -941
- package/src/polar-budget.ts +0 -459
- package/src/polar-capabilities.ts +0 -448
- package/src/polar-conformance.ts +0 -33
- package/src/polar-connector.ts +0 -172
- package/src/polar-server.ts +0 -57
- package/src/polar-twin.ts +0 -938
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sha256": "0e592340767893352c2e894c4624913d76081aef48ebffe8cedcae8d816e9532",
|
|
3
|
+
"plausible": true,
|
|
4
|
+
"bar": "829132787d94a2d4",
|
|
5
|
+
"judge": {
|
|
6
|
+
"agent": "Contributor 16",
|
|
7
|
+
"model": "GPT-6 (Codex)",
|
|
8
|
+
"review": "Independent read-only review, 2026-10-01; did not author these files"
|
|
9
|
+
},
|
|
10
|
+
"authors": [
|
|
11
|
+
"Contributor 39"
|
|
12
|
+
],
|
|
13
|
+
"rounds": 1,
|
|
14
|
+
"ruledSteps": [
|
|
15
|
+
"fields",
|
|
16
|
+
"0",
|
|
17
|
+
"4",
|
|
18
|
+
"11"
|
|
19
|
+
],
|
|
20
|
+
"rulings": "REJECTED. Exhaustive one-round review of original steps 0 through 11 against published requests, preconditions, effect checks, decided values, environments and the current bar.\nE1. Steps 0,4: create a distinct sandbox organization/token and the sandbox product as setup for the sandbox list; 4 must send that sandbox credential and assert its own sandbox state. The current step reuses the production token and product. Polar's API introduction and Sandbox Environment explicitly isolate data, users, tokens and organizations and state a production access token cannot be used in sandbox. Fix this twin isolation defect rather than using exampleDiffers/notReplayed to excuse it. Add the independent sandbox setup immediately after original 0, and retain production setup for the production examples.\nE2. Fields and step 11 (append after it): the inventory omits published operation requests already present in vendored spec paths[*][*].x-codeSamples, two equivalent SDK spellings per served operation. Transcribe and replay each distinct wire request (or explicitly cross-reference identical wire spellings): subscriptions:list, webhooks:list_webhook_endpoints, webhooks:create_webhook_endpoint, products:list, products:create, orders:list, checkouts:list, checkouts:create, checkouts:get, checkouts:client_get, checkouts:client_confirm, customers:list, customers:create, customers:get, customers:get_state_external, customer-sessions:create, events:list, events:ingest, meters:list, meters:create. The snippets include meters sorting=name; zero fixed-price daily product; checkout allow_discount_codes/require_billing_address/allow_trial/is_business_customer defaults; customer external_id=usr_1337,type=individual,email=customer@example.com; session return_url=https://example.com/account; event customer_id; webhook checkout.created. Keep published literals and flags unchanged; map only documented placeholder ids/secrets to captured setup values. For SDK confirm with empty body, use a free product precondition so no required Stripe confirmation token is being silently invented or omitted. Each new setup must only establish an example's precondition or verify its effect, with every value it decides asserted. Add setup/pay steps needed by order/subscription examples and effect read-backs for writes; no contrived refusals.\nE3. Fields and step 11 (same appended block): include additional requests on the already cited pages: API introduction's SDK customers.getStateExternal example and paged product request page=1&limit=100; checkout/session's customer-IP forwarding request (preserve customer_ip_address alongside products) and Python SDK checkout request (the older product_id/allow_discount_codes spelling contradicts the vendored create schema, so preserve it and document that vendor contradiction with exampleDiffers.status rather than altering it); event-ingestion's concrete ai_usage event with its model, request and token metadata, wrapped in the batch ingestion request. A rendered pagination illustration with ellipses is an abridged illustration, not literal JSON; record its condition (250 products,limit100 => max_page3) and implement it as a setup-backed pagination example if counting it, without pinning a guessed response.\nAll existing production SDK checkout, ad-hoc pricing, portal and ingestion request bodies and their present assertions were checked; no further defect found in their intended wire requests. Missing examples are not excused by the current tool enumerating only six doc-examples: Published examples requires all requests the vendor publishes for served operations. Sources: polar/spec/openapi.json.gz x-codeSamples at each named operation; https://polar.sh/docs/api-reference/introduction; https://polar.sh/docs/integrate/sandbox; https://polar.sh/docs/features/checkout/session; https://polar.sh/docs/features/usage-based-billing/event-ingestion; https://polar.sh/docs/features/customer-portal/navigate-customers.",
|
|
21
|
+
"doubts": [],
|
|
22
|
+
"applied": {
|
|
23
|
+
"from": "41277cb22a3fd5d943918952d5eaacb190bfc742b493814b7489ec22544510e8",
|
|
24
|
+
"wasPlausible": false,
|
|
25
|
+
"steps": [
|
|
26
|
+
"fields",
|
|
27
|
+
"0",
|
|
28
|
+
"4",
|
|
29
|
+
"11"
|
|
30
|
+
],
|
|
31
|
+
"rulings": "REJECTED. Exhaustive one-round review of original steps 0 through 11 against published requests, preconditions, effect checks, decided values, environments and the current bar.\nE1. Steps 0,4: create a distinct sandbox organization/token and the sandbox product as setup for the sandbox list; 4 must send that sandbox credential and assert its own sandbox state. The current step reuses the production token and product. Polar's API introduction and Sandbox Environment explicitly isolate data, users, tokens and organizations and state a production access token cannot be used in sandbox. Fix this twin isolation defect rather than using exampleDiffers/notReplayed to excuse it. Add the independent sandbox setup immediately after original 0, and retain production setup for the production examples.\nE2. Fields and step 11 (append after it): the inventory omits published operation requests already present in vendored spec paths[*][*].x-codeSamples, two equivalent SDK spellings per served operation. Transcribe and replay each distinct wire request (or explicitly cross-reference identical wire spellings): subscriptions:list, webhooks:list_webhook_endpoints, webhooks:create_webhook_endpoint, products:list, products:create, orders:list, checkouts:list, checkouts:create, checkouts:get, checkouts:client_get, checkouts:client_confirm, customers:list, customers:create, customers:get, customers:get_state_external, customer-sessions:create, events:list, events:ingest, meters:list, meters:create. The snippets include meters sorting=name; zero fixed-price daily product; checkout allow_discount_codes/require_billing_address/allow_trial/is_business_customer defaults; customer external_id=usr_1337,type=individual,email=customer@example.com; session return_url=https://example.com/account; event customer_id; webhook checkout.created. Keep published literals and flags unchanged; map only documented placeholder ids/secrets to captured setup values. For SDK confirm with empty body, use a free product precondition so no required Stripe confirmation token is being silently invented or omitted. Each new setup must only establish an example's precondition or verify its effect, with every value it decides asserted. Add setup/pay steps needed by order/subscription examples and effect read-backs for writes; no contrived refusals.\nE3. Fields and step 11 (same appended block): include additional requests on the already cited pages: API introduction's SDK customers.getStateExternal example and paged product request page=1&limit=100; checkout/session's customer-IP forwarding request (preserve customer_ip_address alongside products) and Python SDK checkout request (the older product_id/allow_discount_codes spelling contradicts the vendored create schema, so preserve it and document that vendor contradiction with exampleDiffers.status rather than altering it); event-ingestion's concrete ai_usage event with its model, request and token metadata, wrapped in the batch ingestion request. A rendered pagination illustration with ellipses is an abridged illustration, not literal JSON; record its condition (250 products,limit100 => max_page3) and implement it as a setup-backed pagination example if counting it, without pinning a guessed response.\nAll existing production SDK checkout, ad-hoc pricing, portal and ingestion request bodies and their present assertions were checked; no further defect found in their intended wire requests. Missing examples are not excused by the current tool enumerating only six doc-examples: Published examples requires all requests the vendor publishes for served operations. Sources: polar/spec/openapi.json.gz x-codeSamples at each named operation; https://polar.sh/docs/api-reference/introduction; https://polar.sh/docs/integrate/sandbox; https://polar.sh/docs/features/checkout/session; https://polar.sh/docs/features/usage-based-billing/event-ingestion; https://polar.sh/docs/features/customer-portal/navigate-customers."
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Polar API spec — provenance
|
|
2
|
+
|
|
3
|
+
- **File:** `openapi.json.gz`, Polar's own OpenAPI document, the vendor's bytes unchanged and gzipped (`gzip -9 -n`):
|
|
4
|
+
OpenAPI 3.1.0, `info.title` "Polar API", `info.version` `2026-04`, 2,691,391 bytes, 186 operations across 127 paths,
|
|
5
|
+
served at `https://api.polar.sh` (production) and `https://sandbox-api.polar.sh` (sandbox).
|
|
6
|
+
- **Upstream:** https://polar.sh/docs/openapi.json, fetched 2026-09-29 (the document Polar's API reference is built
|
|
7
|
+
from; the same URL the retired census fixture was cut from on 2026-09-02).
|
|
8
|
+
- **SHA-256 of the vendor's bytes** (uncompressed): `b5fafab90f8de4ef5cd839217229b934b6ff8862614055e6010dc03d5f8d15d7`.
|
|
9
|
+
- **Corrections:** none yet (no `patches.json`).
|
|
10
|
+
- **Read by:** `bun scripts/derive-pack.ts polar`, which writes `../src/generated/`.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
Published reference pages read for semantics and examples (2026-10-01):
|
|
14
|
+
- https://polar.sh/docs/api-reference/introduction (production/sandbox product lists, paging and allowances).
|
|
15
|
+
- https://polar.sh/docs/features/checkout/session (SDK checkout and ad-hoc prices).
|
|
16
|
+
- https://polar.sh/docs/features/customer-portal and its navigate-customers page (pre-authenticated portal).
|
|
17
|
+
- https://polar.sh/docs/features/subscriptions/introduction and trials (calendar renewals and deferred trial charge).
|
|
18
|
+
- https://polar.sh/docs/features/usage-based-billing/event-ingestion and meters (immutable events, filters and aggregation).
|
|
19
|
+
- https://polar.sh/docs/integrate/customer-state (the current customer state).
|
|
20
|
+
`doc-examples.json` transcribes published requests; the API reference pages embed this same OpenAPI document and publish no operation response samples. `sources.json` records checked rule citations. The ingestion SDK example's `<value>` name and `<id>` external customer are placeholders; its metadata key/value stays literal.
|
|
21
|
+
|
|
22
|
+
Reviewed primary implementation for checkout TTL and event ingestion, 2026-10-01:
|
|
23
|
+
- https://github.com/polarsource/polar/blob/main/server/polar/config.py and models/checkout.py (24-hour expiry).
|
|
24
|
+
- https://github.com/polarsource/polar/blob/main/server/polar/event/service.py (batch ingestion does not create unresolved customers).
|
|
25
|
+
The spec's x-codeSamples have two equivalent SDK spellings per served operation; doc-examples records each distinct wire request and cross-references both spellings.
|