@volter/twin-stripe 3.0.1 → 3.0.2

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 CHANGED
@@ -3,7 +3,31 @@
3
3
  A local Stripe: the REST API the unmodified `stripe` SDK calls (`https://api.stripe.com/v1`), the hosted pages an
4
4
  application sends a person through, and Stripe.js, over one state.
5
5
 
6
- A Protocol 3 pack (twin-world's docs/contributing/architecture.md, "Protocol 3: the derived pack"). Its surface is
6
+ ## Use with an existing app
7
+
8
+ In an app that already uses this vendor, install this exact release and the product CLI:
9
+
10
+ ```console
11
+ npm install --save-dev --save-exact @volter/world@3.0.68 @volter/twin-stripe@3.0.2
12
+ npx volter world init --name my-app --twins stripe --source stripe=@volter/twin-stripe
13
+ ```
14
+
15
+ Review the detected vendor and generated bindings before booting. Read the credential names and limitations below; the World supplies throwaway credentials. Then run your app's own command through the World:
16
+
17
+ ```console
18
+ npx volter world up
19
+ npx volter world run -- npm test
20
+ npx volter world log
21
+ npx volter world down
22
+ ```
23
+
24
+ Here `npm test` is your app's existing command; replace it with your app or test command. `down` retains state.
25
+ A later `up` resumes it; do not reset or initialize again merely to return.
26
+
27
+ Publisher and catalog contribution instructions: [the public publisher guide](https://github.com/volter-ai/twin-catalog-open/blob/main/docs/contributing.md).
28
+
29
+
30
+ A Protocol 3 pack ([publisher guide](https://github.com/volter-ai/twin-catalog-open/blob/main/docs/contributing.md)). Its surface is
7
31
  generated from Stripe's published OpenAPI document (`spec/`). The derived core serves plain reads, writes and deletes.
8
32
  Handlers are in `src/semantics/<family>.ts`, the state machines in `src/semantics/states.ts`, and Stripe's own
9
33
  computation (money and declines, billing, the ledger, the API versions) in `src/engine/`.
@@ -67,6 +67,10 @@ async function publicDetails(ctx) {
67
67
  /** Dashboard settings, Radar list creation and test Issuing funding; other pages answer Stripe's 404. */
68
68
  export async function screen(ctx) {
69
69
  const path = new URL(ctx.call.request.url).pathname.replace(/\/+$/, '');
70
+ // The twin's declared workspace entry opens its implemented Public details page; this authored choice does not
71
+ // reproduce Stripe's Dashboard home. The request's public base retains the World mount when the console frames it.
72
+ if (path === '' && ['GET', 'HEAD'].includes(ctx.call.request.method))
73
+ return redirect(`${ctx.publicBase}${PUBLIC_DETAILS_PATH}`);
70
74
  // source: https://docs.stripe.com/radar/lists "Use the Dashboard or the API to create lists."
71
75
  // source: https://docs.stripe.com/radar/lists "Enter a name for the list"
72
76
  // source: https://docs.stripe.com/radar/lists "Select the type of list to create."
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@volter/twin-stripe",
3
- "version": "3.0.1",
4
- "description": "Local Stripe twin — a faithful, stateful local Stripe API your real `stripe` SDK talks to unmodified, its hosted pages and Stripe.js. Built on @volter/world-core.",
3
+ "version": "3.0.2",
4
+ "description": "Local Stripe customer, checkout and billing workflows with synthetic state and the real Stripe SDK. Supported operations and hosted-page limits are documented in the README.",
5
5
  "keywords": [
6
6
  "twin",
7
7
  "local",
@@ -34,27 +34,24 @@
34
34
  ],
35
35
  "repository": {
36
36
  "type": "git",
37
- "url": "git+https://github.com/volter-ai/twin-packs-p3.git",
37
+ "url": "git+https://github.com/volter-ai/twin-packs-open.git",
38
38
  "directory": "stripe"
39
39
  },
40
- "homepage": "https://github.com/volter-ai/twin-packs-p3/tree/main/stripe#readme",
40
+ "homepage": "https://github.com/volter-ai/twin-packs-open/tree/main/stripe#readme",
41
41
  "type": "module",
42
42
  "exports": {
43
- ".": {
44
- "types": "./dist/src/index.d.ts",
45
- "default": "./dist/src/index.js"
46
- }
43
+ ".": "./dist/src/index.js"
47
44
  },
48
45
  "bin": {
49
46
  "world-stripe": "dist/src/cli.js"
50
47
  },
51
48
  "dependencies": {
52
- "@volter/world-ui": "^1.0.38",
49
+ "@volter/world-ui": "^1.0.65",
53
50
  "react": "^19.2.7",
54
51
  "react-dom": "^19.2.7"
55
52
  },
56
53
  "peerDependencies": {
57
- "@volter/world-core": "^3.0.38"
54
+ "@volter/world-core": "^3.0.68"
58
55
  },
59
56
  "devDependencies": {
60
57
  "@types/bun": "^1.2.20",
@@ -66,5 +63,8 @@
66
63
  },
67
64
  "engines": {
68
65
  "node": ">=22.3"
66
+ },
67
+ "bugs": {
68
+ "url": "https://github.com/volter-ai/twin-packs-open/issues"
69
69
  }
70
70
  }
@@ -130,6 +130,9 @@ async function publicDetails(ctx: HandlerContext): Promise<Response> {
130
130
  /** Dashboard settings, Radar list creation and test Issuing funding; other pages answer Stripe's 404. */
131
131
  export async function screen(ctx: HandlerContext): Promise<Response> {
132
132
  const path = new URL(ctx.call.request.url).pathname.replace(/\/+$/, '');
133
+ // The twin's declared workspace entry opens its implemented Public details page; this authored choice does not
134
+ // reproduce Stripe's Dashboard home. The request's public base retains the World mount when the console frames it.
135
+ if (path === '' && ['GET', 'HEAD'].includes(ctx.call.request.method)) return redirect(`${ctx.publicBase}${PUBLIC_DETAILS_PATH}`);
133
136
  // source: https://docs.stripe.com/radar/lists "Use the Dashboard or the API to create lists."
134
137
  // source: https://docs.stripe.com/radar/lists "Enter a name for the list"
135
138
  // source: https://docs.stripe.com/radar/lists "Select the type of list to create."
@@ -175,4 +178,3 @@ export async function screen(ctx: HandlerContext): Promise<Response> {
175
178
  }
176
179
  return path === PUBLIC_DETAILS_PATH ? publicDetails(ctx) : notFound();
177
180
  }
178
-
@@ -1,94 +0,0 @@
1
- {
2
- "//": "GENERATED by scripts/pack-facts.ts — current pack descriptors and explicit world-runtime server backings; no prior-artifact entries are retained.",
3
- "packs": {
4
- "stripe": {
5
- "adoption": {
6
- "pypi": [
7
- "stripe"
8
- ],
9
- "sdks": [
10
- "stripe"
11
- ],
12
- "envStems": [
13
- "STRIPE",
14
- "NEXTPRIVATESTRIPE"
15
- ]
16
- },
17
- "hosts": [
18
- {
19
- "host": "api.stripe.com"
20
- },
21
- {
22
- "host": "checkout.stripe.com",
23
- "pathPattern": "^/c/pay/"
24
- },
25
- {
26
- "host": "billing.stripe.com",
27
- "pathPattern": "^/p/session/"
28
- },
29
- {
30
- "host": "connect.stripe.com",
31
- "pathPattern": "^/setup/"
32
- },
33
- {
34
- "host": "dashboard.stripe.com",
35
- "pathPattern": "^/radar/lists(?:/[^/]+)?/?$|^/test/issuing/balance/?$|^/settings/public/?$"
36
- },
37
- {
38
- "host": "verify.stripe.com",
39
- "pathPattern": "^/start/"
40
- },
41
- {
42
- "host": "js.stripe.com",
43
- "pathPattern": "^/v3/?$|^/(v3|[a-z]+)/stripe\\.js$"
44
- }
45
- ],
46
- "archetype": "crud",
47
- "protocol": {
48
- "declared": "3",
49
- "major": 3,
50
- "standing": "current"
51
- },
52
- "transport": "rest",
53
- "resources": [
54
- "charge",
55
- "customer",
56
- "payment_intent",
57
- "setup_intent",
58
- "payment_method",
59
- "subscription",
60
- "price",
61
- "product",
62
- "invoice",
63
- "invoiceitem",
64
- "refund",
65
- "event"
66
- ],
67
- "credentialDoor": {
68
- "path": "/_twin/app-credentials",
69
- "body": {},
70
- "fill": {
71
- "STRIPE_SECRET_KEY": "secret_key",
72
- "STRIPE_API_KEY": "secret_key",
73
- "STRIPE_PRIVATE_KEY": "secret_key",
74
- "BILLING_STRIPE_API_KEY": "secret_key",
75
- "STRIPE_PUBLISHABLE_KEY": "publishable_key",
76
- "NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY": "publishable_key",
77
- "NEXT_PUBLIC_STRIPE_PUBLIC_KEY": "publishable_key",
78
- "NEXT_PUBLIC_STRIPE_KEY": "publishable_key",
79
- "STRIPE_WEBHOOK_SECRET": "webhook_secret",
80
- "STRIPE_WEBHOOK_SIGNING_SECRET": "webhook_secret",
81
- "STRIPE_ENDPOINT_SECRET": "webhook_secret",
82
- "STRIPE_WEBHOOK_SECRET_KEY": "webhook_secret",
83
- "NEXT_PRIVATE_STRIPE_WEBHOOK_SECRET": "webhook_secret",
84
- "BILLING_STRIPE_WEBHOOK_SECRET": "webhook_secret",
85
- "STRIPE_CONNECT_WEBHOOK_SECRET": "connect_webhook_secret",
86
- "STRIPE_WEBHOOK_SECRET_CONNECT": "connect_webhook_secret",
87
- "STRIPE_CONNECT_WEBHOOK_SIGNING_SECRET": "connect_webhook_secret"
88
- }
89
- },
90
- "serveExport": "createStripeTwinServer"
91
- }
92
- },
93
- "undeclared": []
94
- }