@fantastic.dev/better-stripe 0.52.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 +6 -0
- package/README.md +1 -1
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +44 -0
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts +22 -0
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +44 -0
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutSyncTestHelpers.d.ts +22 -0
- package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -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/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 +4 -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 +62 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/balanceFunding/mutations.d.ts +43 -43
- package/dist/component/earnings/triggers.d.ts +46 -0
- package/dist/component/earnings/triggers.d.ts.map +1 -1
- package/dist/component/payoutRelease/queries.d.ts +2 -2
- package/dist/component/payoutRelease/queries.d.ts.map +1 -1
- package/dist/component/schema.d.ts +22 -0
- package/dist/component/schema.js +2 -0
- package/dist/component/schema.js.map +1 -1
- 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 +3 -1
- package/docs/metering-setup.md +2 -0
- package/docs/usage-catalog.md +106 -0
- package/package.json +3 -2
- package/src/client/index.ts +7 -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/webhooks/processors.ts +2 -0
- package/src/component/_generated/api.ts +4 -0
- package/src/component/_generated/component.ts +78 -0
- package/src/component/schema.ts +2 -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
|
@@ -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;
|
|
@@ -1993,6 +1993,29 @@ 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
|
+
};
|
|
1996
2019
|
usageEvents: {
|
|
1997
2020
|
document: {
|
|
1998
2021
|
_creationTime: number;
|
|
@@ -4090,6 +4113,29 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
|
|
|
4090
4113
|
searchIndexes: {};
|
|
4091
4114
|
vectorIndexes: {};
|
|
4092
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
|
+
};
|
|
4093
4139
|
usageEvents: {
|
|
4094
4140
|
document: {
|
|
4095
4141
|
_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"}
|
|
@@ -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
|
-
status: "held";
|
|
167
|
-
reason: "snapshot_limit";
|
|
168
166
|
transfers?: undefined;
|
|
169
167
|
claims?: undefined;
|
|
168
|
+
status: "held";
|
|
169
|
+
reason: "snapshot_limit";
|
|
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
|
|
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,4 +1,26 @@
|
|
|
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
|
+
}, {}, {}>;
|
|
2
24
|
usageEvents: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
3
25
|
acceptedAt: number;
|
|
4
26
|
identity: string;
|
package/dist/component/schema.js
CHANGED
|
@@ -18,6 +18,7 @@ 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";
|
|
22
23
|
import { usageEventsTable, usageOutboxTable, usageScopeCountersTable, usageReservationsTable, } from "./usage/schema.js";
|
|
23
24
|
import { checkoutSessionsTable, invoicesTable, subscriptionsTable, } from "./billing/schema";
|
|
@@ -26,6 +27,7 @@ import { accountsTable } from "./core/schema";
|
|
|
26
27
|
import { pricesTable, productsTable } from "./products/schema";
|
|
27
28
|
import { webhookEventsTable } from "./webhooks/schema";
|
|
28
29
|
export default defineSchema({
|
|
30
|
+
usageCatalog: usageCatalogTable,
|
|
29
31
|
usageEvents: usageEventsTable,
|
|
30
32
|
usageOutbox: usageOutboxTable,
|
|
31
33
|
usageScopeCounters: usageScopeCountersTable,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/component/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,eAAe,IAAI,sCAAsC,EAAE,MAAM,0CAA0C,CAAC;AACrH,OAAO,EACL,eAAe,IAAI,0BAA0B,EAC7C,aAAa,IAAI,wBAAwB,GAC1C,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,iBAAiB,IAAI,0BAA0B,EAC/C,eAAe,IAAI,wBAAwB,EAC3C,aAAa,IAAI,sBAAsB,GACxC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,aAAa,IAAI,yBAAyB,EAC1C,YAAY,IAAI,wBAAwB,GACzC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAC;AAClG,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,uBAAuB,EACvB,eAAe,EACf,2BAA2B,GAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,cAAc,EACd,gBAAgB,GACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,SAAS,IAAI,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EACL,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,WAAW,IAAI,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC9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,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,25 @@
|
|
|
1
|
+
export declare const prepare: import("convex/server").RegisteredMutation<"public", {
|
|
2
|
+
key: string;
|
|
3
|
+
kind: "meter" | "price";
|
|
4
|
+
scopeKey: string;
|
|
5
|
+
termsJson: string;
|
|
6
|
+
}, Promise<{
|
|
7
|
+
_creationTime: number;
|
|
8
|
+
_id: import("convex/values").GenericId<"usageCatalog">;
|
|
9
|
+
firstAttemptAt: number;
|
|
10
|
+
key: string;
|
|
11
|
+
kind: "meter" | "price";
|
|
12
|
+
observationJson?: string | undefined;
|
|
13
|
+
observedAt?: number | undefined;
|
|
14
|
+
providerId?: string | undefined;
|
|
15
|
+
scopeKey: string;
|
|
16
|
+
termsJson: string;
|
|
17
|
+
}>>;
|
|
18
|
+
export declare const complete: import("convex/server").RegisteredMutation<"public", {
|
|
19
|
+
key: string;
|
|
20
|
+
kind: "meter" | "price";
|
|
21
|
+
observationJson: string;
|
|
22
|
+
providerId: string;
|
|
23
|
+
scopeKey: string;
|
|
24
|
+
}, Promise<null>>;
|
|
25
|
+
//# sourceMappingURL=mutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/component/usageCatalog/mutations.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;GA6BlB,CAAC;AACH,eAAO,MAAM,QAAQ;;;;;;iBAyCnB,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { v } from "convex/values";
|
|
2
|
+
import { mutation } from "../_generated/server.js";
|
|
3
|
+
import { doc, kind } from "./schema.js";
|
|
4
|
+
function bounded(value, max) {
|
|
5
|
+
if (!value || new TextEncoder().encode(value).length > max)
|
|
6
|
+
throw new Error("Invalid usage catalog size");
|
|
7
|
+
}
|
|
8
|
+
export const prepare = mutation({
|
|
9
|
+
args: { scopeKey: v.string(), kind, key: v.string(), termsJson: v.string() },
|
|
10
|
+
returns: doc,
|
|
11
|
+
handler: async (ctx, args) => {
|
|
12
|
+
bounded(args.scopeKey, 256);
|
|
13
|
+
bounded(args.key, 512);
|
|
14
|
+
bounded(args.termsJson, 8192);
|
|
15
|
+
const existing = await ctx.db
|
|
16
|
+
.query("usageCatalog")
|
|
17
|
+
.withIndex("by_scope_kind_key", (q) => q
|
|
18
|
+
.eq("scopeKey", args.scopeKey)
|
|
19
|
+
.eq("kind", args.kind)
|
|
20
|
+
.eq("key", args.key))
|
|
21
|
+
.unique();
|
|
22
|
+
if (existing) {
|
|
23
|
+
if (existing.termsJson !== args.termsJson)
|
|
24
|
+
throw new Error("Immutable usage catalog terms conflict");
|
|
25
|
+
return existing;
|
|
26
|
+
}
|
|
27
|
+
const id = await ctx.db.insert("usageCatalog", {
|
|
28
|
+
...args,
|
|
29
|
+
firstAttemptAt: Math.floor(Date.now() / 1000),
|
|
30
|
+
});
|
|
31
|
+
const result = await ctx.db.get("usageCatalog", id);
|
|
32
|
+
if (!result)
|
|
33
|
+
throw new Error("Usage catalog intent unavailable");
|
|
34
|
+
return result;
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
export const complete = mutation({
|
|
38
|
+
args: {
|
|
39
|
+
scopeKey: v.string(),
|
|
40
|
+
kind,
|
|
41
|
+
key: v.string(),
|
|
42
|
+
providerId: v.string(),
|
|
43
|
+
observationJson: v.string(),
|
|
44
|
+
},
|
|
45
|
+
returns: v.null(),
|
|
46
|
+
handler: async (ctx, args) => {
|
|
47
|
+
bounded(args.providerId, 100);
|
|
48
|
+
bounded(args.observationJson, 8192);
|
|
49
|
+
const row = await ctx.db
|
|
50
|
+
.query("usageCatalog")
|
|
51
|
+
.withIndex("by_scope_kind_key", (q) => q
|
|
52
|
+
.eq("scopeKey", args.scopeKey)
|
|
53
|
+
.eq("kind", args.kind)
|
|
54
|
+
.eq("key", args.key))
|
|
55
|
+
.unique();
|
|
56
|
+
if (!row || (row.providerId && row.providerId !== args.providerId))
|
|
57
|
+
throw new Error("Usage catalog reassignment rejected");
|
|
58
|
+
const existing = await ctx.db
|
|
59
|
+
.query("usageCatalog")
|
|
60
|
+
.withIndex("by_scope_kind_provider", (q) => q
|
|
61
|
+
.eq("scopeKey", args.scopeKey)
|
|
62
|
+
.eq("kind", args.kind)
|
|
63
|
+
.eq("providerId", args.providerId))
|
|
64
|
+
.unique();
|
|
65
|
+
if (existing && existing._id !== row._id)
|
|
66
|
+
throw new Error("Usage catalog ownership conflict");
|
|
67
|
+
await ctx.db.patch("usageCatalog", row._id, {
|
|
68
|
+
providerId: args.providerId,
|
|
69
|
+
observationJson: args.observationJson,
|
|
70
|
+
observedAt: Math.floor(Date.now() / 1000),
|
|
71
|
+
});
|
|
72
|
+
return null;
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=mutations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../../src/component/usageCatalog/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,SAAS,OAAO,CAAC,KAAa,EAAE,GAAW;IACzC,IAAI,CAAC,KAAK,IAAI,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,GAAG;QACxD,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;AAClD,CAAC;AACD,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;IAC9B,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE;IAC5E,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC3B,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QAC5B,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACvB,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC9B,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,EAAE;aAC1B,KAAK,CAAC,cAAc,CAAC;aACrB,SAAS,CAAC,mBAAmB,EAAE,CAAC,CAAC,EAAE,EAAE,CACp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AG,IAAI,CAAC;SAC1C,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const get: import("convex/server").RegisteredQuery<"public", {
|
|
2
|
+
key: string;
|
|
3
|
+
kind: "meter" | "price";
|
|
4
|
+
scopeKey: string;
|
|
5
|
+
}, Promise<{
|
|
6
|
+
_creationTime: number;
|
|
7
|
+
_id: import("convex/values").GenericId<"usageCatalog">;
|
|
8
|
+
firstAttemptAt: number;
|
|
9
|
+
key: string;
|
|
10
|
+
kind: "meter" | "price";
|
|
11
|
+
observationJson?: string | undefined;
|
|
12
|
+
observedAt?: number | undefined;
|
|
13
|
+
providerId?: string | undefined;
|
|
14
|
+
scopeKey: string;
|
|
15
|
+
termsJson: string;
|
|
16
|
+
} | null>>;
|
|
17
|
+
export declare const getByProvider: import("convex/server").RegisteredQuery<"public", {
|
|
18
|
+
kind: "meter" | "price";
|
|
19
|
+
providerId: string;
|
|
20
|
+
scopeKey: string;
|
|
21
|
+
}, Promise<{
|
|
22
|
+
_creationTime: number;
|
|
23
|
+
_id: import("convex/values").GenericId<"usageCatalog">;
|
|
24
|
+
firstAttemptAt: number;
|
|
25
|
+
key: string;
|
|
26
|
+
kind: "meter" | "price";
|
|
27
|
+
observationJson?: string | undefined;
|
|
28
|
+
observedAt?: number | undefined;
|
|
29
|
+
providerId?: string | undefined;
|
|
30
|
+
scopeKey: string;
|
|
31
|
+
termsJson: string;
|
|
32
|
+
} | null>>;
|
|
33
|
+
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/component/usageCatalog/queries.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;UAad,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;UAaxB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { v } from "convex/values";
|
|
2
|
+
import { query } from "../_generated/server.js";
|
|
3
|
+
import { kind, doc } from "./schema.js";
|
|
4
|
+
export const get = query({
|
|
5
|
+
args: { scopeKey: v.string(), kind, key: v.string() },
|
|
6
|
+
returns: v.union(doc, v.null()),
|
|
7
|
+
handler: async (ctx, args) => ctx.db
|
|
8
|
+
.query("usageCatalog")
|
|
9
|
+
.withIndex("by_scope_kind_key", (q) => q
|
|
10
|
+
.eq("scopeKey", args.scopeKey)
|
|
11
|
+
.eq("kind", args.kind)
|
|
12
|
+
.eq("key", args.key))
|
|
13
|
+
.unique(),
|
|
14
|
+
});
|
|
15
|
+
export const getByProvider = query({
|
|
16
|
+
args: { scopeKey: v.string(), kind, providerId: v.string() },
|
|
17
|
+
returns: v.union(doc, v.null()),
|
|
18
|
+
handler: async (ctx, args) => ctx.db
|
|
19
|
+
.query("usageCatalog")
|
|
20
|
+
.withIndex("by_scope_kind_provider", (q) => q
|
|
21
|
+
.eq("scopeKey", args.scopeKey)
|
|
22
|
+
.eq("kind", args.kind)
|
|
23
|
+
.eq("providerId", args.providerId))
|
|
24
|
+
.unique(),
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../../src/component/usageCatalog/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AACxC,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,CAAC;IACvB,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE;IACrD,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/B,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CAC3B,GAAG,CAAC,EAAE;SACH,KAAK,CAAC,cAAc,CAAC;SACrB,SAAS,CAAC,mBAAmB,EAAE,CAAC,CAAC,EAAE,EAAE,CACpC,CAAC;SACE,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC;SAC7B,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC;SACrB,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CACvB;SACA,MAAM,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC;IACjC,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE;IAC5D,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/B,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CAC3B,GAAG,CAAC,EAAE;SACH,KAAK,CAAC,cAAc,CAAC;SACrB,SAAS,CAAC,wBAAwB,EAAE,CAAC,CAAC,EAAE,EAAE,CACzC,CAAC;SACE,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC;SAC7B,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC;SACrB,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CACrC;SACA,MAAM,EAAE;CACd,CAAC,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const kind: import("convex/values").VUnion<"meter" | "price", [import("convex/values").VLiteral<"meter", "required">, import("convex/values").VLiteral<"price", "required">], "required", never>;
|
|
2
|
+
export declare const fields: {
|
|
3
|
+
observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
4
|
+
scopeKey: import("convex/values").VString<string, "required">;
|
|
5
|
+
kind: import("convex/values").VUnion<"meter" | "price", [import("convex/values").VLiteral<"meter", "required">, import("convex/values").VLiteral<"price", "required">], "required", never>;
|
|
6
|
+
key: import("convex/values").VString<string, "required">;
|
|
7
|
+
termsJson: import("convex/values").VString<string, "required">;
|
|
8
|
+
firstAttemptAt: import("convex/values").VFloat64<number, "required">;
|
|
9
|
+
providerId: import("convex/values").VString<string | undefined, "optional">;
|
|
10
|
+
observationJson: import("convex/values").VString<string | undefined, "optional">;
|
|
11
|
+
};
|
|
12
|
+
export declare const doc: import("convex/values").VObject<{
|
|
13
|
+
_creationTime: number;
|
|
14
|
+
_id: import("convex/values").GenericId<"usageCatalog">;
|
|
15
|
+
firstAttemptAt: number;
|
|
16
|
+
key: string;
|
|
17
|
+
kind: "meter" | "price";
|
|
18
|
+
observationJson?: string | undefined;
|
|
19
|
+
observedAt?: number | undefined;
|
|
20
|
+
providerId?: string | undefined;
|
|
21
|
+
scopeKey: string;
|
|
22
|
+
termsJson: string;
|
|
23
|
+
}, {
|
|
24
|
+
observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
25
|
+
scopeKey: import("convex/values").VString<string, "required">;
|
|
26
|
+
kind: import("convex/values").VUnion<"meter" | "price", [import("convex/values").VLiteral<"meter", "required">, import("convex/values").VLiteral<"price", "required">], "required", never>;
|
|
27
|
+
key: import("convex/values").VString<string, "required">;
|
|
28
|
+
termsJson: import("convex/values").VString<string, "required">;
|
|
29
|
+
firstAttemptAt: import("convex/values").VFloat64<number, "required">;
|
|
30
|
+
providerId: import("convex/values").VString<string | undefined, "optional">;
|
|
31
|
+
observationJson: import("convex/values").VString<string | undefined, "optional">;
|
|
32
|
+
_id: import("convex/values").VId<import("convex/values").GenericId<"usageCatalog">, "required">;
|
|
33
|
+
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
34
|
+
}, "required", "_creationTime" | "_id" | "firstAttemptAt" | "key" | "kind" | "observationJson" | "observedAt" | "providerId" | "scopeKey" | "termsJson">;
|
|
35
|
+
export declare const usageCatalogTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
36
|
+
firstAttemptAt: number;
|
|
37
|
+
key: string;
|
|
38
|
+
kind: "meter" | "price";
|
|
39
|
+
observationJson?: string | undefined;
|
|
40
|
+
observedAt?: number | undefined;
|
|
41
|
+
providerId?: string | undefined;
|
|
42
|
+
scopeKey: string;
|
|
43
|
+
termsJson: string;
|
|
44
|
+
}, {
|
|
45
|
+
observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
46
|
+
scopeKey: import("convex/values").VString<string, "required">;
|
|
47
|
+
kind: import("convex/values").VUnion<"meter" | "price", [import("convex/values").VLiteral<"meter", "required">, import("convex/values").VLiteral<"price", "required">], "required", never>;
|
|
48
|
+
key: import("convex/values").VString<string, "required">;
|
|
49
|
+
termsJson: import("convex/values").VString<string, "required">;
|
|
50
|
+
firstAttemptAt: import("convex/values").VFloat64<number, "required">;
|
|
51
|
+
providerId: import("convex/values").VString<string | undefined, "optional">;
|
|
52
|
+
observationJson: import("convex/values").VString<string | undefined, "optional">;
|
|
53
|
+
}, "required", "firstAttemptAt" | "key" | "kind" | "observationJson" | "observedAt" | "providerId" | "scopeKey" | "termsJson">, {
|
|
54
|
+
by_scope_kind_key: ["scopeKey", "kind", "key", "_creationTime"];
|
|
55
|
+
by_scope_kind_provider: ["scopeKey", "kind", "providerId", "_creationTime"];
|
|
56
|
+
}, {}, {}>;
|
|
57
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/component/usageCatalog/schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,sLAAkD,CAAC;AACpE,eAAO,MAAM,MAAM;;;;;;;;;CASlB,CAAC;AACF,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;wJAId,CAAC;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;UAEwC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineTable } from "convex/server";
|
|
2
|
+
import { v } from "convex/values";
|
|
3
|
+
export const kind = v.union(v.literal("meter"), v.literal("price"));
|
|
4
|
+
export const fields = {
|
|
5
|
+
observedAt: v.optional(v.number()),
|
|
6
|
+
scopeKey: v.string(),
|
|
7
|
+
kind,
|
|
8
|
+
key: v.string(),
|
|
9
|
+
termsJson: v.string(),
|
|
10
|
+
firstAttemptAt: v.number(),
|
|
11
|
+
providerId: v.optional(v.string()),
|
|
12
|
+
observationJson: v.optional(v.string()),
|
|
13
|
+
};
|
|
14
|
+
export const doc = v.object({
|
|
15
|
+
_id: v.id("usageCatalog"),
|
|
16
|
+
_creationTime: v.number(),
|
|
17
|
+
...fields,
|
|
18
|
+
});
|
|
19
|
+
export const usageCatalogTable = defineTable(fields)
|
|
20
|
+
.index("by_scope_kind_key", ["scopeKey", "kind", "key"])
|
|
21
|
+
.index("by_scope_kind_provider", ["scopeKey", "kind", "providerId"]);
|
|
22
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/component/usageCatalog/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AACpE,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,IAAI;IACJ,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,eAAe,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CACxC,CAAC;AACF,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1B,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC;IACzB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,GAAG,MAAM;CACV,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC,MAAM,CAAC;KACjD,KAAK,CAAC,mBAAmB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;KACvD,KAAK,CAAC,wBAAwB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC"}
|
package/docs/README.md
CHANGED
|
@@ -24,7 +24,7 @@ guide for your integration.
|
|
|
24
24
|
- [SetupIntent recovery](setup-intent-recovery.md).
|
|
25
25
|
- [Balance funding state](balance-funding-state.md) and [workflow](balance-funding-workflow.md).
|
|
26
26
|
- [Example balance funding cutover](example-balance-funding-cutover.md).
|
|
27
|
-
- [Metered usage investigation](metered-usage.md), provider comparison and acceptance requirements.
|
|
27
|
+
- [Metered usage investigation](metered-usage.md), provider comparison and acceptance requirements. Shared contracts, catalog provisioning and local usage acceptance are available; delivery and credit accounting are in progress.
|
|
28
28
|
|
|
29
29
|
## Marketplace, settlement, and recovery
|
|
30
30
|
|
|
@@ -58,3 +58,5 @@ Start with the [native Stripe setup guide](metering-setup.md), then read the
|
|
|
58
58
|
[shared contracts and sandbox evidence](metered-usage.md).
|
|
59
59
|
|
|
60
60
|
[Atomic usage ledger and scoped history](usage-ledger.md) describes acceptance and retention.
|
|
61
|
+
|
|
62
|
+
[Native usage catalog](usage-catalog.md) covers provisioning, immutable versions and typed price observations.
|
package/docs/metering-setup.md
CHANGED
|
@@ -182,3 +182,5 @@ Primary references:
|
|
|
182
182
|
- [Stripe meter event API](https://docs.stripe.com/api/billing/meter-event/create)
|
|
183
183
|
- [Stripe billing credits](https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits)
|
|
184
184
|
- [Metronome quickstart](https://docs.metronome.com/guides/get-started/api-quickstart)
|
|
185
|
+
|
|
186
|
+
Use the [native catalog guide](usage-catalog.md) to provision versioned meters and prices through BetterStripe.
|