@volter/twin-stripe 0.1.2 → 2.0.1

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.
Files changed (229) hide show
  1. package/README.md +96 -27
  2. package/client/dashboard-api.ts +286 -0
  3. package/client/stripe-mirror.css +272 -159
  4. package/client/stripe-mirror.tsx +1384 -541
  5. package/dist/client/dashboard-api.d.ts +107 -0
  6. package/dist/client/dashboard-api.js +238 -0
  7. package/dist/client/dashboard-api.ts +286 -0
  8. package/dist/client/stripe-mirror.bundle.js +236 -0
  9. package/dist/client/stripe-mirror.css +275 -0
  10. package/dist/client/stripe-mirror.d.ts +134 -0
  11. package/dist/client/stripe-mirror.js +823 -0
  12. package/dist/client/stripe-mirror.tsx +1534 -0
  13. package/dist/src/cli.d.ts +2 -0
  14. package/dist/src/cli.js +39 -0
  15. package/dist/src/generated/events.gen.json +1 -0
  16. package/dist/src/generated/surface.gen.json +1 -0
  17. package/dist/src/generated/ui.gen.json +1 -0
  18. package/dist/src/index.d.ts +14 -0
  19. package/dist/src/index.js +75 -0
  20. package/dist/src/manifest.d.ts +2 -0
  21. package/dist/src/manifest.js +1070 -0
  22. package/dist/src/screens/checkout.d.ts +31 -0
  23. package/dist/src/screens/checkout.js +255 -0
  24. package/dist/src/screens/connect-oauth.d.ts +27 -0
  25. package/dist/src/screens/connect-oauth.js +414 -0
  26. package/dist/src/screens/connect-settings.d.ts +22 -0
  27. package/dist/src/screens/connect-settings.js +103 -0
  28. package/dist/src/screens/consent-skin.d.ts +4 -0
  29. package/dist/src/screens/consent-skin.js +18 -0
  30. package/dist/src/screens/financial-connections.d.ts +5 -0
  31. package/dist/src/screens/financial-connections.js +90 -0
  32. package/dist/src/screens/identity.d.ts +5 -0
  33. package/dist/src/screens/identity.js +86 -0
  34. package/dist/src/screens/industries.d.ts +1 -0
  35. package/dist/src/screens/industries.js +267 -0
  36. package/dist/src/screens/onboarding.d.ts +13 -0
  37. package/dist/src/screens/onboarding.js +225 -0
  38. package/dist/src/screens/portal.d.ts +5 -0
  39. package/dist/src/screens/portal.js +216 -0
  40. package/dist/src/screens/public-details.d.ts +5 -0
  41. package/dist/src/screens/public-details.js +90 -0
  42. package/dist/src/semantics/after-payment.d.ts +22 -0
  43. package/dist/src/semantics/after-payment.js +99 -0
  44. package/dist/src/semantics/apps-secrets.d.ts +2 -0
  45. package/dist/src/semantics/apps-secrets.js +54 -0
  46. package/dist/src/semantics/balance.d.ts +11 -0
  47. package/dist/src/semantics/balance.js +195 -0
  48. package/dist/src/semantics/billing.d.ts +2 -0
  49. package/dist/src/semantics/billing.js +220 -0
  50. package/dist/src/semantics/charges.d.ts +28 -0
  51. package/dist/src/semantics/charges.js +209 -0
  52. package/dist/src/semantics/checkout.d.ts +15 -0
  53. package/dist/src/semantics/checkout.js +316 -0
  54. package/dist/src/semantics/connect.d.ts +5 -0
  55. package/dist/src/semantics/connect.js +493 -0
  56. package/dist/src/semantics/coupons.d.ts +6 -0
  57. package/dist/src/semantics/coupons.js +92 -0
  58. package/dist/src/semantics/credit-notes.d.ts +2 -0
  59. package/dist/src/semantics/credit-notes.js +172 -0
  60. package/dist/src/semantics/customers.d.ts +6 -0
  61. package/dist/src/semantics/customers.js +429 -0
  62. package/dist/src/semantics/disputes.d.ts +2 -0
  63. package/dist/src/semantics/disputes.js +51 -0
  64. package/dist/src/semantics/entitlements.d.ts +2 -0
  65. package/dist/src/semantics/entitlements.js +95 -0
  66. package/dist/src/semantics/ephemeral-keys.d.ts +2 -0
  67. package/dist/src/semantics/ephemeral-keys.js +34 -0
  68. package/dist/src/semantics/files.d.ts +2 -0
  69. package/dist/src/semantics/files.js +125 -0
  70. package/dist/src/semantics/invoices.d.ts +18 -0
  71. package/dist/src/semantics/invoices.js +545 -0
  72. package/dist/src/semantics/issuing.d.ts +13 -0
  73. package/dist/src/semantics/issuing.js +575 -0
  74. package/dist/src/semantics/ledger.d.ts +59 -0
  75. package/dist/src/semantics/ledger.js +200 -0
  76. package/dist/src/semantics/payment-intents.d.ts +18 -0
  77. package/dist/src/semantics/payment-intents.js +404 -0
  78. package/dist/src/semantics/payment-links.d.ts +2 -0
  79. package/dist/src/semantics/payment-links.js +133 -0
  80. package/dist/src/semantics/payment-methods.d.ts +20 -0
  81. package/dist/src/semantics/payment-methods.js +140 -0
  82. package/dist/src/semantics/plans.d.ts +5 -0
  83. package/dist/src/semantics/plans.js +121 -0
  84. package/dist/src/semantics/platform.d.ts +9 -0
  85. package/dist/src/semantics/platform.js +206 -0
  86. package/dist/src/semantics/products.d.ts +2 -0
  87. package/dist/src/semantics/products.js +140 -0
  88. package/dist/src/semantics/radar.d.ts +2 -0
  89. package/dist/src/semantics/radar.js +83 -0
  90. package/dist/src/semantics/refunds.d.ts +9 -0
  91. package/dist/src/semantics/refunds.js +195 -0
  92. package/dist/src/semantics/renewals.d.ts +47 -0
  93. package/dist/src/semantics/renewals.js +251 -0
  94. package/dist/src/semantics/setup-intents.d.ts +2 -0
  95. package/dist/src/semantics/setup-intents.js +84 -0
  96. package/dist/src/semantics/shared.d.ts +82 -0
  97. package/dist/src/semantics/shared.js +203 -0
  98. package/dist/src/semantics/subscription-schedules.d.ts +2 -0
  99. package/dist/src/semantics/subscription-schedules.js +119 -0
  100. package/dist/src/semantics/subscriptions.d.ts +11 -0
  101. package/dist/src/semantics/subscriptions.js +605 -0
  102. package/dist/src/semantics/tax.d.ts +2 -0
  103. package/dist/src/semantics/tax.js +197 -0
  104. package/dist/src/semantics/terminal.d.ts +5 -0
  105. package/dist/src/semantics/terminal.js +182 -0
  106. package/dist/src/semantics/test-cards.d.ts +4 -0
  107. package/dist/src/semantics/test-cards.js +7 -0
  108. package/dist/src/semantics/test-clocks.d.ts +6 -0
  109. package/dist/src/semantics/test-clocks.js +73 -0
  110. package/dist/src/semantics/tokens.d.ts +4 -0
  111. package/dist/src/semantics/tokens.js +44 -0
  112. package/dist/src/semantics/transfers.d.ts +2 -0
  113. package/dist/src/semantics/transfers.js +154 -0
  114. package/dist/src/semantics/treasury.d.ts +2 -0
  115. package/dist/src/semantics/treasury.js +377 -0
  116. package/dist/src/semantics/webhook-endpoints.d.ts +3 -0
  117. package/dist/src/semantics/webhook-endpoints.js +85 -0
  118. package/dist/src/stripe-budget.d.ts +55 -0
  119. package/dist/src/stripe-budget.js +155 -0
  120. package/dist/src/stripe-capabilities.d.ts +3 -0
  121. package/dist/src/stripe-capabilities.js +5695 -0
  122. package/dist/src/stripe-conformance.d.ts +43 -0
  123. package/dist/src/stripe-conformance.js +105 -0
  124. package/dist/src/stripe-connector.d.ts +161 -0
  125. package/dist/src/stripe-connector.js +414 -0
  126. package/dist/src/stripe-emit.d.ts +2 -0
  127. package/dist/src/stripe-emit.js +145 -0
  128. package/dist/src/stripe-events.d.ts +93 -0
  129. package/dist/src/stripe-events.js +392 -0
  130. package/dist/src/stripe-js.d.ts +4 -0
  131. package/dist/src/stripe-js.js +70 -0
  132. package/dist/src/stripe-mirror-ui.d.ts +15 -0
  133. package/dist/src/stripe-mirror-ui.js +87 -0
  134. package/dist/src/stripe-params.d.ts +3 -0
  135. package/dist/src/stripe-params.js +43 -0
  136. package/dist/src/stripe-perform-harness.d.ts +9 -0
  137. package/dist/src/stripe-perform-harness.js +26 -0
  138. package/dist/src/stripe-server.d.ts +33 -0
  139. package/dist/src/stripe-server.js +393 -0
  140. package/dist/src/stripe-shared.d.ts +109 -0
  141. package/dist/src/stripe-shared.js +276 -0
  142. package/dist/src/stripe-twin.d.ts +155 -0
  143. package/dist/src/stripe-twin.js +1232 -0
  144. package/dist/src/stripe-ui-conformance.d.ts +5 -0
  145. package/dist/src/stripe-ui-conformance.js +79 -0
  146. package/dist/src/stripe-ui-structure.d.ts +3 -0
  147. package/dist/src/stripe-ui-structure.js +168 -0
  148. package/dist/src/stripe-version.d.ts +12 -0
  149. package/dist/src/stripe-version.js +287 -0
  150. package/dist/test-fixtures/stripe-known-deviations.json +110 -0
  151. package/dist/test-fixtures/stripe-openapi-operations.SOURCE.md +14 -0
  152. package/dist/test-fixtures/stripe-openapi-operations.json +4717 -0
  153. package/dist/test-fixtures/stripe-schemas.SOURCE.md +35 -0
  154. package/dist/test-fixtures/stripe-schemas.json +3813 -0
  155. package/package.json +18 -10
  156. package/src/cli.ts +7 -7
  157. package/src/generated/events.gen.json +1 -0
  158. package/src/generated/surface.gen.json +1 -0
  159. package/src/generated/ui.gen.json +1 -0
  160. package/src/index.ts +34 -10
  161. package/src/manifest.ts +1102 -0
  162. package/src/screens/checkout.tsx +267 -0
  163. package/src/screens/connect-oauth.tsx +400 -0
  164. package/src/screens/connect-settings.tsx +121 -0
  165. package/src/screens/consent-skin.ts +20 -0
  166. package/src/screens/financial-connections.tsx +101 -0
  167. package/src/screens/identity.tsx +96 -0
  168. package/src/screens/industries.ts +267 -0
  169. package/src/screens/onboarding.tsx +243 -0
  170. package/src/screens/portal.tsx +220 -0
  171. package/src/screens/public-details.tsx +105 -0
  172. package/src/semantics/after-payment.ts +118 -0
  173. package/src/semantics/apps-secrets.ts +58 -0
  174. package/src/semantics/balance.ts +209 -0
  175. package/src/semantics/billing.ts +216 -0
  176. package/src/semantics/charges.ts +220 -0
  177. package/src/semantics/checkout.ts +310 -0
  178. package/src/semantics/connect.ts +487 -0
  179. package/src/semantics/coupons.ts +97 -0
  180. package/src/semantics/credit-notes.ts +168 -0
  181. package/src/semantics/customers.ts +432 -0
  182. package/src/semantics/disputes.ts +62 -0
  183. package/src/semantics/entitlements.ts +94 -0
  184. package/src/semantics/ephemeral-keys.ts +34 -0
  185. package/src/semantics/files.ts +143 -0
  186. package/src/semantics/invoices.ts +545 -0
  187. package/src/semantics/issuing.ts +590 -0
  188. package/src/semantics/ledger.ts +253 -0
  189. package/src/semantics/payment-intents.ts +420 -0
  190. package/src/semantics/payment-links.ts +148 -0
  191. package/src/semantics/payment-methods.ts +145 -0
  192. package/src/semantics/plans.ts +131 -0
  193. package/src/semantics/platform.ts +220 -0
  194. package/src/semantics/products.ts +154 -0
  195. package/src/semantics/radar.ts +85 -0
  196. package/src/semantics/refunds.ts +218 -0
  197. package/src/semantics/renewals.ts +274 -0
  198. package/src/semantics/setup-intents.ts +87 -0
  199. package/src/semantics/shared.ts +226 -0
  200. package/src/semantics/subscription-schedules.ts +129 -0
  201. package/src/semantics/subscriptions.ts +610 -0
  202. package/src/semantics/tax.ts +220 -0
  203. package/src/semantics/terminal.ts +195 -0
  204. package/src/semantics/test-cards.ts +7 -0
  205. package/src/semantics/test-clocks.ts +77 -0
  206. package/src/semantics/tokens.ts +52 -0
  207. package/src/semantics/transfers.ts +174 -0
  208. package/src/semantics/treasury.ts +383 -0
  209. package/src/semantics/webhook-endpoints.ts +87 -0
  210. package/src/stripe-budget.ts +4 -4
  211. package/src/stripe-capabilities.ts +2258 -380
  212. package/src/stripe-conformance.ts +19 -7
  213. package/src/stripe-connector.ts +68 -40
  214. package/src/stripe-emit.ts +15 -8
  215. package/src/stripe-events.ts +102 -40
  216. package/src/stripe-js.ts +70 -0
  217. package/src/stripe-mirror-ui.ts +28 -298
  218. package/src/stripe-params.ts +44 -0
  219. package/src/stripe-perform-harness.ts +29 -0
  220. package/src/stripe-server.ts +318 -38
  221. package/src/stripe-shared.ts +297 -0
  222. package/src/stripe-twin.ts +434 -5325
  223. package/src/stripe-ui-conformance.ts +70 -107
  224. package/src/stripe-ui-structure.ts +124 -348
  225. package/src/stripe-version.ts +281 -0
  226. package/test-fixtures/stripe-known-deviations.json +8 -8
  227. package/test-fixtures/stripe-openapi-operations.json +1188 -2855
  228. package/test-fixtures/stripe-schemas.json +85 -12
  229. package/src/stripe-form.ts +0 -35
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ import { keepProcessAlive } from '@volter/world-core/lifecycle';
3
+ // world-stripe CLI: serve the Stripe API twin, the mirror UI, or run conformance.
4
+ import { hasFlag, optionValue } from '@volter/world-core/args';
5
+ import { createStripeTwinServer } from "./stripe-server.js";
6
+ import { createStripeMirrorServer } from "./stripe-mirror-ui.js";
7
+ const [cmd, ...rest] = process.argv.slice(2);
8
+ const port = Number(optionValue(rest, '--port', '0')) || undefined;
9
+ const root = optionValue(rest, '--root') || undefined;
10
+ const readOnly = hasFlag(rest, '--read-only'); // a twin accepts writes unless started read-only
11
+ if (cmd === 'serve') {
12
+ const s = await createStripeTwinServer({ readOnly, ...(root ? { root } : {}), ...(port ? { port } : {}) });
13
+ process.stdout.write(`stripe twin (spec-correct API)${readOnly ? ' [read-only]' : ''} at http://127.0.0.1:${s.port}\n`);
14
+ await keepProcessAlive();
15
+ }
16
+ else if (cmd === 'mirror') {
17
+ const s = await createStripeMirrorServer({ ...(root ? { root } : {}), ...(port ? { port } : {}) });
18
+ process.stdout.write(`stripe mirror UI (dashboard) at http://127.0.0.1:${s.port}\n`);
19
+ await keepProcessAlive();
20
+ }
21
+ else if (cmd === 'emit') {
22
+ // DELIVER: fire a signed, vendor-shaped event synthesized from twin state at the app's
23
+ // registered webhook endpoint(s). `emit --list` shows what's emittable right now.
24
+ const { runEmitCli } = await import('@volter/world-core');
25
+ const { stripeEmitter } = await import("./stripe-emit.js");
26
+ process.exit(await runEmitCli(stripeEmitter, rest));
27
+ }
28
+ else if (cmd === 'conformance') {
29
+ // dev-only; lazy so the bin runs without @volter/world-tooling
30
+ const { checkStripeConformance, loadStripeKnownDeviations, loadStripeSchemas, stripeCoverage } = await import("./stripe-conformance.js");
31
+ const [schemas, known] = await Promise.all([loadStripeSchemas(), loadStripeKnownDeviations()]);
32
+ const report = checkStripeConformance(schemas, { ...(root ? { root } : {}), known });
33
+ process.stdout.write(`${JSON.stringify({ ...report, coverage: stripeCoverage(schemas, { ...(root ? { root } : {}) }) }, null, 2)}\n`);
34
+ if (!report.ok)
35
+ process.exitCode = 1;
36
+ }
37
+ else {
38
+ process.stdout.write('Usage: world-stripe serve|mirror|emit|conformance [--port N] [--root DIR] [--read-only]\n world-stripe emit --list [--root DIR] | emit <event.type> <subject-id> [--root DIR] [--endpoint URL|we_id] [--json]\n');
39
+ }
@@ -0,0 +1 @@
1
+ {"generatedBy":"scripts/derive-pack.ts","spec":"openapi.json.gz","types":["account.application.authorized","account.application.deauthorized","account.external_account.created","account.external_account.deleted","account.external_account.updated","account.updated","application_fee.created","application_fee.refund.updated","application_fee.refunded","apps.install.created","apps.install.deleted","apps.install.updated","balance.available","balance_settings.updated","billing.alert.triggered","billing.credit_balance_transaction.created","billing.credit_grant.created","billing.credit_grant.updated","billing.meter.created","billing.meter.deactivated","billing.meter.reactivated","billing.meter.updated","billing_portal.configuration.created","billing_portal.configuration.updated","billing_portal.session.created","capability.updated","cash_balance.funds_available","charge.captured","charge.dispute.closed","charge.dispute.created","charge.dispute.funds_reinstated","charge.dispute.funds_withdrawn","charge.dispute.updated","charge.expired","charge.failed","charge.pending","charge.refund.updated","charge.refunded","charge.succeeded","charge.updated","checkout.session.async_payment_failed","checkout.session.async_payment_succeeded","checkout.session.completed","checkout.session.expired","climate.order.canceled","climate.order.created","climate.order.delayed","climate.order.delivered","climate.order.product_substituted","climate.product.created","climate.product.pricing_updated","coupon.created","coupon.deleted","coupon.updated","credit_note.created","credit_note.updated","credit_note.voided","customer.created","customer.deleted","customer.discount.created","customer.discount.deleted","customer.discount.updated","customer.source.created","customer.source.deleted","customer.source.expiring","customer.source.updated","customer.subscription.created","customer.subscription.deleted","customer.subscription.paused","customer.subscription.pending_update_applied","customer.subscription.pending_update_expired","customer.subscription.resumed","customer.subscription.trial_will_end","customer.subscription.updated","customer.tax_id.created","customer.tax_id.deleted","customer.tax_id.updated","customer.updated","customer_cash_balance_transaction.created","entitlements.active_entitlement_summary.updated","file.created","financial_connections.account.account_numbers_updated","financial_connections.account.created","financial_connections.account.deactivated","financial_connections.account.disconnected","financial_connections.account.expected_deactivation_date_updated","financial_connections.account.reactivated","financial_connections.account.refreshed_balance","financial_connections.account.refreshed_ownership","financial_connections.account.refreshed_transactions","financial_connections.account.supported_payment_method_types_updated","financial_connections.account.upcoming_account_number_expiry","financial_connections.account.upcoming_deactivation","financial_connections.authorization.expected_deactivation_date_updated","financial_connections.authorization.upcoming_deactivation","identity.verification_session.canceled","identity.verification_session.created","identity.verification_session.processing","identity.verification_session.redacted","identity.verification_session.requires_input","identity.verification_session.verified","invoice.created","invoice.deleted","invoice.finalization_failed","invoice.finalized","invoice.marked_uncollectible","invoice.overdue","invoice.overpaid","invoice.paid","invoice.payment_action_required","invoice.payment_attempt_required","invoice.payment_failed","invoice.payment_succeeded","invoice.sent","invoice.upcoming","invoice.updated","invoice.voided","invoice.will_be_due","invoice_payment.paid","invoiceitem.created","invoiceitem.deleted","issuing_authorization.created","issuing_authorization.request","issuing_authorization.updated","issuing_card.created","issuing_card.updated","issuing_cardholder.created","issuing_cardholder.updated","issuing_dispute.closed","issuing_dispute.created","issuing_dispute.funds_reinstated","issuing_dispute.funds_rescinded","issuing_dispute.submitted","issuing_dispute.updated","issuing_personalization_design.activated","issuing_personalization_design.deactivated","issuing_personalization_design.rejected","issuing_personalization_design.updated","issuing_token.created","issuing_token.updated","issuing_transaction.created","issuing_transaction.purchase_details_receipt_updated","issuing_transaction.updated","mandate.updated","payment_intent.amount_capturable_updated","payment_intent.canceled","payment_intent.created","payment_intent.partially_funded","payment_intent.payment_failed","payment_intent.processing","payment_intent.requires_action","payment_intent.succeeded","payment_link.created","payment_link.updated","payment_method.attached","payment_method.automatically_updated","payment_method.detached","payment_method.updated","payout.canceled","payout.created","payout.failed","payout.paid","payout.reconciliation_completed","payout.updated","person.created","person.deleted","person.updated","plan.created","plan.deleted","plan.updated","price.created","price.deleted","price.updated","product.created","product.deleted","product.updated","promotion_code.created","promotion_code.updated","quote.accepted","quote.canceled","quote.created","quote.finalized","radar.early_fraud_warning.created","radar.early_fraud_warning.updated","refund.created","refund.failed","refund.updated","reporting.report_run.failed","reporting.report_run.succeeded","reporting.report_type.updated","reserve.hold.created","reserve.hold.updated","reserve.plan.created","reserve.plan.disabled","reserve.plan.expired","reserve.plan.updated","reserve.release.created","review.closed","review.opened","setup_intent.canceled","setup_intent.created","setup_intent.requires_action","setup_intent.setup_failed","setup_intent.succeeded","sigma.scheduled_query_run.created","source.canceled","source.chargeable","source.failed","source.mandate_notification","source.refund_attributes_required","source.transaction.created","source.transaction.updated","subscription_schedule.aborted","subscription_schedule.canceled","subscription_schedule.completed","subscription_schedule.created","subscription_schedule.expiring","subscription_schedule.released","subscription_schedule.updated","tax.settings.updated","tax_rate.created","tax_rate.updated","terminal.reader.action_failed","terminal.reader.action_succeeded","terminal.reader.action_updated","test_helpers.test_clock.advancing","test_helpers.test_clock.created","test_helpers.test_clock.deleted","test_helpers.test_clock.internal_failure","test_helpers.test_clock.ready","topup.canceled","topup.created","topup.failed","topup.reversed","topup.succeeded","transfer.created","transfer.reversed","transfer.updated","treasury.credit_reversal.created","treasury.credit_reversal.posted","treasury.debit_reversal.completed","treasury.debit_reversal.created","treasury.debit_reversal.initial_credit_granted","treasury.financial_account.closed","treasury.financial_account.created","treasury.financial_account.features_status_updated","treasury.inbound_transfer.canceled","treasury.inbound_transfer.created","treasury.inbound_transfer.failed","treasury.inbound_transfer.succeeded","treasury.outbound_payment.canceled","treasury.outbound_payment.created","treasury.outbound_payment.expected_arrival_date_updated","treasury.outbound_payment.failed","treasury.outbound_payment.posted","treasury.outbound_payment.returned","treasury.outbound_payment.tracking_details_updated","treasury.outbound_transfer.canceled","treasury.outbound_transfer.created","treasury.outbound_transfer.expected_arrival_date_updated","treasury.outbound_transfer.failed","treasury.outbound_transfer.posted","treasury.outbound_transfer.returned","treasury.outbound_transfer.tracking_details_updated","treasury.received_credit.created","treasury.received_credit.failed","treasury.received_credit.succeeded","treasury.received_debit.created"]}