@paygentic/sdk 0.7.6 → 0.7.7
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/README.md +5 -3
- package/dist/commonjs/funcs/subscriptionsUpdateSubscription.d.ts +16 -0
- package/dist/commonjs/funcs/subscriptionsUpdateSubscription.d.ts.map +1 -0
- package/dist/commonjs/funcs/subscriptionsUpdateSubscription.js +122 -0
- package/dist/commonjs/funcs/subscriptionsUpdateSubscription.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/feeprice.d.ts +5 -1
- package/dist/commonjs/models/feeprice.d.ts.map +1 -1
- package/dist/commonjs/models/feeprice.js +1 -0
- package/dist/commonjs/models/feeprice.js.map +1 -1
- package/dist/commonjs/models/lineitem.d.ts +1 -1
- package/dist/commonjs/models/operations/createprice.d.ts +5 -0
- package/dist/commonjs/models/operations/createprice.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createprice.js +1 -0
- package/dist/commonjs/models/operations/createprice.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/updateprice.d.ts +5 -0
- package/dist/commonjs/models/operations/updateprice.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updateprice.js +1 -0
- package/dist/commonjs/models/operations/updateprice.js.map +1 -1
- package/dist/commonjs/models/operations/updatesubscription.d.ts +71 -0
- package/dist/commonjs/models/operations/updatesubscription.d.ts.map +1 -0
- package/dist/commonjs/models/operations/updatesubscription.js +78 -0
- package/dist/commonjs/models/operations/updatesubscription.js.map +1 -0
- package/dist/commonjs/models/price.d.ts +4 -0
- package/dist/commonjs/models/price.d.ts.map +1 -1
- package/dist/commonjs/models/price.js +1 -0
- package/dist/commonjs/models/price.js.map +1 -1
- package/dist/commonjs/models/pricepropertiesunion.d.ts +1 -1
- package/dist/commonjs/models/schemasprice.d.ts +4 -0
- package/dist/commonjs/models/schemasprice.d.ts.map +1 -1
- package/dist/commonjs/models/schemasprice.js +1 -0
- package/dist/commonjs/models/schemasprice.js.map +1 -1
- package/dist/commonjs/sdk/subscriptions.d.ts +4 -0
- package/dist/commonjs/sdk/subscriptions.d.ts.map +1 -1
- package/dist/commonjs/sdk/subscriptions.js +7 -0
- package/dist/commonjs/sdk/subscriptions.js.map +1 -1
- package/dist/esm/funcs/subscriptionsUpdateSubscription.d.ts +16 -0
- package/dist/esm/funcs/subscriptionsUpdateSubscription.d.ts.map +1 -0
- package/dist/esm/funcs/subscriptionsUpdateSubscription.js +86 -0
- package/dist/esm/funcs/subscriptionsUpdateSubscription.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/feeprice.d.ts +5 -1
- package/dist/esm/models/feeprice.d.ts.map +1 -1
- package/dist/esm/models/feeprice.js +1 -0
- package/dist/esm/models/feeprice.js.map +1 -1
- package/dist/esm/models/lineitem.d.ts +1 -1
- package/dist/esm/models/operations/createprice.d.ts +5 -0
- package/dist/esm/models/operations/createprice.d.ts.map +1 -1
- package/dist/esm/models/operations/createprice.js +1 -0
- package/dist/esm/models/operations/createprice.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/updateprice.d.ts +5 -0
- package/dist/esm/models/operations/updateprice.d.ts.map +1 -1
- package/dist/esm/models/operations/updateprice.js +1 -0
- package/dist/esm/models/operations/updateprice.js.map +1 -1
- package/dist/esm/models/operations/updatesubscription.d.ts +71 -0
- package/dist/esm/models/operations/updatesubscription.d.ts.map +1 -0
- package/dist/esm/models/operations/updatesubscription.js +40 -0
- package/dist/esm/models/operations/updatesubscription.js.map +1 -0
- package/dist/esm/models/price.d.ts +4 -0
- package/dist/esm/models/price.d.ts.map +1 -1
- package/dist/esm/models/price.js +1 -0
- package/dist/esm/models/price.js.map +1 -1
- package/dist/esm/models/pricepropertiesunion.d.ts +1 -1
- package/dist/esm/models/schemasprice.d.ts +4 -0
- package/dist/esm/models/schemasprice.d.ts.map +1 -1
- package/dist/esm/models/schemasprice.js +1 -0
- package/dist/esm/models/schemasprice.js.map +1 -1
- package/dist/esm/sdk/subscriptions.d.ts +4 -0
- package/dist/esm/sdk/subscriptions.d.ts.map +1 -1
- package/dist/esm/sdk/subscriptions.js +7 -0
- package/dist/esm/sdk/subscriptions.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/subscriptionsUpdateSubscription.ts +178 -0
- package/src/lib/config.ts +2 -2
- package/src/models/feeprice.ts +6 -1
- package/src/models/lineitem.ts +1 -1
- package/src/models/operations/createprice.ts +6 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/updateprice.ts +6 -0
- package/src/models/operations/updatesubscription.ts +129 -0
- package/src/models/price.ts +5 -0
- package/src/models/pricepropertiesunion.ts +1 -1
- package/src/models/schemasprice.ts +5 -0
- package/src/sdk/subscriptions.ts +15 -0
|
@@ -54,6 +54,10 @@ export type Price = {
|
|
|
54
54
|
* When true, grants applied to a subscription will discount usage charged by this price. Only supported for standard metered prices.
|
|
55
55
|
*/
|
|
56
56
|
grantDiscountEnabled: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Quantity used when generating invoice line items for this price. Total per period = quantity × unitPrice. Only supported for fee prices; metered prices derive quantity from usage. Defaults to 1.
|
|
59
|
+
*/
|
|
60
|
+
quantity: number;
|
|
57
61
|
};
|
|
58
62
|
/** @internal */
|
|
59
63
|
export declare const PriceObject$inboundSchema: z.ZodNativeEnum<typeof PriceObject>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"price.d.ts","sourceRoot":"","sources":["../../../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AE,MAAM,GAAG,SAAS,CAAC;IACjC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,UAAU,CAAC;IAClB,WAAW,EAAE,gBAAgB,CAAC;IAC9B,UAAU,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,SAAS,EAAE,IAAI,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC;IAC3C;;OAEG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,yBAAyB,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,WAAW,CAChD,CAAC;AAE3B,gBAAgB;AAChB,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,UAAU,CAC/C,CAAC;AAE1B,gBAAgB;AAChB,eAAO,MAAM,8BAA8B,EAAE,CAAC,CAAC,aAAa,CAC1D,OAAO,gBAAgB,CACS,CAAC;AAEnC,gBAAgB;AAChB,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,CAuBpE,CAAC;AAEL,wBAAgB,aAAa,CAC3B,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAM5C"}
|
package/dist/esm/models/price.js
CHANGED
|
@@ -45,6 +45,7 @@ export const Price$inboundSchema = z
|
|
|
45
45
|
updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
46
46
|
features: z.array(PriceFeature$inboundSchema).optional(),
|
|
47
47
|
grantDiscountEnabled: z.boolean().default(false),
|
|
48
|
+
quantity: z.number().int().default(1),
|
|
48
49
|
});
|
|
49
50
|
export function priceFromJSON(jsonString) {
|
|
50
51
|
return safeParse(jsonString, (x) => Price$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Price' from JSON`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"price.js","sourceRoot":"","sources":["../../../src/models/price.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI9C,OAAO,EAAgB,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAE7E,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,OAAO;CACN,CAAC;AAGX,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;CAChB,CAAC;AAGX,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,YAAY;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"price.js","sourceRoot":"","sources":["../../../src/models/price.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI9C,OAAO,EAAgB,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAE7E,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,OAAO;CACN,CAAC;AAGX,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;CAChB,CAAC;AAGX,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO,EAAE,SAAS;I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UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAC7D,IAAI,IAAI,CAAC,CAAC,CAAC,CACZ;IACD,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,QAAQ,EAAE;IACxD,oBAAoB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAChD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;CACtC,CAAC,CAAC;AAEL,MAAM,UAAU,aAAa,CAC3B,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC/C,mCAAmC,CACpC,CAAC;AACJ,CAAC"}
|
|
@@ -75,7 +75,7 @@ export type PriceProperties2 = {
|
|
|
75
75
|
*/
|
|
76
76
|
export type PriceProperties1 = {
|
|
77
77
|
/**
|
|
78
|
-
* Per-unit cost in decimal format for fixed-rate pricing. Sample values: '0.00002' represents $0.00002 per token, '0.15' represents $0.15 per gigabyte stored, '0.05' represents $0.05 per API call
|
|
78
|
+
* Per-unit cost in decimal format for fixed-rate pricing. Sample values: '0.00002' represents $0.00002 per token, '0.15' represents $0.15 per gigabyte stored, '0.05' represents $0.05 per API call. Per unit. Total per period = quantity × unitPrice; see the `quantity` field.
|
|
79
79
|
*/
|
|
80
80
|
unitPrice: string;
|
|
81
81
|
};
|
|
@@ -53,6 +53,10 @@ export type SchemasPrice = {
|
|
|
53
53
|
* When true, grants applied to a subscription will discount usage charged by this price. Only supported for standard metered prices.
|
|
54
54
|
*/
|
|
55
55
|
grantDiscountEnabled: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Quantity for invoice line items. Total per period = quantity × unitPrice. Only supported for fee prices; metered prices derive quantity from usage. Defaults to 1.
|
|
58
|
+
*/
|
|
59
|
+
quantity: number;
|
|
56
60
|
};
|
|
57
61
|
/** @internal */
|
|
58
62
|
export declare const SchemasPriceObject$inboundSchema: z.ZodNativeEnum<typeof SchemasPriceObject>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemasprice.d.ts","sourceRoot":"","sources":["../../../src/models/schemasprice.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,YAAY,EAA8B,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EACL,oBAAoB,EAErB,MAAM,2BAA2B,CAAC;AAEnC,eAAO,MAAM,kBAAkB;;CAErB,CAAC;AACX,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEvE,eAAO,MAAM,iBAAiB;;;;;CAKpB,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAErE,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC;AACX,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAC9C,OAAO,uBAAuB,CAC/B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,kBAAkB,CAAC;IAC3B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC;;OAEG;IACH,KAAK,CA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40
|
updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
41
41
|
features: z.array(PriceFeature$inboundSchema).optional(),
|
|
42
42
|
grantDiscountEnabled: z.boolean().default(false),
|
|
43
|
+
quantity: z.number().int(),
|
|
43
44
|
});
|
|
44
45
|
export function schemasPriceFromJSON(jsonString) {
|
|
45
46
|
return safeParse(jsonString, (x) => SchemasPrice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SchemasPrice' from JSON`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemasprice.js","sourceRoot":"","sources":["../../../src/models/schemasprice.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI9C,OAAO,EAAgB,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAEL,kCAAkC,GACnC,MAAM,2BAA2B,CAAC;AAEnC,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,KAAK,EAAE,OAAO;CACN,CAAC;AAGX,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;CAChB,CAAC;AAGX,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,YAAY;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"schemasprice.js","sourceRoot":"","sources":["../../../src/models/schemasprice.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI9C,OAAO,EAAgB,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAEL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AAC,CAAC,CAAC;IAC5E,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,KAAK,EAAE,+BAA+B,CAAC,QAAQ,EAAE;IACjD,WAAW,EAAE,qCAAqC;IAClD,UAAU,EAAE,kCAAkC;IAC9C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5E,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,QAAQ,EAAE;IACxD,oBAAoB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAChD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;CAC3B,CAAC,CAAC;AAEH,MAAM,UAAU,oBAAoB,CAClC,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,0BAA0B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACtD,0CAA0C,CAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -17,6 +17,10 @@ export declare class Subscriptions extends ClientSDK {
|
|
|
17
17
|
* Get
|
|
18
18
|
*/
|
|
19
19
|
get(request: operations.GetSubscriptionRequest, options?: RequestOptions): Promise<models.Subscription>;
|
|
20
|
+
/**
|
|
21
|
+
* Update
|
|
22
|
+
*/
|
|
23
|
+
updateSubscription(request: operations.UpdateSubscriptionRequest, options?: RequestOptions): Promise<models.Subscription>;
|
|
20
24
|
/**
|
|
21
25
|
* Generate Portal Link
|
|
22
26
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../../src/sdk/subscriptions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../../src/sdk/subscriptions.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,aAAc,SAAQ,SAAS;IAC1C;;OAEG;IACG,IAAI,CACR,OAAO,CAAC,EAAE,UAAU,CAAC,wBAAwB,GAAG,SAAS,EACzD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,yBAAyB,CAAC;IAQhD;;;;;OAKG;IACG,MAAM,CACV,OAAO,EAAE,UAAU,CAAC,yBAAyB,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC;IAQ/B;;OAEG;IACG,GAAG,CACP,OAAO,EAAE,UAAU,CAAC,sBAAsB,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC;IAQ/B;;OAEG;IACG,kBAAkB,CACtB,OAAO,EAAE,UAAU,CAAC,yBAAyB,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC;IAQ/B;;;;;OAKG;IACG,kBAAkB,CACtB,OAAO,EAAE,UAAU,CAAC,yBAAyB,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC;IAQrC;;;;;OAKG;IACG,SAAS,CACb,OAAO,EAAE,UAAU,CAAC,4BAA4B,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC;CAOhC"}
|
|
@@ -6,6 +6,7 @@ import { subscriptionsGeneratePortalLink } from "../funcs/subscriptionsGenerateP
|
|
|
6
6
|
import { subscriptionsGet } from "../funcs/subscriptionsGet.js";
|
|
7
7
|
import { subscriptionsList } from "../funcs/subscriptionsList.js";
|
|
8
8
|
import { subscriptionsTerminate } from "../funcs/subscriptionsTerminate.js";
|
|
9
|
+
import { subscriptionsUpdateSubscription } from "../funcs/subscriptionsUpdateSubscription.js";
|
|
9
10
|
import { ClientSDK } from "../lib/sdks.js";
|
|
10
11
|
import { unwrapAsync } from "../types/fp.js";
|
|
11
12
|
export class Subscriptions extends ClientSDK {
|
|
@@ -30,6 +31,12 @@ export class Subscriptions extends ClientSDK {
|
|
|
30
31
|
async get(request, options) {
|
|
31
32
|
return unwrapAsync(subscriptionsGet(this, request, options));
|
|
32
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Update
|
|
36
|
+
*/
|
|
37
|
+
async updateSubscription(request, options) {
|
|
38
|
+
return unwrapAsync(subscriptionsUpdateSubscription(this, request, options));
|
|
39
|
+
}
|
|
33
40
|
/**
|
|
34
41
|
* Generate Portal Link
|
|
35
42
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../../src/sdk/subscriptions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,6CAA6C,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,aAAc,SAAQ,SAAS;IAC1C;;OAEG;IACH,KAAK,CAAC,IAAI,CACR,OAAyD,EACzD,OAAwB;QAExB,OAAO,WAAW,CAAC,iBAAiB,CAClC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,OAA6C,EAC7C,OAAwB;QAExB,OAAO,WAAW,CAAC,mBAAmB,CACpC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CACP,OAA0C,EAC1C,OAAwB;QAExB,OAAO,WAAW,CAAC,gBAAgB,CACjC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,kBAAkB,CACtB,OAA6C,EAC7C,OAAwB;QAExB,OAAO,WAAW,CAAC,+BAA+B,CAChD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,SAAS,CACb,OAAgD,EAChD,OAAwB;QAExB,OAAO,WAAW,CAAC,sBAAsB,CACvC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../../src/sdk/subscriptions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,6CAA6C,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,+BAA+B,EAAE,MAAM,6CAA6C,CAAC;AAC9F,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,aAAc,SAAQ,SAAS;IAC1C;;OAEG;IACH,KAAK,CAAC,IAAI,CACR,OAAyD,EACzD,OAAwB;QAExB,OAAO,WAAW,CAAC,iBAAiB,CAClC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,OAA6C,EAC7C,OAAwB;QAExB,OAAO,WAAW,CAAC,mBAAmB,CACpC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CACP,OAA0C,EAC1C,OAAwB;QAExB,OAAO,WAAW,CAAC,gBAAgB,CACjC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,kBAAkB,CACtB,OAA6C,EAC7C,OAAwB;QAExB,OAAO,WAAW,CAAC,+BAA+B,CAChD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,kBAAkB,CACtB,OAA6C,EAC7C,OAAwB;QAExB,OAAO,WAAW,CAAC,+BAA+B,CAChD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,SAAS,CACb,OAAgD,EAChD,OAAwB;QAExB,OAAO,WAAW,CAAC,sBAAsB,CACvC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { PaygenticCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { PaygenticError } from "../models/errors/paygenticerror.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as models from "../models/index.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Update
|
|
31
|
+
*/
|
|
32
|
+
export function subscriptionsUpdateSubscription(
|
|
33
|
+
client: PaygenticCore,
|
|
34
|
+
request: operations.UpdateSubscriptionRequest,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): APIPromise<
|
|
37
|
+
Result<
|
|
38
|
+
models.Subscription,
|
|
39
|
+
| errors.BadRequest
|
|
40
|
+
| errors.ErrorT
|
|
41
|
+
| PaygenticError
|
|
42
|
+
| ResponseValidationError
|
|
43
|
+
| ConnectionError
|
|
44
|
+
| RequestAbortedError
|
|
45
|
+
| RequestTimeoutError
|
|
46
|
+
| InvalidRequestError
|
|
47
|
+
| UnexpectedClientError
|
|
48
|
+
| SDKValidationError
|
|
49
|
+
>
|
|
50
|
+
> {
|
|
51
|
+
return new APIPromise($do(
|
|
52
|
+
client,
|
|
53
|
+
request,
|
|
54
|
+
options,
|
|
55
|
+
));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function $do(
|
|
59
|
+
client: PaygenticCore,
|
|
60
|
+
request: operations.UpdateSubscriptionRequest,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
models.Subscription,
|
|
66
|
+
| errors.BadRequest
|
|
67
|
+
| errors.ErrorT
|
|
68
|
+
| PaygenticError
|
|
69
|
+
| ResponseValidationError
|
|
70
|
+
| ConnectionError
|
|
71
|
+
| RequestAbortedError
|
|
72
|
+
| RequestTimeoutError
|
|
73
|
+
| InvalidRequestError
|
|
74
|
+
| UnexpectedClientError
|
|
75
|
+
| SDKValidationError
|
|
76
|
+
>,
|
|
77
|
+
APICall,
|
|
78
|
+
]
|
|
79
|
+
> {
|
|
80
|
+
const parsed = safeParse(
|
|
81
|
+
request,
|
|
82
|
+
(value) => operations.UpdateSubscriptionRequest$outboundSchema.parse(value),
|
|
83
|
+
"Input validation failed",
|
|
84
|
+
);
|
|
85
|
+
if (!parsed.ok) {
|
|
86
|
+
return [parsed, { status: "invalid" }];
|
|
87
|
+
}
|
|
88
|
+
const payload = parsed.value;
|
|
89
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
90
|
+
|
|
91
|
+
const pathParams = {
|
|
92
|
+
id: encodeSimple("id", payload.id, {
|
|
93
|
+
explode: false,
|
|
94
|
+
charEncoding: "percent",
|
|
95
|
+
}),
|
|
96
|
+
};
|
|
97
|
+
const path = pathToFunc("/v0/subscriptions/{id}")(pathParams);
|
|
98
|
+
|
|
99
|
+
const headers = new Headers(compactMap({
|
|
100
|
+
"Content-Type": "application/json",
|
|
101
|
+
Accept: "application/json",
|
|
102
|
+
}));
|
|
103
|
+
|
|
104
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
105
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
106
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
107
|
+
|
|
108
|
+
const context = {
|
|
109
|
+
options: client._options,
|
|
110
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
111
|
+
operationID: "updateSubscription",
|
|
112
|
+
oAuth2Scopes: null,
|
|
113
|
+
|
|
114
|
+
resolvedSecurity: requestSecurity,
|
|
115
|
+
|
|
116
|
+
securitySource: client._options.bearerAuth,
|
|
117
|
+
retryConfig: options?.retries
|
|
118
|
+
|| client._options.retryConfig
|
|
119
|
+
|| { strategy: "none" },
|
|
120
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const requestRes = client._createRequest(context, {
|
|
124
|
+
security: requestSecurity,
|
|
125
|
+
method: "PATCH",
|
|
126
|
+
baseURL: options?.serverURL,
|
|
127
|
+
path: path,
|
|
128
|
+
headers: headers,
|
|
129
|
+
body: body,
|
|
130
|
+
userAgent: client._options.userAgent,
|
|
131
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
132
|
+
}, options);
|
|
133
|
+
if (!requestRes.ok) {
|
|
134
|
+
return [requestRes, { status: "invalid" }];
|
|
135
|
+
}
|
|
136
|
+
const req = requestRes.value;
|
|
137
|
+
|
|
138
|
+
const doResult = await client._do(req, {
|
|
139
|
+
context,
|
|
140
|
+
errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
|
|
141
|
+
retryConfig: context.retryConfig,
|
|
142
|
+
retryCodes: context.retryCodes,
|
|
143
|
+
});
|
|
144
|
+
if (!doResult.ok) {
|
|
145
|
+
return [doResult, { status: "request-error", request: req }];
|
|
146
|
+
}
|
|
147
|
+
const response = doResult.value;
|
|
148
|
+
|
|
149
|
+
const responseFields = {
|
|
150
|
+
HttpMeta: { Response: response, Request: req },
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const [result] = await M.match<
|
|
154
|
+
models.Subscription,
|
|
155
|
+
| errors.BadRequest
|
|
156
|
+
| errors.ErrorT
|
|
157
|
+
| PaygenticError
|
|
158
|
+
| ResponseValidationError
|
|
159
|
+
| ConnectionError
|
|
160
|
+
| RequestAbortedError
|
|
161
|
+
| RequestTimeoutError
|
|
162
|
+
| InvalidRequestError
|
|
163
|
+
| UnexpectedClientError
|
|
164
|
+
| SDKValidationError
|
|
165
|
+
>(
|
|
166
|
+
M.json(200, models.Subscription$inboundSchema),
|
|
167
|
+
M.jsonErr(400, errors.BadRequest$inboundSchema),
|
|
168
|
+
M.jsonErr([401, 403, 404], errors.ErrorT$inboundSchema),
|
|
169
|
+
M.jsonErr(500, errors.ErrorT$inboundSchema),
|
|
170
|
+
M.fail("4XX"),
|
|
171
|
+
M.fail("5XX"),
|
|
172
|
+
)(response, req, { extraFields: responseFields });
|
|
173
|
+
if (!result.ok) {
|
|
174
|
+
return [result, { status: "complete", request: req, response }];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return [result, { status: "complete", request: req, response }];
|
|
178
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
export const SDK_METADATA = {
|
|
66
66
|
language: "typescript",
|
|
67
67
|
openapiDocVersion: "0.1.0",
|
|
68
|
-
sdkVersion: "0.7.
|
|
68
|
+
sdkVersion: "0.7.7",
|
|
69
69
|
genVersion: "2.879.13",
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.7.
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.7.7 2.879.13 0.1.0 @paygentic/sdk",
|
|
71
71
|
} as const;
|
package/src/models/feeprice.ts
CHANGED
|
@@ -33,7 +33,7 @@ export type FeePricePaymentTerm = ClosedEnum<typeof FeePricePaymentTerm>;
|
|
|
33
33
|
|
|
34
34
|
export type Properties = {
|
|
35
35
|
/**
|
|
36
|
-
* The unit price in dollars (e.g., '10.00').
|
|
36
|
+
* The unit price in dollars (e.g., '10.00'). Per unit. Total per period = quantity × unitPrice; see the `quantity` field.
|
|
37
37
|
*/
|
|
38
38
|
unitPrice: string;
|
|
39
39
|
};
|
|
@@ -63,6 +63,10 @@ export type FeePrice = {
|
|
|
63
63
|
*/
|
|
64
64
|
invoiceDisplayName: string;
|
|
65
65
|
properties: Properties;
|
|
66
|
+
/**
|
|
67
|
+
* Quantity for invoice line items. Total per period = quantity × unitPrice. Only supported for fee prices; metered prices derive quantity from usage. Defaults to 1.
|
|
68
|
+
*/
|
|
69
|
+
quantity: number;
|
|
66
70
|
/**
|
|
67
71
|
* The tax rate as a percentage (e.g., 10 for 10%).
|
|
68
72
|
*/
|
|
@@ -110,6 +114,7 @@ export const FeePrice$inboundSchema: z.ZodType<
|
|
|
110
114
|
paymentTerm: FeePricePaymentTerm$inboundSchema,
|
|
111
115
|
invoiceDisplayName: z.string(),
|
|
112
116
|
properties: z.lazy(() => Properties$inboundSchema),
|
|
117
|
+
quantity: z.number().int(),
|
|
113
118
|
taxRate: z.number().optional(),
|
|
114
119
|
});
|
|
115
120
|
|
package/src/models/lineitem.ts
CHANGED
|
@@ -116,7 +116,7 @@ export type LineItem = {
|
|
|
116
116
|
*/
|
|
117
117
|
paymentTerm?: LineItemPaymentTerm | null | undefined;
|
|
118
118
|
/**
|
|
119
|
-
* quantity
|
|
119
|
+
* quantity × unitPrice, before discounts and taxes. For prorated lines, may differ from `quantity × unitPrice` by display precision; subtotal is the authoritative billed amount. Defaults to '0.00' when not yet calculated.
|
|
120
120
|
*/
|
|
121
121
|
subtotal?: string | undefined;
|
|
122
122
|
/**
|
|
@@ -64,6 +64,10 @@ export type CreatePriceRequest = {
|
|
|
64
64
|
* When true, grants applied to a subscription will discount usage charged by this price. Only supported for standard metered prices.
|
|
65
65
|
*/
|
|
66
66
|
grantDiscountEnabled?: boolean | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Quantity for invoice line items. Total per period = quantity × unitPrice. Only supported for fee prices; metered prices derive quantity from usage. Defaults to 1.
|
|
69
|
+
*/
|
|
70
|
+
quantity?: number | undefined;
|
|
67
71
|
};
|
|
68
72
|
|
|
69
73
|
/** @internal */
|
|
@@ -87,6 +91,7 @@ export type CreatePriceRequest$Outbound = {
|
|
|
87
91
|
properties: models.PricePropertiesUnion$Outbound;
|
|
88
92
|
feature?: models.PriceFeatureInput$Outbound | undefined;
|
|
89
93
|
grantDiscountEnabled: boolean;
|
|
94
|
+
quantity?: number | undefined;
|
|
90
95
|
};
|
|
91
96
|
|
|
92
97
|
/** @internal */
|
|
@@ -104,6 +109,7 @@ export const CreatePriceRequest$outboundSchema: z.ZodType<
|
|
|
104
109
|
properties: models.PricePropertiesUnion$outboundSchema,
|
|
105
110
|
feature: models.PriceFeatureInput$outboundSchema.optional(),
|
|
106
111
|
grantDiscountEnabled: z.boolean().default(false),
|
|
112
|
+
quantity: z.number().int().optional(),
|
|
107
113
|
});
|
|
108
114
|
|
|
109
115
|
export function createPriceRequestToJSON(
|
|
@@ -89,5 +89,6 @@ export * from "./updateprice.js";
|
|
|
89
89
|
export * from "./updateproduct.js";
|
|
90
90
|
export * from "./updatesource.js";
|
|
91
91
|
export * from "./updatesourcerule.js";
|
|
92
|
+
export * from "./updatesubscription.js";
|
|
92
93
|
export * from "./updateuser.js";
|
|
93
94
|
export * from "./voidentitlementgrant.js";
|
|
@@ -64,6 +64,10 @@ export type UpdatePriceRequestBody = {
|
|
|
64
64
|
* When true, grants applied to a subscription will discount usage charged by this price. Only supported for standard metered prices.
|
|
65
65
|
*/
|
|
66
66
|
grantDiscountEnabled?: boolean | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Quantity for invoice line items. Total per period = quantity × unitPrice. Only supported for fee prices; metered prices derive quantity from usage. Defaults to 1.
|
|
69
|
+
*/
|
|
70
|
+
quantity?: number | undefined;
|
|
67
71
|
};
|
|
68
72
|
|
|
69
73
|
export type UpdatePriceRequest = {
|
|
@@ -94,6 +98,7 @@ export type UpdatePriceRequestBody$Outbound = {
|
|
|
94
98
|
billingCadence?: string | null | undefined;
|
|
95
99
|
feature?: models.PriceFeatureInput$Outbound | null | undefined;
|
|
96
100
|
grantDiscountEnabled?: boolean | undefined;
|
|
101
|
+
quantity?: number | undefined;
|
|
97
102
|
};
|
|
98
103
|
|
|
99
104
|
/** @internal */
|
|
@@ -110,6 +115,7 @@ export const UpdatePriceRequestBody$outboundSchema: z.ZodType<
|
|
|
110
115
|
billingCadence: z.nullable(z.string()).optional(),
|
|
111
116
|
feature: z.nullable(models.PriceFeatureInput$outboundSchema).optional(),
|
|
112
117
|
grantDiscountEnabled: z.boolean().optional(),
|
|
118
|
+
quantity: z.number().int().optional(),
|
|
113
119
|
});
|
|
114
120
|
|
|
115
121
|
export function updatePriceRequestBodyToJSON(
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const UpdateSubscriptionStatus = {
|
|
10
|
+
Active: "active",
|
|
11
|
+
Terminated: "terminated",
|
|
12
|
+
} as const;
|
|
13
|
+
export type UpdateSubscriptionStatus = ClosedEnum<
|
|
14
|
+
typeof UpdateSubscriptionStatus
|
|
15
|
+
>;
|
|
16
|
+
|
|
17
|
+
export type UpdateSubscriptionRequestBody = {
|
|
18
|
+
endingAt?: Date | undefined;
|
|
19
|
+
status?: UpdateSubscriptionStatus | undefined;
|
|
20
|
+
terminatedAt?: Date | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Identifier of entity that cancelled the subscription. Sample values: 'cust_abc123' for customer-initiated cancellation, 'org_xyz789' for merchant-initiated cancellation
|
|
23
|
+
*/
|
|
24
|
+
terminatedBy?: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Explanation for subscription cancellation. Sample values: 'Customer requested cancellation', 'Payment failure', 'Service migration', 'Contract expiration'
|
|
27
|
+
*/
|
|
28
|
+
terminationReason?: string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Enable or disable automatic charging of invoices using stored payment methods.
|
|
31
|
+
*/
|
|
32
|
+
autoCharge?: boolean | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* When true, forces tax rate to 0%.
|
|
35
|
+
*/
|
|
36
|
+
taxExempt?: boolean | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Minimum wallet balance requirement in decimal dollars (e.g., '100.00'). Can be set to '0' to disable. Maximum allowed is $5,000. Contact support for higher limits. Note: If the calculated charge amount at renewal is below payment processor minimums (typically $1.00), it will be automatically adjusted upward to meet the minimum requirement. Changes apply at next renewal.
|
|
39
|
+
*/
|
|
40
|
+
minimumAccountBalance?: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Override plan setting for renewal reminder emails. Set to true to enable, false to disable, or null to use plan default.
|
|
43
|
+
*/
|
|
44
|
+
renewalReminderEnabled?: boolean | null | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Override plan setting for number of days before renewal to send the reminder. Set to null to use plan default.
|
|
47
|
+
*/
|
|
48
|
+
renewalReminderDays?: number | null | undefined;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export type UpdateSubscriptionRequest = {
|
|
52
|
+
id: string;
|
|
53
|
+
requestBody: UpdateSubscriptionRequestBody;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** @internal */
|
|
57
|
+
export const UpdateSubscriptionStatus$outboundSchema: z.ZodNativeEnum<
|
|
58
|
+
typeof UpdateSubscriptionStatus
|
|
59
|
+
> = z.nativeEnum(UpdateSubscriptionStatus);
|
|
60
|
+
|
|
61
|
+
/** @internal */
|
|
62
|
+
export type UpdateSubscriptionRequestBody$Outbound = {
|
|
63
|
+
endingAt?: string | undefined;
|
|
64
|
+
status?: string | undefined;
|
|
65
|
+
terminatedAt?: string | undefined;
|
|
66
|
+
terminatedBy?: string | undefined;
|
|
67
|
+
terminationReason?: string | undefined;
|
|
68
|
+
autoCharge?: boolean | undefined;
|
|
69
|
+
taxExempt?: boolean | undefined;
|
|
70
|
+
minimumAccountBalance?: string | undefined;
|
|
71
|
+
renewalReminderEnabled?: boolean | null | undefined;
|
|
72
|
+
renewalReminderDays?: number | null | undefined;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** @internal */
|
|
76
|
+
export const UpdateSubscriptionRequestBody$outboundSchema: z.ZodType<
|
|
77
|
+
UpdateSubscriptionRequestBody$Outbound,
|
|
78
|
+
z.ZodTypeDef,
|
|
79
|
+
UpdateSubscriptionRequestBody
|
|
80
|
+
> = z.object({
|
|
81
|
+
endingAt: z.date().transform(v => v.toISOString()).optional(),
|
|
82
|
+
status: UpdateSubscriptionStatus$outboundSchema.optional(),
|
|
83
|
+
terminatedAt: z.date().transform(v => v.toISOString()).optional(),
|
|
84
|
+
terminatedBy: z.string().optional(),
|
|
85
|
+
terminationReason: z.string().optional(),
|
|
86
|
+
autoCharge: z.boolean().optional(),
|
|
87
|
+
taxExempt: z.boolean().optional(),
|
|
88
|
+
minimumAccountBalance: z.string().optional(),
|
|
89
|
+
renewalReminderEnabled: z.nullable(z.boolean()).optional(),
|
|
90
|
+
renewalReminderDays: z.nullable(z.number().int()).optional(),
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
export function updateSubscriptionRequestBodyToJSON(
|
|
94
|
+
updateSubscriptionRequestBody: UpdateSubscriptionRequestBody,
|
|
95
|
+
): string {
|
|
96
|
+
return JSON.stringify(
|
|
97
|
+
UpdateSubscriptionRequestBody$outboundSchema.parse(
|
|
98
|
+
updateSubscriptionRequestBody,
|
|
99
|
+
),
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** @internal */
|
|
104
|
+
export type UpdateSubscriptionRequest$Outbound = {
|
|
105
|
+
id: string;
|
|
106
|
+
RequestBody: UpdateSubscriptionRequestBody$Outbound;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/** @internal */
|
|
110
|
+
export const UpdateSubscriptionRequest$outboundSchema: z.ZodType<
|
|
111
|
+
UpdateSubscriptionRequest$Outbound,
|
|
112
|
+
z.ZodTypeDef,
|
|
113
|
+
UpdateSubscriptionRequest
|
|
114
|
+
> = z.object({
|
|
115
|
+
id: z.string(),
|
|
116
|
+
requestBody: z.lazy(() => UpdateSubscriptionRequestBody$outboundSchema),
|
|
117
|
+
}).transform((v) => {
|
|
118
|
+
return remap$(v, {
|
|
119
|
+
requestBody: "RequestBody",
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
export function updateSubscriptionRequestToJSON(
|
|
124
|
+
updateSubscriptionRequest: UpdateSubscriptionRequest,
|
|
125
|
+
): string {
|
|
126
|
+
return JSON.stringify(
|
|
127
|
+
UpdateSubscriptionRequest$outboundSchema.parse(updateSubscriptionRequest),
|
|
128
|
+
);
|
|
129
|
+
}
|
package/src/models/price.ts
CHANGED
|
@@ -61,6 +61,10 @@ export type Price = {
|
|
|
61
61
|
* When true, grants applied to a subscription will discount usage charged by this price. Only supported for standard metered prices.
|
|
62
62
|
*/
|
|
63
63
|
grantDiscountEnabled: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Quantity used when generating invoice line items for this price. Total per period = quantity × unitPrice. Only supported for fee prices; metered prices derive quantity from usage. Defaults to 1.
|
|
66
|
+
*/
|
|
67
|
+
quantity: number;
|
|
64
68
|
};
|
|
65
69
|
|
|
66
70
|
/** @internal */
|
|
@@ -99,6 +103,7 @@ export const Price$inboundSchema: z.ZodType<Price, z.ZodTypeDef, unknown> = z
|
|
|
99
103
|
),
|
|
100
104
|
features: z.array(PriceFeature$inboundSchema).optional(),
|
|
101
105
|
grantDiscountEnabled: z.boolean().default(false),
|
|
106
|
+
quantity: z.number().int().default(1),
|
|
102
107
|
});
|
|
103
108
|
|
|
104
109
|
export function priceFromJSON(
|
|
@@ -86,7 +86,7 @@ export type PriceProperties2 = {
|
|
|
86
86
|
*/
|
|
87
87
|
export type PriceProperties1 = {
|
|
88
88
|
/**
|
|
89
|
-
* Per-unit cost in decimal format for fixed-rate pricing. Sample values: '0.00002' represents $0.00002 per token, '0.15' represents $0.15 per gigabyte stored, '0.05' represents $0.05 per API call
|
|
89
|
+
* Per-unit cost in decimal format for fixed-rate pricing. Sample values: '0.00002' represents $0.00002 per token, '0.15' represents $0.15 per gigabyte stored, '0.05' represents $0.05 per API call. Per unit. Total per period = quantity × unitPrice; see the `quantity` field.
|
|
90
90
|
*/
|
|
91
91
|
unitPrice: string;
|
|
92
92
|
};
|
|
@@ -67,6 +67,10 @@ export type SchemasPrice = {
|
|
|
67
67
|
* When true, grants applied to a subscription will discount usage charged by this price. Only supported for standard metered prices.
|
|
68
68
|
*/
|
|
69
69
|
grantDiscountEnabled: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Quantity for invoice line items. Total per period = quantity × unitPrice. Only supported for fee prices; metered prices derive quantity from usage. Defaults to 1.
|
|
72
|
+
*/
|
|
73
|
+
quantity: number;
|
|
70
74
|
};
|
|
71
75
|
|
|
72
76
|
/** @internal */
|
|
@@ -103,6 +107,7 @@ export const SchemasPrice$inboundSchema: z.ZodType<
|
|
|
103
107
|
updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
104
108
|
features: z.array(PriceFeature$inboundSchema).optional(),
|
|
105
109
|
grantDiscountEnabled: z.boolean().default(false),
|
|
110
|
+
quantity: z.number().int(),
|
|
106
111
|
});
|
|
107
112
|
|
|
108
113
|
export function schemasPriceFromJSON(
|