@volter/twin-polar 2.0.36 → 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
|
Binary file
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"https://polar.sh/docs/api-reference/introduction": {
|
|
3
|
+
"status": 200,
|
|
4
|
+
"checked": "2026-10-01",
|
|
5
|
+
"quotes": {
|
|
6
|
+
"Create separate tokens in each environment.": true,
|
|
7
|
+
"500 requests per minute": true,
|
|
8
|
+
"100 requests per minute": true
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"https://polar.sh/docs/features/checkout/session": {
|
|
12
|
+
"status": 200,
|
|
13
|
+
"checked": "2026-10-03",
|
|
14
|
+
"quotes": {
|
|
15
|
+
"Ad-hoc prices are temporary prices that exist only for that specific checkout session": true
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"https://polar.sh/docs/features/customer-portal": {
|
|
19
|
+
"status": 200,
|
|
20
|
+
"checked": "2026-10-03",
|
|
21
|
+
"quotes": {
|
|
22
|
+
"active subscriptions": true
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"https://polar.sh/docs/features/customer-portal/navigate-customers": {
|
|
26
|
+
"status": 200,
|
|
27
|
+
"checked": "2026-10-03",
|
|
28
|
+
"quotes": {
|
|
29
|
+
"no email code required": true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"https://polar.sh/docs/features/subscriptions/introduction": {
|
|
33
|
+
"status": 200,
|
|
34
|
+
"checked": "2026-10-01",
|
|
35
|
+
"quotes": {
|
|
36
|
+
"At the end of each billing period, Polar advances the subscription to the next cycle and creates a new order": true,
|
|
37
|
+
"creates a new order": true,
|
|
38
|
+
"Daily, weekly, monthly or yearly.": true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"https://polar.sh/docs/features/subscriptions/trials": {
|
|
42
|
+
"status": 200,
|
|
43
|
+
"checked": "2026-10-01",
|
|
44
|
+
"quotes": {
|
|
45
|
+
"they will not be charged immediately": true,
|
|
46
|
+
"Once the trial period ends, the customer will be automatically charged for the subscription, and their billing cycle will begin.": true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"https://polar.sh/docs/features/usage-based-billing/event-ingestion": {
|
|
50
|
+
"status": 200,
|
|
51
|
+
"checked": "2026-10-01",
|
|
52
|
+
"quotes": {
|
|
53
|
+
"Polar never issues retroactive invoices or credits for late events.": true
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"https://polar.sh/docs/features/usage-based-billing/meters": {
|
|
57
|
+
"status": 200,
|
|
58
|
+
"checked": "2026-10-01",
|
|
59
|
+
"quotes": {
|
|
60
|
+
"Counts the number of unique values of a property.": true,
|
|
61
|
+
"Operators are the operators that you want to use to filter the events.": true
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"https://raw.githubusercontent.com/polarsource/polar/main/server/polar/config.py": {
|
|
65
|
+
"status": 200,
|
|
66
|
+
"checked": "2026-10-01",
|
|
67
|
+
"quotes": {
|
|
68
|
+
"CHECKOUT_TTL_SECONDS: int = 60 * 60 * 24": true
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
package/src/cli.ts
CHANGED
|
@@ -1,25 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// world-polar CLI: serve the KERNEL-BACKED Polar API twin, or run conformance. State lives in
|
|
4
|
-
// the @volter/world-core action log (no in-memory side-store). Conformance is dev-only + lazy-imported
|
|
5
|
-
// so the bin runs without @volter/world-tooling (E2).
|
|
2
|
+
// world-polar: serve the polar twin.
|
|
6
3
|
import { hasFlag, optionValue } from '@volter/world-core/args';
|
|
7
|
-
import {
|
|
4
|
+
import { keepProcessAlive } from '@volter/world-core/lifecycle';
|
|
5
|
+
import { createPolarTwinServer } from './server.ts';
|
|
8
6
|
|
|
9
7
|
const [cmd, ...rest] = process.argv.slice(2);
|
|
10
|
-
const port = Number(optionValue(rest, '--port',
|
|
8
|
+
const port = Number(optionValue(rest, '--port', '0')) || undefined;
|
|
11
9
|
const root = optionValue(rest, '--root') || undefined;
|
|
12
|
-
const readOnly = hasFlag(rest, '--read-only');
|
|
10
|
+
const readOnly = hasFlag(rest, '--read-only');
|
|
13
11
|
|
|
14
12
|
if (cmd === 'serve' || cmd === undefined) {
|
|
15
13
|
const s = await createPolarTwinServer({ readOnly, ...(root ? { root } : {}), ...(port ? { port } : {}) });
|
|
16
|
-
process.stdout.write(`polar twin
|
|
14
|
+
process.stdout.write(`polar twin${readOnly ? ' [read-only]' : ''} at http://127.0.0.1:${s.port}\n`);
|
|
17
15
|
await keepProcessAlive();
|
|
18
|
-
} else if (cmd === 'conformance') {
|
|
19
|
-
const { checkPolarConformance } = await import('./polar-conformance.ts');
|
|
20
|
-
const report = checkPolarConformance();
|
|
21
|
-
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
22
|
-
if (!report.ok) process.exitCode = 1;
|
|
23
16
|
} else {
|
|
24
|
-
process.stdout.write('Usage: world-polar serve
|
|
17
|
+
process.stdout.write('Usage: world-polar serve [--port N] [--root DIR] [--read-only]\n');
|
|
25
18
|
}
|
package/src/fetch.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// GENERATED by scripts/create-pack.ts (--init, --index): a fixed file. The kernel serves the discovery door, the clock,
|
|
2
|
+
// the World's doors, the vendor's screens and the API from the pack's parts (architecture, "The pack contract").
|
|
3
|
+
import { createPackFetch, type DerivedFetch, type DerivedSurface, type PackFetchOptions } from '@volter/world-core';
|
|
4
|
+
import surface from './generated/surface.gen.json' with { type: 'json' };
|
|
5
|
+
import { manifest } from './manifest.ts';
|
|
6
|
+
import { around } from './semantics/around.ts';
|
|
7
|
+
import { clock } from './semantics/clock.ts';
|
|
8
|
+
import { tenant } from './semantics/tenant.ts';
|
|
9
|
+
import * as doors from './semantics/doors.ts';
|
|
10
|
+
import { polarSemantics } from './semantics/index.ts';
|
|
11
|
+
import { screen as screen_checkout } from './screens/checkout.ts';
|
|
12
|
+
import { screen as screen_portal } from './screens/portal.ts';
|
|
13
|
+
|
|
14
|
+
export function createPolarFetch(options: PackFetchOptions = {}): DerivedFetch {
|
|
15
|
+
return createPackFetch({
|
|
16
|
+
manifest,
|
|
17
|
+
surface: surface as DerivedSurface,
|
|
18
|
+
handlers: polarSemantics,
|
|
19
|
+
doors,
|
|
20
|
+
around,
|
|
21
|
+
clock,
|
|
22
|
+
tenant,
|
|
23
|
+
screens: { "checkout": screen_checkout, "portal": screen_portal },
|
|
24
|
+
}, options);
|
|
25
|
+
}
|