@polar-sh/sdk 0.20.0 → 0.20.2
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 +4 -0
- package/docs/sdks/polarsubscriptions/README.md +6 -5
- package/docs/sdks/subscriptions/README.md +165 -1
- package/funcs/customerPortalSubscriptionsUpdate.d.ts +1 -1
- package/funcs/customerPortalSubscriptionsUpdate.d.ts.map +1 -1
- package/funcs/customerPortalSubscriptionsUpdate.js +2 -2
- package/funcs/customerPortalSubscriptionsUpdate.js.map +1 -1
- package/funcs/productsList.d.ts.map +1 -1
- package/funcs/productsList.js +1 -0
- package/funcs/productsList.js.map +1 -1
- package/funcs/subscriptionsRevoke.d.ts +17 -0
- package/funcs/subscriptionsRevoke.d.ts.map +1 -0
- package/funcs/subscriptionsRevoke.js +106 -0
- package/funcs/subscriptionsRevoke.js.map +1 -0
- package/funcs/subscriptionsUpdate.d.ts +17 -0
- package/funcs/subscriptionsUpdate.d.ts.map +1 -0
- package/funcs/subscriptionsUpdate.js +109 -0
- package/funcs/subscriptionsUpdate.js.map +1 -0
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/customercancellationreason.d.ts +46 -0
- package/models/components/customercancellationreason.d.ts.map +1 -0
- package/models/components/customercancellationreason.js +56 -0
- package/models/components/customercancellationreason.js.map +1 -0
- package/models/components/customerordersubscription.d.ts +9 -0
- package/models/components/customerordersubscription.d.ts.map +1 -1
- package/models/components/customerordersubscription.js +17 -0
- package/models/components/customerordersubscription.js.map +1 -1
- package/models/components/customersubscription.d.ts +9 -0
- package/models/components/customersubscription.d.ts.map +1 -1
- package/models/components/customersubscription.js +17 -0
- package/models/components/customersubscription.js.map +1 -1
- package/models/components/customersubscriptioncancel.d.ts +58 -0
- package/models/components/customersubscriptioncancel.d.ts.map +1 -0
- package/models/components/customersubscriptioncancel.js +79 -0
- package/models/components/customersubscriptioncancel.js.map +1 -0
- package/models/components/customersubscriptionupdate.d.ts +4 -6
- package/models/components/customersubscriptionupdate.d.ts.map +1 -1
- package/models/components/customersubscriptionupdate.js +10 -15
- package/models/components/customersubscriptionupdate.js.map +1 -1
- package/models/components/customersubscriptionupdateprice.d.ts +32 -0
- package/models/components/customersubscriptionupdateprice.d.ts.map +1 -0
- package/models/components/customersubscriptionupdateprice.js +68 -0
- package/models/components/customersubscriptionupdateprice.js.map +1 -0
- package/models/components/index.d.ts +7 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +7 -0
- package/models/components/index.js.map +1 -1
- package/models/components/ordersubscription.d.ts +9 -0
- package/models/components/ordersubscription.d.ts.map +1 -1
- package/models/components/ordersubscription.js +17 -0
- package/models/components/ordersubscription.js.map +1 -1
- package/models/components/subscription.d.ts +9 -0
- package/models/components/subscription.d.ts.map +1 -1
- package/models/components/subscription.js +17 -0
- package/models/components/subscription.js.map +1 -1
- package/models/components/subscriptioncancel.d.ts +80 -0
- package/models/components/subscriptioncancel.d.ts.map +1 -0
- package/models/components/subscriptioncancel.js +79 -0
- package/models/components/subscriptioncancel.js.map +1 -0
- package/models/components/subscriptionupdate.d.ts +27 -0
- package/models/components/subscriptionupdate.d.ts.map +1 -0
- package/models/components/subscriptionupdate.js +63 -0
- package/models/components/subscriptionupdate.js.map +1 -0
- package/models/components/subscriptionupdateprice.d.ts +32 -0
- package/models/components/subscriptionupdateprice.d.ts.map +1 -0
- package/models/components/subscriptionupdateprice.js +68 -0
- package/models/components/subscriptionupdateprice.js.map +1 -0
- package/models/components/webhooksubscriptioncanceledpayload.d.ts +2 -2
- package/models/components/webhooksubscriptionuncanceledpayload.d.ts +39 -0
- package/models/components/webhooksubscriptionuncanceledpayload.d.ts.map +1 -0
- package/models/components/webhooksubscriptionuncanceledpayload.js +62 -0
- package/models/components/webhooksubscriptionuncanceledpayload.js.map +1 -0
- package/models/operations/customerportalsubscriptionscancel.d.ts +1 -1
- package/models/operations/customerportalsubscriptionsget.d.ts +1 -1
- package/models/operations/customerportalsubscriptionsupdate.d.ts +1 -1
- package/models/operations/index.d.ts +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/orderslist.d.ts +13 -13
- package/models/operations/orderslist.d.ts.map +1 -1
- package/models/operations/orderslist.js +16 -16
- package/models/operations/orderslist.js.map +1 -1
- package/models/operations/productslist.d.ts +29 -0
- package/models/operations/productslist.d.ts.map +1 -1
- package/models/operations/productslist.js +26 -1
- package/models/operations/productslist.js.map +1 -1
- package/models/operations/subscriptionsrevoke.d.ts +32 -0
- package/models/operations/subscriptionsrevoke.d.ts.map +1 -0
- package/models/operations/subscriptionsrevoke.js +59 -0
- package/models/operations/subscriptionsrevoke.js.map +1 -0
- package/models/operations/subscriptionsupdate.d.ts +35 -0
- package/models/operations/subscriptionsupdate.d.ts.map +1 -0
- package/models/operations/subscriptionsupdate.js +71 -0
- package/models/operations/subscriptionsupdate.js.map +1 -0
- package/package.json +1 -1
- package/sdk/subscriptions.d.ts +15 -0
- package/sdk/subscriptions.d.ts.map +1 -1
- package/sdk/subscriptions.js +20 -0
- package/sdk/subscriptions.js.map +1 -1
- package/src/funcs/customerPortalSubscriptionsUpdate.ts +4 -1
- package/src/funcs/productsList.ts +1 -0
- package/src/funcs/subscriptionsRevoke.ts +146 -0
- package/src/funcs/subscriptionsUpdate.ts +149 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/customercancellationreason.ts +41 -0
- package/src/models/components/customerordersubscription.ts +37 -0
- package/src/models/components/customersubscription.ts +37 -0
- package/src/models/components/customersubscriptioncancel.ts +118 -0
- package/src/models/components/customersubscriptionupdate.ts +26 -21
- package/src/models/components/customersubscriptionupdateprice.ts +80 -0
- package/src/models/components/index.ts +7 -0
- package/src/models/components/ordersubscription.ts +37 -0
- package/src/models/components/subscription.ts +37 -0
- package/src/models/components/subscriptioncancel.ts +144 -0
- package/src/models/components/subscriptionupdate.ts +78 -0
- package/src/models/components/subscriptionupdateprice.ts +78 -0
- package/src/models/components/webhooksubscriptioncanceledpayload.ts +2 -2
- package/src/models/components/webhooksubscriptionuncanceledpayload.ts +90 -0
- package/src/models/operations/customerportalsubscriptionscancel.ts +1 -1
- package/src/models/operations/customerportalsubscriptionsget.ts +1 -1
- package/src/models/operations/customerportalsubscriptionsupdate.ts +1 -1
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/orderslist.ts +28 -21
- package/src/models/operations/productslist.ts +60 -0
- package/src/models/operations/subscriptionsrevoke.ts +69 -0
- package/src/models/operations/subscriptionsupdate.ts +83 -0
- package/src/sdk/subscriptions.ts +37 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.SubscriptionsUpdateRequest$ = exports.SubscriptionsUpdateRequest$outboundSchema = exports.SubscriptionsUpdateRequest$inboundSchema = void 0;
|
|
30
|
+
exports.subscriptionsUpdateRequestToJSON = subscriptionsUpdateRequestToJSON;
|
|
31
|
+
exports.subscriptionsUpdateRequestFromJSON = subscriptionsUpdateRequestFromJSON;
|
|
32
|
+
const z = __importStar(require("zod"));
|
|
33
|
+
const primitives_js_1 = require("../../lib/primitives.js");
|
|
34
|
+
const schemas_js_1 = require("../../lib/schemas.js");
|
|
35
|
+
const components = __importStar(require("../components/index.js"));
|
|
36
|
+
/** @internal */
|
|
37
|
+
exports.SubscriptionsUpdateRequest$inboundSchema = z.object({
|
|
38
|
+
id: z.string(),
|
|
39
|
+
SubscriptionUpdate: components.SubscriptionUpdate$inboundSchema,
|
|
40
|
+
}).transform((v) => {
|
|
41
|
+
return (0, primitives_js_1.remap)(v, {
|
|
42
|
+
"SubscriptionUpdate": "subscriptionUpdate",
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
/** @internal */
|
|
46
|
+
exports.SubscriptionsUpdateRequest$outboundSchema = z.object({
|
|
47
|
+
id: z.string(),
|
|
48
|
+
subscriptionUpdate: components.SubscriptionUpdate$outboundSchema,
|
|
49
|
+
}).transform((v) => {
|
|
50
|
+
return (0, primitives_js_1.remap)(v, {
|
|
51
|
+
subscriptionUpdate: "SubscriptionUpdate",
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
57
|
+
*/
|
|
58
|
+
var SubscriptionsUpdateRequest$;
|
|
59
|
+
(function (SubscriptionsUpdateRequest$) {
|
|
60
|
+
/** @deprecated use `SubscriptionsUpdateRequest$inboundSchema` instead. */
|
|
61
|
+
SubscriptionsUpdateRequest$.inboundSchema = exports.SubscriptionsUpdateRequest$inboundSchema;
|
|
62
|
+
/** @deprecated use `SubscriptionsUpdateRequest$outboundSchema` instead. */
|
|
63
|
+
SubscriptionsUpdateRequest$.outboundSchema = exports.SubscriptionsUpdateRequest$outboundSchema;
|
|
64
|
+
})(SubscriptionsUpdateRequest$ || (exports.SubscriptionsUpdateRequest$ = SubscriptionsUpdateRequest$ = {}));
|
|
65
|
+
function subscriptionsUpdateRequestToJSON(subscriptionsUpdateRequest) {
|
|
66
|
+
return JSON.stringify(exports.SubscriptionsUpdateRequest$outboundSchema.parse(subscriptionsUpdateRequest));
|
|
67
|
+
}
|
|
68
|
+
function subscriptionsUpdateRequestFromJSON(jsonString) {
|
|
69
|
+
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SubscriptionsUpdateRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubscriptionsUpdateRequest' from JSON`);
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=subscriptionsupdate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptionsupdate.js","sourceRoot":"","sources":["../../src/models/operations/subscriptionsupdate.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEH,4EAMC;AAED,gFAQC;AA9ED,uCAAyB;AACzB,2DAA0D;AAC1D,qDAAiD;AAEjD,mEAAqD;AAWrD,gBAAgB;AACH,QAAA,wCAAwC,GAIjD,CAAC,CAAC,MAAM,CAAC;IACX,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,kBAAkB,EAAE,UAAU,CAAC,gCAAgC;CAChE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,oBAAoB,EAAE,oBAAoB;KAC3C,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAQH,gBAAgB;AACH,QAAA,yCAAyC,GAIlD,CAAC,CAAC,MAAM,CAAC;IACX,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,kBAAkB,EAAE,UAAU,CAAC,iCAAiC;CACjE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,kBAAkB,EAAE,oBAAoB;KACzC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,IAAiB,2BAA2B,CAO3C;AAPD,WAAiB,2BAA2B;IAC1C,0EAA0E;IAC7D,yCAAa,GAAG,gDAAwC,CAAC;IACtE,2EAA2E;IAC9D,0CAAc,GAAG,iDAAyC,CAAC;AAG1E,CAAC,EAPgB,2BAA2B,2CAA3B,2BAA2B,QAO3C;AAED,SAAgB,gCAAgC,CAC9C,0BAAsD;IAEtD,OAAO,IAAI,CAAC,SAAS,CACnB,iDAAyC,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAC5E,CAAC;AACJ,CAAC;AAED,SAAgB,kCAAkC,CAChD,UAAkB;IAElB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,gDAAwC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACpE,wDAAwD,CACzD,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
package/sdk/subscriptions.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
|
+
import * as components from "../models/components/index.js";
|
|
2
3
|
import * as operations from "../models/operations/index.js";
|
|
3
4
|
import { PageIterator } from "../types/operations.js";
|
|
4
5
|
export declare class Subscriptions extends ClientSDK {
|
|
@@ -18,5 +19,19 @@ export declare class Subscriptions extends ClientSDK {
|
|
|
18
19
|
* Export subscriptions as a CSV file.
|
|
19
20
|
*/
|
|
20
21
|
export(request: operations.SubscriptionsExportRequest, options?: RequestOptions): Promise<any>;
|
|
22
|
+
/**
|
|
23
|
+
* Update Subscription
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* Update a subscription.
|
|
27
|
+
*/
|
|
28
|
+
update(request: operations.SubscriptionsUpdateRequest, options?: RequestOptions): Promise<components.Subscription>;
|
|
29
|
+
/**
|
|
30
|
+
* Revoke Subscription
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Revoke a subscription, i.e cancel immediately.
|
|
34
|
+
*/
|
|
35
|
+
revoke(request: operations.SubscriptionsRevokeRequest, options?: RequestOptions): Promise<components.Subscription>;
|
|
21
36
|
}
|
|
22
37
|
//# sourceMappingURL=subscriptions.d.ts.map
|
|
@@ -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":"AAQA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAwB,MAAM,wBAAwB,CAAC;AAE5E,qBAAa,aAAc,SAAQ,SAAS;IAC1C;;;;;OAKG;IACG,IAAI,CACR,OAAO,EAAE,UAAU,CAAC,wBAAwB,EAC5C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CACR,YAAY,CAAC,UAAU,CAAC,yBAAyB,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CACrE;IAQD;;;;;OAKG;IACG,MAAM,CACV,OAAO,EAAE,UAAU,CAAC,0BAA0B,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,GAAG,CAAC;IAQf;;;;;OAKG;IACG,MAAM,CACV,OAAO,EAAE,UAAU,CAAC,0BAA0B,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC;IAQnC;;;;;OAKG;IACG,MAAM,CACV,OAAO,EAAE,UAAU,CAAC,0BAA0B,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC;CAOpC"}
|
package/sdk/subscriptions.js
CHANGED
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Subscriptions = void 0;
|
|
7
7
|
const subscriptionsExport_js_1 = require("../funcs/subscriptionsExport.js");
|
|
8
8
|
const subscriptionsList_js_1 = require("../funcs/subscriptionsList.js");
|
|
9
|
+
const subscriptionsRevoke_js_1 = require("../funcs/subscriptionsRevoke.js");
|
|
10
|
+
const subscriptionsUpdate_js_1 = require("../funcs/subscriptionsUpdate.js");
|
|
9
11
|
const sdks_js_1 = require("../lib/sdks.js");
|
|
10
12
|
const fp_js_1 = require("../types/fp.js");
|
|
11
13
|
const operations_js_1 = require("../types/operations.js");
|
|
@@ -28,6 +30,24 @@ class Subscriptions extends sdks_js_1.ClientSDK {
|
|
|
28
30
|
async export(request, options) {
|
|
29
31
|
return (0, fp_js_1.unwrapAsync)((0, subscriptionsExport_js_1.subscriptionsExport)(this, request, options));
|
|
30
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Update Subscription
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* Update a subscription.
|
|
38
|
+
*/
|
|
39
|
+
async update(request, options) {
|
|
40
|
+
return (0, fp_js_1.unwrapAsync)((0, subscriptionsUpdate_js_1.subscriptionsUpdate)(this, request, options));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Revoke Subscription
|
|
44
|
+
*
|
|
45
|
+
* @remarks
|
|
46
|
+
* Revoke a subscription, i.e cancel immediately.
|
|
47
|
+
*/
|
|
48
|
+
async revoke(request, options) {
|
|
49
|
+
return (0, fp_js_1.unwrapAsync)((0, subscriptionsRevoke_js_1.subscriptionsRevoke)(this, request, options));
|
|
50
|
+
}
|
|
31
51
|
}
|
|
32
52
|
exports.Subscriptions = Subscriptions;
|
|
33
53
|
//# sourceMappingURL=subscriptions.js.map
|
package/sdk/subscriptions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../src/sdk/subscriptions.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,4EAAsE;AACtE,wEAAkE;AAClE,4CAA2D;
|
|
1
|
+
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../src/sdk/subscriptions.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,4EAAsE;AACtE,wEAAkE;AAClE,4EAAsE;AACtE,4EAAsE;AACtE,4CAA2D;AAG3D,0CAA6C;AAC7C,0DAA4E;AAE5E,MAAa,aAAc,SAAQ,mBAAS;IAC1C;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CACR,OAA4C,EAC5C,OAAwB;QAIxB,OAAO,IAAA,oCAAoB,EAAC,IAAA,wCAAiB,EAC3C,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,OAA8C,EAC9C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,4CAAmB,EACpC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,OAA8C,EAC9C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,4CAAmB,EACpC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,OAA8C,EAC9C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,4CAAmB,EACpC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AAtED,sCAsEC"}
|
|
@@ -36,6 +36,7 @@ export async function customerPortalSubscriptionsUpdate(
|
|
|
36
36
|
): Promise<
|
|
37
37
|
Result<
|
|
38
38
|
components.CustomerSubscription,
|
|
39
|
+
| errors.AlreadyCanceledSubscription
|
|
39
40
|
| errors.ResourceNotFound
|
|
40
41
|
| errors.HTTPValidationError
|
|
41
42
|
| SDKError
|
|
@@ -110,7 +111,7 @@ export async function customerPortalSubscriptionsUpdate(
|
|
|
110
111
|
|
|
111
112
|
const doResult = await client._do(req, {
|
|
112
113
|
context,
|
|
113
|
-
errorCodes: ["404", "422", "4XX", "5XX"],
|
|
114
|
+
errorCodes: ["403", "404", "422", "4XX", "5XX"],
|
|
114
115
|
retryConfig: context.retryConfig,
|
|
115
116
|
retryCodes: context.retryCodes,
|
|
116
117
|
});
|
|
@@ -125,6 +126,7 @@ export async function customerPortalSubscriptionsUpdate(
|
|
|
125
126
|
|
|
126
127
|
const [result] = await M.match<
|
|
127
128
|
components.CustomerSubscription,
|
|
129
|
+
| errors.AlreadyCanceledSubscription
|
|
128
130
|
| errors.ResourceNotFound
|
|
129
131
|
| errors.HTTPValidationError
|
|
130
132
|
| SDKError
|
|
@@ -136,6 +138,7 @@ export async function customerPortalSubscriptionsUpdate(
|
|
|
136
138
|
| ConnectionError
|
|
137
139
|
>(
|
|
138
140
|
M.json(200, components.CustomerSubscription$inboundSchema),
|
|
141
|
+
M.jsonErr(403, errors.AlreadyCanceledSubscription$inboundSchema),
|
|
139
142
|
M.jsonErr(404, errors.ResourceNotFound$inboundSchema),
|
|
140
143
|
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
141
144
|
M.fail(["4XX", "5XX"]),
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { PolarCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import * as components from "../models/components/index.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 { SDKError } from "../models/errors/sdkerror.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { Result } from "../types/fp.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Revoke Subscription
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Revoke a subscription, i.e cancel immediately.
|
|
31
|
+
*/
|
|
32
|
+
export async function subscriptionsRevoke(
|
|
33
|
+
client: PolarCore,
|
|
34
|
+
request: operations.SubscriptionsRevokeRequest,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): Promise<
|
|
37
|
+
Result<
|
|
38
|
+
components.Subscription,
|
|
39
|
+
| errors.AlreadyCanceledSubscription
|
|
40
|
+
| errors.ResourceNotFound
|
|
41
|
+
| errors.HTTPValidationError
|
|
42
|
+
| SDKError
|
|
43
|
+
| SDKValidationError
|
|
44
|
+
| UnexpectedClientError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| ConnectionError
|
|
49
|
+
>
|
|
50
|
+
> {
|
|
51
|
+
const parsed = safeParse(
|
|
52
|
+
request,
|
|
53
|
+
(value) =>
|
|
54
|
+
operations.SubscriptionsRevokeRequest$outboundSchema.parse(value),
|
|
55
|
+
"Input validation failed",
|
|
56
|
+
);
|
|
57
|
+
if (!parsed.ok) {
|
|
58
|
+
return parsed;
|
|
59
|
+
}
|
|
60
|
+
const payload = parsed.value;
|
|
61
|
+
const body = null;
|
|
62
|
+
|
|
63
|
+
const pathParams = {
|
|
64
|
+
id: encodeSimple("id", payload.id, {
|
|
65
|
+
explode: false,
|
|
66
|
+
charEncoding: "percent",
|
|
67
|
+
}),
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const path = pathToFunc("/v1/subscriptions/{id}")(pathParams);
|
|
71
|
+
|
|
72
|
+
const headers = new Headers({
|
|
73
|
+
Accept: "application/json",
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const secConfig = await extractSecurity(client._options.accessToken);
|
|
77
|
+
const securityInput = secConfig == null ? {} : { accessToken: secConfig };
|
|
78
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
79
|
+
|
|
80
|
+
const context = {
|
|
81
|
+
operationID: "subscriptions:revoke",
|
|
82
|
+
oAuth2Scopes: [],
|
|
83
|
+
|
|
84
|
+
resolvedSecurity: requestSecurity,
|
|
85
|
+
|
|
86
|
+
securitySource: client._options.accessToken,
|
|
87
|
+
retryConfig: options?.retries
|
|
88
|
+
|| client._options.retryConfig
|
|
89
|
+
|| { strategy: "none" },
|
|
90
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const requestRes = client._createRequest(context, {
|
|
94
|
+
security: requestSecurity,
|
|
95
|
+
method: "DELETE",
|
|
96
|
+
baseURL: options?.serverURL,
|
|
97
|
+
path: path,
|
|
98
|
+
headers: headers,
|
|
99
|
+
body: body,
|
|
100
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
101
|
+
}, options);
|
|
102
|
+
if (!requestRes.ok) {
|
|
103
|
+
return requestRes;
|
|
104
|
+
}
|
|
105
|
+
const req = requestRes.value;
|
|
106
|
+
|
|
107
|
+
const doResult = await client._do(req, {
|
|
108
|
+
context,
|
|
109
|
+
errorCodes: ["403", "404", "422", "4XX", "5XX"],
|
|
110
|
+
retryConfig: context.retryConfig,
|
|
111
|
+
retryCodes: context.retryCodes,
|
|
112
|
+
});
|
|
113
|
+
if (!doResult.ok) {
|
|
114
|
+
return doResult;
|
|
115
|
+
}
|
|
116
|
+
const response = doResult.value;
|
|
117
|
+
|
|
118
|
+
const responseFields = {
|
|
119
|
+
HttpMeta: { Response: response, Request: req },
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const [result] = await M.match<
|
|
123
|
+
components.Subscription,
|
|
124
|
+
| errors.AlreadyCanceledSubscription
|
|
125
|
+
| errors.ResourceNotFound
|
|
126
|
+
| errors.HTTPValidationError
|
|
127
|
+
| SDKError
|
|
128
|
+
| SDKValidationError
|
|
129
|
+
| UnexpectedClientError
|
|
130
|
+
| InvalidRequestError
|
|
131
|
+
| RequestAbortedError
|
|
132
|
+
| RequestTimeoutError
|
|
133
|
+
| ConnectionError
|
|
134
|
+
>(
|
|
135
|
+
M.json(200, components.Subscription$inboundSchema),
|
|
136
|
+
M.jsonErr(403, errors.AlreadyCanceledSubscription$inboundSchema),
|
|
137
|
+
M.jsonErr(404, errors.ResourceNotFound$inboundSchema),
|
|
138
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
139
|
+
M.fail(["4XX", "5XX"]),
|
|
140
|
+
)(response, { extraFields: responseFields });
|
|
141
|
+
if (!result.ok) {
|
|
142
|
+
return result;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { PolarCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import * as components from "../models/components/index.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 { SDKError } from "../models/errors/sdkerror.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { Result } from "../types/fp.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Update Subscription
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Update a subscription.
|
|
31
|
+
*/
|
|
32
|
+
export async function subscriptionsUpdate(
|
|
33
|
+
client: PolarCore,
|
|
34
|
+
request: operations.SubscriptionsUpdateRequest,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): Promise<
|
|
37
|
+
Result<
|
|
38
|
+
components.Subscription,
|
|
39
|
+
| errors.AlreadyCanceledSubscription
|
|
40
|
+
| errors.ResourceNotFound
|
|
41
|
+
| errors.HTTPValidationError
|
|
42
|
+
| SDKError
|
|
43
|
+
| SDKValidationError
|
|
44
|
+
| UnexpectedClientError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| ConnectionError
|
|
49
|
+
>
|
|
50
|
+
> {
|
|
51
|
+
const parsed = safeParse(
|
|
52
|
+
request,
|
|
53
|
+
(value) =>
|
|
54
|
+
operations.SubscriptionsUpdateRequest$outboundSchema.parse(value),
|
|
55
|
+
"Input validation failed",
|
|
56
|
+
);
|
|
57
|
+
if (!parsed.ok) {
|
|
58
|
+
return parsed;
|
|
59
|
+
}
|
|
60
|
+
const payload = parsed.value;
|
|
61
|
+
const body = encodeJSON("body", payload.SubscriptionUpdate, {
|
|
62
|
+
explode: true,
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const pathParams = {
|
|
66
|
+
id: encodeSimple("id", payload.id, {
|
|
67
|
+
explode: false,
|
|
68
|
+
charEncoding: "percent",
|
|
69
|
+
}),
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const path = pathToFunc("/v1/subscriptions/{id}")(pathParams);
|
|
73
|
+
|
|
74
|
+
const headers = new Headers({
|
|
75
|
+
"Content-Type": "application/json",
|
|
76
|
+
Accept: "application/json",
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const secConfig = await extractSecurity(client._options.accessToken);
|
|
80
|
+
const securityInput = secConfig == null ? {} : { accessToken: secConfig };
|
|
81
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
82
|
+
|
|
83
|
+
const context = {
|
|
84
|
+
operationID: "subscriptions:update",
|
|
85
|
+
oAuth2Scopes: [],
|
|
86
|
+
|
|
87
|
+
resolvedSecurity: requestSecurity,
|
|
88
|
+
|
|
89
|
+
securitySource: client._options.accessToken,
|
|
90
|
+
retryConfig: options?.retries
|
|
91
|
+
|| client._options.retryConfig
|
|
92
|
+
|| { strategy: "none" },
|
|
93
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const requestRes = client._createRequest(context, {
|
|
97
|
+
security: requestSecurity,
|
|
98
|
+
method: "PATCH",
|
|
99
|
+
baseURL: options?.serverURL,
|
|
100
|
+
path: path,
|
|
101
|
+
headers: headers,
|
|
102
|
+
body: body,
|
|
103
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
104
|
+
}, options);
|
|
105
|
+
if (!requestRes.ok) {
|
|
106
|
+
return requestRes;
|
|
107
|
+
}
|
|
108
|
+
const req = requestRes.value;
|
|
109
|
+
|
|
110
|
+
const doResult = await client._do(req, {
|
|
111
|
+
context,
|
|
112
|
+
errorCodes: ["403", "404", "422", "4XX", "5XX"],
|
|
113
|
+
retryConfig: context.retryConfig,
|
|
114
|
+
retryCodes: context.retryCodes,
|
|
115
|
+
});
|
|
116
|
+
if (!doResult.ok) {
|
|
117
|
+
return doResult;
|
|
118
|
+
}
|
|
119
|
+
const response = doResult.value;
|
|
120
|
+
|
|
121
|
+
const responseFields = {
|
|
122
|
+
HttpMeta: { Response: response, Request: req },
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const [result] = await M.match<
|
|
126
|
+
components.Subscription,
|
|
127
|
+
| errors.AlreadyCanceledSubscription
|
|
128
|
+
| errors.ResourceNotFound
|
|
129
|
+
| errors.HTTPValidationError
|
|
130
|
+
| SDKError
|
|
131
|
+
| SDKValidationError
|
|
132
|
+
| UnexpectedClientError
|
|
133
|
+
| InvalidRequestError
|
|
134
|
+
| RequestAbortedError
|
|
135
|
+
| RequestTimeoutError
|
|
136
|
+
| ConnectionError
|
|
137
|
+
>(
|
|
138
|
+
M.json(200, components.Subscription$inboundSchema),
|
|
139
|
+
M.jsonErr(403, errors.AlreadyCanceledSubscription$inboundSchema),
|
|
140
|
+
M.jsonErr(404, errors.ResourceNotFound$inboundSchema),
|
|
141
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
142
|
+
M.fail(["4XX", "5XX"]),
|
|
143
|
+
)(response, { extraFields: responseFields });
|
|
144
|
+
if (!result.ok) {
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return result;
|
|
149
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -60,7 +60,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
60
60
|
export const SDK_METADATA = {
|
|
61
61
|
language: "typescript",
|
|
62
62
|
openapiDocVersion: "0.1.0",
|
|
63
|
-
sdkVersion: "0.20.
|
|
64
|
-
genVersion: "2.
|
|
65
|
-
userAgent: "speakeasy-sdk/typescript 0.20.
|
|
63
|
+
sdkVersion: "0.20.2",
|
|
64
|
+
genVersion: "2.486.6",
|
|
65
|
+
userAgent: "speakeasy-sdk/typescript 0.20.2 2.486.6 0.1.0 @polar-sh/sdk",
|
|
66
66
|
} as const;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const CustomerCancellationReason = {
|
|
9
|
+
CustomerService: "customer_service",
|
|
10
|
+
LowQuality: "low_quality",
|
|
11
|
+
MissingFeatures: "missing_features",
|
|
12
|
+
SwitchedService: "switched_service",
|
|
13
|
+
TooComplex: "too_complex",
|
|
14
|
+
TooExpensive: "too_expensive",
|
|
15
|
+
Unused: "unused",
|
|
16
|
+
Other: "other",
|
|
17
|
+
} as const;
|
|
18
|
+
export type CustomerCancellationReason = ClosedEnum<
|
|
19
|
+
typeof CustomerCancellationReason
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const CustomerCancellationReason$inboundSchema: z.ZodNativeEnum<
|
|
24
|
+
typeof CustomerCancellationReason
|
|
25
|
+
> = z.nativeEnum(CustomerCancellationReason);
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const CustomerCancellationReason$outboundSchema: z.ZodNativeEnum<
|
|
29
|
+
typeof CustomerCancellationReason
|
|
30
|
+
> = CustomerCancellationReason$inboundSchema;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
35
|
+
*/
|
|
36
|
+
export namespace CustomerCancellationReason$ {
|
|
37
|
+
/** @deprecated use `CustomerCancellationReason$inboundSchema` instead. */
|
|
38
|
+
export const inboundSchema = CustomerCancellationReason$inboundSchema;
|
|
39
|
+
/** @deprecated use `CustomerCancellationReason$outboundSchema` instead. */
|
|
40
|
+
export const outboundSchema = CustomerCancellationReason$outboundSchema;
|
|
41
|
+
}
|
|
@@ -7,6 +7,11 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
CustomerCancellationReason,
|
|
12
|
+
CustomerCancellationReason$inboundSchema,
|
|
13
|
+
CustomerCancellationReason$outboundSchema,
|
|
14
|
+
} from "./customercancellationreason.js";
|
|
10
15
|
import {
|
|
11
16
|
SubscriptionRecurringInterval,
|
|
12
17
|
SubscriptionRecurringInterval$inboundSchema,
|
|
@@ -38,13 +43,17 @@ export type CustomerOrderSubscription = {
|
|
|
38
43
|
currentPeriodStart: Date;
|
|
39
44
|
currentPeriodEnd: Date | null;
|
|
40
45
|
cancelAtPeriodEnd: boolean;
|
|
46
|
+
canceledAt: Date | null;
|
|
41
47
|
startedAt: Date | null;
|
|
48
|
+
endsAt: Date | null;
|
|
42
49
|
endedAt: Date | null;
|
|
43
50
|
customerId: string;
|
|
44
51
|
productId: string;
|
|
45
52
|
priceId: string;
|
|
46
53
|
discountId: string | null;
|
|
47
54
|
checkoutId: string | null;
|
|
55
|
+
customerCancellationReason: CustomerCancellationReason | null;
|
|
56
|
+
customerCancellationComment: string | null;
|
|
48
57
|
};
|
|
49
58
|
|
|
50
59
|
/** @internal */
|
|
@@ -69,9 +78,15 @@ export const CustomerOrderSubscription$inboundSchema: z.ZodType<
|
|
|
69
78
|
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
70
79
|
),
|
|
71
80
|
cancel_at_period_end: z.boolean(),
|
|
81
|
+
canceled_at: z.nullable(
|
|
82
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
83
|
+
),
|
|
72
84
|
started_at: z.nullable(
|
|
73
85
|
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
74
86
|
),
|
|
87
|
+
ends_at: z.nullable(
|
|
88
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
89
|
+
),
|
|
75
90
|
ended_at: z.nullable(
|
|
76
91
|
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
77
92
|
),
|
|
@@ -80,6 +95,10 @@ export const CustomerOrderSubscription$inboundSchema: z.ZodType<
|
|
|
80
95
|
price_id: z.string(),
|
|
81
96
|
discount_id: z.nullable(z.string()),
|
|
82
97
|
checkout_id: z.nullable(z.string()),
|
|
98
|
+
customer_cancellation_reason: z.nullable(
|
|
99
|
+
CustomerCancellationReason$inboundSchema,
|
|
100
|
+
),
|
|
101
|
+
customer_cancellation_comment: z.nullable(z.string()),
|
|
83
102
|
}).transform((v) => {
|
|
84
103
|
return remap$(v, {
|
|
85
104
|
"created_at": "createdAt",
|
|
@@ -88,13 +107,17 @@ export const CustomerOrderSubscription$inboundSchema: z.ZodType<
|
|
|
88
107
|
"current_period_start": "currentPeriodStart",
|
|
89
108
|
"current_period_end": "currentPeriodEnd",
|
|
90
109
|
"cancel_at_period_end": "cancelAtPeriodEnd",
|
|
110
|
+
"canceled_at": "canceledAt",
|
|
91
111
|
"started_at": "startedAt",
|
|
112
|
+
"ends_at": "endsAt",
|
|
92
113
|
"ended_at": "endedAt",
|
|
93
114
|
"customer_id": "customerId",
|
|
94
115
|
"product_id": "productId",
|
|
95
116
|
"price_id": "priceId",
|
|
96
117
|
"discount_id": "discountId",
|
|
97
118
|
"checkout_id": "checkoutId",
|
|
119
|
+
"customer_cancellation_reason": "customerCancellationReason",
|
|
120
|
+
"customer_cancellation_comment": "customerCancellationComment",
|
|
98
121
|
});
|
|
99
122
|
});
|
|
100
123
|
|
|
@@ -110,13 +133,17 @@ export type CustomerOrderSubscription$Outbound = {
|
|
|
110
133
|
current_period_start: string;
|
|
111
134
|
current_period_end: string | null;
|
|
112
135
|
cancel_at_period_end: boolean;
|
|
136
|
+
canceled_at: string | null;
|
|
113
137
|
started_at: string | null;
|
|
138
|
+
ends_at: string | null;
|
|
114
139
|
ended_at: string | null;
|
|
115
140
|
customer_id: string;
|
|
116
141
|
product_id: string;
|
|
117
142
|
price_id: string;
|
|
118
143
|
discount_id: string | null;
|
|
119
144
|
checkout_id: string | null;
|
|
145
|
+
customer_cancellation_reason: string | null;
|
|
146
|
+
customer_cancellation_comment: string | null;
|
|
120
147
|
};
|
|
121
148
|
|
|
122
149
|
/** @internal */
|
|
@@ -135,13 +162,19 @@ export const CustomerOrderSubscription$outboundSchema: z.ZodType<
|
|
|
135
162
|
currentPeriodStart: z.date().transform(v => v.toISOString()),
|
|
136
163
|
currentPeriodEnd: z.nullable(z.date().transform(v => v.toISOString())),
|
|
137
164
|
cancelAtPeriodEnd: z.boolean(),
|
|
165
|
+
canceledAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
138
166
|
startedAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
167
|
+
endsAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
139
168
|
endedAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
140
169
|
customerId: z.string(),
|
|
141
170
|
productId: z.string(),
|
|
142
171
|
priceId: z.string(),
|
|
143
172
|
discountId: z.nullable(z.string()),
|
|
144
173
|
checkoutId: z.nullable(z.string()),
|
|
174
|
+
customerCancellationReason: z.nullable(
|
|
175
|
+
CustomerCancellationReason$outboundSchema,
|
|
176
|
+
),
|
|
177
|
+
customerCancellationComment: z.nullable(z.string()),
|
|
145
178
|
}).transform((v) => {
|
|
146
179
|
return remap$(v, {
|
|
147
180
|
createdAt: "created_at",
|
|
@@ -150,13 +183,17 @@ export const CustomerOrderSubscription$outboundSchema: z.ZodType<
|
|
|
150
183
|
currentPeriodStart: "current_period_start",
|
|
151
184
|
currentPeriodEnd: "current_period_end",
|
|
152
185
|
cancelAtPeriodEnd: "cancel_at_period_end",
|
|
186
|
+
canceledAt: "canceled_at",
|
|
153
187
|
startedAt: "started_at",
|
|
188
|
+
endsAt: "ends_at",
|
|
154
189
|
endedAt: "ended_at",
|
|
155
190
|
customerId: "customer_id",
|
|
156
191
|
productId: "product_id",
|
|
157
192
|
priceId: "price_id",
|
|
158
193
|
discountId: "discount_id",
|
|
159
194
|
checkoutId: "checkout_id",
|
|
195
|
+
customerCancellationReason: "customer_cancellation_reason",
|
|
196
|
+
customerCancellationComment: "customer_cancellation_comment",
|
|
160
197
|
});
|
|
161
198
|
});
|
|
162
199
|
|