@polar-sh/sdk 0.34.13 → 0.34.14

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.
Files changed (92) hide show
  1. package/README.md +2 -1
  2. package/bin/mcp-server.js +55 -10
  3. package/bin/mcp-server.js.map +13 -12
  4. package/dist/commonjs/funcs/subscriptionsRevoke.d.ts +2 -1
  5. package/dist/commonjs/funcs/subscriptionsRevoke.d.ts.map +1 -1
  6. package/dist/commonjs/funcs/subscriptionsRevoke.js +3 -2
  7. package/dist/commonjs/funcs/subscriptionsRevoke.js.map +1 -1
  8. package/dist/commonjs/funcs/subscriptionsUpdate.d.ts +2 -1
  9. package/dist/commonjs/funcs/subscriptionsUpdate.d.ts.map +1 -1
  10. package/dist/commonjs/funcs/subscriptionsUpdate.js +3 -2
  11. package/dist/commonjs/funcs/subscriptionsUpdate.js.map +1 -1
  12. package/dist/commonjs/lib/config.d.ts +3 -3
  13. package/dist/commonjs/lib/config.js +3 -3
  14. package/dist/commonjs/lib/config.js.map +1 -1
  15. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  16. package/dist/commonjs/mcp-server/server.js +1 -1
  17. package/dist/commonjs/models/components/checkoutlinkproduct.d.ts +1 -1
  18. package/dist/commonjs/models/components/checkoutproduct.d.ts +1 -1
  19. package/dist/commonjs/models/components/customerorderproduct.d.ts +1 -1
  20. package/dist/commonjs/models/components/customerproduct.d.ts +1 -1
  21. package/dist/commonjs/models/components/customersubscriptionproduct.d.ts +1 -1
  22. package/dist/commonjs/models/components/discountproduct.d.ts +1 -1
  23. package/dist/commonjs/models/components/orderproduct.d.ts +1 -1
  24. package/dist/commonjs/models/components/product.d.ts +1 -1
  25. package/dist/commonjs/models/components/productcreate.d.ts +1 -1
  26. package/dist/commonjs/models/components/scope.d.ts +6 -3
  27. package/dist/commonjs/models/components/scope.d.ts.map +1 -1
  28. package/dist/commonjs/models/components/scope.js +2 -1
  29. package/dist/commonjs/models/components/scope.js.map +1 -1
  30. package/dist/commonjs/models/components/subscriptionrecurringinterval.d.ts +6 -0
  31. package/dist/commonjs/models/components/subscriptionrecurringinterval.d.ts.map +1 -1
  32. package/dist/commonjs/models/components/subscriptionrecurringinterval.js +2 -0
  33. package/dist/commonjs/models/components/subscriptionrecurringinterval.js.map +1 -1
  34. package/dist/commonjs/models/errors/subscriptionlocked.d.ts +39 -0
  35. package/dist/commonjs/models/errors/subscriptionlocked.d.ts.map +1 -0
  36. package/dist/commonjs/models/errors/subscriptionlocked.js +88 -0
  37. package/dist/commonjs/models/errors/subscriptionlocked.js.map +1 -0
  38. package/dist/esm/funcs/subscriptionsRevoke.d.ts +2 -1
  39. package/dist/esm/funcs/subscriptionsRevoke.d.ts.map +1 -1
  40. package/dist/esm/funcs/subscriptionsRevoke.js +3 -2
  41. package/dist/esm/funcs/subscriptionsRevoke.js.map +1 -1
  42. package/dist/esm/funcs/subscriptionsUpdate.d.ts +2 -1
  43. package/dist/esm/funcs/subscriptionsUpdate.d.ts.map +1 -1
  44. package/dist/esm/funcs/subscriptionsUpdate.js +3 -2
  45. package/dist/esm/funcs/subscriptionsUpdate.js.map +1 -1
  46. package/dist/esm/lib/config.d.ts +3 -3
  47. package/dist/esm/lib/config.js +3 -3
  48. package/dist/esm/lib/config.js.map +1 -1
  49. package/dist/esm/mcp-server/mcp-server.js +1 -1
  50. package/dist/esm/mcp-server/server.js +1 -1
  51. package/dist/esm/models/components/checkoutlinkproduct.d.ts +1 -1
  52. package/dist/esm/models/components/checkoutproduct.d.ts +1 -1
  53. package/dist/esm/models/components/customerorderproduct.d.ts +1 -1
  54. package/dist/esm/models/components/customerproduct.d.ts +1 -1
  55. package/dist/esm/models/components/customersubscriptionproduct.d.ts +1 -1
  56. package/dist/esm/models/components/discountproduct.d.ts +1 -1
  57. package/dist/esm/models/components/orderproduct.d.ts +1 -1
  58. package/dist/esm/models/components/product.d.ts +1 -1
  59. package/dist/esm/models/components/productcreate.d.ts +1 -1
  60. package/dist/esm/models/components/scope.d.ts +6 -3
  61. package/dist/esm/models/components/scope.d.ts.map +1 -1
  62. package/dist/esm/models/components/scope.js +2 -1
  63. package/dist/esm/models/components/scope.js.map +1 -1
  64. package/dist/esm/models/components/subscriptionrecurringinterval.d.ts +6 -0
  65. package/dist/esm/models/components/subscriptionrecurringinterval.d.ts.map +1 -1
  66. package/dist/esm/models/components/subscriptionrecurringinterval.js +2 -0
  67. package/dist/esm/models/components/subscriptionrecurringinterval.js.map +1 -1
  68. package/dist/esm/models/errors/subscriptionlocked.d.ts +39 -0
  69. package/dist/esm/models/errors/subscriptionlocked.d.ts.map +1 -0
  70. package/dist/esm/models/errors/subscriptionlocked.js +51 -0
  71. package/dist/esm/models/errors/subscriptionlocked.js.map +1 -0
  72. package/docs/sdks/subscriptions/README.md +2 -0
  73. package/examples/package-lock.json +1 -1
  74. package/jsr.json +1 -1
  75. package/package.json +1 -1
  76. package/src/funcs/subscriptionsRevoke.ts +9 -1
  77. package/src/funcs/subscriptionsUpdate.ts +9 -1
  78. package/src/lib/config.ts +3 -3
  79. package/src/mcp-server/mcp-server.ts +1 -1
  80. package/src/mcp-server/server.ts +1 -1
  81. package/src/models/components/checkoutlinkproduct.ts +1 -1
  82. package/src/models/components/checkoutproduct.ts +1 -1
  83. package/src/models/components/customerorderproduct.ts +1 -1
  84. package/src/models/components/customerproduct.ts +1 -1
  85. package/src/models/components/customersubscriptionproduct.ts +1 -1
  86. package/src/models/components/discountproduct.ts +1 -1
  87. package/src/models/components/orderproduct.ts +1 -1
  88. package/src/models/components/product.ts +1 -1
  89. package/src/models/components/productcreate.ts +1 -1
  90. package/src/models/components/scope.ts +2 -1
  91. package/src/models/components/subscriptionrecurringinterval.ts +2 -0
  92. package/src/models/errors/subscriptionlocked.ts +85 -0
@@ -55,7 +55,7 @@ export function createMCPServer(deps: {
55
55
  }) {
56
56
  const server = new McpServer({
57
57
  name: "Polar",
58
- version: "0.34.13",
58
+ version: "0.34.14",
59
59
  });
60
60
 
61
61
  const client = new PolarCore({
@@ -69,7 +69,7 @@ export type CheckoutLinkProduct = {
69
69
  */
70
70
  description: string | null;
71
71
  /**
72
- * The recurring interval of the product. If `None`, the product is a one-time purchase.
72
+ * The recurring interval of the product. If `None`, the product is a one-time purchase.Note that the `day` and `week` values are for internal Polar staff use only.
73
73
  */
74
74
  recurringInterval: SubscriptionRecurringInterval | null;
75
75
  /**
@@ -64,7 +64,7 @@ export type CheckoutProduct = {
64
64
  */
65
65
  description: string | null;
66
66
  /**
67
- * The recurring interval of the product. If `None`, the product is a one-time purchase.
67
+ * The recurring interval of the product. If `None`, the product is a one-time purchase.Note that the `day` and `week` values are for internal Polar staff use only.
68
68
  */
69
69
  recurringInterval: SubscriptionRecurringInterval | null;
70
70
  /**
@@ -69,7 +69,7 @@ export type CustomerOrderProduct = {
69
69
  */
70
70
  description: string | null;
71
71
  /**
72
- * The recurring interval of the product. If `None`, the product is a one-time purchase.
72
+ * The recurring interval of the product. If `None`, the product is a one-time purchase.Note that the `day` and `week` values are for internal Polar staff use only.
73
73
  */
74
74
  recurringInterval: SubscriptionRecurringInterval | null;
75
75
  /**
@@ -64,7 +64,7 @@ export type CustomerProduct = {
64
64
  */
65
65
  description: string | null;
66
66
  /**
67
- * The recurring interval of the product. If `None`, the product is a one-time purchase.
67
+ * The recurring interval of the product. If `None`, the product is a one-time purchase.Note that the `day` and `week` values are for internal Polar staff use only.
68
68
  */
69
69
  recurringInterval: SubscriptionRecurringInterval | null;
70
70
  /**
@@ -69,7 +69,7 @@ export type CustomerSubscriptionProduct = {
69
69
  */
70
70
  description: string | null;
71
71
  /**
72
- * The recurring interval of the product. If `None`, the product is a one-time purchase.
72
+ * The recurring interval of the product. If `None`, the product is a one-time purchase.Note that the `day` and `week` values are for internal Polar staff use only.
73
73
  */
74
74
  recurringInterval: SubscriptionRecurringInterval | null;
75
75
  /**
@@ -41,7 +41,7 @@ export type DiscountProduct = {
41
41
  */
42
42
  description: string | null;
43
43
  /**
44
- * The recurring interval of the product. If `None`, the product is a one-time purchase.
44
+ * The recurring interval of the product. If `None`, the product is a one-time purchase.Note that the `day` and `week` values are for internal Polar staff use only.
45
45
  */
46
46
  recurringInterval: SubscriptionRecurringInterval | null;
47
47
  /**
@@ -38,7 +38,7 @@ export type OrderProduct = {
38
38
  */
39
39
  description: string | null;
40
40
  /**
41
- * The recurring interval of the product. If `None`, the product is a one-time purchase.
41
+ * The recurring interval of the product. If `None`, the product is a one-time purchase.Note that the `day` and `week` values are for internal Polar staff use only.
42
42
  */
43
43
  recurringInterval: SubscriptionRecurringInterval | null;
44
44
  /**
@@ -72,7 +72,7 @@ export type Product = {
72
72
  */
73
73
  description: string | null;
74
74
  /**
75
- * The recurring interval of the product. If `None`, the product is a one-time purchase.
75
+ * The recurring interval of the product. If `None`, the product is a one-time purchase.Note that the `day` and `week` values are for internal Polar staff use only.
76
76
  */
77
77
  recurringInterval: SubscriptionRecurringInterval | null;
78
78
  /**
@@ -80,7 +80,7 @@ export type ProductCreate = {
80
80
  */
81
81
  description?: string | null | undefined;
82
82
  /**
83
- * The recurring interval of the product. If `None`, the product is a one-time purchase.
83
+ * The recurring interval of the product. If `None`, the product is a one-time purchase.Note that the `day` and `week` values are for internal Polar staff use only.
84
84
  */
85
85
  recurringInterval: SubscriptionRecurringInterval | null;
86
86
  /**
@@ -10,7 +10,8 @@ export const Scope = {
10
10
  Profile: "profile",
11
11
  Email: "email",
12
12
  UserRead: "user:read",
13
- WebDefault: "web_default",
13
+ WebRead: "web:read",
14
+ WebWrite: "web:write",
14
15
  OrganizationsRead: "organizations:read",
15
16
  OrganizationsWrite: "organizations:write",
16
17
  CustomFieldsRead: "custom_fields:read",
@@ -6,6 +6,8 @@ import * as z from "zod";
6
6
  import { ClosedEnum } from "../../types/enums.js";
7
7
 
8
8
  export const SubscriptionRecurringInterval = {
9
+ Day: "day",
10
+ Week: "week",
9
11
  Month: "month",
10
12
  Year: "year",
11
13
  } as const;
@@ -0,0 +1,85 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { PolarError } from "./polarerror.js";
7
+
8
+ export type SubscriptionLockedData = {
9
+ error: "SubscriptionLocked";
10
+ detail: string;
11
+ };
12
+
13
+ export class SubscriptionLocked extends PolarError {
14
+ error: "SubscriptionLocked";
15
+ detail: string;
16
+
17
+ /** The original data that was passed to this error instance. */
18
+ data$: SubscriptionLockedData;
19
+
20
+ constructor(
21
+ err: SubscriptionLockedData,
22
+ httpMeta: { response: Response; request: Request; body: string },
23
+ ) {
24
+ const message = "message" in err && typeof err.message === "string"
25
+ ? err.message
26
+ : `API error occurred: ${JSON.stringify(err)}`;
27
+ super(message, httpMeta);
28
+ this.data$ = err;
29
+ this.error = err.error;
30
+ this.detail = err.detail;
31
+
32
+ this.name = "SubscriptionLocked";
33
+ }
34
+ }
35
+
36
+ /** @internal */
37
+ export const SubscriptionLocked$inboundSchema: z.ZodType<
38
+ SubscriptionLocked,
39
+ z.ZodTypeDef,
40
+ unknown
41
+ > = z.object({
42
+ error: z.literal("SubscriptionLocked"),
43
+ detail: z.string(),
44
+ request$: z.instanceof(Request),
45
+ response$: z.instanceof(Response),
46
+ body$: z.string(),
47
+ })
48
+ .transform((v) => {
49
+ return new SubscriptionLocked(v, {
50
+ request: v.request$,
51
+ response: v.response$,
52
+ body: v.body$,
53
+ });
54
+ });
55
+
56
+ /** @internal */
57
+ export type SubscriptionLocked$Outbound = {
58
+ error: "SubscriptionLocked";
59
+ detail: string;
60
+ };
61
+
62
+ /** @internal */
63
+ export const SubscriptionLocked$outboundSchema: z.ZodType<
64
+ SubscriptionLocked$Outbound,
65
+ z.ZodTypeDef,
66
+ SubscriptionLocked
67
+ > = z.instanceof(SubscriptionLocked)
68
+ .transform(v => v.data$)
69
+ .pipe(z.object({
70
+ error: z.literal("SubscriptionLocked"),
71
+ detail: z.string(),
72
+ }));
73
+
74
+ /**
75
+ * @internal
76
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
77
+ */
78
+ export namespace SubscriptionLocked$ {
79
+ /** @deprecated use `SubscriptionLocked$inboundSchema` instead. */
80
+ export const inboundSchema = SubscriptionLocked$inboundSchema;
81
+ /** @deprecated use `SubscriptionLocked$outboundSchema` instead. */
82
+ export const outboundSchema = SubscriptionLocked$outboundSchema;
83
+ /** @deprecated use `SubscriptionLocked$Outbound` instead. */
84
+ export type Outbound = SubscriptionLocked$Outbound;
85
+ }