@fantastic.dev/better-stripe 0.51.0 → 0.53.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.
- package/CHANGELOG.md +20 -0
- package/README.md +1 -1
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +210 -32
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts +105 -16
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +178 -0
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutSyncTestHelpers.d.ts +89 -0
- package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
- package/dist/client/index.d.ts +6 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +5 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/products/catalogClient.d.ts +23 -0
- package/dist/client/products/catalogClient.d.ts.map +1 -1
- package/dist/client/products/catalogClient.js +32 -0
- package/dist/client/products/catalogClient.js.map +1 -1
- package/dist/client/products/fixedPrice.d.ts +4 -0
- package/dist/client/products/fixedPrice.d.ts.map +1 -0
- package/dist/client/products/fixedPrice.js +10 -0
- package/dist/client/products/fixedPrice.js.map +1 -0
- package/dist/client/products/products.d.ts.map +1 -1
- package/dist/client/products/products.js +3 -0
- package/dist/client/products/products.js.map +1 -1
- package/dist/client/usage/catalog.d.ts +7 -0
- package/dist/client/usage/catalog.d.ts.map +1 -0
- package/dist/client/usage/catalog.js +55 -0
- package/dist/client/usage/catalog.js.map +1 -0
- package/dist/client/usage/catalogLifecycle.d.ts +25 -0
- package/dist/client/usage/catalogLifecycle.d.ts.map +1 -0
- package/dist/client/usage/catalogLifecycle.js +64 -0
- package/dist/client/usage/catalogLifecycle.js.map +1 -0
- package/dist/client/usage/catalogMath.d.ts +3 -0
- package/dist/client/usage/catalogMath.d.ts.map +1 -0
- package/dist/client/usage/catalogMath.js +21 -0
- package/dist/client/usage/catalogMath.js.map +1 -0
- package/dist/client/usage/catalogPrices.d.ts +5 -0
- package/dist/client/usage/catalogPrices.d.ts.map +1 -0
- package/dist/client/usage/catalogPrices.js +178 -0
- package/dist/client/usage/catalogPrices.js.map +1 -0
- package/dist/client/usage/catalogRead.d.ts +25 -0
- package/dist/client/usage/catalogRead.d.ts.map +1 -0
- package/dist/client/usage/catalogRead.js +71 -0
- package/dist/client/usage/catalogRead.js.map +1 -0
- package/dist/client/usage/catalogTypes.d.ts +97 -0
- package/dist/client/usage/catalogTypes.d.ts.map +1 -0
- package/dist/client/usage/catalogTypes.js +106 -0
- package/dist/client/usage/catalogTypes.js.map +1 -0
- package/dist/client/usage/client.d.ts +37 -0
- package/dist/client/usage/client.d.ts.map +1 -0
- package/dist/client/usage/client.js +59 -0
- package/dist/client/usage/client.js.map +1 -0
- package/dist/client/usage/records.d.ts +1 -1
- package/dist/client/usage/records.d.ts.map +1 -1
- package/dist/client/usage/records.js +1 -1
- package/dist/client/usage/records.js.map +1 -1
- package/dist/client/webhooks/processors.d.ts.map +1 -1
- package/dist/client/webhooks/processors.js +3 -0
- package/dist/client/webhooks/processors.js.map +1 -1
- package/dist/component/_generated/api.d.ts +10 -0
- package/dist/component/_generated/api.d.ts.map +1 -1
- package/dist/component/_generated/api.js.map +1 -1
- package/dist/component/_generated/component.d.ts +141 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/balanceFunding/internal/actions.d.ts +11 -11
- package/dist/component/balanceFunding/mutations.d.ts +43 -43
- package/dist/component/balanceFunding/stateHandlers.d.ts +8 -8
- package/dist/component/earnings/triggers.d.ts +224 -16
- package/dist/component/earnings/triggers.d.ts.map +1 -1
- package/dist/component/schema.d.ts +89 -0
- package/dist/component/schema.js +7 -0
- package/dist/component/schema.js.map +1 -1
- package/dist/component/usage/helpers.d.ts +13 -0
- package/dist/component/usage/helpers.d.ts.map +1 -0
- package/dist/component/usage/helpers.js +34 -0
- package/dist/component/usage/helpers.js.map +1 -0
- package/dist/component/usage/mutations.d.ts +14 -0
- package/dist/component/usage/mutations.d.ts.map +1 -0
- package/dist/component/usage/mutations.js +124 -0
- package/dist/component/usage/mutations.js.map +1 -0
- package/dist/component/usage/queries.d.ts +62 -0
- package/dist/component/usage/queries.d.ts.map +1 -0
- package/dist/component/usage/queries.js +65 -0
- package/dist/component/usage/queries.js.map +1 -0
- package/dist/component/usage/schema.d.ts +110 -0
- package/dist/component/usage/schema.d.ts.map +1 -0
- package/dist/component/usage/schema.js +54 -0
- package/dist/component/usage/schema.js.map +1 -0
- package/dist/component/usageCatalog/mutations.d.ts +25 -0
- package/dist/component/usageCatalog/mutations.d.ts.map +1 -0
- package/dist/component/usageCatalog/mutations.js +75 -0
- package/dist/component/usageCatalog/mutations.js.map +1 -0
- package/dist/component/usageCatalog/queries.d.ts +33 -0
- package/dist/component/usageCatalog/queries.d.ts.map +1 -0
- package/dist/component/usageCatalog/queries.js +26 -0
- package/dist/component/usageCatalog/queries.js.map +1 -0
- package/dist/component/usageCatalog/schema.d.ts +57 -0
- package/dist/component/usageCatalog/schema.d.ts.map +1 -0
- package/dist/component/usageCatalog/schema.js +22 -0
- package/dist/component/usageCatalog/schema.js.map +1 -0
- package/docs/README.md +5 -1
- package/docs/metered-usage.md +2 -2
- package/docs/metering-setup.md +4 -1
- package/docs/usage-catalog.md +106 -0
- package/docs/usage-ledger.md +62 -0
- package/package.json +4 -2
- package/src/client/index.ts +12 -0
- package/src/client/products/catalogClient.ts +77 -0
- package/src/client/products/fixedPrice.test.ts +57 -0
- package/src/client/products/fixedPrice.ts +13 -0
- package/src/client/products/products.ts +2 -0
- package/src/client/usage/catalog.test.ts +464 -0
- package/src/client/usage/catalog.ts +117 -0
- package/src/client/usage/catalogLifecycle.ts +128 -0
- package/src/client/usage/catalogMath.test.ts +13 -0
- package/src/client/usage/catalogMath.ts +22 -0
- package/src/client/usage/catalogPrices.ts +251 -0
- package/src/client/usage/catalogRead.ts +98 -0
- package/src/client/usage/catalogTypes.ts +170 -0
- package/src/client/usage/client.ts +97 -0
- package/src/client/usage/ledger-client.test.ts +74 -0
- package/src/client/usage/records.ts +1 -1
- package/src/client/webhooks/processors.ts +2 -0
- package/src/component/_generated/api.ts +10 -0
- package/src/component/_generated/component.ts +184 -0
- package/src/component/schema.ts +12 -0
- package/src/component/usage/helpers.ts +33 -0
- package/src/component/usage/ledger.test.ts +310 -0
- package/src/component/usage/mutations.ts +139 -0
- package/src/component/usage/queries.ts +69 -0
- package/src/component/usage/schema.ts +65 -0
- package/src/component/usageCatalog/mutations.ts +79 -0
- package/src/component/usageCatalog/queries.ts +32 -0
- package/src/component/usageCatalog/schema.ts +21 -0
|
@@ -9,17 +9,6 @@ export declare const bridge: import("convex/server").RegisteredAction<"internal"
|
|
|
9
9
|
stripeSubscriptionId: string;
|
|
10
10
|
version: number;
|
|
11
11
|
}, Promise<{
|
|
12
|
-
status: "ready";
|
|
13
|
-
value: {
|
|
14
|
-
customerAccount: string;
|
|
15
|
-
enabled?: boolean | undefined;
|
|
16
|
-
paymentMethodId: string | null;
|
|
17
|
-
paymentMethodTypes?: string[] | null | undefined;
|
|
18
|
-
phase: "apply" | "attach" | "create";
|
|
19
|
-
providerApiVersion: string;
|
|
20
|
-
stripeSubscriptionId: string;
|
|
21
|
-
};
|
|
22
|
-
} | {
|
|
23
12
|
reason: "history_incomplete" | "provider_outcome_unknown";
|
|
24
13
|
retryable: false;
|
|
25
14
|
status: "unknown";
|
|
@@ -35,5 +24,16 @@ export declare const bridge: import("convex/server").RegisteredAction<"internal"
|
|
|
35
24
|
reason: "provider_pending";
|
|
36
25
|
retryable: true;
|
|
37
26
|
status: "not_ready";
|
|
27
|
+
} | {
|
|
28
|
+
status: "ready";
|
|
29
|
+
value: {
|
|
30
|
+
customerAccount: string;
|
|
31
|
+
enabled?: boolean | undefined;
|
|
32
|
+
paymentMethodId: string | null;
|
|
33
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
34
|
+
phase: "apply" | "attach" | "create";
|
|
35
|
+
providerApiVersion: string;
|
|
36
|
+
stripeSubscriptionId: string;
|
|
37
|
+
};
|
|
38
38
|
}>>;
|
|
39
39
|
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -22,6 +22,14 @@ export declare const begin: import("convex/server").RegisteredMutation<"public",
|
|
|
22
22
|
requestKey: string;
|
|
23
23
|
scopeKey: string;
|
|
24
24
|
}, Promise<{
|
|
25
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
26
|
+
retryable: false;
|
|
27
|
+
status: "conflict";
|
|
28
|
+
} | {
|
|
29
|
+
reason: "policy_invalid";
|
|
30
|
+
retryable: false;
|
|
31
|
+
status: "rejected";
|
|
32
|
+
} | {
|
|
25
33
|
operation: {
|
|
26
34
|
accountId: string;
|
|
27
35
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -32,14 +40,6 @@ export declare const begin: import("convex/server").RegisteredMutation<"public",
|
|
|
32
40
|
} | {
|
|
33
41
|
enabled: boolean;
|
|
34
42
|
status: "unchanged";
|
|
35
|
-
} | {
|
|
36
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
37
|
-
retryable: false;
|
|
38
|
-
status: "conflict";
|
|
39
|
-
} | {
|
|
40
|
-
reason: "policy_invalid";
|
|
41
|
-
retryable: false;
|
|
42
|
-
status: "rejected";
|
|
43
43
|
} | {
|
|
44
44
|
reason: "provider_pending";
|
|
45
45
|
retryable: true;
|
|
@@ -395,6 +395,14 @@ export declare const prepare: import("convex/server").RegisteredMutation<"public
|
|
|
395
395
|
requestKey: string;
|
|
396
396
|
scopeKey: string;
|
|
397
397
|
}, Promise<{
|
|
398
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
399
|
+
retryable: false;
|
|
400
|
+
status: "conflict";
|
|
401
|
+
} | {
|
|
402
|
+
reason: "policy_invalid";
|
|
403
|
+
retryable: false;
|
|
404
|
+
status: "rejected";
|
|
405
|
+
} | {
|
|
398
406
|
operation: {
|
|
399
407
|
accountId: string;
|
|
400
408
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -405,14 +413,6 @@ export declare const prepare: import("convex/server").RegisteredMutation<"public
|
|
|
405
413
|
} | {
|
|
406
414
|
enabled: boolean;
|
|
407
415
|
status: "unchanged";
|
|
408
|
-
} | {
|
|
409
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
410
|
-
retryable: false;
|
|
411
|
-
status: "conflict";
|
|
412
|
-
} | {
|
|
413
|
-
reason: "policy_invalid";
|
|
414
|
-
retryable: false;
|
|
415
|
-
status: "rejected";
|
|
416
416
|
} | {
|
|
417
417
|
reason: "provider_pending";
|
|
418
418
|
retryable: true;
|
|
@@ -595,22 +595,6 @@ export declare const startWorkflow: import("convex/server").RegisteredMutation<"
|
|
|
595
595
|
} & {
|
|
596
596
|
providerAction: string;
|
|
597
597
|
}, Promise<{
|
|
598
|
-
reason: "history_incomplete" | "provider_outcome_unknown";
|
|
599
|
-
retryable: false;
|
|
600
|
-
status: "unknown";
|
|
601
|
-
} | {
|
|
602
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
603
|
-
retryable: false;
|
|
604
|
-
status: "conflict";
|
|
605
|
-
} | {
|
|
606
|
-
reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
|
|
607
|
-
retryable: false;
|
|
608
|
-
status: "rejected";
|
|
609
|
-
} | {
|
|
610
|
-
reason: "provider_pending";
|
|
611
|
-
retryable: true;
|
|
612
|
-
status: "not_ready";
|
|
613
|
-
} | {
|
|
614
598
|
operation: {
|
|
615
599
|
accountId: string;
|
|
616
600
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -627,16 +611,7 @@ export declare const startWorkflow: import("convex/server").RegisteredMutation<"
|
|
|
627
611
|
version: number;
|
|
628
612
|
};
|
|
629
613
|
status: "canceled";
|
|
630
|
-
}
|
|
631
|
-
export declare const resumeWorkflow: import("convex/server").RegisteredMutation<"public", {
|
|
632
|
-
accountId: string;
|
|
633
|
-
definitionVersion: string;
|
|
634
|
-
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
635
|
-
providerApiVersion: string;
|
|
636
|
-
scopeKey: string;
|
|
637
|
-
stripeSubscriptionId: string;
|
|
638
|
-
version: number;
|
|
639
|
-
}, Promise<{
|
|
614
|
+
} | {
|
|
640
615
|
reason: "history_incomplete" | "provider_outcome_unknown";
|
|
641
616
|
retryable: false;
|
|
642
617
|
status: "unknown";
|
|
@@ -652,7 +627,16 @@ export declare const resumeWorkflow: import("convex/server").RegisteredMutation<
|
|
|
652
627
|
reason: "provider_pending";
|
|
653
628
|
retryable: true;
|
|
654
629
|
status: "not_ready";
|
|
655
|
-
}
|
|
630
|
+
}>>;
|
|
631
|
+
export declare const resumeWorkflow: import("convex/server").RegisteredMutation<"public", {
|
|
632
|
+
accountId: string;
|
|
633
|
+
definitionVersion: string;
|
|
634
|
+
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
635
|
+
providerApiVersion: string;
|
|
636
|
+
scopeKey: string;
|
|
637
|
+
stripeSubscriptionId: string;
|
|
638
|
+
version: number;
|
|
639
|
+
}, Promise<{
|
|
656
640
|
operation: {
|
|
657
641
|
accountId: string;
|
|
658
642
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -669,6 +653,22 @@ export declare const resumeWorkflow: import("convex/server").RegisteredMutation<
|
|
|
669
653
|
version: number;
|
|
670
654
|
};
|
|
671
655
|
status: "canceled";
|
|
656
|
+
} | {
|
|
657
|
+
reason: "history_incomplete" | "provider_outcome_unknown";
|
|
658
|
+
retryable: false;
|
|
659
|
+
status: "unknown";
|
|
660
|
+
} | {
|
|
661
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
662
|
+
retryable: false;
|
|
663
|
+
status: "conflict";
|
|
664
|
+
} | {
|
|
665
|
+
reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
|
|
666
|
+
retryable: false;
|
|
667
|
+
status: "rejected";
|
|
668
|
+
} | {
|
|
669
|
+
reason: "provider_pending";
|
|
670
|
+
retryable: true;
|
|
671
|
+
status: "not_ready";
|
|
672
672
|
}>>;
|
|
673
673
|
export declare const cancelWorkflow: import("convex/server").RegisteredMutation<"public", {
|
|
674
674
|
accountId: string;
|
|
@@ -5,6 +5,14 @@ export declare function savePreparationHandler(ctx: MutationCtx, args: Infer<typ
|
|
|
5
5
|
preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
|
|
6
6
|
}>;
|
|
7
7
|
export declare function beginHandler(ctx: MutationCtx, args: Infer<typeof beginArgs>): Promise<{
|
|
8
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
9
|
+
retryable: false;
|
|
10
|
+
status: "conflict";
|
|
11
|
+
} | {
|
|
12
|
+
reason: "policy_invalid";
|
|
13
|
+
retryable: false;
|
|
14
|
+
status: "rejected";
|
|
15
|
+
} | {
|
|
8
16
|
operation: {
|
|
9
17
|
accountId: string;
|
|
10
18
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -15,14 +23,6 @@ export declare function beginHandler(ctx: MutationCtx, args: Infer<typeof beginA
|
|
|
15
23
|
} | {
|
|
16
24
|
enabled: boolean;
|
|
17
25
|
status: "unchanged";
|
|
18
|
-
} | {
|
|
19
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
20
|
-
retryable: false;
|
|
21
|
-
status: "conflict";
|
|
22
|
-
} | {
|
|
23
|
-
reason: "policy_invalid";
|
|
24
|
-
retryable: false;
|
|
25
|
-
status: "rejected";
|
|
26
26
|
} | {
|
|
27
27
|
reason: "provider_pending";
|
|
28
28
|
retryable: true;
|
|
@@ -372,6 +372,14 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
|
|
|
372
372
|
preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
|
|
373
373
|
requestKey: string;
|
|
374
374
|
result?: {
|
|
375
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
376
|
+
retryable: false;
|
|
377
|
+
status: "conflict";
|
|
378
|
+
} | {
|
|
379
|
+
reason: "policy_invalid";
|
|
380
|
+
retryable: false;
|
|
381
|
+
status: "rejected";
|
|
382
|
+
} | {
|
|
375
383
|
operation: {
|
|
376
384
|
accountId: string;
|
|
377
385
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -382,14 +390,6 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
|
|
|
382
390
|
} | {
|
|
383
391
|
enabled: boolean;
|
|
384
392
|
status: "unchanged";
|
|
385
|
-
} | {
|
|
386
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
387
|
-
retryable: false;
|
|
388
|
-
status: "conflict";
|
|
389
|
-
} | {
|
|
390
|
-
reason: "policy_invalid";
|
|
391
|
-
retryable: false;
|
|
392
|
-
status: "rejected";
|
|
393
393
|
} | {
|
|
394
394
|
reason: "provider_pending";
|
|
395
395
|
retryable: true;
|
|
@@ -1993,6 +1993,110 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
|
|
|
1993
1993
|
searchIndexes: {};
|
|
1994
1994
|
vectorIndexes: {};
|
|
1995
1995
|
};
|
|
1996
|
+
usageCatalog: {
|
|
1997
|
+
document: {
|
|
1998
|
+
_creationTime: number;
|
|
1999
|
+
_id: import("convex/values").GenericId<"usageCatalog">;
|
|
2000
|
+
firstAttemptAt: number;
|
|
2001
|
+
key: string;
|
|
2002
|
+
kind: "meter" | "price";
|
|
2003
|
+
observationJson?: string | undefined;
|
|
2004
|
+
observedAt?: number | undefined;
|
|
2005
|
+
providerId?: string | undefined;
|
|
2006
|
+
scopeKey: string;
|
|
2007
|
+
termsJson: string;
|
|
2008
|
+
};
|
|
2009
|
+
fieldPaths: "_id" | ("_creationTime" | "firstAttemptAt" | "key" | "kind" | "observationJson" | "observedAt" | "providerId" | "scopeKey" | "termsJson");
|
|
2010
|
+
indexes: {
|
|
2011
|
+
by_id: ["_id"];
|
|
2012
|
+
by_creation_time: ["_creationTime"];
|
|
2013
|
+
by_scope_kind_key: ["scopeKey", "kind", "key", "_creationTime"];
|
|
2014
|
+
by_scope_kind_provider: ["scopeKey", "kind", "providerId", "_creationTime"];
|
|
2015
|
+
};
|
|
2016
|
+
searchIndexes: {};
|
|
2017
|
+
vectorIndexes: {};
|
|
2018
|
+
};
|
|
2019
|
+
usageEvents: {
|
|
2020
|
+
document: {
|
|
2021
|
+
_creationTime: number;
|
|
2022
|
+
_id: import("convex/values").GenericId<"usageEvents">;
|
|
2023
|
+
acceptedAt: number;
|
|
2024
|
+
identity: string;
|
|
2025
|
+
occurredAt: number;
|
|
2026
|
+
recordJson: string;
|
|
2027
|
+
reservationId?: import("convex/values").GenericId<"usageReservations"> | undefined;
|
|
2028
|
+
scopeKey: string;
|
|
2029
|
+
subscriptionJson: string;
|
|
2030
|
+
};
|
|
2031
|
+
fieldPaths: "_id" | ("_creationTime" | "acceptedAt" | "identity" | "occurredAt" | "recordJson" | "reservationId" | "scopeKey" | "subscriptionJson");
|
|
2032
|
+
indexes: {
|
|
2033
|
+
by_id: ["_id"];
|
|
2034
|
+
by_creation_time: ["_creationTime"];
|
|
2035
|
+
by_identity: ["identity", "_creationTime"];
|
|
2036
|
+
by_scope_time: ["scopeKey", "occurredAt", "_creationTime"];
|
|
2037
|
+
};
|
|
2038
|
+
searchIndexes: {};
|
|
2039
|
+
vectorIndexes: {};
|
|
2040
|
+
};
|
|
2041
|
+
usageOutbox: {
|
|
2042
|
+
document: {
|
|
2043
|
+
_creationTime: number;
|
|
2044
|
+
_id: import("convex/values").GenericId<"usageOutbox">;
|
|
2045
|
+
attempts: number;
|
|
2046
|
+
dispatch?: string | undefined;
|
|
2047
|
+
eventId: import("convex/values").GenericId<"usageEvents">;
|
|
2048
|
+
nextAttemptAt: number;
|
|
2049
|
+
providerIdentifier: string;
|
|
2050
|
+
scopeKey: string;
|
|
2051
|
+
state: "held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown";
|
|
2052
|
+
};
|
|
2053
|
+
fieldPaths: "_id" | ("_creationTime" | "attempts" | "dispatch" | "eventId" | "nextAttemptAt" | "providerIdentifier" | "scopeKey" | "state");
|
|
2054
|
+
indexes: {
|
|
2055
|
+
by_id: ["_id"];
|
|
2056
|
+
by_creation_time: ["_creationTime"];
|
|
2057
|
+
by_event: ["eventId", "_creationTime"];
|
|
2058
|
+
by_scope_state: ["scopeKey", "state", "_creationTime"];
|
|
2059
|
+
by_state_next: ["state", "nextAttemptAt", "_creationTime"];
|
|
2060
|
+
};
|
|
2061
|
+
searchIndexes: {};
|
|
2062
|
+
vectorIndexes: {};
|
|
2063
|
+
};
|
|
2064
|
+
usageReservations: {
|
|
2065
|
+
document: {
|
|
2066
|
+
_creationTime: number;
|
|
2067
|
+
_id: import("convex/values").GenericId<"usageReservations">;
|
|
2068
|
+
eventId?: import("convex/values").GenericId<"usageEvents"> | undefined;
|
|
2069
|
+
planJson: string;
|
|
2070
|
+
scaledQuantity: string;
|
|
2071
|
+
scopeKey: string;
|
|
2072
|
+
sourceEventId: string;
|
|
2073
|
+
state: "committed" | "released" | "reserved";
|
|
2074
|
+
};
|
|
2075
|
+
fieldPaths: "_id" | ("_creationTime" | "eventId" | "planJson" | "scaledQuantity" | "scopeKey" | "sourceEventId" | "state");
|
|
2076
|
+
indexes: {
|
|
2077
|
+
by_id: ["_id"];
|
|
2078
|
+
by_creation_time: ["_creationTime"];
|
|
2079
|
+
by_scope_source: ["scopeKey", "sourceEventId", "_creationTime"];
|
|
2080
|
+
};
|
|
2081
|
+
searchIndexes: {};
|
|
2082
|
+
vectorIndexes: {};
|
|
2083
|
+
};
|
|
2084
|
+
usageScopeCounters: {
|
|
2085
|
+
document: {
|
|
2086
|
+
_creationTime: number;
|
|
2087
|
+
_id: import("convex/values").GenericId<"usageScopeCounters">;
|
|
2088
|
+
count: number;
|
|
2089
|
+
scopeKey: string;
|
|
2090
|
+
};
|
|
2091
|
+
fieldPaths: "_id" | ("_creationTime" | "count" | "scopeKey");
|
|
2092
|
+
indexes: {
|
|
2093
|
+
by_id: ["_id"];
|
|
2094
|
+
by_creation_time: ["_creationTime"];
|
|
2095
|
+
by_scope: ["scopeKey", "_creationTime"];
|
|
2096
|
+
};
|
|
2097
|
+
searchIndexes: {};
|
|
2098
|
+
vectorIndexes: {};
|
|
2099
|
+
};
|
|
1996
2100
|
webhookEvents: {
|
|
1997
2101
|
document: {
|
|
1998
2102
|
_creationTime: number;
|
|
@@ -2388,6 +2492,14 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
|
|
|
2388
2492
|
preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
|
|
2389
2493
|
requestKey: string;
|
|
2390
2494
|
result?: {
|
|
2495
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2496
|
+
retryable: false;
|
|
2497
|
+
status: "conflict";
|
|
2498
|
+
} | {
|
|
2499
|
+
reason: "policy_invalid";
|
|
2500
|
+
retryable: false;
|
|
2501
|
+
status: "rejected";
|
|
2502
|
+
} | {
|
|
2391
2503
|
operation: {
|
|
2392
2504
|
accountId: string;
|
|
2393
2505
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -2398,14 +2510,6 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
|
|
|
2398
2510
|
} | {
|
|
2399
2511
|
enabled: boolean;
|
|
2400
2512
|
status: "unchanged";
|
|
2401
|
-
} | {
|
|
2402
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2403
|
-
retryable: false;
|
|
2404
|
-
status: "conflict";
|
|
2405
|
-
} | {
|
|
2406
|
-
reason: "policy_invalid";
|
|
2407
|
-
retryable: false;
|
|
2408
|
-
status: "rejected";
|
|
2409
2513
|
} | {
|
|
2410
2514
|
reason: "provider_pending";
|
|
2411
2515
|
retryable: true;
|
|
@@ -4009,6 +4113,110 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
|
|
|
4009
4113
|
searchIndexes: {};
|
|
4010
4114
|
vectorIndexes: {};
|
|
4011
4115
|
};
|
|
4116
|
+
usageCatalog: {
|
|
4117
|
+
document: {
|
|
4118
|
+
_creationTime: number;
|
|
4119
|
+
_id: import("convex/values").GenericId<"usageCatalog">;
|
|
4120
|
+
firstAttemptAt: number;
|
|
4121
|
+
key: string;
|
|
4122
|
+
kind: "meter" | "price";
|
|
4123
|
+
observationJson?: string | undefined;
|
|
4124
|
+
observedAt?: number | undefined;
|
|
4125
|
+
providerId?: string | undefined;
|
|
4126
|
+
scopeKey: string;
|
|
4127
|
+
termsJson: string;
|
|
4128
|
+
};
|
|
4129
|
+
fieldPaths: "_id" | ("_creationTime" | "firstAttemptAt" | "key" | "kind" | "observationJson" | "observedAt" | "providerId" | "scopeKey" | "termsJson");
|
|
4130
|
+
indexes: {
|
|
4131
|
+
by_id: ["_id"];
|
|
4132
|
+
by_creation_time: ["_creationTime"];
|
|
4133
|
+
by_scope_kind_key: ["scopeKey", "kind", "key", "_creationTime"];
|
|
4134
|
+
by_scope_kind_provider: ["scopeKey", "kind", "providerId", "_creationTime"];
|
|
4135
|
+
};
|
|
4136
|
+
searchIndexes: {};
|
|
4137
|
+
vectorIndexes: {};
|
|
4138
|
+
};
|
|
4139
|
+
usageEvents: {
|
|
4140
|
+
document: {
|
|
4141
|
+
_creationTime: number;
|
|
4142
|
+
_id: import("convex/values").GenericId<"usageEvents">;
|
|
4143
|
+
acceptedAt: number;
|
|
4144
|
+
identity: string;
|
|
4145
|
+
occurredAt: number;
|
|
4146
|
+
recordJson: string;
|
|
4147
|
+
reservationId?: import("convex/values").GenericId<"usageReservations"> | undefined;
|
|
4148
|
+
scopeKey: string;
|
|
4149
|
+
subscriptionJson: string;
|
|
4150
|
+
};
|
|
4151
|
+
fieldPaths: "_id" | ("_creationTime" | "acceptedAt" | "identity" | "occurredAt" | "recordJson" | "reservationId" | "scopeKey" | "subscriptionJson");
|
|
4152
|
+
indexes: {
|
|
4153
|
+
by_id: ["_id"];
|
|
4154
|
+
by_creation_time: ["_creationTime"];
|
|
4155
|
+
by_identity: ["identity", "_creationTime"];
|
|
4156
|
+
by_scope_time: ["scopeKey", "occurredAt", "_creationTime"];
|
|
4157
|
+
};
|
|
4158
|
+
searchIndexes: {};
|
|
4159
|
+
vectorIndexes: {};
|
|
4160
|
+
};
|
|
4161
|
+
usageOutbox: {
|
|
4162
|
+
document: {
|
|
4163
|
+
_creationTime: number;
|
|
4164
|
+
_id: import("convex/values").GenericId<"usageOutbox">;
|
|
4165
|
+
attempts: number;
|
|
4166
|
+
dispatch?: string | undefined;
|
|
4167
|
+
eventId: import("convex/values").GenericId<"usageEvents">;
|
|
4168
|
+
nextAttemptAt: number;
|
|
4169
|
+
providerIdentifier: string;
|
|
4170
|
+
scopeKey: string;
|
|
4171
|
+
state: "held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown";
|
|
4172
|
+
};
|
|
4173
|
+
fieldPaths: "_id" | ("_creationTime" | "attempts" | "dispatch" | "eventId" | "nextAttemptAt" | "providerIdentifier" | "scopeKey" | "state");
|
|
4174
|
+
indexes: {
|
|
4175
|
+
by_id: ["_id"];
|
|
4176
|
+
by_creation_time: ["_creationTime"];
|
|
4177
|
+
by_event: ["eventId", "_creationTime"];
|
|
4178
|
+
by_scope_state: ["scopeKey", "state", "_creationTime"];
|
|
4179
|
+
by_state_next: ["state", "nextAttemptAt", "_creationTime"];
|
|
4180
|
+
};
|
|
4181
|
+
searchIndexes: {};
|
|
4182
|
+
vectorIndexes: {};
|
|
4183
|
+
};
|
|
4184
|
+
usageReservations: {
|
|
4185
|
+
document: {
|
|
4186
|
+
_creationTime: number;
|
|
4187
|
+
_id: import("convex/values").GenericId<"usageReservations">;
|
|
4188
|
+
eventId?: import("convex/values").GenericId<"usageEvents"> | undefined;
|
|
4189
|
+
planJson: string;
|
|
4190
|
+
scaledQuantity: string;
|
|
4191
|
+
scopeKey: string;
|
|
4192
|
+
sourceEventId: string;
|
|
4193
|
+
state: "committed" | "released" | "reserved";
|
|
4194
|
+
};
|
|
4195
|
+
fieldPaths: "_id" | ("_creationTime" | "eventId" | "planJson" | "scaledQuantity" | "scopeKey" | "sourceEventId" | "state");
|
|
4196
|
+
indexes: {
|
|
4197
|
+
by_id: ["_id"];
|
|
4198
|
+
by_creation_time: ["_creationTime"];
|
|
4199
|
+
by_scope_source: ["scopeKey", "sourceEventId", "_creationTime"];
|
|
4200
|
+
};
|
|
4201
|
+
searchIndexes: {};
|
|
4202
|
+
vectorIndexes: {};
|
|
4203
|
+
};
|
|
4204
|
+
usageScopeCounters: {
|
|
4205
|
+
document: {
|
|
4206
|
+
_creationTime: number;
|
|
4207
|
+
_id: import("convex/values").GenericId<"usageScopeCounters">;
|
|
4208
|
+
count: number;
|
|
4209
|
+
scopeKey: string;
|
|
4210
|
+
};
|
|
4211
|
+
fieldPaths: "_id" | ("_creationTime" | "count" | "scopeKey");
|
|
4212
|
+
indexes: {
|
|
4213
|
+
by_id: ["_id"];
|
|
4214
|
+
by_creation_time: ["_creationTime"];
|
|
4215
|
+
by_scope: ["scopeKey", "_creationTime"];
|
|
4216
|
+
};
|
|
4217
|
+
searchIndexes: {};
|
|
4218
|
+
vectorIndexes: {};
|
|
4219
|
+
};
|
|
4012
4220
|
webhookEvents: {
|
|
4013
4221
|
document: {
|
|
4014
4222
|
_creationTime: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../../src/component/earnings/triggers.ts"],"names":[],"mappings":"AA6GA,eAAO,MAAM,QAAQ
|
|
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"}
|
|
@@ -1,4 +1,93 @@
|
|
|
1
1
|
declare const _default: import("convex/server").SchemaDefinition<{
|
|
2
|
+
usageCatalog: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
3
|
+
firstAttemptAt: number;
|
|
4
|
+
key: string;
|
|
5
|
+
kind: "meter" | "price";
|
|
6
|
+
observationJson?: string | undefined;
|
|
7
|
+
observedAt?: number | undefined;
|
|
8
|
+
providerId?: string | undefined;
|
|
9
|
+
scopeKey: string;
|
|
10
|
+
termsJson: string;
|
|
11
|
+
}, {
|
|
12
|
+
observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
13
|
+
scopeKey: import("convex/values").VString<string, "required">;
|
|
14
|
+
kind: import("convex/values").VUnion<"meter" | "price", [import("convex/values").VLiteral<"meter", "required">, import("convex/values").VLiteral<"price", "required">], "required", never>;
|
|
15
|
+
key: import("convex/values").VString<string, "required">;
|
|
16
|
+
termsJson: import("convex/values").VString<string, "required">;
|
|
17
|
+
firstAttemptAt: import("convex/values").VFloat64<number, "required">;
|
|
18
|
+
providerId: import("convex/values").VString<string | undefined, "optional">;
|
|
19
|
+
observationJson: import("convex/values").VString<string | undefined, "optional">;
|
|
20
|
+
}, "required", "firstAttemptAt" | "key" | "kind" | "observationJson" | "observedAt" | "providerId" | "scopeKey" | "termsJson">, {
|
|
21
|
+
by_scope_kind_key: ["scopeKey", "kind", "key", "_creationTime"];
|
|
22
|
+
by_scope_kind_provider: ["scopeKey", "kind", "providerId", "_creationTime"];
|
|
23
|
+
}, {}, {}>;
|
|
24
|
+
usageEvents: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
25
|
+
acceptedAt: number;
|
|
26
|
+
identity: string;
|
|
27
|
+
occurredAt: number;
|
|
28
|
+
recordJson: string;
|
|
29
|
+
reservationId?: import("convex/values").GenericId<"usageReservations"> | undefined;
|
|
30
|
+
scopeKey: string;
|
|
31
|
+
subscriptionJson: string;
|
|
32
|
+
}, {
|
|
33
|
+
reservationId: import("convex/values").VId<import("convex/values").GenericId<"usageReservations"> | undefined, "optional">;
|
|
34
|
+
scopeKey: import("convex/values").VString<string, "required">;
|
|
35
|
+
identity: import("convex/values").VString<string, "required">;
|
|
36
|
+
recordJson: import("convex/values").VString<string, "required">;
|
|
37
|
+
subscriptionJson: import("convex/values").VString<string, "required">;
|
|
38
|
+
occurredAt: import("convex/values").VFloat64<number, "required">;
|
|
39
|
+
acceptedAt: import("convex/values").VFloat64<number, "required">;
|
|
40
|
+
}, "required", "acceptedAt" | "identity" | "occurredAt" | "recordJson" | "reservationId" | "scopeKey" | "subscriptionJson">, {
|
|
41
|
+
by_identity: ["identity", "_creationTime"];
|
|
42
|
+
by_scope_time: ["scopeKey", "occurredAt", "_creationTime"];
|
|
43
|
+
}, {}, {}>;
|
|
44
|
+
usageOutbox: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
45
|
+
attempts: number;
|
|
46
|
+
dispatch?: string | undefined;
|
|
47
|
+
eventId: import("convex/values").GenericId<"usageEvents">;
|
|
48
|
+
nextAttemptAt: number;
|
|
49
|
+
providerIdentifier: string;
|
|
50
|
+
scopeKey: string;
|
|
51
|
+
state: "held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown";
|
|
52
|
+
}, {
|
|
53
|
+
eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
|
|
54
|
+
scopeKey: import("convex/values").VString<string, "required">;
|
|
55
|
+
state: import("convex/values").VUnion<"held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown", [import("convex/values").VLiteral<"queued", "required">, import("convex/values").VLiteral<"sending", "required">, import("convex/values").VLiteral<"provider_accepted", "required">, import("convex/values").VLiteral<"rejected", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"held", "required">], "required", never>;
|
|
56
|
+
attempts: import("convex/values").VFloat64<number, "required">;
|
|
57
|
+
nextAttemptAt: import("convex/values").VFloat64<number, "required">;
|
|
58
|
+
providerIdentifier: import("convex/values").VString<string, "required">;
|
|
59
|
+
dispatch: import("convex/values").VString<string | undefined, "optional">;
|
|
60
|
+
}, "required", "attempts" | "dispatch" | "eventId" | "nextAttemptAt" | "providerIdentifier" | "scopeKey" | "state">, {
|
|
61
|
+
by_event: ["eventId", "_creationTime"];
|
|
62
|
+
by_scope_state: ["scopeKey", "state", "_creationTime"];
|
|
63
|
+
by_state_next: ["state", "nextAttemptAt", "_creationTime"];
|
|
64
|
+
}, {}, {}>;
|
|
65
|
+
usageScopeCounters: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
66
|
+
count: number;
|
|
67
|
+
scopeKey: string;
|
|
68
|
+
}, {
|
|
69
|
+
scopeKey: import("convex/values").VString<string, "required">;
|
|
70
|
+
count: import("convex/values").VFloat64<number, "required">;
|
|
71
|
+
}, "required", "count" | "scopeKey">, {
|
|
72
|
+
by_scope: ["scopeKey", "_creationTime"];
|
|
73
|
+
}, {}, {}>;
|
|
74
|
+
usageReservations: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
75
|
+
eventId?: import("convex/values").GenericId<"usageEvents"> | undefined;
|
|
76
|
+
planJson: string;
|
|
77
|
+
scaledQuantity: string;
|
|
78
|
+
scopeKey: string;
|
|
79
|
+
sourceEventId: string;
|
|
80
|
+
state: "committed" | "released" | "reserved";
|
|
81
|
+
}, {
|
|
82
|
+
scopeKey: import("convex/values").VString<string, "required">;
|
|
83
|
+
sourceEventId: import("convex/values").VString<string, "required">;
|
|
84
|
+
planJson: import("convex/values").VString<string, "required">;
|
|
85
|
+
scaledQuantity: import("convex/values").VString<string, "required">;
|
|
86
|
+
state: import("convex/values").VUnion<"committed" | "released" | "reserved", [import("convex/values").VLiteral<"reserved", "required">, import("convex/values").VLiteral<"committed", "required">, import("convex/values").VLiteral<"released", "required">], "required", never>;
|
|
87
|
+
eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents"> | undefined, "optional">;
|
|
88
|
+
}, "required", "eventId" | "planJson" | "scaledQuantity" | "scopeKey" | "sourceEventId" | "state">, {
|
|
89
|
+
by_scope_source: ["scopeKey", "sourceEventId", "_creationTime"];
|
|
90
|
+
}, {}, {}>;
|
|
2
91
|
refundSyncClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
3
92
|
acceptedAt?: number | undefined;
|
|
4
93
|
acceptedContext?: string | undefined;
|
package/dist/component/schema.js
CHANGED
|
@@ -18,13 +18,20 @@ import { policiesTable, operationsTable } from "./payoutPolicy/schema.js";
|
|
|
18
18
|
import { currencyTotalsTable } from "./earnings/schema.js";
|
|
19
19
|
import { claimsTable, balancesTable, groupsTable, reservationsTable, } from "./costRecovery/schema";
|
|
20
20
|
import { allocationsTable, commissionTermsTable, commissionDecisionsTable, } from "./settlement/schema";
|
|
21
|
+
import { usageCatalogTable } from "./usageCatalog/schema.js";
|
|
21
22
|
import { defineSchema } from "convex/server";
|
|
23
|
+
import { usageEventsTable, usageOutboxTable, usageScopeCountersTable, usageReservationsTable, } from "./usage/schema.js";
|
|
22
24
|
import { checkoutSessionsTable, invoicesTable, subscriptionsTable, } from "./billing/schema";
|
|
23
25
|
import { disputesTable, paymentsTable, payoutsTable, pendingFeeRefundsTable, refundsTable, transferReversalOpsTable, transfersTable, } from "./connect/schema";
|
|
24
26
|
import { accountsTable } from "./core/schema";
|
|
25
27
|
import { pricesTable, productsTable } from "./products/schema";
|
|
26
28
|
import { webhookEventsTable } from "./webhooks/schema";
|
|
27
29
|
export default defineSchema({
|
|
30
|
+
usageCatalog: usageCatalogTable,
|
|
31
|
+
usageEvents: usageEventsTable,
|
|
32
|
+
usageOutbox: usageOutboxTable,
|
|
33
|
+
usageScopeCounters: usageScopeCountersTable,
|
|
34
|
+
usageReservations: usageReservationsTable,
|
|
28
35
|
refundSyncClaims: refundSyncClaimsTable,
|
|
29
36
|
processingCostReconciliationOperations,
|
|
30
37
|
recoveryWorkflowOperations,
|
|
@@ -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AmB;IAChD,uBAAuB;IACvB,iBAAiB;IACjB,gBAAgB;IAChB,yBAAyB,EAAE,iBAAiB;IAC5C,yBAAyB,EAAE,8BAA8B;IACzD,gBAAgB,EAAE,qBAAqB;IACvC,iBAAiB,EAAE,sBAAsB;IACzC,mBAAmB,EAAE,wBAAwB;IAC7C,uBAAuB,EAAE,4BAA4B;IACrD,cAAc,EAAE,aAAa;IAC7B,sBAAsB,EAAE,eAAe;IACvC,cAAc,EAAE,mBAAmB;IACnC,cAAc,EAAE,WAAW;IAC3B,gBAAgB,EAAE,aAAa;IAC/B,cAAc,EAAE,WAAW;IAC3B,oBAAoB,EAAE,iBAAiB;IACvC,qBAAqB,EAAE,gBAAgB;IACvC,eAAe,EAAE,oBAAoB;IACrC,mBAAmB,EAAE,wBAAwB;IAC7C,OAAO;IACP,QAAQ,EAAE,aAAa;IACvB,eAAe,EAAE,oBAAoB;IAErC,WAAW;IACX,QAAQ,EAAE,aAAa;IACvB,MAAM,EAAE,WAAW;IAEnB,UAAU;IACV,aAAa,EAAE,kBAAkB;IACjC,gBAAgB,EAAE,qBAAqB;IACvC,QAAQ,EAAE,aAAa;IAEvB,UAAU;IACV,QAAQ,EAAE,aAAa;IACvB,OAAO,EAAE,YAAY;IACrB,iBAAiB,EAAE,sBAAsB;IACzC,OAAO,EAAE,YAAY;IACrB,QAAQ,EAAE,aAAa;IACvB,SAAS,EAAE,cAAc;IACzB,mBAAmB,EAAE,wBAAwB;IAE7C,WAAW;IACX,aAAa,EAAE,kBAAkB;CAClC,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { UsageScope } from "../../client/usage/records.js";
|
|
2
|
+
export declare function scopeKey(input: UsageScope): string;
|
|
3
|
+
export declare function subscriptionSnapshot(json: string): {
|
|
4
|
+
subscriptionId: string;
|
|
5
|
+
subscriptionItemId: string;
|
|
6
|
+
stripePriceId: string;
|
|
7
|
+
period: {
|
|
8
|
+
start: number;
|
|
9
|
+
end: number;
|
|
10
|
+
};
|
|
11
|
+
interval: "month";
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/component/usage/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,UAIzC;AAkBD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM;;;;;;;;;EAOhD"}
|