@polar-sh/sdk 0.36.1 → 0.36.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 +24 -19
- package/bin/mcp-server.js +224 -66
- package/bin/mcp-server.js.map +8 -8
- package/dist/commonjs/funcs/customerPortalCustomerSessionIntrospect.d.ts +20 -0
- package/dist/commonjs/funcs/customerPortalCustomerSessionIntrospect.d.ts.map +1 -0
- package/dist/commonjs/funcs/customerPortalCustomerSessionIntrospect.js +110 -0
- package/dist/commonjs/funcs/customerPortalCustomerSessionIntrospect.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/models/components/checkout.d.ts +5 -0
- package/dist/commonjs/models/components/checkout.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkout.js +4 -0
- package/dist/commonjs/models/components/checkout.js.map +1 -1
- package/dist/commonjs/models/components/checkoutcreate.d.ts +5 -0
- package/dist/commonjs/models/components/checkoutcreate.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutcreate.js +4 -0
- package/dist/commonjs/models/components/checkoutcreate.js.map +1 -1
- package/dist/commonjs/models/components/checkoutpublic.d.ts +5 -0
- package/dist/commonjs/models/components/checkoutpublic.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutpublic.js +4 -0
- package/dist/commonjs/models/components/checkoutpublic.js.map +1 -1
- package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts +5 -0
- package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutpublicconfirmed.js +4 -0
- package/dist/commonjs/models/components/checkoutpublicconfirmed.js.map +1 -1
- package/dist/commonjs/models/components/checkoutupdate.d.ts +5 -0
- package/dist/commonjs/models/components/checkoutupdate.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutupdate.js +4 -0
- package/dist/commonjs/models/components/checkoutupdate.js.map +1 -1
- package/dist/commonjs/models/components/customercustomersession.d.ts +31 -0
- package/dist/commonjs/models/components/customercustomersession.d.ts.map +1 -0
- package/dist/commonjs/models/components/customercustomersession.js +82 -0
- package/dist/commonjs/models/components/customercustomersession.js.map +1 -0
- package/dist/commonjs/models/components/customersession.d.ts +2 -0
- package/dist/commonjs/models/components/customersession.d.ts.map +1 -1
- package/dist/commonjs/models/components/customersession.js +4 -0
- package/dist/commonjs/models/components/customersession.js.map +1 -1
- package/dist/commonjs/models/components/customersessioncustomerexternalidcreate.d.ts +5 -0
- package/dist/commonjs/models/components/customersessioncustomerexternalidcreate.d.ts.map +1 -1
- package/dist/commonjs/models/components/customersessioncustomerexternalidcreate.js +4 -0
- package/dist/commonjs/models/components/customersessioncustomerexternalidcreate.js.map +1 -1
- package/dist/commonjs/models/components/customersessioncustomeridcreate.d.ts +5 -0
- package/dist/commonjs/models/components/customersessioncustomeridcreate.d.ts.map +1 -1
- package/dist/commonjs/models/components/customersessioncustomeridcreate.js +4 -0
- package/dist/commonjs/models/components/customersessioncustomeridcreate.js.map +1 -1
- package/dist/commonjs/models/components/productcreateonetime.d.ts +44 -4
- package/dist/commonjs/models/components/productcreateonetime.d.ts.map +1 -1
- package/dist/commonjs/models/components/productcreateonetime.js +60 -20
- package/dist/commonjs/models/components/productcreateonetime.js.map +1 -1
- package/dist/commonjs/models/components/productcreaterecurring.d.ts +44 -4
- package/dist/commonjs/models/components/productcreaterecurring.d.ts.map +1 -1
- package/dist/commonjs/models/components/productcreaterecurring.js +60 -20
- package/dist/commonjs/models/components/productcreaterecurring.js.map +1 -1
- package/dist/commonjs/models/components/productupdate.d.ts +85 -4
- package/dist/commonjs/models/components/productupdate.d.ts.map +1 -1
- package/dist/commonjs/models/components/productupdate.js +117 -21
- package/dist/commonjs/models/components/productupdate.js.map +1 -1
- package/dist/commonjs/models/components/webtokenrequest.d.ts +67 -0
- package/dist/commonjs/models/components/webtokenrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/webtokenrequest.js +117 -0
- package/dist/commonjs/models/components/webtokenrequest.js.map +1 -0
- package/dist/commonjs/models/operations/customerportalcustomersessionintrospect.d.ts +29 -0
- package/dist/commonjs/models/operations/customerportalcustomersessionintrospect.d.ts.map +1 -0
- package/dist/commonjs/models/operations/customerportalcustomersessionintrospect.js +78 -0
- package/dist/commonjs/models/operations/customerportalcustomersessionintrospect.js.map +1 -0
- package/dist/commonjs/models/operations/oauth2requesttoken.d.ts +3 -2
- package/dist/commonjs/models/operations/oauth2requesttoken.d.ts.map +1 -1
- package/dist/commonjs/models/operations/oauth2requesttoken.js +3 -0
- package/dist/commonjs/models/operations/oauth2requesttoken.js.map +1 -1
- package/dist/commonjs/sdk/customerportal.d.ts +3 -0
- package/dist/commonjs/sdk/customerportal.d.ts.map +1 -1
- package/dist/commonjs/sdk/customerportal.js +4 -0
- package/dist/commonjs/sdk/customerportal.js.map +1 -1
- package/dist/commonjs/sdk/customersession.d.ts +15 -0
- package/dist/commonjs/sdk/customersession.d.ts.map +1 -0
- package/dist/commonjs/sdk/customersession.js +24 -0
- package/dist/commonjs/sdk/customersession.js.map +1 -0
- package/dist/esm/funcs/customerPortalCustomerSessionIntrospect.d.ts +20 -0
- package/dist/esm/funcs/customerPortalCustomerSessionIntrospect.d.ts.map +1 -0
- package/dist/esm/funcs/customerPortalCustomerSessionIntrospect.js +74 -0
- package/dist/esm/funcs/customerPortalCustomerSessionIntrospect.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/models/components/checkout.d.ts +5 -0
- package/dist/esm/models/components/checkout.d.ts.map +1 -1
- package/dist/esm/models/components/checkout.js +4 -0
- package/dist/esm/models/components/checkout.js.map +1 -1
- package/dist/esm/models/components/checkoutcreate.d.ts +5 -0
- package/dist/esm/models/components/checkoutcreate.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutcreate.js +4 -0
- package/dist/esm/models/components/checkoutcreate.js.map +1 -1
- package/dist/esm/models/components/checkoutpublic.d.ts +5 -0
- package/dist/esm/models/components/checkoutpublic.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutpublic.js +4 -0
- package/dist/esm/models/components/checkoutpublic.js.map +1 -1
- package/dist/esm/models/components/checkoutpublicconfirmed.d.ts +5 -0
- package/dist/esm/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutpublicconfirmed.js +4 -0
- package/dist/esm/models/components/checkoutpublicconfirmed.js.map +1 -1
- package/dist/esm/models/components/checkoutupdate.d.ts +5 -0
- package/dist/esm/models/components/checkoutupdate.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutupdate.js +4 -0
- package/dist/esm/models/components/checkoutupdate.js.map +1 -1
- package/dist/esm/models/components/customercustomersession.d.ts +31 -0
- package/dist/esm/models/components/customercustomersession.d.ts.map +1 -0
- package/dist/esm/models/components/customercustomersession.js +44 -0
- package/dist/esm/models/components/customercustomersession.js.map +1 -0
- package/dist/esm/models/components/customersession.d.ts +2 -0
- package/dist/esm/models/components/customersession.d.ts.map +1 -1
- package/dist/esm/models/components/customersession.js +4 -0
- package/dist/esm/models/components/customersession.js.map +1 -1
- package/dist/esm/models/components/customersessioncustomerexternalidcreate.d.ts +5 -0
- package/dist/esm/models/components/customersessioncustomerexternalidcreate.d.ts.map +1 -1
- package/dist/esm/models/components/customersessioncustomerexternalidcreate.js +4 -0
- package/dist/esm/models/components/customersessioncustomerexternalidcreate.js.map +1 -1
- package/dist/esm/models/components/customersessioncustomeridcreate.d.ts +5 -0
- package/dist/esm/models/components/customersessioncustomeridcreate.d.ts.map +1 -1
- package/dist/esm/models/components/customersessioncustomeridcreate.js +4 -0
- package/dist/esm/models/components/customersessioncustomeridcreate.js.map +1 -1
- package/dist/esm/models/components/productcreateonetime.d.ts +44 -4
- package/dist/esm/models/components/productcreateonetime.d.ts.map +1 -1
- package/dist/esm/models/components/productcreateonetime.js +60 -20
- package/dist/esm/models/components/productcreateonetime.js.map +1 -1
- package/dist/esm/models/components/productcreaterecurring.d.ts +44 -4
- package/dist/esm/models/components/productcreaterecurring.d.ts.map +1 -1
- package/dist/esm/models/components/productcreaterecurring.js +60 -20
- package/dist/esm/models/components/productcreaterecurring.js.map +1 -1
- package/dist/esm/models/components/productupdate.d.ts +85 -4
- package/dist/esm/models/components/productupdate.d.ts.map +1 -1
- package/dist/esm/models/components/productupdate.js +114 -20
- package/dist/esm/models/components/productupdate.js.map +1 -1
- package/dist/esm/models/components/webtokenrequest.d.ts +67 -0
- package/dist/esm/models/components/webtokenrequest.d.ts.map +1 -0
- package/dist/esm/models/components/webtokenrequest.js +79 -0
- package/dist/esm/models/components/webtokenrequest.js.map +1 -0
- package/dist/esm/models/operations/customerportalcustomersessionintrospect.d.ts +29 -0
- package/dist/esm/models/operations/customerportalcustomersessionintrospect.d.ts.map +1 -0
- package/dist/esm/models/operations/customerportalcustomersessionintrospect.js +40 -0
- package/dist/esm/models/operations/customerportalcustomersessionintrospect.js.map +1 -0
- package/dist/esm/models/operations/oauth2requesttoken.d.ts +3 -2
- package/dist/esm/models/operations/oauth2requesttoken.d.ts.map +1 -1
- package/dist/esm/models/operations/oauth2requesttoken.js +3 -0
- package/dist/esm/models/operations/oauth2requesttoken.js.map +1 -1
- package/dist/esm/sdk/customerportal.d.ts +3 -0
- package/dist/esm/sdk/customerportal.d.ts.map +1 -1
- package/dist/esm/sdk/customerportal.js +4 -0
- package/dist/esm/sdk/customerportal.js.map +1 -1
- package/dist/esm/sdk/customersession.d.ts +15 -0
- package/dist/esm/sdk/customersession.d.ts.map +1 -0
- package/dist/esm/sdk/customersession.js +20 -0
- package/dist/esm/sdk/customersession.js.map +1 -0
- package/docs/sdks/customersession/README.md +79 -0
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/customerPortalCustomerSessionIntrospect.ts +157 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/components/checkout.ts +9 -0
- package/src/models/components/checkoutcreate.ts +9 -0
- package/src/models/components/checkoutpublic.ts +9 -0
- package/src/models/components/checkoutpublicconfirmed.ts +9 -0
- package/src/models/components/checkoutupdate.ts +9 -0
- package/src/models/components/customercustomersession.ts +81 -0
- package/src/models/components/customersession.ts +6 -0
- package/src/models/components/customersessioncustomerexternalidcreate.ts +9 -0
- package/src/models/components/customersessioncustomeridcreate.ts +9 -0
- package/src/models/components/productcreateonetime.ts +120 -40
- package/src/models/components/productcreaterecurring.ts +120 -40
- package/src/models/components/productupdate.ts +233 -40
- package/src/models/components/webtokenrequest.ts +133 -0
- package/src/models/operations/customerportalcustomersessionintrospect.ts +89 -0
- package/src/models/operations/oauth2requesttoken.ts +12 -2
- package/src/sdk/customerportal.ts +6 -0
- package/src/sdk/customersession.ts +30 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type CustomerPortalCustomerSessionIntrospectSecurity = {
|
|
12
|
+
customerSession: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const CustomerPortalCustomerSessionIntrospectSecurity$inboundSchema:
|
|
17
|
+
z.ZodType<
|
|
18
|
+
CustomerPortalCustomerSessionIntrospectSecurity,
|
|
19
|
+
z.ZodTypeDef,
|
|
20
|
+
unknown
|
|
21
|
+
> = z.object({
|
|
22
|
+
customer_session: z.string(),
|
|
23
|
+
}).transform((v) => {
|
|
24
|
+
return remap$(v, {
|
|
25
|
+
"customer_session": "customerSession",
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export type CustomerPortalCustomerSessionIntrospectSecurity$Outbound = {
|
|
31
|
+
customer_session: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const CustomerPortalCustomerSessionIntrospectSecurity$outboundSchema:
|
|
36
|
+
z.ZodType<
|
|
37
|
+
CustomerPortalCustomerSessionIntrospectSecurity$Outbound,
|
|
38
|
+
z.ZodTypeDef,
|
|
39
|
+
CustomerPortalCustomerSessionIntrospectSecurity
|
|
40
|
+
> = z.object({
|
|
41
|
+
customerSession: z.string(),
|
|
42
|
+
}).transform((v) => {
|
|
43
|
+
return remap$(v, {
|
|
44
|
+
customerSession: "customer_session",
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @internal
|
|
50
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
51
|
+
*/
|
|
52
|
+
export namespace CustomerPortalCustomerSessionIntrospectSecurity$ {
|
|
53
|
+
/** @deprecated use `CustomerPortalCustomerSessionIntrospectSecurity$inboundSchema` instead. */
|
|
54
|
+
export const inboundSchema =
|
|
55
|
+
CustomerPortalCustomerSessionIntrospectSecurity$inboundSchema;
|
|
56
|
+
/** @deprecated use `CustomerPortalCustomerSessionIntrospectSecurity$outboundSchema` instead. */
|
|
57
|
+
export const outboundSchema =
|
|
58
|
+
CustomerPortalCustomerSessionIntrospectSecurity$outboundSchema;
|
|
59
|
+
/** @deprecated use `CustomerPortalCustomerSessionIntrospectSecurity$Outbound` instead. */
|
|
60
|
+
export type Outbound =
|
|
61
|
+
CustomerPortalCustomerSessionIntrospectSecurity$Outbound;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function customerPortalCustomerSessionIntrospectSecurityToJSON(
|
|
65
|
+
customerPortalCustomerSessionIntrospectSecurity:
|
|
66
|
+
CustomerPortalCustomerSessionIntrospectSecurity,
|
|
67
|
+
): string {
|
|
68
|
+
return JSON.stringify(
|
|
69
|
+
CustomerPortalCustomerSessionIntrospectSecurity$outboundSchema.parse(
|
|
70
|
+
customerPortalCustomerSessionIntrospectSecurity,
|
|
71
|
+
),
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function customerPortalCustomerSessionIntrospectSecurityFromJSON(
|
|
76
|
+
jsonString: string,
|
|
77
|
+
): SafeParseResult<
|
|
78
|
+
CustomerPortalCustomerSessionIntrospectSecurity,
|
|
79
|
+
SDKValidationError
|
|
80
|
+
> {
|
|
81
|
+
return safeParse(
|
|
82
|
+
jsonString,
|
|
83
|
+
(x) =>
|
|
84
|
+
CustomerPortalCustomerSessionIntrospectSecurity$inboundSchema.parse(
|
|
85
|
+
JSON.parse(x),
|
|
86
|
+
),
|
|
87
|
+
`Failed to parse 'CustomerPortalCustomerSessionIntrospectSecurity' from JSON`,
|
|
88
|
+
);
|
|
89
|
+
}
|
|
@@ -17,11 +17,18 @@ import {
|
|
|
17
17
|
RefreshTokenRequest$Outbound,
|
|
18
18
|
RefreshTokenRequest$outboundSchema,
|
|
19
19
|
} from "../components/refreshtokenrequest.js";
|
|
20
|
+
import {
|
|
21
|
+
WebTokenRequest,
|
|
22
|
+
WebTokenRequest$inboundSchema,
|
|
23
|
+
WebTokenRequest$Outbound,
|
|
24
|
+
WebTokenRequest$outboundSchema,
|
|
25
|
+
} from "../components/webtokenrequest.js";
|
|
20
26
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
21
27
|
|
|
22
28
|
export type Oauth2RequestTokenRequestBody =
|
|
23
29
|
| AuthorizationCodeTokenRequest
|
|
24
|
-
| RefreshTokenRequest
|
|
30
|
+
| RefreshTokenRequest
|
|
31
|
+
| WebTokenRequest;
|
|
25
32
|
|
|
26
33
|
/** @internal */
|
|
27
34
|
export const Oauth2RequestTokenRequestBody$inboundSchema: z.ZodType<
|
|
@@ -31,12 +38,14 @@ export const Oauth2RequestTokenRequestBody$inboundSchema: z.ZodType<
|
|
|
31
38
|
> = z.union([
|
|
32
39
|
AuthorizationCodeTokenRequest$inboundSchema,
|
|
33
40
|
RefreshTokenRequest$inboundSchema,
|
|
41
|
+
WebTokenRequest$inboundSchema,
|
|
34
42
|
]);
|
|
35
43
|
|
|
36
44
|
/** @internal */
|
|
37
45
|
export type Oauth2RequestTokenRequestBody$Outbound =
|
|
38
46
|
| AuthorizationCodeTokenRequest$Outbound
|
|
39
|
-
| RefreshTokenRequest$Outbound
|
|
47
|
+
| RefreshTokenRequest$Outbound
|
|
48
|
+
| WebTokenRequest$Outbound;
|
|
40
49
|
|
|
41
50
|
/** @internal */
|
|
42
51
|
export const Oauth2RequestTokenRequestBody$outboundSchema: z.ZodType<
|
|
@@ -46,6 +55,7 @@ export const Oauth2RequestTokenRequestBody$outboundSchema: z.ZodType<
|
|
|
46
55
|
> = z.union([
|
|
47
56
|
AuthorizationCodeTokenRequest$outboundSchema,
|
|
48
57
|
RefreshTokenRequest$outboundSchema,
|
|
58
|
+
WebTokenRequest$outboundSchema,
|
|
49
59
|
]);
|
|
50
60
|
|
|
51
61
|
/**
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { ClientSDK } from "../lib/sdks.js";
|
|
6
|
+
import { CustomerSession } from "./customersession.js";
|
|
6
7
|
import { Downloadables } from "./downloadables.js";
|
|
7
8
|
import { PolarBenefitGrants } from "./polarbenefitgrants.js";
|
|
8
9
|
import { PolarCustomerMeters } from "./polarcustomermeters.js";
|
|
@@ -34,6 +35,11 @@ export class CustomerPortal extends ClientSDK {
|
|
|
34
35
|
return (this._seats ??= new Seats(this._options));
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
private _customerSession?: CustomerSession;
|
|
39
|
+
get customerSession(): CustomerSession {
|
|
40
|
+
return (this._customerSession ??= new CustomerSession(this._options));
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
private _downloadables?: Downloadables;
|
|
38
44
|
get downloadables(): Downloadables {
|
|
39
45
|
return (this._downloadables ??= new Downloadables(this._options));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { customerPortalCustomerSessionIntrospect } from "../funcs/customerPortalCustomerSessionIntrospect.js";
|
|
6
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
7
|
+
import { CustomerCustomerSession } from "../models/components/customercustomersession.js";
|
|
8
|
+
import { CustomerPortalCustomerSessionIntrospectSecurity } from "../models/operations/customerportalcustomersessionintrospect.js";
|
|
9
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
10
|
+
|
|
11
|
+
export class CustomerSession extends ClientSDK {
|
|
12
|
+
/**
|
|
13
|
+
* Introspect Customer Session
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Introspect the current session and return its information.
|
|
17
|
+
*
|
|
18
|
+
* **Scopes**: `customer_portal:read` `customer_portal:write`
|
|
19
|
+
*/
|
|
20
|
+
async introspect(
|
|
21
|
+
security: CustomerPortalCustomerSessionIntrospectSecurity,
|
|
22
|
+
options?: RequestOptions,
|
|
23
|
+
): Promise<CustomerCustomerSession> {
|
|
24
|
+
return unwrapAsync(customerPortalCustomerSessionIntrospect(
|
|
25
|
+
this,
|
|
26
|
+
security,
|
|
27
|
+
options,
|
|
28
|
+
));
|
|
29
|
+
}
|
|
30
|
+
}
|