@fantastic.dev/better-stripe 0.39.0 → 0.41.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 (137) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +1 -1
  3. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +442 -0
  4. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
  5. package/dist/client/connect/payoutExecutionTestHelpers.d.ts +221 -0
  6. package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
  7. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +442 -0
  8. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
  9. package/dist/client/connect/payoutSyncTestHelpers.d.ts +221 -0
  10. package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
  11. package/dist/client/costRecovery-invoices.d.ts +2 -2
  12. package/dist/client/costRecovery-invoices.d.ts.map +1 -1
  13. package/dist/client/costRecovery-invoices.js +7 -6
  14. package/dist/client/costRecovery-invoices.js.map +1 -1
  15. package/dist/client/costRecovery.d.ts +5 -2
  16. package/dist/client/costRecovery.d.ts.map +1 -1
  17. package/dist/client/costRecovery.js +3 -1
  18. package/dist/client/costRecovery.js.map +1 -1
  19. package/dist/client/index.d.ts +3 -2
  20. package/dist/client/index.d.ts.map +1 -1
  21. package/dist/client/index.js +2 -2
  22. package/dist/client/index.js.map +1 -1
  23. package/dist/client/paymentSource/client.d.ts +21 -0
  24. package/dist/client/paymentSource/client.d.ts.map +1 -0
  25. package/dist/client/paymentSource/client.js +8 -0
  26. package/dist/client/paymentSource/client.js.map +1 -0
  27. package/dist/client/paymentSource/contracts.d.ts +30 -0
  28. package/dist/client/paymentSource/contracts.d.ts.map +1 -0
  29. package/dist/client/paymentSource/contracts.js +16 -0
  30. package/dist/client/paymentSource/contracts.js.map +1 -0
  31. package/dist/client/paymentSource/economics.d.ts +12 -0
  32. package/dist/client/paymentSource/economics.d.ts.map +1 -0
  33. package/dist/client/paymentSource/economics.js +13 -0
  34. package/dist/client/paymentSource/economics.js.map +1 -0
  35. package/dist/client/paymentSource/funding.d.ts +10 -0
  36. package/dist/client/paymentSource/funding.d.ts.map +1 -0
  37. package/dist/client/paymentSource/funding.js +12 -0
  38. package/dist/client/paymentSource/funding.js.map +1 -0
  39. package/dist/client/paymentSource/history.d.ts +13 -0
  40. package/dist/client/paymentSource/history.d.ts.map +1 -0
  41. package/dist/client/paymentSource/history.js +41 -0
  42. package/dist/client/paymentSource/history.js.map +1 -0
  43. package/dist/client/paymentSource/resolver.d.ts +6 -0
  44. package/dist/client/paymentSource/resolver.d.ts.map +1 -0
  45. package/dist/client/paymentSource/resolver.js +222 -0
  46. package/dist/client/paymentSource/resolver.js.map +1 -0
  47. package/dist/client/recoveryWorkflow/client.d.ts +14 -0
  48. package/dist/client/recoveryWorkflow/client.d.ts.map +1 -0
  49. package/dist/client/recoveryWorkflow/client.js +34 -0
  50. package/dist/client/recoveryWorkflow/client.js.map +1 -0
  51. package/dist/client/recoveryWorkflow/contracts.d.ts +63 -0
  52. package/dist/client/recoveryWorkflow/contracts.d.ts.map +1 -0
  53. package/dist/client/recoveryWorkflow/contracts.js +11 -0
  54. package/dist/client/recoveryWorkflow/contracts.js.map +1 -0
  55. package/dist/client/recoveryWorkflow/provider.d.ts +10 -0
  56. package/dist/client/recoveryWorkflow/provider.d.ts.map +1 -0
  57. package/dist/client/recoveryWorkflow/provider.js +80 -0
  58. package/dist/client/recoveryWorkflow/provider.js.map +1 -0
  59. package/dist/client/recoveryWorkflow/settlement.d.ts +6 -0
  60. package/dist/client/recoveryWorkflow/settlement.d.ts.map +1 -0
  61. package/dist/client/recoveryWorkflow/settlement.js +43 -0
  62. package/dist/client/recoveryWorkflow/settlement.js.map +1 -0
  63. package/dist/client/settlement/verifiedSale.d.ts.map +1 -1
  64. package/dist/client/settlement/verifiedSale.js +4 -6
  65. package/dist/client/settlement/verifiedSale.js.map +1 -1
  66. package/dist/component/_generated/api.d.ts +12 -0
  67. package/dist/component/_generated/api.d.ts.map +1 -1
  68. package/dist/component/_generated/api.js.map +1 -1
  69. package/dist/component/_generated/component.d.ts +164 -0
  70. package/dist/component/_generated/component.d.ts.map +1 -1
  71. package/dist/component/earnings/triggers.d.ts +194 -0
  72. package/dist/component/earnings/triggers.d.ts.map +1 -1
  73. package/dist/component/payoutRelease/queries.d.ts +2 -2
  74. package/dist/component/payoutRelease/queries.d.ts.map +1 -1
  75. package/dist/component/recoveryWorkflow/bridge.d.ts +21 -0
  76. package/dist/component/recoveryWorkflow/bridge.d.ts.map +1 -0
  77. package/dist/component/recoveryWorkflow/bridge.js +52 -0
  78. package/dist/component/recoveryWorkflow/bridge.js.map +1 -0
  79. package/dist/component/recoveryWorkflow/helpers.d.ts +83 -0
  80. package/dist/component/recoveryWorkflow/helpers.d.ts.map +1 -0
  81. package/dist/component/recoveryWorkflow/helpers.js +48 -0
  82. package/dist/component/recoveryWorkflow/helpers.js.map +1 -0
  83. package/dist/component/recoveryWorkflow/mutations.d.ts +91 -0
  84. package/dist/component/recoveryWorkflow/mutations.d.ts.map +1 -0
  85. package/dist/component/recoveryWorkflow/mutations.js +177 -0
  86. package/dist/component/recoveryWorkflow/mutations.js.map +1 -0
  87. package/dist/component/recoveryWorkflow/queries.d.ts +118 -0
  88. package/dist/component/recoveryWorkflow/queries.d.ts.map +1 -0
  89. package/dist/component/recoveryWorkflow/queries.js +20 -0
  90. package/dist/component/recoveryWorkflow/queries.js.map +1 -0
  91. package/dist/component/recoveryWorkflow/schema.d.ts +653 -0
  92. package/dist/component/recoveryWorkflow/schema.d.ts.map +1 -0
  93. package/dist/component/recoveryWorkflow/schema.js +81 -0
  94. package/dist/component/recoveryWorkflow/schema.js.map +1 -0
  95. package/dist/component/recoveryWorkflow/steps.d.ts +70 -0
  96. package/dist/component/recoveryWorkflow/steps.d.ts.map +1 -0
  97. package/dist/component/recoveryWorkflow/steps.js +94 -0
  98. package/dist/component/recoveryWorkflow/steps.js.map +1 -0
  99. package/dist/component/recoveryWorkflow/workflow.d.ts +22 -0
  100. package/dist/component/recoveryWorkflow/workflow.d.ts.map +1 -0
  101. package/dist/component/recoveryWorkflow/workflow.js +56 -0
  102. package/dist/component/recoveryWorkflow/workflow.js.map +1 -0
  103. package/dist/component/schema.d.ts +221 -0
  104. package/dist/component/schema.js +3 -0
  105. package/dist/component/schema.js.map +1 -1
  106. package/docs/settlement.md +48 -0
  107. package/package.json +1 -1
  108. package/src/client/costRecovery-invoices.ts +9 -7
  109. package/src/client/costRecovery.ts +8 -3
  110. package/src/client/index.ts +6 -2
  111. package/src/client/paymentSource/client.ts +13 -0
  112. package/src/client/paymentSource/contracts.ts +33 -0
  113. package/src/client/paymentSource/economics.ts +20 -0
  114. package/src/client/paymentSource/funding.ts +23 -0
  115. package/src/client/paymentSource/history.ts +48 -0
  116. package/src/client/paymentSource/resolver.test.ts +582 -0
  117. package/src/client/paymentSource/resolver.ts +350 -0
  118. package/src/client/recoveryWorkflow/client.test.ts +37 -0
  119. package/src/client/recoveryWorkflow/client.ts +76 -0
  120. package/src/client/recoveryWorkflow/contracts.ts +72 -0
  121. package/src/client/recoveryWorkflow/provider.test.ts +424 -0
  122. package/src/client/recoveryWorkflow/provider.ts +119 -0
  123. package/src/client/recoveryWorkflow/settlement.ts +67 -0
  124. package/src/client/settlement/verifiedSale.ts +4 -10
  125. package/src/component/_generated/api.ts +12 -0
  126. package/src/component/_generated/component.ts +222 -0
  127. package/src/component/recoveryWorkflow/bridge.test.ts +481 -0
  128. package/src/component/recoveryWorkflow/bridge.ts +66 -0
  129. package/src/component/recoveryWorkflow/helpers.ts +58 -0
  130. package/src/component/recoveryWorkflow/journal.test.ts +104 -0
  131. package/src/component/recoveryWorkflow/mutations.ts +224 -0
  132. package/src/component/recoveryWorkflow/queries.ts +19 -0
  133. package/src/component/recoveryWorkflow/schema.ts +92 -0
  134. package/src/component/recoveryWorkflow/state.test.ts +191 -0
  135. package/src/component/recoveryWorkflow/steps.ts +97 -0
  136. package/src/component/recoveryWorkflow/workflow.ts +73 -0
  137. package/src/component/schema.ts +6 -0
@@ -1497,6 +1497,103 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
1497
1497
  searchIndexes: {};
1498
1498
  vectorIndexes: {};
1499
1499
  };
1500
+ recoveryWorkflowOperations: {
1501
+ document: {
1502
+ _creationTime: number;
1503
+ _id: import("convex/values").GenericId<"recoveryWorkflowOperations">;
1504
+ accountId: string;
1505
+ activePhase?: "execute" | "reconcile" | undefined;
1506
+ allocation?: {
1507
+ adjustmentAmount?: number | undefined;
1508
+ currency: string;
1509
+ gross: number;
1510
+ paymentId?: string | undefined;
1511
+ paymentIntentId?: string | undefined;
1512
+ platformNet: number;
1513
+ processingFee: number;
1514
+ sourceChargeId: string;
1515
+ sourceInvoiceId?: string | undefined;
1516
+ transfers: {
1517
+ amount: number;
1518
+ destinationAccountId: string;
1519
+ role: "affiliate" | "other" | "store";
1520
+ }[];
1521
+ } | undefined;
1522
+ cancelRequested: boolean;
1523
+ completion?: string | undefined;
1524
+ currency: string;
1525
+ definitionVersion: number;
1526
+ groupKey: string;
1527
+ maxAttempts: number;
1528
+ outcome?: "collect" | "release" | undefined;
1529
+ provider: string;
1530
+ providerApiVersion: string;
1531
+ providerStarted: boolean;
1532
+ releaseUncollectible: boolean;
1533
+ resumeQueued: boolean;
1534
+ retryDelayMs: number;
1535
+ scopeKey: string;
1536
+ sourceId: string;
1537
+ sourceKind: "invoice" | "settlement";
1538
+ status: "canceled" | "completed" | "queued" | "running" | "unknown" | "waiting";
1539
+ version: number;
1540
+ workflowId?: string | undefined;
1541
+ };
1542
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "activePhase" | "allocation" | "allocation.adjustmentAmount" | "allocation.currency" | "allocation.gross" | "allocation.paymentId" | "allocation.paymentIntentId" | "allocation.platformNet" | "allocation.processingFee" | "allocation.sourceChargeId" | "allocation.sourceInvoiceId" | "allocation.transfers" | "cancelRequested" | "completion" | "currency" | "definitionVersion" | "groupKey" | "maxAttempts" | "outcome" | "provider" | "providerApiVersion" | "providerStarted" | "releaseUncollectible" | "resumeQueued" | "retryDelayMs" | "scopeKey" | "sourceId" | "sourceKind" | "status" | "version" | "workflowId");
1543
+ indexes: {
1544
+ by_id: ["_id"];
1545
+ by_creation_time: ["_creationTime"];
1546
+ by_group: ["groupKey", "_creationTime"];
1547
+ by_source: ["sourceKind", "sourceId", "_creationTime"];
1548
+ };
1549
+ searchIndexes: {};
1550
+ vectorIndexes: {};
1551
+ };
1552
+ recoveryWorkflowRequests: {
1553
+ document: {
1554
+ _creationTime: number;
1555
+ _id: import("convex/values").GenericId<"recoveryWorkflowRequests">;
1556
+ binding: {
1557
+ accountId: string;
1558
+ allocation?: {
1559
+ adjustmentAmount?: number | undefined;
1560
+ currency: string;
1561
+ gross: number;
1562
+ paymentId?: string | undefined;
1563
+ paymentIntentId?: string | undefined;
1564
+ platformNet: number;
1565
+ processingFee: number;
1566
+ sourceChargeId: string;
1567
+ sourceInvoiceId?: string | undefined;
1568
+ transfers: {
1569
+ amount: number;
1570
+ destinationAccountId: string;
1571
+ role: "affiliate" | "other" | "store";
1572
+ }[];
1573
+ } | undefined;
1574
+ completion?: string | undefined;
1575
+ currency: string;
1576
+ definitionVersion: number;
1577
+ groupKey: string;
1578
+ maxAttempts: number;
1579
+ provider: string;
1580
+ providerApiVersion: string;
1581
+ releaseUncollectible: boolean;
1582
+ retryDelayMs: number;
1583
+ scopeKey: string;
1584
+ };
1585
+ operationId: import("convex/values").GenericId<"recoveryWorkflowOperations">;
1586
+ requestKey: string;
1587
+ };
1588
+ fieldPaths: "_id" | ("_creationTime" | "binding" | "binding.accountId" | "binding.allocation" | "binding.allocation.adjustmentAmount" | "binding.allocation.currency" | "binding.allocation.gross" | "binding.allocation.paymentId" | "binding.allocation.paymentIntentId" | "binding.allocation.platformNet" | "binding.allocation.processingFee" | "binding.allocation.sourceChargeId" | "binding.allocation.sourceInvoiceId" | "binding.allocation.transfers" | "binding.completion" | "binding.currency" | "binding.definitionVersion" | "binding.groupKey" | "binding.maxAttempts" | "binding.provider" | "binding.providerApiVersion" | "binding.releaseUncollectible" | "binding.retryDelayMs" | "binding.scopeKey" | "operationId" | "requestKey");
1589
+ indexes: {
1590
+ by_id: ["_id"];
1591
+ by_creation_time: ["_creationTime"];
1592
+ by_key: ["requestKey", "_creationTime"];
1593
+ };
1594
+ searchIndexes: {};
1595
+ vectorIndexes: {};
1596
+ };
1500
1597
  refunds: {
1501
1598
  document: {
1502
1599
  _creationTime: number;
@@ -3195,6 +3292,103 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
3195
3292
  searchIndexes: {};
3196
3293
  vectorIndexes: {};
3197
3294
  };
3295
+ recoveryWorkflowOperations: {
3296
+ document: {
3297
+ _creationTime: number;
3298
+ _id: import("convex/values").GenericId<"recoveryWorkflowOperations">;
3299
+ accountId: string;
3300
+ activePhase?: "execute" | "reconcile" | undefined;
3301
+ allocation?: {
3302
+ adjustmentAmount?: number | undefined;
3303
+ currency: string;
3304
+ gross: number;
3305
+ paymentId?: string | undefined;
3306
+ paymentIntentId?: string | undefined;
3307
+ platformNet: number;
3308
+ processingFee: number;
3309
+ sourceChargeId: string;
3310
+ sourceInvoiceId?: string | undefined;
3311
+ transfers: {
3312
+ amount: number;
3313
+ destinationAccountId: string;
3314
+ role: "affiliate" | "other" | "store";
3315
+ }[];
3316
+ } | undefined;
3317
+ cancelRequested: boolean;
3318
+ completion?: string | undefined;
3319
+ currency: string;
3320
+ definitionVersion: number;
3321
+ groupKey: string;
3322
+ maxAttempts: number;
3323
+ outcome?: "collect" | "release" | undefined;
3324
+ provider: string;
3325
+ providerApiVersion: string;
3326
+ providerStarted: boolean;
3327
+ releaseUncollectible: boolean;
3328
+ resumeQueued: boolean;
3329
+ retryDelayMs: number;
3330
+ scopeKey: string;
3331
+ sourceId: string;
3332
+ sourceKind: "invoice" | "settlement";
3333
+ status: "canceled" | "completed" | "queued" | "running" | "unknown" | "waiting";
3334
+ version: number;
3335
+ workflowId?: string | undefined;
3336
+ };
3337
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "activePhase" | "allocation" | "allocation.adjustmentAmount" | "allocation.currency" | "allocation.gross" | "allocation.paymentId" | "allocation.paymentIntentId" | "allocation.platformNet" | "allocation.processingFee" | "allocation.sourceChargeId" | "allocation.sourceInvoiceId" | "allocation.transfers" | "cancelRequested" | "completion" | "currency" | "definitionVersion" | "groupKey" | "maxAttempts" | "outcome" | "provider" | "providerApiVersion" | "providerStarted" | "releaseUncollectible" | "resumeQueued" | "retryDelayMs" | "scopeKey" | "sourceId" | "sourceKind" | "status" | "version" | "workflowId");
3338
+ indexes: {
3339
+ by_id: ["_id"];
3340
+ by_creation_time: ["_creationTime"];
3341
+ by_group: ["groupKey", "_creationTime"];
3342
+ by_source: ["sourceKind", "sourceId", "_creationTime"];
3343
+ };
3344
+ searchIndexes: {};
3345
+ vectorIndexes: {};
3346
+ };
3347
+ recoveryWorkflowRequests: {
3348
+ document: {
3349
+ _creationTime: number;
3350
+ _id: import("convex/values").GenericId<"recoveryWorkflowRequests">;
3351
+ binding: {
3352
+ accountId: string;
3353
+ allocation?: {
3354
+ adjustmentAmount?: number | undefined;
3355
+ currency: string;
3356
+ gross: number;
3357
+ paymentId?: string | undefined;
3358
+ paymentIntentId?: string | undefined;
3359
+ platformNet: number;
3360
+ processingFee: number;
3361
+ sourceChargeId: string;
3362
+ sourceInvoiceId?: string | undefined;
3363
+ transfers: {
3364
+ amount: number;
3365
+ destinationAccountId: string;
3366
+ role: "affiliate" | "other" | "store";
3367
+ }[];
3368
+ } | undefined;
3369
+ completion?: string | undefined;
3370
+ currency: string;
3371
+ definitionVersion: number;
3372
+ groupKey: string;
3373
+ maxAttempts: number;
3374
+ provider: string;
3375
+ providerApiVersion: string;
3376
+ releaseUncollectible: boolean;
3377
+ retryDelayMs: number;
3378
+ scopeKey: string;
3379
+ };
3380
+ operationId: import("convex/values").GenericId<"recoveryWorkflowOperations">;
3381
+ requestKey: string;
3382
+ };
3383
+ fieldPaths: "_id" | ("_creationTime" | "binding" | "binding.accountId" | "binding.allocation" | "binding.allocation.adjustmentAmount" | "binding.allocation.currency" | "binding.allocation.gross" | "binding.allocation.paymentId" | "binding.allocation.paymentIntentId" | "binding.allocation.platformNet" | "binding.allocation.processingFee" | "binding.allocation.sourceChargeId" | "binding.allocation.sourceInvoiceId" | "binding.allocation.transfers" | "binding.completion" | "binding.currency" | "binding.definitionVersion" | "binding.groupKey" | "binding.maxAttempts" | "binding.provider" | "binding.providerApiVersion" | "binding.releaseUncollectible" | "binding.retryDelayMs" | "binding.scopeKey" | "operationId" | "requestKey");
3384
+ indexes: {
3385
+ by_id: ["_id"];
3386
+ by_creation_time: ["_creationTime"];
3387
+ by_key: ["requestKey", "_creationTime"];
3388
+ };
3389
+ searchIndexes: {};
3390
+ vectorIndexes: {};
3391
+ };
3198
3392
  refunds: {
3199
3393
  document: {
3200
3394
  _creationTime: number;
@@ -1 +1 @@
1
- {"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../../src/component/earnings/triggers.ts"],"names":[],"mappings":"AA6GA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAA0D,CAAC"}
@@ -163,10 +163,10 @@ export declare const snapshot: import("convex/server").RegisteredQuery<"public",
163
163
  accountId: string;
164
164
  ownerKey: string;
165
165
  }, Promise<{
166
- transfers?: undefined;
167
- claims?: undefined;
168
166
  status: "held";
169
167
  reason: "snapshot_limit";
168
+ transfers?: undefined;
169
+ claims?: undefined;
170
170
  } | {
171
171
  reason?: undefined;
172
172
  status: "ready";
@@ -1 +1 @@
1
- {"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/component/payoutRelease/queries.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAIlB,CAAC;AACH,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAiBd,CAAC;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BlB,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;GAQf,CAAC;AAEH,4FAA4F;AAC5F,eAAO,MAAM,QAAQ;;;;;;YAsBE,MAAM;YAAmB,gBAAgB;;;YAS3C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAE1B,CAAC"}
1
+ {"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/component/payoutRelease/queries.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAIlB,CAAC;AACH,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAiBd,CAAC;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BlB,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;GAQf,CAAC;AAEH,4FAA4F;AAC5F,eAAO,MAAM,QAAQ;;;;YAsBE,MAAM;YAAmB,gBAAgB;;;;;YAS3C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAE1B,CAAC"}
@@ -0,0 +1,21 @@
1
+ export declare const invoke: import("convex/server").RegisteredAction<"internal", {
2
+ accountId: string;
3
+ currency: string;
4
+ groupKey: string;
5
+ operationId: import("convex/values").GenericId<"recoveryWorkflowOperations">;
6
+ phase: "execute" | "reconcile";
7
+ scopeKey: string;
8
+ version: number;
9
+ }, Promise<{
10
+ outcome: "collect" | "release";
11
+ status: "ready";
12
+ } | {
13
+ reason: "provider_pending";
14
+ status: "not_ready";
15
+ } | {
16
+ reason: "provider_outcome_unknown";
17
+ status: "unknown";
18
+ } | {
19
+ status: "canceled";
20
+ }>>;
21
+ //# sourceMappingURL=bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../../src/component/recoveryWorkflow/bridge.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;GAwDjB,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { anyApi } from "convex/server";
2
+ import { internalAction } from "../_generated/server.js";
3
+ import { refFields, phase, receipt } from "./schema.js";
4
+ import { same } from "./helpers.js";
5
+ const unknown = {
6
+ status: "unknown",
7
+ reason: "provider_outcome_unknown",
8
+ };
9
+ export const invoke = internalAction({
10
+ args: { ...refFields, phase },
11
+ returns: receipt,
12
+ handler: async (ctx, args) => {
13
+ try {
14
+ const { phase: _phase, ...ref } = args;
15
+ const op = await ctx.runQuery(anyApi.recoveryWorkflow.queries.saved, ref);
16
+ if (!(await ctx.runMutation(anyApi.recoveryWorkflow.steps.beginProvider, args)))
17
+ return { status: "canceled" };
18
+ const request = {
19
+ ...args,
20
+ providerApiVersion: op.providerApiVersion,
21
+ definitionVersion: op.definitionVersion,
22
+ };
23
+ const result = await ctx.runAction(op.provider, request);
24
+ if (!result || typeof result !== "object" || Array.isArray(result))
25
+ return unknown;
26
+ const r = result;
27
+ const allowed = [
28
+ ...Object.keys(request),
29
+ "sourceId",
30
+ "status",
31
+ "outcome",
32
+ "reason",
33
+ ];
34
+ if (Object.keys(r).some((k) => !allowed.includes(k)) ||
35
+ !same(Object.fromEntries(Object.keys(request).map((k) => [k, r[k]])), request) ||
36
+ r.sourceId !== op.sourceId)
37
+ return unknown;
38
+ if (r.status === "ready" &&
39
+ (r.outcome === "collect" || r.outcome === "release") &&
40
+ (op.sourceKind !== "settlement" || r.outcome === "collect"))
41
+ return { status: "ready", outcome: r.outcome };
42
+ if (r.status === "not_ready" && r.reason === "provider_pending")
43
+ return { status: "not_ready", reason: "provider_pending" };
44
+ return unknown;
45
+ }
46
+ catch {
47
+ // Never allow an SDK exception, response object, or host payload into Workflow history.
48
+ return unknown;
49
+ }
50
+ },
51
+ });
52
+ //# sourceMappingURL=bridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../../src/component/recoveryWorkflow/bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAuB,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,MAAM,OAAO,GAAG;IACd,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,0BAA0B;CAC1B,CAAC;AACX,MAAM,CAAC,MAAM,MAAM,GAAG,cAAc,CAAC;IACnC,IAAI,EAAE,EAAE,GAAG,SAAS,EAAE,KAAK,EAAE;IAC7B,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAkC,EAAE;QAC3D,IAAI,CAAC;YACH,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC;YACvC,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YAC1E,IACE,CAAC,CAAC,MAAM,GAAG,CAAC,WAAW,CACrB,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,aAAa,EAC3C,IAAI,CACL,CAAC;gBAEF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;YAChC,MAAM,OAAO,GAAG;gBACd,GAAG,IAAI;gBACP,kBAAkB,EAAE,EAAE,CAAC,kBAAkB;gBACzC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB;aACxC,CAAC;YACF,MAAM,MAAM,GAAY,MAAM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AkB,EAAE,CAAC;YAC7D,OAAO,OAAO,CAAC;QACjB,CAAC;QAAC,MAAM,CAAC;YACP,wFAAwF;YACxF,OAAO,OAAO,CAAC;QACjB,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,83 @@
1
+ import type { Doc } from "../_generated/dataModel.js";
2
+ import type { QueryCtx, MutationCtx } from "../_generated/server.js";
3
+ import type { Infer } from "convex/values";
4
+ declare const _ref: import("convex/values").VObject<{
5
+ accountId: string;
6
+ currency: string;
7
+ groupKey: string;
8
+ operationId: import("convex/values").GenericId<"recoveryWorkflowOperations">;
9
+ scopeKey: string;
10
+ version: number;
11
+ }, {
12
+ accountId: import("convex/values").VString<string, "required">;
13
+ scopeKey: import("convex/values").VString<string, "required">;
14
+ currency: import("convex/values").VString<string, "required">;
15
+ groupKey: import("convex/values").VString<string, "required">;
16
+ operationId: import("convex/values").VId<import("convex/values").GenericId<"recoveryWorkflowOperations">, "required">;
17
+ version: import("convex/values").VFloat64<number, "required">;
18
+ }, "required", "accountId" | "currency" | "groupKey" | "operationId" | "scopeKey" | "version">;
19
+ export type OperationRef = Infer<typeof _ref>;
20
+ export declare const identityConflict: {
21
+ readonly status: "conflict";
22
+ readonly reason: "identity_changed";
23
+ readonly retryable: false;
24
+ };
25
+ export declare function reference(op: Doc<"recoveryWorkflowOperations">): OperationRef;
26
+ export declare function status(op: Doc<"recoveryWorkflowOperations">): {
27
+ sourceKind: "invoice" | "settlement";
28
+ sourceId: string;
29
+ status: "canceled" | "completed" | "queued" | "running" | "unknown" | "waiting";
30
+ cancelRequested: boolean;
31
+ outcome?: "collect" | "release" | undefined;
32
+ accountId: string;
33
+ currency: string;
34
+ groupKey: string;
35
+ operationId: import("convex/values").GenericId<"recoveryWorkflowOperations">;
36
+ scopeKey: string;
37
+ version: number;
38
+ };
39
+ export declare function read(ctx: QueryCtx | MutationCtx, args: OperationRef): Promise<{
40
+ _creationTime: number;
41
+ _id: import("convex/values").GenericId<"recoveryWorkflowOperations">;
42
+ accountId: string;
43
+ activePhase?: "execute" | "reconcile" | undefined;
44
+ allocation?: {
45
+ adjustmentAmount?: number | undefined;
46
+ currency: string;
47
+ gross: number;
48
+ paymentId?: string | undefined;
49
+ paymentIntentId?: string | undefined;
50
+ platformNet: number;
51
+ processingFee: number;
52
+ sourceChargeId: string;
53
+ sourceInvoiceId?: string | undefined;
54
+ transfers: {
55
+ amount: number;
56
+ destinationAccountId: string;
57
+ role: "affiliate" | "other" | "store";
58
+ }[];
59
+ } | undefined;
60
+ cancelRequested: boolean;
61
+ completion?: string | undefined;
62
+ currency: string;
63
+ definitionVersion: number;
64
+ groupKey: string;
65
+ maxAttempts: number;
66
+ outcome?: "collect" | "release" | undefined;
67
+ provider: string;
68
+ providerApiVersion: string;
69
+ providerStarted: boolean;
70
+ releaseUncollectible: boolean;
71
+ resumeQueued: boolean;
72
+ retryDelayMs: number;
73
+ scopeKey: string;
74
+ sourceId: string;
75
+ sourceKind: "invoice" | "settlement";
76
+ status: "canceled" | "completed" | "queued" | "running" | "unknown" | "waiting";
77
+ version: number;
78
+ workflowId?: string | undefined;
79
+ }>;
80
+ /** Stable object ordering without admitting arbitrary durable caller payloads. */
81
+ export declare function same(a: unknown, b: unknown): boolean;
82
+ export {};
83
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/component/recoveryWorkflow/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3C,QAAA,MAAM,IAAI;;;;;;;;;;;;;;8FAAsB,CAAC;AACjC,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAC9C,eAAO,MAAM,gBAAgB;aAC3B,MAAM,EAAE,UAAU;aAClB,MAAM,EAAE,kBAAkB;aAC1B,SAAS;CACD,CAAC;AACX,wBAAgB,SAAS,CAAC,EAAE,EAAE,GAAG,CAAC,4BAA4B,CAAC,GAAG,YAAY,CAS7E;AACD,wBAAgB,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,4BAA4B,CAAC;;;;;;;;;;;;EAS3D;AACD,wBAAsB,IAAI,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,EAAE,IAAI,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAUzE;AACD,kFAAkF;AAClF,wBAAgB,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAapD"}
@@ -0,0 +1,48 @@
1
+ import { v } from "convex/values";
2
+ import { refFields } from "./schema.js";
3
+ const _ref = v.object(refFields);
4
+ export const identityConflict = {
5
+ status: "conflict",
6
+ reason: "identity_changed",
7
+ retryable: false,
8
+ };
9
+ export function reference(op) {
10
+ return {
11
+ accountId: op.accountId,
12
+ scopeKey: op.scopeKey,
13
+ currency: op.currency,
14
+ groupKey: op.groupKey,
15
+ operationId: op._id,
16
+ version: op.version,
17
+ };
18
+ }
19
+ export function status(op) {
20
+ return {
21
+ ...reference(op),
22
+ sourceKind: op.sourceKind,
23
+ sourceId: op.sourceId,
24
+ status: op.status,
25
+ cancelRequested: op.cancelRequested,
26
+ ...(op.outcome ? { outcome: op.outcome } : {}),
27
+ };
28
+ }
29
+ export async function read(ctx, args) {
30
+ const op = await ctx.db.get("recoveryWorkflowOperations", args.operationId);
31
+ if (!op ||
32
+ Object.entries(reference(op)).some(([k, value]) => value !== args[k]))
33
+ throw new Error("Recovery operation identity does not match.");
34
+ return op;
35
+ }
36
+ /** Stable object ordering without admitting arbitrary durable caller payloads. */
37
+ export function same(a, b) {
38
+ const canonical = (x) => Array.isArray(x)
39
+ ? x.map(canonical)
40
+ : x && typeof x === "object"
41
+ ? Object.fromEntries(Object.entries(x)
42
+ .filter(([, v]) => v !== undefined)
43
+ .sort(([a], [b]) => a.localeCompare(b))
44
+ .map(([k, v]) => [k, canonical(v)]))
45
+ : x;
46
+ return JSON.stringify(canonical(a)) === JSON.stringify(canonical(b));
47
+ }
48
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/component/recoveryWorkflow/helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAEjC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,kBAAkB;IAC1B,SAAS,EAAE,KAAK;CACR,CAAC;AACX,MAAM,UAAU,SAAS,CAAC,EAAqC;IAC7D,OAAO;QACL,SAAS,EAAE,EAAE,CAAC,SAAS;QACvB,QAAQ,EAAE,EAAE,CAAC,QAAQ;QACrB,QAAQ,EAAE,EAAE,CAAC,QAAQ;QACrB,QAAQ,EAAE,EAAE,CAAC,QAAQ;QACrB,WAAW,EAAE,EAAE,CAAC,GAAG;QACnB,OAAO,EAAE,EAAE,CAAC,OAAO;KACpB,CAAC;AACJ,CAAC;AACD,MAAM,UAAU,MAAM,CAAC,EAAqC;IAC1D,OAAO;QACL,GAAG,SAAS,CAAC,EAAE,CAAC;QAChB,UAAU,EAAE,EAAE,CAAC,UAAU;QACzB,QAAQ,EAAE,EAAE,CAAC,QAAQ;QACrB,MAAM,EAAE,EAAE,CAAC,MAAM;QACjB,eAAe,EAAE,EAAE,CAAC,eAAe;QACnC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,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ACV,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,CAAC"}
@@ -0,0 +1,91 @@
1
+ export declare const start: import("convex/server").RegisteredMutation<"public", {
2
+ accountId: string;
3
+ allocation?: {
4
+ adjustmentAmount?: number | undefined;
5
+ currency: string;
6
+ gross: number;
7
+ paymentId?: string | undefined;
8
+ paymentIntentId?: string | undefined;
9
+ platformNet: number;
10
+ processingFee: number;
11
+ sourceChargeId: string;
12
+ sourceInvoiceId?: string | undefined;
13
+ transfers: {
14
+ amount: number;
15
+ destinationAccountId: string;
16
+ role: "affiliate" | "other" | "store";
17
+ }[];
18
+ } | undefined;
19
+ completion?: string | undefined;
20
+ currency: string;
21
+ definitionVersion: number;
22
+ groupKey: string;
23
+ maxAttempts: number;
24
+ provider: string;
25
+ providerApiVersion: string;
26
+ releaseUncollectible: boolean;
27
+ requestKey: string;
28
+ retryDelayMs: number;
29
+ scopeKey: string;
30
+ }, Promise<{
31
+ readonly status: "conflict";
32
+ readonly reason: "identity_changed";
33
+ readonly retryable: false;
34
+ } | {
35
+ sourceKind: "invoice" | "settlement";
36
+ sourceId: string;
37
+ status: "canceled" | "completed" | "queued" | "running" | "unknown" | "waiting";
38
+ cancelRequested: boolean;
39
+ outcome?: "collect" | "release" | undefined;
40
+ accountId: string;
41
+ currency: string;
42
+ groupKey: string;
43
+ operationId: import("convex/values").GenericId<"recoveryWorkflowOperations">;
44
+ scopeKey: string;
45
+ version: number;
46
+ } | {
47
+ readonly status: "not_ready";
48
+ readonly reason: "history_incomplete";
49
+ readonly retryable: true;
50
+ }>>;
51
+ export declare const requestCancel: import("convex/server").RegisteredMutation<"public", {
52
+ accountId: string;
53
+ currency: string;
54
+ groupKey: string;
55
+ operationId: import("convex/values").GenericId<"recoveryWorkflowOperations">;
56
+ scopeKey: string;
57
+ version: number;
58
+ }, Promise<{
59
+ sourceKind: "invoice" | "settlement";
60
+ sourceId: string;
61
+ status: "canceled" | "completed" | "queued" | "running" | "unknown" | "waiting";
62
+ cancelRequested: boolean;
63
+ outcome?: "collect" | "release" | undefined;
64
+ accountId: string;
65
+ currency: string;
66
+ groupKey: string;
67
+ operationId: import("convex/values").GenericId<"recoveryWorkflowOperations">;
68
+ scopeKey: string;
69
+ version: number;
70
+ }>>;
71
+ export declare const resume: import("convex/server").RegisteredMutation<"public", {
72
+ accountId: string;
73
+ currency: string;
74
+ groupKey: string;
75
+ operationId: import("convex/values").GenericId<"recoveryWorkflowOperations">;
76
+ scopeKey: string;
77
+ version: number;
78
+ }, Promise<{
79
+ sourceKind: "invoice" | "settlement";
80
+ sourceId: string;
81
+ status: "canceled" | "completed" | "queued" | "running" | "unknown" | "waiting";
82
+ cancelRequested: boolean;
83
+ outcome?: "collect" | "release" | undefined;
84
+ accountId: string;
85
+ currency: string;
86
+ groupKey: string;
87
+ operationId: import("convex/values").GenericId<"recoveryWorkflowOperations">;
88
+ scopeKey: string;
89
+ version: number;
90
+ }>>;
91
+ //# sourceMappingURL=mutations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/component/recoveryWorkflow/mutations.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA6DF,WAAW;qBACX,oBAAoB;;GAwElC,CAAC;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;GAYxB,CAAC;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;GAyDjB,CAAC"}