@fantastic.dev/better-stripe 0.57.0 → 0.58.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 +3 -1
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +122 -36
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts +45 -2
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +122 -36
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutSyncTestHelpers.d.ts +45 -2
- package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
- package/dist/client/usage/allowanceClient.d.ts +51 -0
- package/dist/client/usage/allowanceClient.d.ts.map +1 -0
- package/dist/client/usage/allowanceClient.js +64 -0
- package/dist/client/usage/allowanceClient.js.map +1 -0
- package/dist/client/usage/allowanceTerms.d.ts +64 -0
- package/dist/client/usage/allowanceTerms.d.ts.map +1 -0
- package/dist/client/usage/allowanceTerms.js +101 -0
- package/dist/client/usage/allowanceTerms.js.map +1 -0
- package/dist/client/usage/client.d.ts +2 -2
- package/dist/client/usage/client.d.ts.map +1 -1
- package/dist/client/usage/client.js +2 -2
- package/dist/client/usage/client.js.map +1 -1
- package/dist/client/usage/index.d.ts +2 -0
- package/dist/client/usage/index.d.ts.map +1 -1
- package/dist/client/usageExports.d.ts +2 -0
- package/dist/client/usageExports.d.ts.map +1 -1
- package/dist/component/_generated/api.d.ts +8 -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 +70 -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 +16 -16
- package/dist/component/balanceFunding/stateHandlers.d.ts +8 -8
- package/dist/component/balanceFunding/workflowValidators.d.ts +16 -16
- package/dist/component/earnings/triggers.d.ts +110 -18
- package/dist/component/earnings/triggers.d.ts.map +1 -1
- package/dist/component/schema.d.ts +45 -2
- package/dist/component/schema.js +3 -0
- package/dist/component/schema.js.map +1 -1
- package/dist/component/usage/mutations.d.ts.map +1 -1
- package/dist/component/usage/mutations.js +4 -0
- package/dist/component/usage/mutations.js.map +1 -1
- package/dist/component/usage/schema.d.ts +3 -2
- package/dist/component/usage/schema.d.ts.map +1 -1
- package/dist/component/usage/schema.js +2 -1
- package/dist/component/usage/schema.js.map +1 -1
- package/dist/component/usageAllowance/helpers.d.ts +78 -0
- package/dist/component/usageAllowance/helpers.d.ts.map +1 -0
- package/dist/component/usageAllowance/helpers.js +99 -0
- package/dist/component/usageAllowance/helpers.js.map +1 -0
- package/dist/component/usageAllowance/mutations.d.ts +37 -0
- package/dist/component/usageAllowance/mutations.d.ts.map +1 -0
- package/dist/component/usageAllowance/mutations.js +99 -0
- package/dist/component/usageAllowance/mutations.js.map +1 -0
- package/dist/component/usageAllowance/queries.d.ts +36 -0
- package/dist/component/usageAllowance/queries.d.ts.map +1 -0
- package/dist/component/usageAllowance/queries.js +113 -0
- package/dist/component/usageAllowance/queries.js.map +1 -0
- package/dist/component/usageAllowance/reservations.d.ts +25 -0
- package/dist/component/usageAllowance/reservations.d.ts.map +1 -0
- package/dist/component/usageAllowance/reservations.js +150 -0
- package/dist/component/usageAllowance/reservations.js.map +1 -0
- package/dist/component/usageAllowance/schema.d.ts +77 -0
- package/dist/component/usageAllowance/schema.d.ts.map +1 -0
- package/dist/component/usageAllowance/schema.js +32 -0
- package/dist/component/usageAllowance/schema.js.map +1 -0
- package/docs/README.md +2 -0
- package/docs/usage-limits.md +217 -0
- package/package.json +2 -1
- package/src/client/usage/allowanceClient.test.ts +93 -0
- package/src/client/usage/allowanceClient.ts +134 -0
- package/src/client/usage/allowanceTerms.test.ts +131 -0
- package/src/client/usage/allowanceTerms.ts +172 -0
- package/src/client/usage/client.ts +2 -2
- package/src/client/usage/index.ts +8 -0
- package/src/client/usageExports.ts +8 -0
- package/src/component/_generated/api.ts +8 -0
- package/src/component/_generated/component.ts +94 -0
- package/src/component/schema.ts +6 -0
- package/src/component/usage/allowance.test.ts +435 -0
- package/src/component/usage/mutations.ts +13 -0
- package/src/component/usage/schema.ts +4 -1
- package/src/component/usageAllowance/helpers.ts +137 -0
- package/src/component/usageAllowance/mutations.ts +139 -0
- package/src/component/usageAllowance/queries.ts +133 -0
- package/src/component/usageAllowance/reservations.ts +220 -0
- package/src/component/usageAllowance/schema.ts +36 -0
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
export declare function large(count?: number, amount?: number): Promise<{
|
|
2
2
|
t: import("convex-test").TestConvex<import("convex/server").SchemaDefinition<{
|
|
3
|
+
usageAllowancePolicies: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
4
|
+
bindingJson: string;
|
|
5
|
+
consumed: string;
|
|
6
|
+
end: number;
|
|
7
|
+
historyCount: number;
|
|
8
|
+
key: string;
|
|
9
|
+
nativeKey: string;
|
|
10
|
+
policyJson: string;
|
|
11
|
+
reserved: string;
|
|
12
|
+
revision: number;
|
|
13
|
+
scopeKey: string;
|
|
14
|
+
start: number;
|
|
15
|
+
}, {
|
|
16
|
+
key: import("convex/values").VString<string, "required">;
|
|
17
|
+
nativeKey: import("convex/values").VString<string, "required">;
|
|
18
|
+
scopeKey: import("convex/values").VString<string, "required">;
|
|
19
|
+
bindingJson: import("convex/values").VString<string, "required">;
|
|
20
|
+
start: import("convex/values").VFloat64<number, "required">;
|
|
21
|
+
end: import("convex/values").VFloat64<number, "required">;
|
|
22
|
+
policyJson: import("convex/values").VString<string, "required">;
|
|
23
|
+
revision: import("convex/values").VFloat64<number, "required">;
|
|
24
|
+
consumed: import("convex/values").VString<string, "required">;
|
|
25
|
+
reserved: import("convex/values").VString<string, "required">;
|
|
26
|
+
historyCount: import("convex/values").VFloat64<number, "required">;
|
|
27
|
+
}, "required", "bindingJson" | "consumed" | "end" | "historyCount" | "key" | "nativeKey" | "policyJson" | "reserved" | "revision" | "scopeKey" | "start">, {
|
|
28
|
+
by_key: ["key", "_creationTime"];
|
|
29
|
+
by_native_start: ["nativeKey", "start", "_creationTime"];
|
|
30
|
+
by_scope_start: ["scopeKey", "start", "_creationTime"];
|
|
31
|
+
}, {}, {}>;
|
|
32
|
+
usageAllowanceHistory: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
33
|
+
at: number;
|
|
34
|
+
evidenceJson: string;
|
|
35
|
+
key: string;
|
|
36
|
+
kind: "commit" | "policy" | "release" | "reservation";
|
|
37
|
+
}, {
|
|
38
|
+
key: import("convex/values").VString<string, "required">;
|
|
39
|
+
kind: import("convex/values").VUnion<"commit" | "policy" | "release" | "reservation", [import("convex/values").VLiteral<"policy", "required">, import("convex/values").VLiteral<"reservation", "required">, import("convex/values").VLiteral<"commit", "required">, import("convex/values").VLiteral<"release", "required">], "required", never>;
|
|
40
|
+
evidenceJson: import("convex/values").VString<string, "required">;
|
|
41
|
+
at: import("convex/values").VFloat64<number, "required">;
|
|
42
|
+
}, "required", "at" | "evidenceJson" | "key" | "kind">, {
|
|
43
|
+
by_key: ["key", "_creationTime"];
|
|
44
|
+
}, {}, {}>;
|
|
3
45
|
usageSubscriptionControls: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
4
46
|
cancelAtPeriodEnd: boolean;
|
|
5
47
|
firstAttemptAt: number;
|
|
@@ -259,7 +301,7 @@ export declare function large(count?: number, amount?: number): Promise<{
|
|
|
259
301
|
}, {}, {}>;
|
|
260
302
|
usageReservations: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
261
303
|
accountKey?: string | undefined;
|
|
262
|
-
accountingKind?: "prepaid" | undefined;
|
|
304
|
+
accountingKind?: "allowance" | "prepaid" | undefined;
|
|
263
305
|
allocationsJson?: string | undefined;
|
|
264
306
|
eventId?: import("convex/values").GenericId<"usageEvents"> | undefined;
|
|
265
307
|
inputJson?: string | undefined;
|
|
@@ -277,13 +319,14 @@ export declare function large(count?: number, amount?: number): Promise<{
|
|
|
277
319
|
scaledQuantity: import("convex/values").VString<string, "required">;
|
|
278
320
|
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>;
|
|
279
321
|
eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents"> | undefined, "optional">;
|
|
280
|
-
accountingKind: import("convex/values").
|
|
322
|
+
accountingKind: import("convex/values").VUnion<"allowance" | "prepaid" | undefined, [import("convex/values").VLiteral<"prepaid", "required">, import("convex/values").VLiteral<"allowance", "required">], "optional", never>;
|
|
281
323
|
accountKey: import("convex/values").VString<string | undefined, "optional">;
|
|
282
324
|
inputJson: import("convex/values").VString<string | undefined, "optional">;
|
|
283
325
|
subscriptionJson: import("convex/values").VString<string | undefined, "optional">;
|
|
284
326
|
allocationsJson: import("convex/values").VString<string | undefined, "optional">;
|
|
285
327
|
releaseReason: import("convex/values").VString<string | undefined, "optional">;
|
|
286
328
|
}, "required", "accountKey" | "accountingKind" | "allocationsJson" | "eventId" | "inputJson" | "planJson" | "releaseReason" | "scaledQuantity" | "scopeKey" | "sourceEventId" | "state" | "subscriptionJson">, {
|
|
329
|
+
by_account_state: ["accountKey", "state", "_creationTime"];
|
|
287
330
|
by_scope_source: ["scopeKey", "sourceEventId", "_creationTime"];
|
|
288
331
|
by_scope_state: ["scopeKey", "state", "_creationTime"];
|
|
289
332
|
}, {}, {}>;
|
|
@@ -1473,14 +1516,6 @@ export declare function large(count?: number, amount?: number): Promise<{
|
|
|
1473
1516
|
preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
|
|
1474
1517
|
requestKey: string;
|
|
1475
1518
|
result?: {
|
|
1476
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
1477
|
-
retryable: false;
|
|
1478
|
-
status: "conflict";
|
|
1479
|
-
} | {
|
|
1480
|
-
reason: "policy_invalid";
|
|
1481
|
-
retryable: false;
|
|
1482
|
-
status: "rejected";
|
|
1483
|
-
} | {
|
|
1484
1519
|
operation: {
|
|
1485
1520
|
accountId: string;
|
|
1486
1521
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -1491,6 +1526,14 @@ export declare function large(count?: number, amount?: number): Promise<{
|
|
|
1491
1526
|
} | {
|
|
1492
1527
|
enabled: boolean;
|
|
1493
1528
|
status: "unchanged";
|
|
1529
|
+
} | {
|
|
1530
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
1531
|
+
retryable: false;
|
|
1532
|
+
status: "conflict";
|
|
1533
|
+
} | {
|
|
1534
|
+
reason: "policy_invalid";
|
|
1535
|
+
retryable: false;
|
|
1536
|
+
status: "rejected";
|
|
1494
1537
|
} | {
|
|
1495
1538
|
reason: "provider_pending";
|
|
1496
1539
|
retryable: true;
|
|
@@ -1501,14 +1544,6 @@ export declare function large(count?: number, amount?: number): Promise<{
|
|
|
1501
1544
|
payload: import("convex/values").VString<string, "required">;
|
|
1502
1545
|
preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
|
|
1503
1546
|
result: import("convex/values").VUnion<{
|
|
1504
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
1505
|
-
retryable: false;
|
|
1506
|
-
status: "conflict";
|
|
1507
|
-
} | {
|
|
1508
|
-
reason: "policy_invalid";
|
|
1509
|
-
retryable: false;
|
|
1510
|
-
status: "rejected";
|
|
1511
|
-
} | {
|
|
1512
1547
|
operation: {
|
|
1513
1548
|
accountId: string;
|
|
1514
1549
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -1519,6 +1554,14 @@ export declare function large(count?: number, amount?: number): Promise<{
|
|
|
1519
1554
|
} | {
|
|
1520
1555
|
enabled: boolean;
|
|
1521
1556
|
status: "unchanged";
|
|
1557
|
+
} | {
|
|
1558
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
1559
|
+
retryable: false;
|
|
1560
|
+
status: "conflict";
|
|
1561
|
+
} | {
|
|
1562
|
+
reason: "policy_invalid";
|
|
1563
|
+
retryable: false;
|
|
1564
|
+
status: "rejected";
|
|
1522
1565
|
} | {
|
|
1523
1566
|
reason: "provider_pending";
|
|
1524
1567
|
retryable: true;
|
|
@@ -3821,6 +3864,48 @@ export declare function large(count?: number, amount?: number): Promise<{
|
|
|
3821
3864
|
export declare function withHistory(count?: number, amount?: number): Promise<{
|
|
3822
3865
|
s: {
|
|
3823
3866
|
t: import("convex-test").TestConvex<import("convex/server").SchemaDefinition<{
|
|
3867
|
+
usageAllowancePolicies: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
3868
|
+
bindingJson: string;
|
|
3869
|
+
consumed: string;
|
|
3870
|
+
end: number;
|
|
3871
|
+
historyCount: number;
|
|
3872
|
+
key: string;
|
|
3873
|
+
nativeKey: string;
|
|
3874
|
+
policyJson: string;
|
|
3875
|
+
reserved: string;
|
|
3876
|
+
revision: number;
|
|
3877
|
+
scopeKey: string;
|
|
3878
|
+
start: number;
|
|
3879
|
+
}, {
|
|
3880
|
+
key: import("convex/values").VString<string, "required">;
|
|
3881
|
+
nativeKey: import("convex/values").VString<string, "required">;
|
|
3882
|
+
scopeKey: import("convex/values").VString<string, "required">;
|
|
3883
|
+
bindingJson: import("convex/values").VString<string, "required">;
|
|
3884
|
+
start: import("convex/values").VFloat64<number, "required">;
|
|
3885
|
+
end: import("convex/values").VFloat64<number, "required">;
|
|
3886
|
+
policyJson: import("convex/values").VString<string, "required">;
|
|
3887
|
+
revision: import("convex/values").VFloat64<number, "required">;
|
|
3888
|
+
consumed: import("convex/values").VString<string, "required">;
|
|
3889
|
+
reserved: import("convex/values").VString<string, "required">;
|
|
3890
|
+
historyCount: import("convex/values").VFloat64<number, "required">;
|
|
3891
|
+
}, "required", "bindingJson" | "consumed" | "end" | "historyCount" | "key" | "nativeKey" | "policyJson" | "reserved" | "revision" | "scopeKey" | "start">, {
|
|
3892
|
+
by_key: ["key", "_creationTime"];
|
|
3893
|
+
by_native_start: ["nativeKey", "start", "_creationTime"];
|
|
3894
|
+
by_scope_start: ["scopeKey", "start", "_creationTime"];
|
|
3895
|
+
}, {}, {}>;
|
|
3896
|
+
usageAllowanceHistory: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
3897
|
+
at: number;
|
|
3898
|
+
evidenceJson: string;
|
|
3899
|
+
key: string;
|
|
3900
|
+
kind: "commit" | "policy" | "release" | "reservation";
|
|
3901
|
+
}, {
|
|
3902
|
+
key: import("convex/values").VString<string, "required">;
|
|
3903
|
+
kind: import("convex/values").VUnion<"commit" | "policy" | "release" | "reservation", [import("convex/values").VLiteral<"policy", "required">, import("convex/values").VLiteral<"reservation", "required">, import("convex/values").VLiteral<"commit", "required">, import("convex/values").VLiteral<"release", "required">], "required", never>;
|
|
3904
|
+
evidenceJson: import("convex/values").VString<string, "required">;
|
|
3905
|
+
at: import("convex/values").VFloat64<number, "required">;
|
|
3906
|
+
}, "required", "at" | "evidenceJson" | "key" | "kind">, {
|
|
3907
|
+
by_key: ["key", "_creationTime"];
|
|
3908
|
+
}, {}, {}>;
|
|
3824
3909
|
usageSubscriptionControls: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
3825
3910
|
cancelAtPeriodEnd: boolean;
|
|
3826
3911
|
firstAttemptAt: number;
|
|
@@ -4080,7 +4165,7 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
|
|
|
4080
4165
|
}, {}, {}>;
|
|
4081
4166
|
usageReservations: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
4082
4167
|
accountKey?: string | undefined;
|
|
4083
|
-
accountingKind?: "prepaid" | undefined;
|
|
4168
|
+
accountingKind?: "allowance" | "prepaid" | undefined;
|
|
4084
4169
|
allocationsJson?: string | undefined;
|
|
4085
4170
|
eventId?: import("convex/values").GenericId<"usageEvents"> | undefined;
|
|
4086
4171
|
inputJson?: string | undefined;
|
|
@@ -4098,13 +4183,14 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
|
|
|
4098
4183
|
scaledQuantity: import("convex/values").VString<string, "required">;
|
|
4099
4184
|
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>;
|
|
4100
4185
|
eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents"> | undefined, "optional">;
|
|
4101
|
-
accountingKind: import("convex/values").
|
|
4186
|
+
accountingKind: import("convex/values").VUnion<"allowance" | "prepaid" | undefined, [import("convex/values").VLiteral<"prepaid", "required">, import("convex/values").VLiteral<"allowance", "required">], "optional", never>;
|
|
4102
4187
|
accountKey: import("convex/values").VString<string | undefined, "optional">;
|
|
4103
4188
|
inputJson: import("convex/values").VString<string | undefined, "optional">;
|
|
4104
4189
|
subscriptionJson: import("convex/values").VString<string | undefined, "optional">;
|
|
4105
4190
|
allocationsJson: import("convex/values").VString<string | undefined, "optional">;
|
|
4106
4191
|
releaseReason: import("convex/values").VString<string | undefined, "optional">;
|
|
4107
4192
|
}, "required", "accountKey" | "accountingKind" | "allocationsJson" | "eventId" | "inputJson" | "planJson" | "releaseReason" | "scaledQuantity" | "scopeKey" | "sourceEventId" | "state" | "subscriptionJson">, {
|
|
4193
|
+
by_account_state: ["accountKey", "state", "_creationTime"];
|
|
4108
4194
|
by_scope_source: ["scopeKey", "sourceEventId", "_creationTime"];
|
|
4109
4195
|
by_scope_state: ["scopeKey", "state", "_creationTime"];
|
|
4110
4196
|
}, {}, {}>;
|
|
@@ -5294,14 +5380,6 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
|
|
|
5294
5380
|
preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
|
|
5295
5381
|
requestKey: string;
|
|
5296
5382
|
result?: {
|
|
5297
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
5298
|
-
retryable: false;
|
|
5299
|
-
status: "conflict";
|
|
5300
|
-
} | {
|
|
5301
|
-
reason: "policy_invalid";
|
|
5302
|
-
retryable: false;
|
|
5303
|
-
status: "rejected";
|
|
5304
|
-
} | {
|
|
5305
5383
|
operation: {
|
|
5306
5384
|
accountId: string;
|
|
5307
5385
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -5312,6 +5390,14 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
|
|
|
5312
5390
|
} | {
|
|
5313
5391
|
enabled: boolean;
|
|
5314
5392
|
status: "unchanged";
|
|
5393
|
+
} | {
|
|
5394
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
5395
|
+
retryable: false;
|
|
5396
|
+
status: "conflict";
|
|
5397
|
+
} | {
|
|
5398
|
+
reason: "policy_invalid";
|
|
5399
|
+
retryable: false;
|
|
5400
|
+
status: "rejected";
|
|
5315
5401
|
} | {
|
|
5316
5402
|
reason: "provider_pending";
|
|
5317
5403
|
retryable: true;
|
|
@@ -5322,14 +5408,6 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
|
|
|
5322
5408
|
payload: import("convex/values").VString<string, "required">;
|
|
5323
5409
|
preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
|
|
5324
5410
|
result: import("convex/values").VUnion<{
|
|
5325
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
5326
|
-
retryable: false;
|
|
5327
|
-
status: "conflict";
|
|
5328
|
-
} | {
|
|
5329
|
-
reason: "policy_invalid";
|
|
5330
|
-
retryable: false;
|
|
5331
|
-
status: "rejected";
|
|
5332
|
-
} | {
|
|
5333
5411
|
operation: {
|
|
5334
5412
|
accountId: string;
|
|
5335
5413
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -5340,6 +5418,14 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
|
|
|
5340
5418
|
} | {
|
|
5341
5419
|
enabled: boolean;
|
|
5342
5420
|
status: "unchanged";
|
|
5421
|
+
} | {
|
|
5422
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
5423
|
+
retryable: false;
|
|
5424
|
+
status: "conflict";
|
|
5425
|
+
} | {
|
|
5426
|
+
reason: "policy_invalid";
|
|
5427
|
+
retryable: false;
|
|
5428
|
+
status: "rejected";
|
|
5343
5429
|
} | {
|
|
5344
5430
|
reason: "provider_pending";
|
|
5345
5431
|
retryable: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payoutLargeAdoptionTestHelpers.d.ts","sourceRoot":"","sources":["../../../src/client/connect/payoutLargeAdoptionTestHelpers.ts"],"names":[],"mappings":"AAGA,wBAAsB,KAAK,CAAC,KAAK,SAAM,EAAE,MAAM,SAAK
|
|
1
|
+
{"version":3,"file":"payoutLargeAdoptionTestHelpers.d.ts","sourceRoot":"","sources":["../../../src/client/connect/payoutLargeAdoptionTestHelpers.ts"],"names":[],"mappings":"AAGA,wBAAsB,KAAK,CAAC,KAAK,SAAM,EAAE,MAAM,SAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAGtC,MAAM;yBACT;gBAAE,gBAAgB,EAAE,MAAM,CAAC;gBAAC,MAAM,EAAE,MAAM,CAAA;aAAE,EAAE;;;GA2C9D"}
|
|
@@ -14,6 +14,48 @@ type Sync = (stripe: Stripe, component: Component, ctx: RunCtx, opts: {
|
|
|
14
14
|
export declare function operation(): Promise<Sync>;
|
|
15
15
|
export declare function setup(scope?: Scope): Promise<{
|
|
16
16
|
t: import("convex-test").TestConvex<import("convex/server").SchemaDefinition<{
|
|
17
|
+
usageAllowancePolicies: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
18
|
+
bindingJson: string;
|
|
19
|
+
consumed: string;
|
|
20
|
+
end: number;
|
|
21
|
+
historyCount: number;
|
|
22
|
+
key: string;
|
|
23
|
+
nativeKey: string;
|
|
24
|
+
policyJson: string;
|
|
25
|
+
reserved: string;
|
|
26
|
+
revision: number;
|
|
27
|
+
scopeKey: string;
|
|
28
|
+
start: number;
|
|
29
|
+
}, {
|
|
30
|
+
key: import("convex/values").VString<string, "required">;
|
|
31
|
+
nativeKey: import("convex/values").VString<string, "required">;
|
|
32
|
+
scopeKey: import("convex/values").VString<string, "required">;
|
|
33
|
+
bindingJson: import("convex/values").VString<string, "required">;
|
|
34
|
+
start: import("convex/values").VFloat64<number, "required">;
|
|
35
|
+
end: import("convex/values").VFloat64<number, "required">;
|
|
36
|
+
policyJson: import("convex/values").VString<string, "required">;
|
|
37
|
+
revision: import("convex/values").VFloat64<number, "required">;
|
|
38
|
+
consumed: import("convex/values").VString<string, "required">;
|
|
39
|
+
reserved: import("convex/values").VString<string, "required">;
|
|
40
|
+
historyCount: import("convex/values").VFloat64<number, "required">;
|
|
41
|
+
}, "required", "bindingJson" | "consumed" | "end" | "historyCount" | "key" | "nativeKey" | "policyJson" | "reserved" | "revision" | "scopeKey" | "start">, {
|
|
42
|
+
by_key: ["key", "_creationTime"];
|
|
43
|
+
by_native_start: ["nativeKey", "start", "_creationTime"];
|
|
44
|
+
by_scope_start: ["scopeKey", "start", "_creationTime"];
|
|
45
|
+
}, {}, {}>;
|
|
46
|
+
usageAllowanceHistory: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
47
|
+
at: number;
|
|
48
|
+
evidenceJson: string;
|
|
49
|
+
key: string;
|
|
50
|
+
kind: "commit" | "policy" | "release" | "reservation";
|
|
51
|
+
}, {
|
|
52
|
+
key: import("convex/values").VString<string, "required">;
|
|
53
|
+
kind: import("convex/values").VUnion<"commit" | "policy" | "release" | "reservation", [import("convex/values").VLiteral<"policy", "required">, import("convex/values").VLiteral<"reservation", "required">, import("convex/values").VLiteral<"commit", "required">, import("convex/values").VLiteral<"release", "required">], "required", never>;
|
|
54
|
+
evidenceJson: import("convex/values").VString<string, "required">;
|
|
55
|
+
at: import("convex/values").VFloat64<number, "required">;
|
|
56
|
+
}, "required", "at" | "evidenceJson" | "key" | "kind">, {
|
|
57
|
+
by_key: ["key", "_creationTime"];
|
|
58
|
+
}, {}, {}>;
|
|
17
59
|
usageSubscriptionControls: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
18
60
|
cancelAtPeriodEnd: boolean;
|
|
19
61
|
firstAttemptAt: number;
|
|
@@ -273,7 +315,7 @@ export declare function setup(scope?: Scope): Promise<{
|
|
|
273
315
|
}, {}, {}>;
|
|
274
316
|
usageReservations: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
275
317
|
accountKey?: string | undefined;
|
|
276
|
-
accountingKind?: "prepaid" | undefined;
|
|
318
|
+
accountingKind?: "allowance" | "prepaid" | undefined;
|
|
277
319
|
allocationsJson?: string | undefined;
|
|
278
320
|
eventId?: import("convex/values").GenericId<"usageEvents"> | undefined;
|
|
279
321
|
inputJson?: string | undefined;
|
|
@@ -291,13 +333,14 @@ export declare function setup(scope?: Scope): Promise<{
|
|
|
291
333
|
scaledQuantity: import("convex/values").VString<string, "required">;
|
|
292
334
|
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>;
|
|
293
335
|
eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents"> | undefined, "optional">;
|
|
294
|
-
accountingKind: import("convex/values").
|
|
336
|
+
accountingKind: import("convex/values").VUnion<"allowance" | "prepaid" | undefined, [import("convex/values").VLiteral<"prepaid", "required">, import("convex/values").VLiteral<"allowance", "required">], "optional", never>;
|
|
295
337
|
accountKey: import("convex/values").VString<string | undefined, "optional">;
|
|
296
338
|
inputJson: import("convex/values").VString<string | undefined, "optional">;
|
|
297
339
|
subscriptionJson: import("convex/values").VString<string | undefined, "optional">;
|
|
298
340
|
allocationsJson: import("convex/values").VString<string | undefined, "optional">;
|
|
299
341
|
releaseReason: import("convex/values").VString<string | undefined, "optional">;
|
|
300
342
|
}, "required", "accountKey" | "accountingKind" | "allocationsJson" | "eventId" | "inputJson" | "planJson" | "releaseReason" | "scaledQuantity" | "scopeKey" | "sourceEventId" | "state" | "subscriptionJson">, {
|
|
343
|
+
by_account_state: ["accountKey", "state", "_creationTime"];
|
|
301
344
|
by_scope_source: ["scopeKey", "sourceEventId", "_creationTime"];
|
|
302
345
|
by_scope_state: ["scopeKey", "state", "_creationTime"];
|
|
303
346
|
}, {}, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payoutSyncTestHelpers.d.ts","sourceRoot":"","sources":["../../../src/client/connect/payoutSyncTestHelpers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;A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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAKxC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkCzC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQtC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { RunCtx } from "../helpers.js";
|
|
2
|
+
import { UsageCreditClient } from "./creditClient.js";
|
|
3
|
+
import { type UsageScope } from "./records.js";
|
|
4
|
+
import { type UsageAllowanceBinding, type UsageAllowanceStatus, type UsageAllowanceReconciliation, type UsageLimitPolicy } from "./allowanceTerms.js";
|
|
5
|
+
import type { UsageSubscriptionBinding } from "./boundaries.js";
|
|
6
|
+
import type { Id } from "../../component/_generated/dataModel.js";
|
|
7
|
+
export type UsageAllowanceReservation = {
|
|
8
|
+
state: "denied";
|
|
9
|
+
reason: "not_entitled" | "hard_limit";
|
|
10
|
+
revision: number;
|
|
11
|
+
} | {
|
|
12
|
+
state: "reserved" | "committed" | "released";
|
|
13
|
+
reservationId: Id<"usageReservations">;
|
|
14
|
+
revision: number;
|
|
15
|
+
};
|
|
16
|
+
/** Trusted host authorizes policy management and the exact billable activity. */
|
|
17
|
+
export declare class UsageAllowanceClient extends UsageCreditClient {
|
|
18
|
+
configureAllowance(ctx: RunCtx, input: UsageAllowanceBinding & {
|
|
19
|
+
policy: UsageLimitPolicy;
|
|
20
|
+
expectedRevision: number;
|
|
21
|
+
}): Promise<{
|
|
22
|
+
revision: number;
|
|
23
|
+
}>;
|
|
24
|
+
getAllowanceStatus(ctx: RunCtx, input: UsageAllowanceBinding): Promise<UsageAllowanceStatus | null>;
|
|
25
|
+
reconcileAllowance(ctx: RunCtx, input: UsageAllowanceBinding): Promise<UsageAllowanceReconciliation>;
|
|
26
|
+
reserveAllowance(ctx: RunCtx, input: {
|
|
27
|
+
event: unknown;
|
|
28
|
+
subscription: UsageSubscriptionBinding;
|
|
29
|
+
}): Promise<UsageAllowanceReservation>;
|
|
30
|
+
releaseAllowance(ctx: RunCtx, input: {
|
|
31
|
+
scope: UsageScope;
|
|
32
|
+
reservationId: Id<"usageReservations">;
|
|
33
|
+
reason: "work_failed" | "abandoned_before_work";
|
|
34
|
+
}): Promise<any>;
|
|
35
|
+
readAllowanceHistory(ctx: RunCtx, input: UsageAllowanceBinding & {
|
|
36
|
+
limit: number;
|
|
37
|
+
cursor: string | null;
|
|
38
|
+
}): Promise<{
|
|
39
|
+
records: {
|
|
40
|
+
_creationTime: number;
|
|
41
|
+
_id: import("convex/values").GenericId<"usageAllowanceHistory">;
|
|
42
|
+
at: number;
|
|
43
|
+
evidenceJson: string;
|
|
44
|
+
key: string;
|
|
45
|
+
kind: "commit" | "policy" | "release" | "reservation";
|
|
46
|
+
}[];
|
|
47
|
+
cursor: string | null;
|
|
48
|
+
isDone: boolean;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=allowanceClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowanceClient.d.ts","sourceRoot":"","sources":["../../../src/client/usage/allowanceClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAmC,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EACjC,KAAK,gBAAgB,EACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,KAAK,EAAO,EAAE,EAAE,MAAM,yCAAyC,CAAC;AACvE,MAAM,MAAM,yBAAyB,GACjC;IAAE,KAAK,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,cAAc,GAAG,YAAY,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC5E;IACE,KAAK,EAAE,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;IAC7C,aAAa,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AASN,iFAAiF;AACjF,qBAAa,oBAAqB,SAAQ,iBAAiB;IACzD,kBAAkB,CAChB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,qBAAqB,GAAG;QAC7B,MAAM,EAAE,gBAAgB,CAAC;QACzB,gBAAgB,EAAE,MAAM,CAAC;KAC1B,GACA,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAe/B;IACK,kBAAkB,CACtB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAQtC;IACD,kBAAkB,CAChB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,4BAA4B,CAAC,CAKvC;IACD,gBAAgB,CACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,YAAY,EAAE,wBAAwB,CAAA;KAAE,GAChE,OAAO,CAAC,yBAAyB,CAAC,CAgBpC;IACD,gBAAgB,CACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE;QACL,KAAK,EAAE,UAAU,CAAC;QAClB,aAAa,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC;QACvC,MAAM,EAAE,aAAa,GAAG,uBAAuB,CAAC;KACjD,gBAOF;IACK,oBAAoB,CACxB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,qBAAqB,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE;;;;;;;;;;;OAoBxE;CACF"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { runMutationOrThrow } from "../helpers.js";
|
|
3
|
+
import { componentRef } from "../webhooks/helpers.js";
|
|
4
|
+
import { UsageCreditClient } from "./creditClient.js";
|
|
5
|
+
import { prepareUsageRecord, scopeSchema } from "./records.js";
|
|
6
|
+
import { allowanceBinding, limitPolicy, } from "./allowanceTerms.js";
|
|
7
|
+
const bindingJson = (input) => JSON.stringify(allowanceBinding({
|
|
8
|
+
scope: input.scope,
|
|
9
|
+
binding: input.binding,
|
|
10
|
+
subscription: input.subscription,
|
|
11
|
+
}));
|
|
12
|
+
/** Trusted host authorizes policy management and the exact billable activity. */
|
|
13
|
+
export class UsageAllowanceClient extends UsageCreditClient {
|
|
14
|
+
configureAllowance(ctx, input) {
|
|
15
|
+
const binding = allowanceBinding({
|
|
16
|
+
scope: input.scope,
|
|
17
|
+
binding: input.binding,
|
|
18
|
+
subscription: input.subscription,
|
|
19
|
+
});
|
|
20
|
+
return runMutationOrThrow(ctx, componentRef(this.component, "usageAllowance/mutations/configure"), {
|
|
21
|
+
bindingJson: JSON.stringify(binding),
|
|
22
|
+
policyJson: JSON.stringify(limitPolicy(input.policy, binding)),
|
|
23
|
+
expectedRevision: input.expectedRevision,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
async getAllowanceStatus(ctx, input) {
|
|
27
|
+
const result = (await ctx.runQuery(componentRef(this.component, "usageAllowance/queries/status"), { bindingJson: bindingJson(input) }));
|
|
28
|
+
return result === null
|
|
29
|
+
? null
|
|
30
|
+
: JSON.parse(result);
|
|
31
|
+
}
|
|
32
|
+
reconcileAllowance(ctx, input) {
|
|
33
|
+
return ctx.runQuery(componentRef(this.component, "usageAllowance/queries/reconciliation"), { bindingJson: bindingJson(input) });
|
|
34
|
+
}
|
|
35
|
+
reserveAllowance(ctx, input) {
|
|
36
|
+
const event = prepareUsageRecord(input.event);
|
|
37
|
+
return runMutationOrThrow(ctx, componentRef(this.component, "usageAllowance/mutations/reserve"), {
|
|
38
|
+
inputJson: JSON.stringify({
|
|
39
|
+
scope: event.scope,
|
|
40
|
+
binding: event.binding,
|
|
41
|
+
sourceEventId: event.sourceEventId,
|
|
42
|
+
occurredAt: event.occurredAt,
|
|
43
|
+
quantity: event.quantity,
|
|
44
|
+
}),
|
|
45
|
+
subscriptionJson: JSON.stringify(input.subscription),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
releaseAllowance(ctx, input) {
|
|
49
|
+
return runMutationOrThrow(ctx, componentRef(this.component, "usageAllowance/mutations/release"), { ...input, scope: scopeSchema.parse(input.scope) });
|
|
50
|
+
}
|
|
51
|
+
async readAllowanceHistory(ctx, input) {
|
|
52
|
+
const limit = z.number().int().min(1).max(100).parse(input.limit), cursor = z.string().min(1).max(2048).nullable().parse(input.cursor);
|
|
53
|
+
const result = (await ctx.runQuery(componentRef(this.component, "usageAllowance/queries/readHistory"), {
|
|
54
|
+
bindingJson: bindingJson(input),
|
|
55
|
+
paginationOpts: { numItems: limit, cursor },
|
|
56
|
+
}));
|
|
57
|
+
return {
|
|
58
|
+
records: result.page,
|
|
59
|
+
cursor: result.isDone ? null : result.continueCursor,
|
|
60
|
+
isDone: result.isDone,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=allowanceClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowanceClient.js","sourceRoot":"","sources":["../../../src/client/usage/allowanceClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAmB,MAAM,cAAc,CAAC;AAChF,OAAO,EACL,gBAAgB,EAChB,WAAW,GAKZ,MAAM,qBAAqB,CAAC;AAU7B,MAAM,WAAW,GAAG,CAAC,KAA4B,EAAE,EAAE,CACnD,IAAI,CAAC,SAAS,CACZ,gBAAgB,CAAC;IACf,KAAK,EAAE,KAAK,CAAC,KAAK;IAClB,OAAO,EAAE,KAAK,CAAC,OAAO;IACtB,YAAY,EAAE,KAAK,CAAC,YAAY;CACjC,CAAC,CACH,CAAC;AACJ,iFAAiF;AACjF,MAAM,OAAO,oBAAqB,SAAQ,iBAAiB;IACzD,kBAAkB,CAChB,GAAW,EACX,KAGC;QAED,MAAM,OAAO,GAAG,gBAAgB,CAAC;YAC/B,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,YAAY,EAAE,KAAK,CAAC,YAAY;SACjC,CAAC,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MAAM,CAAC,MAAM;SACtB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type PreparedUsageRecord } from "./records.js";
|
|
3
|
+
import type { UsageSubscriptionBinding } from "./boundaries.js";
|
|
4
|
+
export type UsageAllowanceBinding = Pick<PreparedUsageRecord, "scope" | "binding"> & {
|
|
5
|
+
subscription: UsageSubscriptionBinding;
|
|
6
|
+
};
|
|
7
|
+
export declare const usageLimitPolicySchema: z.ZodObject<{
|
|
8
|
+
reset: z.ZodLiteral<"billing_period">;
|
|
9
|
+
rollover: z.ZodLiteral<"none">;
|
|
10
|
+
entitled: z.ZodBoolean;
|
|
11
|
+
overage: z.ZodEnum<{
|
|
12
|
+
allow: "allow";
|
|
13
|
+
reject: "reject";
|
|
14
|
+
}>;
|
|
15
|
+
limit: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
16
|
+
mode: z.ZodLiteral<"none">;
|
|
17
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
18
|
+
mode: z.ZodEnum<{
|
|
19
|
+
hard: "hard";
|
|
20
|
+
soft: "soft";
|
|
21
|
+
}>;
|
|
22
|
+
quantity: z.ZodString;
|
|
23
|
+
}, z.core.$strict>], "mode">;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
export type UsageLimitPolicy = z.infer<typeof usageLimitPolicySchema>;
|
|
26
|
+
export type UsageAllowanceStatus = {
|
|
27
|
+
revision: number;
|
|
28
|
+
observedAt: number;
|
|
29
|
+
period: UsageSubscriptionBinding["period"];
|
|
30
|
+
accepting: boolean;
|
|
31
|
+
policy: UsageLimitPolicy;
|
|
32
|
+
consumedQuantity: string;
|
|
33
|
+
reservedQuantity: string;
|
|
34
|
+
includedQuantity: string;
|
|
35
|
+
remainingIncludedQuantity: string;
|
|
36
|
+
billableOverageQuantity: string;
|
|
37
|
+
softLimitReached: boolean;
|
|
38
|
+
hardLimitRemainingQuantity: string | null;
|
|
39
|
+
committedEstimate: {
|
|
40
|
+
amountDecimal: string;
|
|
41
|
+
currency: string;
|
|
42
|
+
};
|
|
43
|
+
projectedEstimate: {
|
|
44
|
+
amountDecimal: string;
|
|
45
|
+
currency: string;
|
|
46
|
+
};
|
|
47
|
+
cashCollection: "none";
|
|
48
|
+
};
|
|
49
|
+
export declare function allowanceBinding(input: unknown): UsageAllowanceBinding;
|
|
50
|
+
export declare function limitPolicy(input: unknown, binding: UsageAllowanceBinding): UsageLimitPolicy;
|
|
51
|
+
export declare function allowanceStatus(binding: UsageAllowanceBinding, policy: UsageLimitPolicy, row: {
|
|
52
|
+
consumed: string;
|
|
53
|
+
reserved: string;
|
|
54
|
+
revision: number;
|
|
55
|
+
}, observedAt: number): UsageAllowanceStatus;
|
|
56
|
+
export type UsageAllowanceReconciliation = {
|
|
57
|
+
status: "matched" | "held";
|
|
58
|
+
reason: string;
|
|
59
|
+
consumedScaledQuantity: string;
|
|
60
|
+
reservedScaledQuantity: string;
|
|
61
|
+
acceptedScaledQuantity: string;
|
|
62
|
+
repaired: false;
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=allowanceTerms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowanceTerms.d.ts","sourceRoot":"","sources":["../../../src/client/usage/allowanceTerms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAG5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAChE,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,mBAAmB,EACnB,OAAO,GAAG,SAAS,CACpB,GAAG;IACF,YAAY,EAAE,wBAAwB,CAAC;CACxC,CAAC;AASF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;kBASjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAA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