@fantastic.dev/better-stripe 0.92.0 → 0.93.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.
Files changed (84) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/client/billing/renewalAttach/internal/producer/classOwnedActionRoot.d.ts +30 -0
  4. package/dist/client/billing/renewalAttach/internal/producer/classOwnedActionRoot.d.ts.map +1 -0
  5. package/dist/client/billing/renewalAttach/internal/producer/classOwnedActionRoot.js +113 -0
  6. package/dist/client/billing/renewalAttach/internal/producer/classOwnedActionRoot.js.map +1 -0
  7. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +594 -32
  8. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
  9. package/dist/client/connect/payoutExecutionTestHelpers.d.ts +281 -0
  10. package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
  11. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +594 -32
  12. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
  13. package/dist/client/connect/payoutSyncTestHelpers.d.ts +281 -0
  14. package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
  15. package/dist/client/index.d.ts +3 -2
  16. package/dist/client/index.d.ts.map +1 -1
  17. package/dist/client/index.js +16 -3
  18. package/dist/client/index.js.map +1 -1
  19. package/dist/component/_generated/api.d.ts +6 -0
  20. package/dist/component/_generated/api.d.ts.map +1 -1
  21. package/dist/component/_generated/api.js.map +1 -1
  22. package/dist/component/_generated/component.d.ts +406 -0
  23. package/dist/component/_generated/component.d.ts.map +1 -1
  24. package/dist/component/balanceFunding/mutations.d.ts +16 -16
  25. package/dist/component/balanceFunding/preparationHandlers.d.ts +8 -8
  26. package/dist/component/balanceFunding/workflowValidators.d.ts +16 -16
  27. package/dist/component/earnings/triggers.d.ts +294 -0
  28. package/dist/component/earnings/triggers.d.ts.map +1 -1
  29. package/dist/component/financialObservations/settlementHelpers.d.ts +3 -3
  30. package/dist/component/renewalOperations/helpers.d.ts +236 -0
  31. package/dist/component/renewalOperations/helpers.d.ts.map +1 -0
  32. package/dist/component/renewalOperations/helpers.js +457 -0
  33. package/dist/component/renewalOperations/helpers.js.map +1 -0
  34. package/dist/component/renewalOperations/mutations.d.ts +252 -0
  35. package/dist/component/renewalOperations/mutations.d.ts.map +1 -0
  36. package/dist/component/renewalOperations/mutations.js +340 -0
  37. package/dist/component/renewalOperations/mutations.js.map +1 -0
  38. package/dist/component/renewalOperations/queries.d.ts +163 -0
  39. package/dist/component/renewalOperations/queries.d.ts.map +1 -0
  40. package/dist/component/renewalOperations/queries.js +167 -0
  41. package/dist/component/renewalOperations/queries.js.map +1 -0
  42. package/dist/component/renewalOperations/schema.d.ts +1988 -0
  43. package/dist/component/renewalOperations/schema.d.ts.map +1 -0
  44. package/dist/component/renewalOperations/schema.js +227 -0
  45. package/dist/component/renewalOperations/schema.js.map +1 -0
  46. package/dist/component/schema.d.ts +281 -0
  47. package/dist/component/schema.js +5 -0
  48. package/dist/component/schema.js.map +1 -1
  49. package/dist/component/usage/allowance.fixtures.d.ts +281 -0
  50. package/dist/component/usage/allowance.fixtures.d.ts.map +1 -1
  51. package/dist/component/usageCredits/accounting.fixtures.d.ts +297 -16
  52. package/dist/component/usageCredits/accounting.fixtures.d.ts.map +1 -1
  53. package/dist/shared/renewalOperationJournal.d.ts +43 -0
  54. package/dist/shared/renewalOperationJournal.d.ts.map +1 -0
  55. package/dist/shared/renewalOperationJournal.js +294 -0
  56. package/dist/shared/renewalOperationJournal.js.map +1 -0
  57. package/docs/renewal-context-reads.md +152 -0
  58. package/package.json +1 -1
  59. package/src/client/billing/renewalAttach/internal/operationJournal.integration.test.ts +380 -0
  60. package/src/client/billing/renewalAttach/internal/producer/classOwnedActionRoot.ts +155 -0
  61. package/src/client/index.ts +24 -3
  62. package/src/component/_generated/api.ts +6 -0
  63. package/src/component/_generated/component.ts +450 -0
  64. package/src/component/renewalOperations/acknowledgement.fixtures.ts +552 -0
  65. package/src/component/renewalOperations/acknowledgement.test.ts +573 -0
  66. package/src/component/renewalOperations/acknowledgementReads.test.ts +442 -0
  67. package/src/component/renewalOperations/acknowledgementV2.test.ts +493 -0
  68. package/src/component/renewalOperations/acknowledgementV2Publication.test.ts +373 -0
  69. package/src/component/renewalOperations/basisBinding.test.ts +567 -0
  70. package/src/component/renewalOperations/basisLifecycle.test.ts +569 -0
  71. package/src/component/renewalOperations/boundHistory.test.ts +474 -0
  72. package/src/component/renewalOperations/helpers.ts +592 -0
  73. package/src/component/renewalOperations/historyReads.test.ts +595 -0
  74. package/src/component/renewalOperations/initialBasis.test.ts +578 -0
  75. package/src/component/renewalOperations/journal.test.ts +567 -0
  76. package/src/component/renewalOperations/mutations.ts +456 -0
  77. package/src/component/renewalOperations/payload.test.ts +589 -0
  78. package/src/component/renewalOperations/payloadEncoding.test.ts +592 -0
  79. package/src/component/renewalOperations/queries.ts +204 -0
  80. package/src/component/renewalOperations/schema.ts +268 -0
  81. package/src/component/renewalOperations/timingPolicy.fixtures.ts +193 -0
  82. package/src/component/renewalOperations/timingPolicy.test.ts +523 -0
  83. package/src/component/schema.ts +11 -0
  84. package/src/shared/renewalOperationJournal.ts +333 -0
@@ -8345,6 +8345,456 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
8345
8345
  >;
8346
8346
  };
8347
8347
  };
8348
+ renewalOperations: {
8349
+ mutations: {
8350
+ appendStageEvent: FunctionReference<
8351
+ "mutation",
8352
+ "internal",
8353
+ {
8354
+ event: { binding: string; dataJSON: string; sequence: 1 | 2 | 3 };
8355
+ expectedSequence: number;
8356
+ reservation:
8357
+ | {
8358
+ accountJSON: string;
8359
+ apiVersion: string;
8360
+ attemptId: string;
8361
+ authorizationId: string;
8362
+ authorizationRevision: number;
8363
+ authorizationScope: string;
8364
+ basisJSON: string;
8365
+ committedRevision: 1;
8366
+ firstDispatchedAt: number;
8367
+ key: string;
8368
+ logicalOperationId: string;
8369
+ operationId: string;
8370
+ ordinal: 1;
8371
+ payloadId: string;
8372
+ preparedRevision: 0;
8373
+ recordJSON: string;
8374
+ requestBinding: string;
8375
+ stage: "attach" | "configure";
8376
+ }
8377
+ | {
8378
+ accountJSON: string;
8379
+ apiVersion: string;
8380
+ attemptId: string;
8381
+ authorizationId: string;
8382
+ authorizationRevision: number;
8383
+ authorizationScope: string;
8384
+ committedRevision: 1;
8385
+ firstDispatchedAt: number;
8386
+ key: string;
8387
+ logicalOperationId: string;
8388
+ operationId: string;
8389
+ ordinal: 1;
8390
+ payloadId: string;
8391
+ preparedRevision: 0;
8392
+ recordJSON: string;
8393
+ recordVersion: 2;
8394
+ requestBinding: string;
8395
+ stage: "attach";
8396
+ timingPolicyJSON: string;
8397
+ };
8398
+ },
8399
+ {
8400
+ attemptId: string;
8401
+ binding: string;
8402
+ eventId: string;
8403
+ operationId: string;
8404
+ payloadId: string;
8405
+ reservation:
8406
+ | {
8407
+ accountJSON: string;
8408
+ apiVersion: string;
8409
+ attemptId: string;
8410
+ authorizationId: string;
8411
+ authorizationRevision: number;
8412
+ authorizationScope: string;
8413
+ basisJSON: string;
8414
+ committedRevision: 1;
8415
+ firstDispatchedAt: number;
8416
+ key: string;
8417
+ logicalOperationId: string;
8418
+ operationId: string;
8419
+ ordinal: 1;
8420
+ payloadId: string;
8421
+ preparedRevision: 0;
8422
+ recordJSON: string;
8423
+ requestBinding: string;
8424
+ stage: "attach" | "configure";
8425
+ }
8426
+ | {
8427
+ accountJSON: string;
8428
+ apiVersion: string;
8429
+ attemptId: string;
8430
+ authorizationId: string;
8431
+ authorizationRevision: number;
8432
+ authorizationScope: string;
8433
+ committedRevision: 1;
8434
+ firstDispatchedAt: number;
8435
+ key: string;
8436
+ logicalOperationId: string;
8437
+ operationId: string;
8438
+ ordinal: 1;
8439
+ payloadId: string;
8440
+ preparedRevision: 0;
8441
+ recordJSON: string;
8442
+ recordVersion: 2;
8443
+ requestBinding: string;
8444
+ stage: "attach";
8445
+ timingPolicyJSON: string;
8446
+ };
8447
+ sequence: 1 | 2 | 3;
8448
+ sourcePayloadId: string;
8449
+ stage: "attach" | "configure";
8450
+ },
8451
+ Name
8452
+ >;
8453
+ bindInitialBasis: FunctionReference<
8454
+ "mutation",
8455
+ "internal",
8456
+ {
8457
+ attemptId: string;
8458
+ basisJSON: string;
8459
+ operationId: string;
8460
+ policyJSON: string;
8461
+ },
8462
+ {
8463
+ initialBasis: {
8464
+ attemptId: string;
8465
+ basisJSON: string;
8466
+ policyJSON: string;
8467
+ sourcePayloadId: string;
8468
+ stage: "attach";
8469
+ version: 1;
8470
+ };
8471
+ operationId: string;
8472
+ status: "bound";
8473
+ },
8474
+ Name
8475
+ >;
8476
+ createAuthorizedOperation: FunctionReference<
8477
+ "mutation",
8478
+ "internal",
8479
+ {
8480
+ authorizationRevision: number;
8481
+ authorizationScope: string;
8482
+ logicalOperationId: string;
8483
+ recordJSON: string;
8484
+ },
8485
+ | { operationId: string; status: "created" }
8486
+ | { operationId: string; status: "existing" }
8487
+ | { reason: "identity_changed"; status: "conflict" },
8488
+ Name
8489
+ >;
8490
+ reserveAttempt: FunctionReference<
8491
+ "mutation",
8492
+ "internal",
8493
+ {
8494
+ expectedRequestBinding: string;
8495
+ expectedRevision: number;
8496
+ operationId: string;
8497
+ recordJSON: string;
8498
+ stage: "attach" | "configure";
8499
+ },
8500
+ | {
8501
+ committedRevision: 1;
8502
+ disposition: "acquired";
8503
+ previousRevision: 0;
8504
+ reservation:
8505
+ | {
8506
+ accountJSON: string;
8507
+ apiVersion: string;
8508
+ attemptId: string;
8509
+ authorizationId: string;
8510
+ authorizationRevision: number;
8511
+ authorizationScope: string;
8512
+ basisJSON: string;
8513
+ committedRevision: 1;
8514
+ firstDispatchedAt: number;
8515
+ key: string;
8516
+ logicalOperationId: string;
8517
+ operationId: string;
8518
+ ordinal: 1;
8519
+ payloadId: string;
8520
+ preparedRevision: 0;
8521
+ recordJSON: string;
8522
+ requestBinding: string;
8523
+ stage: "attach" | "configure";
8524
+ }
8525
+ | {
8526
+ accountJSON: string;
8527
+ apiVersion: string;
8528
+ attemptId: string;
8529
+ authorizationId: string;
8530
+ authorizationRevision: number;
8531
+ authorizationScope: string;
8532
+ committedRevision: 1;
8533
+ firstDispatchedAt: number;
8534
+ key: string;
8535
+ logicalOperationId: string;
8536
+ operationId: string;
8537
+ ordinal: 1;
8538
+ payloadId: string;
8539
+ preparedRevision: 0;
8540
+ recordJSON: string;
8541
+ recordVersion: 2;
8542
+ requestBinding: string;
8543
+ stage: "attach";
8544
+ timingPolicyJSON: string;
8545
+ };
8546
+ }
8547
+ | {
8548
+ committedRevision: 1;
8549
+ disposition: "existing";
8550
+ reservation:
8551
+ | {
8552
+ accountJSON: string;
8553
+ apiVersion: string;
8554
+ attemptId: string;
8555
+ authorizationId: string;
8556
+ authorizationRevision: number;
8557
+ authorizationScope: string;
8558
+ basisJSON: string;
8559
+ committedRevision: 1;
8560
+ firstDispatchedAt: number;
8561
+ key: string;
8562
+ logicalOperationId: string;
8563
+ operationId: string;
8564
+ ordinal: 1;
8565
+ payloadId: string;
8566
+ preparedRevision: 0;
8567
+ recordJSON: string;
8568
+ requestBinding: string;
8569
+ stage: "attach" | "configure";
8570
+ }
8571
+ | {
8572
+ accountJSON: string;
8573
+ apiVersion: string;
8574
+ attemptId: string;
8575
+ authorizationId: string;
8576
+ authorizationRevision: number;
8577
+ authorizationScope: string;
8578
+ committedRevision: 1;
8579
+ firstDispatchedAt: number;
8580
+ key: string;
8581
+ logicalOperationId: string;
8582
+ operationId: string;
8583
+ ordinal: 1;
8584
+ payloadId: string;
8585
+ preparedRevision: 0;
8586
+ recordJSON: string;
8587
+ recordVersion: 2;
8588
+ requestBinding: string;
8589
+ stage: "attach";
8590
+ timingPolicyJSON: string;
8591
+ };
8592
+ }
8593
+ | { disposition: "conflict"; reason: "identity_changed" },
8594
+ Name
8595
+ >;
8596
+ retainProviderAcknowledgement: FunctionReference<
8597
+ "mutation",
8598
+ "internal",
8599
+ {
8600
+ attemptId: string;
8601
+ expectedSequence: 2 | 3;
8602
+ operationId: string;
8603
+ receiptJSON: string;
8604
+ },
8605
+ {
8606
+ attemptId: string;
8607
+ dispatchEventId: string;
8608
+ dispatchPayloadId: string;
8609
+ operationId: string;
8610
+ receiptBinding: string;
8611
+ receiptPayloadId: string;
8612
+ responseEventId: string;
8613
+ responsePayloadId: string;
8614
+ schemaVersion: 1;
8615
+ sourcePayloadId: string;
8616
+ stage: "attach";
8617
+ status: "retained";
8618
+ },
8619
+ Name
8620
+ >;
8621
+ };
8622
+ queries: {
8623
+ loadAuthorizedOperation: FunctionReference<
8624
+ "query",
8625
+ "internal",
8626
+ { operationId: string },
8627
+ | null
8628
+ | {
8629
+ activeAttempt: null;
8630
+ initialBasis: null;
8631
+ operationId: string;
8632
+ recordJSON: string;
8633
+ recordVersion: 2;
8634
+ revision: 0;
8635
+ }
8636
+ | {
8637
+ activeAttempt: {
8638
+ accountJSON: string;
8639
+ apiVersion: string;
8640
+ attemptId: string;
8641
+ authorizationId: string;
8642
+ authorizationRevision: number;
8643
+ authorizationScope: string;
8644
+ committedRevision: 1;
8645
+ firstDispatchedAt: number;
8646
+ key: string;
8647
+ logicalOperationId: string;
8648
+ operationId: string;
8649
+ ordinal: 1;
8650
+ payloadId: string;
8651
+ preparedRevision: 0;
8652
+ recordVersion: 2;
8653
+ requestBinding: string;
8654
+ stage: "attach";
8655
+ timingPolicyJSON: string;
8656
+ };
8657
+ initialBasis: null | {
8658
+ attemptId: string;
8659
+ basisJSON: string;
8660
+ policyJSON: string;
8661
+ sourcePayloadId: string;
8662
+ stage: "attach";
8663
+ version: 1;
8664
+ };
8665
+ operationId: string;
8666
+ recordJSON: string;
8667
+ recordVersion: 2;
8668
+ revision: 1;
8669
+ }
8670
+ | {
8671
+ activeAttempt: null | {
8672
+ accountJSON: string;
8673
+ apiVersion: string;
8674
+ attemptId: string;
8675
+ authorizationId: string;
8676
+ authorizationRevision: number;
8677
+ authorizationScope: string;
8678
+ basisJSON: string;
8679
+ committedRevision: 1;
8680
+ firstDispatchedAt: number;
8681
+ key: string;
8682
+ logicalOperationId: string;
8683
+ operationId: string;
8684
+ ordinal: 1;
8685
+ payloadId: string;
8686
+ preparedRevision: 0;
8687
+ requestBinding: string;
8688
+ stage: "attach" | "configure";
8689
+ };
8690
+ operationId: string;
8691
+ recordJSON: string;
8692
+ revision: 0 | 1;
8693
+ },
8694
+ Name
8695
+ >;
8696
+ readAttempt: FunctionReference<
8697
+ "query",
8698
+ "internal",
8699
+ { attemptId: string; operationId: string },
8700
+ null | {
8701
+ events: Array<{
8702
+ attemptId: string;
8703
+ binding: string;
8704
+ eventId: string;
8705
+ operationId: string;
8706
+ payloadId: string;
8707
+ sequence: 1 | 2 | 3;
8708
+ sourcePayloadId: string;
8709
+ stage: "attach" | "configure";
8710
+ }>;
8711
+ reservation:
8712
+ | {
8713
+ accountJSON: string;
8714
+ apiVersion: string;
8715
+ attemptId: string;
8716
+ authorizationId: string;
8717
+ authorizationRevision: number;
8718
+ authorizationScope: string;
8719
+ basisJSON: string;
8720
+ committedRevision: 1;
8721
+ firstDispatchedAt: number;
8722
+ key: string;
8723
+ logicalOperationId: string;
8724
+ operationId: string;
8725
+ ordinal: 1;
8726
+ payloadId: string;
8727
+ preparedRevision: 0;
8728
+ recordJSON: string;
8729
+ requestBinding: string;
8730
+ stage: "attach" | "configure";
8731
+ }
8732
+ | {
8733
+ accountJSON: string;
8734
+ apiVersion: string;
8735
+ attemptId: string;
8736
+ authorizationId: string;
8737
+ authorizationRevision: number;
8738
+ authorizationScope: string;
8739
+ committedRevision: 1;
8740
+ firstDispatchedAt: number;
8741
+ key: string;
8742
+ logicalOperationId: string;
8743
+ operationId: string;
8744
+ ordinal: 1;
8745
+ payloadId: string;
8746
+ preparedRevision: 0;
8747
+ recordJSON: string;
8748
+ recordVersion: 2;
8749
+ requestBinding: string;
8750
+ stage: "attach";
8751
+ timingPolicyJSON: string;
8752
+ };
8753
+ },
8754
+ Name
8755
+ >;
8756
+ readProviderAcknowledgement: FunctionReference<
8757
+ "query",
8758
+ "internal",
8759
+ { operationId: string },
8760
+ null | {
8761
+ receiptJSON: string;
8762
+ retention: {
8763
+ attemptId: string;
8764
+ dispatchEventId: string;
8765
+ dispatchPayloadId: string;
8766
+ operationId: string;
8767
+ receiptBinding: string;
8768
+ receiptPayloadId: string;
8769
+ responseEventId: string;
8770
+ responsePayloadId: string;
8771
+ schemaVersion: 1;
8772
+ sourcePayloadId: string;
8773
+ stage: "attach";
8774
+ status: "retained";
8775
+ };
8776
+ },
8777
+ Name
8778
+ >;
8779
+ readStageEvent: FunctionReference<
8780
+ "query",
8781
+ "internal",
8782
+ { attemptId: string; operationId: string; sequence: 1 | 2 | 3 },
8783
+ null | {
8784
+ attemptId: string;
8785
+ binding: string;
8786
+ dataJSON: string;
8787
+ eventId: string;
8788
+ operationId: string;
8789
+ payloadId: string;
8790
+ sequence: 1 | 2 | 3;
8791
+ sourcePayloadId: string;
8792
+ stage: "attach" | "configure";
8793
+ },
8794
+ Name
8795
+ >;
8796
+ };
8797
+ };
8348
8798
  reversalObservations: {
8349
8799
  mutations: {
8350
8800
  resume: FunctionReference<