@aventurevc/api-schemas 0.8.538 → 0.8.540
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/dist/billing/additional-usage-mutation.d.ts +2 -0
- package/dist/billing/additional-usage-mutation.js +4 -0
- package/dist/billing/additional-usage.d.ts +1 -0
- package/dist/billing/additional-usage.js +2 -0
- package/dist/billing/catalog.d.ts +1 -0
- package/dist/billing/catalog.js +2 -0
- package/dist/billing/subscription.d.ts +2 -0
- package/dist/http/problem-detail.d.ts +1 -0
- package/dist/http/problem-detail.js +3 -1
- package/package.json +1 -1
|
@@ -6,6 +6,8 @@ declare const BillingAdditionalUsageMutationSchemaDefinition: z.ZodObject<{
|
|
|
6
6
|
autoTopUpCardRevision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
7
|
autoTopUpEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
8
8
|
enabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
9
|
+
expectedPriceRevision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10
|
+
expectedTermsRevision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
11
|
funding: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
10
12
|
PREPAID_CREDIT: "PREPAID_CREDIT";
|
|
11
13
|
USAGE_INVOICE: "USAGE_INVOICE";
|
|
@@ -14,6 +14,10 @@ const BillingAdditionalUsageMutationSchemaDefinition = z.object({
|
|
|
14
14
|
autoTopUpEnabled: z.boolean().nullish(),
|
|
15
15
|
/** Turn recording of usage past the monthly caps on or off. */
|
|
16
16
|
enabled: z.boolean().nullish(),
|
|
17
|
+
/** The plan catalog's additionalUsagePriceRevision from the prices the user reviewed, sent with expectedTermsRevision. */
|
|
18
|
+
expectedPriceRevision: z.string().nullish(),
|
|
19
|
+
/** The termsRevision the user reviewed, sent with expectedPriceRevision; sending only one is rejected. When either is no longer current, nothing is saved and the request fails with 409 billing_additional_usage_terms_changed. Omitting both skips the check. */
|
|
20
|
+
expectedTermsRevision: z.string().nullish(),
|
|
17
21
|
funding: BillingAdditionalUsageFundingTypeSchema.nullish(),
|
|
18
22
|
/** Unbilled cents that trigger a USAGE_INVOICE invoice; one of the plan catalog's invoiceIncrementCents. */
|
|
19
23
|
invoiceIncrementCents: z.number().int().nullish(),
|
|
@@ -35,6 +35,7 @@ declare const BillingAdditionalUsageSchemaDefinition: z.ZodObject<{
|
|
|
35
35
|
spendCapCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
36
36
|
spendLimitUsedCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
37
37
|
spentCents: z.ZodNumber;
|
|
38
|
+
termsRevision: z.ZodOptional<z.ZodString>;
|
|
38
39
|
unbilledCents: z.ZodNumber;
|
|
39
40
|
}, z.core.$strip>;
|
|
40
41
|
type BillingAdditionalUsageDefinition = z.infer<typeof BillingAdditionalUsageSchemaDefinition>;
|
|
@@ -31,6 +31,8 @@ const BillingAdditionalUsageSchemaDefinition = z.object({
|
|
|
31
31
|
spendLimitUsedCents: z.number().nullish(),
|
|
32
32
|
/** Pay as You Go Usage priced this UTC month, in cents. */
|
|
33
33
|
spentCents: z.number(),
|
|
34
|
+
/** Opaque revision of the terms a user reviews: these settings, the standing automatic top-up approval, and the Pay as You Go Usage prices. Send it as expectedTermsRevision, with the plan catalog's additionalUsagePriceRevision as expectedPriceRevision, when saving reviewed terms. Spend, balance, status, and reset time never change it. Always present; optional so older readers accept responses without it. */
|
|
35
|
+
termsRevision: z.string().optional(),
|
|
34
36
|
/** Priced usage not yet paid by credit or placed on an invoice, in cents; the next threshold or period invoice bills it. */
|
|
35
37
|
unbilledCents: z.number(),
|
|
36
38
|
});
|
|
@@ -7,6 +7,7 @@ declare const BillingCatalogSchemaDefinition: z.ZodObject<{
|
|
|
7
7
|
type: string;
|
|
8
8
|
unitAmount: number;
|
|
9
9
|
}, import("./catalog-additional-usage.ts").BillingCatalogAdditionalUsageSchemaInput>>>;
|
|
10
|
+
additionalUsagePriceRevision: z.ZodOptional<z.ZodString>;
|
|
10
11
|
creditPack: z.ZodArray<z.ZodType<{
|
|
11
12
|
amountCents: number;
|
|
12
13
|
appStoreProductId?: string | null | undefined;
|
package/dist/billing/catalog.js
CHANGED
|
@@ -6,6 +6,8 @@ import { BillingCatalogPlanSchema } from "./catalog-plan.js";
|
|
|
6
6
|
import { BillingCatalogTierSchema } from "./catalog-tier.js";
|
|
7
7
|
const BillingCatalogSchemaDefinition = z.object({
|
|
8
8
|
additionalUsage: z.array(BillingCatalogAdditionalUsageSchema),
|
|
9
|
+
/** Opaque revision of the Pay as You Go Usage prices, credit packs, and invoice increments listed here. Send it as expectedPriceRevision with expectedTermsRevision when saving reviewed Pay as You Go Usage terms. Always present; optional so older readers accept responses without it. */
|
|
10
|
+
additionalUsagePriceRevision: z.string().optional(),
|
|
9
11
|
creditPack: z.array(BillingCatalogCreditPackSchema),
|
|
10
12
|
/** Invoice increments a USAGE_INVOICE subscriber may choose, in cents. */
|
|
11
13
|
invoiceIncrementCents: z.array(z.number().int()),
|
|
@@ -20,6 +20,7 @@ declare const BillingSubscriptionSchemaDefinition: z.ZodObject<{
|
|
|
20
20
|
spendCapCents?: number | null | undefined;
|
|
21
21
|
spendLimitUsedCents?: number | null | undefined;
|
|
22
22
|
spentCents: number;
|
|
23
|
+
termsRevision?: string | undefined;
|
|
23
24
|
unbilledCents: number;
|
|
24
25
|
}, import("./additional-usage.ts").BillingAdditionalUsageSchemaInput, z.core.$ZodTypeInternals<{
|
|
25
26
|
assistantPurchaseEnabled?: boolean | undefined;
|
|
@@ -41,6 +42,7 @@ declare const BillingSubscriptionSchemaDefinition: z.ZodObject<{
|
|
|
41
42
|
spendCapCents?: number | null | undefined;
|
|
42
43
|
spendLimitUsedCents?: number | null | undefined;
|
|
43
44
|
spentCents: number;
|
|
45
|
+
termsRevision?: string | undefined;
|
|
44
46
|
unbilledCents: number;
|
|
45
47
|
}, import("./additional-usage.ts").BillingAdditionalUsageSchemaInput>>;
|
|
46
48
|
allowance: z.ZodType<{
|
|
@@ -51,6 +51,7 @@ export declare const ProblemDetailSchema: z.ZodObject<{
|
|
|
51
51
|
account_exists: "account_exists";
|
|
52
52
|
async_lookup_sign_in_required: "async_lookup_sign_in_required";
|
|
53
53
|
billing_additional_usage_cap_reached: "billing_additional_usage_cap_reached";
|
|
54
|
+
billing_additional_usage_terms_changed: "billing_additional_usage_terms_changed";
|
|
54
55
|
billing_ai_charge_window_closed: "billing_ai_charge_window_closed";
|
|
55
56
|
billing_allowance_exhausted: "billing_allowance_exhausted";
|
|
56
57
|
billing_complimentary_term: "billing_complimentary_term";
|
|
@@ -22,7 +22,7 @@ export const ProblemDetailSchema = z.object({
|
|
|
22
22
|
/** For a school campus lookup (NCES records), the evidence from the campus's own website that is still missing; absent for other failures. */
|
|
23
23
|
campusProofRefusal: IdentificationCampusRefusalSchema.nullish(),
|
|
24
24
|
circuitBreaker: z.string().nullish(),
|
|
25
|
-
/**
|
|
25
|
+
/** Secondary ProblemDetail.code for branching when HTTP status is insufficient; surface server-side codes and stop. */
|
|
26
26
|
code: z
|
|
27
27
|
.union([
|
|
28
28
|
z.enum([
|
|
@@ -62,6 +62,8 @@ export const ProblemDetailSchema = z.object({
|
|
|
62
62
|
"billing_ai_charge_window_closed",
|
|
63
63
|
/** The caller's monthly allowance is spent and the next Pay as You Go Usage unit would pass the monthly spend cap or the prepaid credit left. Agent action: stop and report ProblemDetail.allowanceType, limit, used, remaining, and resetAt, then follow ProblemDetail.resolution: when prepaid credit is used up, buy credit through POST /v1/billing/credit-purchases only with the user's exact quoted approval of the amount; when the monthly cap is reached, raise spendCapCents through /v1/billing/additional-usage or wait for resetAt. */
|
|
64
64
|
"billing_additional_usage_cap_reached",
|
|
65
|
+
/** Reviewed Pay as You Go Usage terms are stale; reread and review again. */
|
|
66
|
+
"billing_additional_usage_terms_changed",
|
|
65
67
|
/** The prepaid credit Checkout is paid, expired, or closed. Retire this purchase intent before explicitly starting another Checkout; ambiguous transport failures and in-progress conflicts must keep the original key. */
|
|
66
68
|
"billing_credit_checkout_closed",
|
|
67
69
|
/** A credit grant is still being recorded; retry after it settles. */
|