@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.
- package/README.md +96 -27
- package/client/dashboard-api.ts +286 -0
- package/client/stripe-mirror.css +272 -159
- package/client/stripe-mirror.tsx +1384 -541
- package/dist/client/dashboard-api.d.ts +107 -0
- package/dist/client/dashboard-api.js +238 -0
- package/dist/client/dashboard-api.ts +286 -0
- package/dist/client/stripe-mirror.bundle.js +236 -0
- package/dist/client/stripe-mirror.css +275 -0
- package/dist/client/stripe-mirror.d.ts +134 -0
- package/dist/client/stripe-mirror.js +823 -0
- package/dist/client/stripe-mirror.tsx +1534 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +39 -0
- package/dist/src/generated/events.gen.json +1 -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 +14 -0
- package/dist/src/index.js +75 -0
- package/dist/src/manifest.d.ts +2 -0
- package/dist/src/manifest.js +1070 -0
- package/dist/src/screens/checkout.d.ts +31 -0
- package/dist/src/screens/checkout.js +255 -0
- package/dist/src/screens/connect-oauth.d.ts +27 -0
- package/dist/src/screens/connect-oauth.js +414 -0
- package/dist/src/screens/connect-settings.d.ts +22 -0
- package/dist/src/screens/connect-settings.js +103 -0
- package/dist/src/screens/consent-skin.d.ts +4 -0
- package/dist/src/screens/consent-skin.js +18 -0
- package/dist/src/screens/financial-connections.d.ts +5 -0
- package/dist/src/screens/financial-connections.js +90 -0
- package/dist/src/screens/identity.d.ts +5 -0
- package/dist/src/screens/identity.js +86 -0
- package/dist/src/screens/industries.d.ts +1 -0
- package/dist/src/screens/industries.js +267 -0
- package/dist/src/screens/onboarding.d.ts +13 -0
- package/dist/src/screens/onboarding.js +225 -0
- package/dist/src/screens/portal.d.ts +5 -0
- package/dist/src/screens/portal.js +216 -0
- package/dist/src/screens/public-details.d.ts +5 -0
- package/dist/src/screens/public-details.js +90 -0
- package/dist/src/semantics/after-payment.d.ts +22 -0
- package/dist/src/semantics/after-payment.js +99 -0
- package/dist/src/semantics/apps-secrets.d.ts +2 -0
- package/dist/src/semantics/apps-secrets.js +54 -0
- package/dist/src/semantics/balance.d.ts +11 -0
- package/dist/src/semantics/balance.js +195 -0
- package/dist/src/semantics/billing.d.ts +2 -0
- package/dist/src/semantics/billing.js +220 -0
- package/dist/src/semantics/charges.d.ts +28 -0
- package/dist/src/semantics/charges.js +209 -0
- package/dist/src/semantics/checkout.d.ts +15 -0
- package/dist/src/semantics/checkout.js +316 -0
- package/dist/src/semantics/connect.d.ts +5 -0
- package/dist/src/semantics/connect.js +493 -0
- package/dist/src/semantics/coupons.d.ts +6 -0
- package/dist/src/semantics/coupons.js +92 -0
- package/dist/src/semantics/credit-notes.d.ts +2 -0
- package/dist/src/semantics/credit-notes.js +172 -0
- package/dist/src/semantics/customers.d.ts +6 -0
- package/dist/src/semantics/customers.js +429 -0
- package/dist/src/semantics/disputes.d.ts +2 -0
- package/dist/src/semantics/disputes.js +51 -0
- package/dist/src/semantics/entitlements.d.ts +2 -0
- package/dist/src/semantics/entitlements.js +95 -0
- package/dist/src/semantics/ephemeral-keys.d.ts +2 -0
- package/dist/src/semantics/ephemeral-keys.js +34 -0
- package/dist/src/semantics/files.d.ts +2 -0
- package/dist/src/semantics/files.js +125 -0
- package/dist/src/semantics/invoices.d.ts +18 -0
- package/dist/src/semantics/invoices.js +545 -0
- package/dist/src/semantics/issuing.d.ts +13 -0
- package/dist/src/semantics/issuing.js +575 -0
- package/dist/src/semantics/ledger.d.ts +59 -0
- package/dist/src/semantics/ledger.js +200 -0
- package/dist/src/semantics/payment-intents.d.ts +18 -0
- package/dist/src/semantics/payment-intents.js +404 -0
- package/dist/src/semantics/payment-links.d.ts +2 -0
- package/dist/src/semantics/payment-links.js +133 -0
- package/dist/src/semantics/payment-methods.d.ts +20 -0
- package/dist/src/semantics/payment-methods.js +140 -0
- package/dist/src/semantics/plans.d.ts +5 -0
- package/dist/src/semantics/plans.js +121 -0
- package/dist/src/semantics/platform.d.ts +9 -0
- package/dist/src/semantics/platform.js +206 -0
- package/dist/src/semantics/products.d.ts +2 -0
- package/dist/src/semantics/products.js +140 -0
- package/dist/src/semantics/radar.d.ts +2 -0
- package/dist/src/semantics/radar.js +83 -0
- package/dist/src/semantics/refunds.d.ts +9 -0
- package/dist/src/semantics/refunds.js +195 -0
- package/dist/src/semantics/renewals.d.ts +47 -0
- package/dist/src/semantics/renewals.js +251 -0
- package/dist/src/semantics/setup-intents.d.ts +2 -0
- package/dist/src/semantics/setup-intents.js +84 -0
- package/dist/src/semantics/shared.d.ts +82 -0
- package/dist/src/semantics/shared.js +203 -0
- package/dist/src/semantics/subscription-schedules.d.ts +2 -0
- package/dist/src/semantics/subscription-schedules.js +119 -0
- package/dist/src/semantics/subscriptions.d.ts +11 -0
- package/dist/src/semantics/subscriptions.js +605 -0
- package/dist/src/semantics/tax.d.ts +2 -0
- package/dist/src/semantics/tax.js +197 -0
- package/dist/src/semantics/terminal.d.ts +5 -0
- package/dist/src/semantics/terminal.js +182 -0
- package/dist/src/semantics/test-cards.d.ts +4 -0
- package/dist/src/semantics/test-cards.js +7 -0
- package/dist/src/semantics/test-clocks.d.ts +6 -0
- package/dist/src/semantics/test-clocks.js +73 -0
- package/dist/src/semantics/tokens.d.ts +4 -0
- package/dist/src/semantics/tokens.js +44 -0
- package/dist/src/semantics/transfers.d.ts +2 -0
- package/dist/src/semantics/transfers.js +154 -0
- package/dist/src/semantics/treasury.d.ts +2 -0
- package/dist/src/semantics/treasury.js +377 -0
- package/dist/src/semantics/webhook-endpoints.d.ts +3 -0
- package/dist/src/semantics/webhook-endpoints.js +85 -0
- package/dist/src/stripe-budget.d.ts +55 -0
- package/dist/src/stripe-budget.js +155 -0
- package/dist/src/stripe-capabilities.d.ts +3 -0
- package/dist/src/stripe-capabilities.js +5695 -0
- package/dist/src/stripe-conformance.d.ts +43 -0
- package/dist/src/stripe-conformance.js +105 -0
- package/dist/src/stripe-connector.d.ts +161 -0
- package/dist/src/stripe-connector.js +414 -0
- package/dist/src/stripe-emit.d.ts +2 -0
- package/dist/src/stripe-emit.js +145 -0
- package/dist/src/stripe-events.d.ts +93 -0
- package/dist/src/stripe-events.js +392 -0
- package/dist/src/stripe-js.d.ts +4 -0
- package/dist/src/stripe-js.js +70 -0
- package/dist/src/stripe-mirror-ui.d.ts +15 -0
- package/dist/src/stripe-mirror-ui.js +87 -0
- package/dist/src/stripe-params.d.ts +3 -0
- package/dist/src/stripe-params.js +43 -0
- package/dist/src/stripe-perform-harness.d.ts +9 -0
- package/dist/src/stripe-perform-harness.js +26 -0
- package/dist/src/stripe-server.d.ts +33 -0
- package/dist/src/stripe-server.js +393 -0
- package/dist/src/stripe-shared.d.ts +109 -0
- package/dist/src/stripe-shared.js +276 -0
- package/dist/src/stripe-twin.d.ts +155 -0
- package/dist/src/stripe-twin.js +1232 -0
- package/dist/src/stripe-ui-conformance.d.ts +5 -0
- package/dist/src/stripe-ui-conformance.js +79 -0
- package/dist/src/stripe-ui-structure.d.ts +3 -0
- package/dist/src/stripe-ui-structure.js +168 -0
- package/dist/src/stripe-version.d.ts +12 -0
- package/dist/src/stripe-version.js +287 -0
- package/dist/test-fixtures/stripe-known-deviations.json +110 -0
- package/dist/test-fixtures/stripe-openapi-operations.SOURCE.md +14 -0
- package/dist/test-fixtures/stripe-openapi-operations.json +4717 -0
- package/dist/test-fixtures/stripe-schemas.SOURCE.md +35 -0
- package/dist/test-fixtures/stripe-schemas.json +3813 -0
- package/package.json +18 -10
- package/src/cli.ts +7 -7
- package/src/generated/events.gen.json +1 -0
- package/src/generated/surface.gen.json +1 -0
- package/src/generated/ui.gen.json +1 -0
- package/src/index.ts +34 -10
- package/src/manifest.ts +1102 -0
- package/src/screens/checkout.tsx +267 -0
- package/src/screens/connect-oauth.tsx +400 -0
- package/src/screens/connect-settings.tsx +121 -0
- package/src/screens/consent-skin.ts +20 -0
- package/src/screens/financial-connections.tsx +101 -0
- package/src/screens/identity.tsx +96 -0
- package/src/screens/industries.ts +267 -0
- package/src/screens/onboarding.tsx +243 -0
- package/src/screens/portal.tsx +220 -0
- package/src/screens/public-details.tsx +105 -0
- package/src/semantics/after-payment.ts +118 -0
- package/src/semantics/apps-secrets.ts +58 -0
- package/src/semantics/balance.ts +209 -0
- package/src/semantics/billing.ts +216 -0
- package/src/semantics/charges.ts +220 -0
- package/src/semantics/checkout.ts +310 -0
- package/src/semantics/connect.ts +487 -0
- package/src/semantics/coupons.ts +97 -0
- package/src/semantics/credit-notes.ts +168 -0
- package/src/semantics/customers.ts +432 -0
- package/src/semantics/disputes.ts +62 -0
- package/src/semantics/entitlements.ts +94 -0
- package/src/semantics/ephemeral-keys.ts +34 -0
- package/src/semantics/files.ts +143 -0
- package/src/semantics/invoices.ts +545 -0
- package/src/semantics/issuing.ts +590 -0
- package/src/semantics/ledger.ts +253 -0
- package/src/semantics/payment-intents.ts +420 -0
- package/src/semantics/payment-links.ts +148 -0
- package/src/semantics/payment-methods.ts +145 -0
- package/src/semantics/plans.ts +131 -0
- package/src/semantics/platform.ts +220 -0
- package/src/semantics/products.ts +154 -0
- package/src/semantics/radar.ts +85 -0
- package/src/semantics/refunds.ts +218 -0
- package/src/semantics/renewals.ts +274 -0
- package/src/semantics/setup-intents.ts +87 -0
- package/src/semantics/shared.ts +226 -0
- package/src/semantics/subscription-schedules.ts +129 -0
- package/src/semantics/subscriptions.ts +610 -0
- package/src/semantics/tax.ts +220 -0
- package/src/semantics/terminal.ts +195 -0
- package/src/semantics/test-cards.ts +7 -0
- package/src/semantics/test-clocks.ts +77 -0
- package/src/semantics/tokens.ts +52 -0
- package/src/semantics/transfers.ts +174 -0
- package/src/semantics/treasury.ts +383 -0
- package/src/semantics/webhook-endpoints.ts +87 -0
- package/src/stripe-budget.ts +4 -4
- package/src/stripe-capabilities.ts +2258 -380
- package/src/stripe-conformance.ts +19 -7
- package/src/stripe-connector.ts +68 -40
- package/src/stripe-emit.ts +15 -8
- package/src/stripe-events.ts +102 -40
- package/src/stripe-js.ts +70 -0
- package/src/stripe-mirror-ui.ts +28 -298
- package/src/stripe-params.ts +44 -0
- package/src/stripe-perform-harness.ts +29 -0
- package/src/stripe-server.ts +318 -38
- package/src/stripe-shared.ts +297 -0
- package/src/stripe-twin.ts +434 -5325
- package/src/stripe-ui-conformance.ts +70 -107
- package/src/stripe-ui-structure.ts +124 -348
- package/src/stripe-version.ts +281 -0
- package/test-fixtures/stripe-known-deviations.json +8 -8
- package/test-fixtures/stripe-openapi-operations.json +1188 -2855
- package/test-fixtures/stripe-schemas.json +85 -12
- package/src/stripe-form.ts +0 -35
package/dist/src/cli.js
ADDED
|
@@ -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"]}
|