@polar-sh/sdk 0.13.1 → 0.13.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.
Files changed (155) hide show
  1. package/README.md +13 -0
  2. package/docs/sdks/checkoutlinks/README.md +400 -0
  3. package/funcs/checkoutLinksCreate.d.ts +16 -0
  4. package/funcs/checkoutLinksCreate.d.ts.map +1 -0
  5. package/funcs/checkoutLinksCreate.js +95 -0
  6. package/funcs/checkoutLinksCreate.js.map +1 -0
  7. package/funcs/checkoutLinksDelete.d.ts +16 -0
  8. package/funcs/checkoutLinksDelete.d.ts.map +1 -0
  9. package/funcs/checkoutLinksDelete.js +101 -0
  10. package/funcs/checkoutLinksDelete.js.map +1 -0
  11. package/funcs/checkoutLinksGet.d.ts +17 -0
  12. package/funcs/checkoutLinksGet.d.ts.map +1 -0
  13. package/funcs/checkoutLinksGet.js +101 -0
  14. package/funcs/checkoutLinksGet.js.map +1 -0
  15. package/funcs/checkoutLinksList.d.ts +17 -0
  16. package/funcs/checkoutLinksList.d.ts.map +1 -0
  17. package/funcs/checkoutLinksList.js +130 -0
  18. package/funcs/checkoutLinksList.js.map +1 -0
  19. package/funcs/checkoutLinksUpdate.d.ts +17 -0
  20. package/funcs/checkoutLinksUpdate.d.ts.map +1 -0
  21. package/funcs/checkoutLinksUpdate.js +104 -0
  22. package/funcs/checkoutLinksUpdate.js.map +1 -0
  23. package/lib/config.d.ts +2 -2
  24. package/lib/config.js +2 -2
  25. package/models/components/checkoutlink.d.ts +69 -0
  26. package/models/components/checkoutlink.d.ts.map +1 -0
  27. package/models/components/checkoutlink.js +90 -0
  28. package/models/components/checkoutlink.js.map +1 -0
  29. package/models/components/checkoutlinkcreate.d.ts +85 -0
  30. package/models/components/checkoutlinkcreate.d.ts.map +1 -0
  31. package/models/components/checkoutlinkcreate.js +90 -0
  32. package/models/components/checkoutlinkcreate.js.map +1 -0
  33. package/models/components/checkoutlinksortproperty.d.ts +28 -0
  34. package/models/components/checkoutlinksortproperty.d.ts.map +1 -0
  35. package/models/components/checkoutlinksortproperty.js +50 -0
  36. package/models/components/checkoutlinksortproperty.js.map +1 -0
  37. package/models/components/checkoutlinkupdate.d.ts +46 -0
  38. package/models/components/checkoutlinkupdate.d.ts.map +1 -0
  39. package/models/components/checkoutlinkupdate.js +61 -0
  40. package/models/components/checkoutlinkupdate.js.map +1 -0
  41. package/models/components/checkoutpublic.d.ts +5 -2
  42. package/models/components/checkoutpublic.d.ts.map +1 -1
  43. package/models/components/checkoutpublic.js +2 -2
  44. package/models/components/checkoutpublic.js.map +1 -1
  45. package/models/components/index.d.ts +5 -0
  46. package/models/components/index.d.ts.map +1 -1
  47. package/models/components/index.js +5 -0
  48. package/models/components/index.js.map +1 -1
  49. package/models/components/listresourcecheckoutlink.d.ts +29 -0
  50. package/models/components/listresourcecheckoutlink.d.ts.map +1 -0
  51. package/models/components/listresourcecheckoutlink.js +54 -0
  52. package/models/components/listresourcecheckoutlink.js.map +1 -0
  53. package/models/components/oauth2client.js +2 -2
  54. package/models/components/oauth2client.js.map +1 -1
  55. package/models/components/oauth2clientconfiguration.js +2 -2
  56. package/models/components/oauth2clientconfiguration.js.map +1 -1
  57. package/models/components/oauth2clientconfigurationupdate.js +2 -2
  58. package/models/components/oauth2clientconfigurationupdate.js.map +1 -1
  59. package/models/components/polarcheckoutschemascheckout.d.ts +2 -109
  60. package/models/components/polarcheckoutschemascheckout.d.ts.map +1 -1
  61. package/models/components/polarcheckoutschemascheckout.js +3 -108
  62. package/models/components/polarcheckoutschemascheckout.js.map +1 -1
  63. package/models/components/productpriceonetimecustom.d.ts +5 -0
  64. package/models/components/productpriceonetimecustom.d.ts.map +1 -1
  65. package/models/components/productpriceonetimecustom.js +4 -0
  66. package/models/components/productpriceonetimecustom.js.map +1 -1
  67. package/models/components/productpriceonetimefixed.d.ts +5 -0
  68. package/models/components/productpriceonetimefixed.d.ts.map +1 -1
  69. package/models/components/productpriceonetimefixed.js +4 -0
  70. package/models/components/productpriceonetimefixed.js.map +1 -1
  71. package/models/components/productpriceonetimefree.d.ts +5 -0
  72. package/models/components/productpriceonetimefree.d.ts.map +1 -1
  73. package/models/components/productpriceonetimefree.js +4 -0
  74. package/models/components/productpriceonetimefree.js.map +1 -1
  75. package/models/components/productpricerecurringcustom.d.ts +5 -0
  76. package/models/components/productpricerecurringcustom.d.ts.map +1 -1
  77. package/models/components/productpricerecurringcustom.js +4 -0
  78. package/models/components/productpricerecurringcustom.js.map +1 -1
  79. package/models/components/productpricerecurringfixed.d.ts +5 -0
  80. package/models/components/productpricerecurringfixed.d.ts.map +1 -1
  81. package/models/components/productpricerecurringfixed.js +4 -0
  82. package/models/components/productpricerecurringfixed.js.map +1 -1
  83. package/models/components/productpricerecurringfree.d.ts +5 -0
  84. package/models/components/productpricerecurringfree.d.ts.map +1 -1
  85. package/models/components/productpricerecurringfree.js +4 -0
  86. package/models/components/productpricerecurringfree.js.map +1 -1
  87. package/models/components/webhookcheckoutcreatedpayload.d.ts +3 -3
  88. package/models/components/webhookcheckoutcreatedpayload.d.ts.map +1 -1
  89. package/models/components/webhookcheckoutcreatedpayload.js +2 -2
  90. package/models/components/webhookcheckoutcreatedpayload.js.map +1 -1
  91. package/models/components/webhookcheckoutupdatedpayload.d.ts +3 -3
  92. package/models/components/webhookcheckoutupdatedpayload.d.ts.map +1 -1
  93. package/models/components/webhookcheckoutupdatedpayload.js +2 -2
  94. package/models/components/webhookcheckoutupdatedpayload.js.map +1 -1
  95. package/models/operations/checkoutlinksdelete.d.ts +28 -0
  96. package/models/operations/checkoutlinksdelete.d.ts.map +1 -0
  97. package/models/operations/checkoutlinksdelete.js +50 -0
  98. package/models/operations/checkoutlinksdelete.js.map +1 -0
  99. package/models/operations/checkoutlinksget.d.ts +28 -0
  100. package/models/operations/checkoutlinksget.d.ts.map +1 -0
  101. package/models/operations/checkoutlinksget.js +50 -0
  102. package/models/operations/checkoutlinksget.js.map +1 -0
  103. package/models/operations/checkoutlinkslist.d.ts +116 -0
  104. package/models/operations/checkoutlinkslist.d.ts.map +1 -0
  105. package/models/operations/checkoutlinkslist.js +129 -0
  106. package/models/operations/checkoutlinkslist.js.map +1 -0
  107. package/models/operations/checkoutlinksupdate.d.ts +31 -0
  108. package/models/operations/checkoutlinksupdate.d.ts.map +1 -0
  109. package/models/operations/checkoutlinksupdate.js +62 -0
  110. package/models/operations/checkoutlinksupdate.js.map +1 -0
  111. package/models/operations/index.d.ts +4 -0
  112. package/models/operations/index.d.ts.map +1 -1
  113. package/models/operations/index.js +4 -0
  114. package/models/operations/index.js.map +1 -1
  115. package/package.json +1 -1
  116. package/sdk/checkoutlinks.d.ts +42 -0
  117. package/sdk/checkoutlinks.d.ts.map +1 -0
  118. package/sdk/checkoutlinks.js +63 -0
  119. package/sdk/checkoutlinks.js.map +1 -0
  120. package/sdk/sdk.d.ts +3 -0
  121. package/sdk/sdk.d.ts.map +1 -1
  122. package/sdk/sdk.js +5 -0
  123. package/sdk/sdk.js.map +1 -1
  124. package/src/funcs/checkoutLinksCreate.ts +124 -0
  125. package/src/funcs/checkoutLinksDelete.ts +135 -0
  126. package/src/funcs/checkoutLinksGet.ts +134 -0
  127. package/src/funcs/checkoutLinksList.ts +189 -0
  128. package/src/funcs/checkoutLinksUpdate.ts +138 -0
  129. package/src/lib/config.ts +2 -2
  130. package/src/models/components/checkoutlink.ts +131 -0
  131. package/src/models/components/checkoutlinkcreate.ts +127 -0
  132. package/src/models/components/checkoutlinksortproperty.ts +35 -0
  133. package/src/models/components/checkoutlinkupdate.ts +73 -0
  134. package/src/models/components/checkoutpublic.ts +7 -4
  135. package/src/models/components/index.ts +5 -0
  136. package/src/models/components/listresourcecheckoutlink.ts +61 -0
  137. package/src/models/components/oauth2client.ts +2 -2
  138. package/src/models/components/oauth2clientconfiguration.ts +2 -2
  139. package/src/models/components/oauth2clientconfigurationupdate.ts +2 -2
  140. package/src/models/components/polarcheckoutschemascheckout.ts +4 -217
  141. package/src/models/components/productpriceonetimecustom.ts +9 -0
  142. package/src/models/components/productpriceonetimefixed.ts +9 -0
  143. package/src/models/components/productpriceonetimefree.ts +9 -0
  144. package/src/models/components/productpricerecurringcustom.ts +9 -0
  145. package/src/models/components/productpricerecurringfixed.ts +9 -0
  146. package/src/models/components/productpricerecurringfree.ts +9 -0
  147. package/src/models/components/webhookcheckoutcreatedpayload.ts +8 -8
  148. package/src/models/components/webhookcheckoutupdatedpayload.ts +8 -8
  149. package/src/models/operations/checkoutlinksdelete.ts +48 -0
  150. package/src/models/operations/checkoutlinksget.ts +48 -0
  151. package/src/models/operations/checkoutlinkslist.ts +224 -0
  152. package/src/models/operations/checkoutlinksupdate.ts +62 -0
  153. package/src/models/operations/index.ts +4 -0
  154. package/src/sdk/checkoutlinks.ts +101 -0
  155. package/src/sdk/sdk.ts +6 -0
@@ -52,6 +52,10 @@ export type CheckoutPublic = {
52
52
  * Client secret used to update and complete the checkout session from the client.
53
53
  */
54
54
  clientSecret: string;
55
+ /**
56
+ * URL where the customer can access the checkout session.
57
+ */
58
+ url: string;
55
59
  /**
56
60
  * Expiration date and time of the checkout session.
57
61
  */
@@ -97,7 +101,6 @@ export type CheckoutPublic = {
97
101
  */
98
102
  product: Product;
99
103
  productPrice: ProductPrice;
100
- url: string;
101
104
  };
102
105
 
103
106
  /** @internal */
@@ -146,6 +149,7 @@ export const CheckoutPublic$inboundSchema: z.ZodType<
146
149
  payment_processor: z.literal("stripe").optional(),
147
150
  status: CheckoutStatus$inboundSchema,
148
151
  client_secret: z.string(),
152
+ url: z.string(),
149
153
  expires_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
150
154
  success_url: z.string(),
151
155
  amount: z.nullable(z.number().int()),
@@ -166,7 +170,6 @@ export const CheckoutPublic$inboundSchema: z.ZodType<
166
170
  ),
167
171
  product: Product$inboundSchema,
168
172
  product_price: ProductPrice$inboundSchema,
169
- url: z.string(),
170
173
  }).transform((v) => {
171
174
  return remap$(v, {
172
175
  "created_at": "createdAt",
@@ -199,6 +202,7 @@ export type CheckoutPublic$Outbound = {
199
202
  payment_processor: "stripe";
200
203
  status: string;
201
204
  client_secret: string;
205
+ url: string;
202
206
  expires_at: string;
203
207
  success_url: string;
204
208
  amount: number | null;
@@ -217,7 +221,6 @@ export type CheckoutPublic$Outbound = {
217
221
  payment_processor_metadata: CheckoutPublicPaymentProcessorMetadata$Outbound;
218
222
  product: Product$Outbound;
219
223
  product_price: ProductPrice$Outbound;
220
- url: string;
221
224
  };
222
225
 
223
226
  /** @internal */
@@ -232,6 +235,7 @@ export const CheckoutPublic$outboundSchema: z.ZodType<
232
235
  paymentProcessor: z.literal("stripe").default("stripe"),
233
236
  status: CheckoutStatus$outboundSchema,
234
237
  clientSecret: z.string(),
238
+ url: z.string(),
235
239
  expiresAt: z.date().transform(v => v.toISOString()),
236
240
  successUrl: z.string(),
237
241
  amount: z.nullable(z.number().int()),
@@ -252,7 +256,6 @@ export const CheckoutPublic$outboundSchema: z.ZodType<
252
256
  ),
253
257
  product: Product$outboundSchema,
254
258
  productPrice: ProductPrice$outboundSchema,
255
- url: z.string(),
256
259
  }).transform((v) => {
257
260
  return remap$(v, {
258
261
  createdAt: "created_at",
@@ -82,6 +82,10 @@ export * from "./benefitlicensekeysupdate.js";
82
82
  export * from "./benefittype.js";
83
83
  export * from "./bylineprofile.js";
84
84
  export * from "./checkoutconfirmstripe.js";
85
+ export * from "./checkoutlink.js";
86
+ export * from "./checkoutlinkcreate.js";
87
+ export * from "./checkoutlinksortproperty.js";
88
+ export * from "./checkoutlinkupdate.js";
85
89
  export * from "./checkoutpublic.js";
86
90
  export * from "./checkoutsortproperty.js";
87
91
  export * from "./checkoutstatus.js";
@@ -121,6 +125,7 @@ export * from "./listresourcearticle.js";
121
125
  export * from "./listresourcebenefit.js";
122
126
  export * from "./listresourcebenefitgrant.js";
123
127
  export * from "./listresourcecheckout.js";
128
+ export * from "./listresourcecheckoutlink.js";
124
129
  export * from "./listresourcedownloadableread.js";
125
130
  export * from "./listresourceexternalorganization.js";
126
131
  export * from "./listresourcefileread.js";
@@ -0,0 +1,61 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import {
7
+ CheckoutLink,
8
+ CheckoutLink$inboundSchema,
9
+ CheckoutLink$Outbound,
10
+ CheckoutLink$outboundSchema,
11
+ } from "./checkoutlink.js";
12
+ import {
13
+ Pagination,
14
+ Pagination$inboundSchema,
15
+ Pagination$Outbound,
16
+ Pagination$outboundSchema,
17
+ } from "./pagination.js";
18
+
19
+ export type ListResourceCheckoutLink = {
20
+ items: Array<CheckoutLink>;
21
+ pagination: Pagination;
22
+ };
23
+
24
+ /** @internal */
25
+ export const ListResourceCheckoutLink$inboundSchema: z.ZodType<
26
+ ListResourceCheckoutLink,
27
+ z.ZodTypeDef,
28
+ unknown
29
+ > = z.object({
30
+ items: z.array(CheckoutLink$inboundSchema),
31
+ pagination: Pagination$inboundSchema,
32
+ });
33
+
34
+ /** @internal */
35
+ export type ListResourceCheckoutLink$Outbound = {
36
+ items: Array<CheckoutLink$Outbound>;
37
+ pagination: Pagination$Outbound;
38
+ };
39
+
40
+ /** @internal */
41
+ export const ListResourceCheckoutLink$outboundSchema: z.ZodType<
42
+ ListResourceCheckoutLink$Outbound,
43
+ z.ZodTypeDef,
44
+ ListResourceCheckoutLink
45
+ > = z.object({
46
+ items: z.array(CheckoutLink$outboundSchema),
47
+ pagination: Pagination$outboundSchema,
48
+ });
49
+
50
+ /**
51
+ * @internal
52
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
53
+ */
54
+ export namespace ListResourceCheckoutLink$ {
55
+ /** @deprecated use `ListResourceCheckoutLink$inboundSchema` instead. */
56
+ export const inboundSchema = ListResourceCheckoutLink$inboundSchema;
57
+ /** @deprecated use `ListResourceCheckoutLink$outboundSchema` instead. */
58
+ export const outboundSchema = ListResourceCheckoutLink$outboundSchema;
59
+ /** @deprecated use `ListResourceCheckoutLink$Outbound` instead. */
60
+ export type Outbound = ListResourceCheckoutLink$Outbound;
61
+ }
@@ -125,7 +125,7 @@ export const OAuth2Client$inboundSchema: z.ZodType<
125
125
  grant_types: z.array(GrantTypes$inboundSchema).optional(),
126
126
  response_types: z.array(ResponseTypes$inboundSchema).optional(),
127
127
  scope: z.string().default(
128
- "openid profile email user:read organizations:read organizations:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write",
128
+ "openid profile email user:read organizations:read organizations:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write",
129
129
  ),
130
130
  client_name: z.string(),
131
131
  client_uri: z.nullable(z.string()).optional(),
@@ -193,7 +193,7 @@ export const OAuth2Client$outboundSchema: z.ZodType<
193
193
  grantTypes: z.array(GrantTypes$outboundSchema).optional(),
194
194
  responseTypes: z.array(ResponseTypes$outboundSchema).optional(),
195
195
  scope: z.string().default(
196
- "openid profile email user:read organizations:read organizations:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write",
196
+ "openid profile email user:read organizations:read organizations:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write",
197
197
  ),
198
198
  clientName: z.string(),
199
199
  clientUri: z.nullable(z.string()).optional(),
@@ -131,7 +131,7 @@ export const OAuth2ClientConfiguration$inboundSchema: z.ZodType<
131
131
  response_types: z.array(OAuth2ClientConfigurationResponseTypes$inboundSchema)
132
132
  .optional(),
133
133
  scope: z.string().default(
134
- "openid profile email user:read organizations:read organizations:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write",
134
+ "openid profile email user:read organizations:read organizations:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write",
135
135
  ),
136
136
  client_name: z.string(),
137
137
  client_uri: z.nullable(z.string()).optional(),
@@ -182,7 +182,7 @@ export const OAuth2ClientConfiguration$outboundSchema: z.ZodType<
182
182
  responseTypes: z.array(OAuth2ClientConfigurationResponseTypes$outboundSchema)
183
183
  .optional(),
184
184
  scope: z.string().default(
185
- "openid profile email user:read organizations:read organizations:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write",
185
+ "openid profile email user:read organizations:read organizations:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write",
186
186
  ),
187
187
  clientName: z.string(),
188
188
  clientUri: z.nullable(z.string()).optional(),
@@ -135,7 +135,7 @@ export const OAuth2ClientConfigurationUpdate$inboundSchema: z.ZodType<
135
135
  OAuth2ClientConfigurationUpdateResponseTypes$inboundSchema,
136
136
  ).optional(),
137
137
  scope: z.string().default(
138
- "openid profile email user:read organizations:read organizations:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write",
138
+ "openid profile email user:read organizations:read organizations:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write",
139
139
  ),
140
140
  client_name: z.string(),
141
141
  client_uri: z.nullable(z.string()).optional(),
@@ -189,7 +189,7 @@ export const OAuth2ClientConfigurationUpdate$outboundSchema: z.ZodType<
189
189
  OAuth2ClientConfigurationUpdateResponseTypes$outboundSchema,
190
190
  ).optional(),
191
191
  scope: z.string().default(
192
- "openid profile email user:read organizations:read organizations:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write",
192
+ "openid profile email user:read organizations:read organizations:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write",
193
193
  ),
194
194
  clientName: z.string(),
195
195
  clientUri: z.nullable(z.string()).optional(),
@@ -41,71 +41,9 @@ export type PolarCheckoutSchemasCheckout = {
41
41
  */
42
42
  clientSecret: string;
43
43
  /**
44
- * Expiration date and time of the checkout session.
45
- */
46
- expiresAt: Date;
47
- /**
48
- * URL where the customer will be redirected after a successful payment.
49
- */
50
- successUrl: string;
51
- amount: number | null;
52
- /**
53
- * Computed tax amount to pay in cents.
54
- */
55
- taxAmount: number | null;
56
- /**
57
- * Currency code of the checkout session.
58
- */
59
- currency: string | null;
60
- /**
61
- * Total amount to pay in cents.
62
- */
63
- totalAmount: number | null;
64
- /**
65
- * ID of the product to checkout.
66
- */
67
- productId: string;
68
- /**
69
- * ID of the product price to checkout.
44
+ * URL where the customer can access the checkout session.
70
45
  */
71
- productPriceId: string;
72
- /**
73
- * Whether the checkout requires payment. Useful to detect free products.
74
- */
75
- isPaymentRequired: boolean;
76
- customerId: string | null;
77
- customerName: string | null;
78
- customerEmail: string | null;
79
- customerIpAddress: string | null;
80
- customerBillingAddress: Address | null;
81
- customerTaxId: string | null;
82
- paymentProcessorMetadata: PaymentProcessorMetadata;
83
- metadata: { [k: string]: string };
84
46
  url: string;
85
- };
86
-
87
- /**
88
- * Checkout session data retrieved using an access token.
89
- */
90
- export type PolarCheckoutSchemasCheckoutInput = {
91
- /**
92
- * Creation timestamp of the object.
93
- */
94
- createdAt: Date;
95
- /**
96
- * Last modification timestamp of the object.
97
- */
98
- modifiedAt: Date | null;
99
- /**
100
- * The ID of the object.
101
- */
102
- id: string;
103
- paymentProcessor?: "stripe" | undefined;
104
- status: CheckoutStatus;
105
- /**
106
- * Client secret used to update and complete the checkout session from the client.
107
- */
108
- clientSecret: string;
109
47
  /**
110
48
  * Expiration date and time of the checkout session.
111
49
  */
@@ -193,6 +131,7 @@ export const PolarCheckoutSchemasCheckout$inboundSchema: z.ZodType<
193
131
  payment_processor: z.literal("stripe").optional(),
194
132
  status: CheckoutStatus$inboundSchema,
195
133
  client_secret: z.string(),
134
+ url: z.string(),
196
135
  expires_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
197
136
  success_url: z.string(),
198
137
  amount: z.nullable(z.number().int()),
@@ -212,7 +151,6 @@ export const PolarCheckoutSchemasCheckout$inboundSchema: z.ZodType<
212
151
  PaymentProcessorMetadata$inboundSchema
213
152
  ),
214
153
  metadata: z.record(z.string()),
215
- url: z.string(),
216
154
  }).transform((v) => {
217
155
  return remap$(v, {
218
156
  "created_at": "createdAt",
@@ -244,6 +182,7 @@ export type PolarCheckoutSchemasCheckout$Outbound = {
244
182
  payment_processor: "stripe";
245
183
  status: string;
246
184
  client_secret: string;
185
+ url: string;
247
186
  expires_at: string;
248
187
  success_url: string;
249
188
  amount: number | null;
@@ -261,7 +200,6 @@ export type PolarCheckoutSchemasCheckout$Outbound = {
261
200
  customer_tax_id: string | null;
262
201
  payment_processor_metadata: PaymentProcessorMetadata$Outbound;
263
202
  metadata: { [k: string]: string };
264
- url: string;
265
203
  };
266
204
 
267
205
  /** @internal */
@@ -276,6 +214,7 @@ export const PolarCheckoutSchemasCheckout$outboundSchema: z.ZodType<
276
214
  paymentProcessor: z.literal("stripe").default("stripe"),
277
215
  status: CheckoutStatus$outboundSchema,
278
216
  clientSecret: z.string(),
217
+ url: z.string(),
279
218
  expiresAt: z.date().transform(v => v.toISOString()),
280
219
  successUrl: z.string(),
281
220
  amount: z.nullable(z.number().int()),
@@ -295,7 +234,6 @@ export const PolarCheckoutSchemasCheckout$outboundSchema: z.ZodType<
295
234
  PaymentProcessorMetadata$outboundSchema
296
235
  ),
297
236
  metadata: z.record(z.string()),
298
- url: z.string(),
299
237
  }).transform((v) => {
300
238
  return remap$(v, {
301
239
  createdAt: "created_at",
@@ -331,154 +269,3 @@ export namespace PolarCheckoutSchemasCheckout$ {
331
269
  /** @deprecated use `PolarCheckoutSchemasCheckout$Outbound` instead. */
332
270
  export type Outbound = PolarCheckoutSchemasCheckout$Outbound;
333
271
  }
334
-
335
- /** @internal */
336
- export const PolarCheckoutSchemasCheckoutInput$inboundSchema: z.ZodType<
337
- PolarCheckoutSchemasCheckoutInput,
338
- z.ZodTypeDef,
339
- unknown
340
- > = z.object({
341
- created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
342
- modified_at: z.nullable(
343
- z.string().datetime({ offset: true }).transform(v => new Date(v)),
344
- ),
345
- id: z.string(),
346
- payment_processor: z.literal("stripe").optional(),
347
- status: CheckoutStatus$inboundSchema,
348
- client_secret: z.string(),
349
- expires_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
350
- success_url: z.string(),
351
- amount: z.nullable(z.number().int()),
352
- tax_amount: z.nullable(z.number().int()),
353
- currency: z.nullable(z.string()),
354
- total_amount: z.nullable(z.number().int()),
355
- product_id: z.string(),
356
- product_price_id: z.string(),
357
- is_payment_required: z.boolean(),
358
- customer_id: z.nullable(z.string()),
359
- customer_name: z.nullable(z.string()),
360
- customer_email: z.nullable(z.string()),
361
- customer_ip_address: z.nullable(z.string()),
362
- customer_billing_address: z.nullable(Address$inboundSchema),
363
- customer_tax_id: z.nullable(z.string()),
364
- payment_processor_metadata: z.lazy(() =>
365
- PaymentProcessorMetadata$inboundSchema
366
- ),
367
- metadata: z.record(z.string()),
368
- }).transform((v) => {
369
- return remap$(v, {
370
- "created_at": "createdAt",
371
- "modified_at": "modifiedAt",
372
- "payment_processor": "paymentProcessor",
373
- "client_secret": "clientSecret",
374
- "expires_at": "expiresAt",
375
- "success_url": "successUrl",
376
- "tax_amount": "taxAmount",
377
- "total_amount": "totalAmount",
378
- "product_id": "productId",
379
- "product_price_id": "productPriceId",
380
- "is_payment_required": "isPaymentRequired",
381
- "customer_id": "customerId",
382
- "customer_name": "customerName",
383
- "customer_email": "customerEmail",
384
- "customer_ip_address": "customerIpAddress",
385
- "customer_billing_address": "customerBillingAddress",
386
- "customer_tax_id": "customerTaxId",
387
- "payment_processor_metadata": "paymentProcessorMetadata",
388
- });
389
- });
390
-
391
- /** @internal */
392
- export type PolarCheckoutSchemasCheckoutInput$Outbound = {
393
- created_at: string;
394
- modified_at: string | null;
395
- id: string;
396
- payment_processor: "stripe";
397
- status: string;
398
- client_secret: string;
399
- expires_at: string;
400
- success_url: string;
401
- amount: number | null;
402
- tax_amount: number | null;
403
- currency: string | null;
404
- total_amount: number | null;
405
- product_id: string;
406
- product_price_id: string;
407
- is_payment_required: boolean;
408
- customer_id: string | null;
409
- customer_name: string | null;
410
- customer_email: string | null;
411
- customer_ip_address: string | null;
412
- customer_billing_address: Address$Outbound | null;
413
- customer_tax_id: string | null;
414
- payment_processor_metadata: PaymentProcessorMetadata$Outbound;
415
- metadata: { [k: string]: string };
416
- };
417
-
418
- /** @internal */
419
- export const PolarCheckoutSchemasCheckoutInput$outboundSchema: z.ZodType<
420
- PolarCheckoutSchemasCheckoutInput$Outbound,
421
- z.ZodTypeDef,
422
- PolarCheckoutSchemasCheckoutInput
423
- > = z.object({
424
- createdAt: z.date().transform(v => v.toISOString()),
425
- modifiedAt: z.nullable(z.date().transform(v => v.toISOString())),
426
- id: z.string(),
427
- paymentProcessor: z.literal("stripe").default("stripe"),
428
- status: CheckoutStatus$outboundSchema,
429
- clientSecret: z.string(),
430
- expiresAt: z.date().transform(v => v.toISOString()),
431
- successUrl: z.string(),
432
- amount: z.nullable(z.number().int()),
433
- taxAmount: z.nullable(z.number().int()),
434
- currency: z.nullable(z.string()),
435
- totalAmount: z.nullable(z.number().int()),
436
- productId: z.string(),
437
- productPriceId: z.string(),
438
- isPaymentRequired: z.boolean(),
439
- customerId: z.nullable(z.string()),
440
- customerName: z.nullable(z.string()),
441
- customerEmail: z.nullable(z.string()),
442
- customerIpAddress: z.nullable(z.string()),
443
- customerBillingAddress: z.nullable(Address$outboundSchema),
444
- customerTaxId: z.nullable(z.string()),
445
- paymentProcessorMetadata: z.lazy(() =>
446
- PaymentProcessorMetadata$outboundSchema
447
- ),
448
- metadata: z.record(z.string()),
449
- }).transform((v) => {
450
- return remap$(v, {
451
- createdAt: "created_at",
452
- modifiedAt: "modified_at",
453
- paymentProcessor: "payment_processor",
454
- clientSecret: "client_secret",
455
- expiresAt: "expires_at",
456
- successUrl: "success_url",
457
- taxAmount: "tax_amount",
458
- totalAmount: "total_amount",
459
- productId: "product_id",
460
- productPriceId: "product_price_id",
461
- isPaymentRequired: "is_payment_required",
462
- customerId: "customer_id",
463
- customerName: "customer_name",
464
- customerEmail: "customer_email",
465
- customerIpAddress: "customer_ip_address",
466
- customerBillingAddress: "customer_billing_address",
467
- customerTaxId: "customer_tax_id",
468
- paymentProcessorMetadata: "payment_processor_metadata",
469
- });
470
- });
471
-
472
- /**
473
- * @internal
474
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
475
- */
476
- export namespace PolarCheckoutSchemasCheckoutInput$ {
477
- /** @deprecated use `PolarCheckoutSchemasCheckoutInput$inboundSchema` instead. */
478
- export const inboundSchema = PolarCheckoutSchemasCheckoutInput$inboundSchema;
479
- /** @deprecated use `PolarCheckoutSchemasCheckoutInput$outboundSchema` instead. */
480
- export const outboundSchema =
481
- PolarCheckoutSchemasCheckoutInput$outboundSchema;
482
- /** @deprecated use `PolarCheckoutSchemasCheckoutInput$Outbound` instead. */
483
- export type Outbound = PolarCheckoutSchemasCheckoutInput$Outbound;
484
- }
@@ -47,6 +47,10 @@ export type ProductPriceOneTimeCustom = {
47
47
  * Whether the price is archived and no longer available.
48
48
  */
49
49
  isArchived: boolean;
50
+ /**
51
+ * The ID of the product owning the price.
52
+ */
53
+ productId: string;
50
54
  /**
51
55
  * The currency.
52
56
  */
@@ -126,6 +130,7 @@ export const ProductPriceOneTimeCustom$inboundSchema: z.ZodType<
126
130
  id: z.string(),
127
131
  amount_type: z.literal("custom").optional(),
128
132
  is_archived: z.boolean(),
133
+ product_id: z.string(),
129
134
  price_currency: z.string(),
130
135
  minimum_amount: z.nullable(z.number().int()),
131
136
  maximum_amount: z.nullable(z.number().int()),
@@ -137,6 +142,7 @@ export const ProductPriceOneTimeCustom$inboundSchema: z.ZodType<
137
142
  "modified_at": "modifiedAt",
138
143
  "amount_type": "amountType",
139
144
  "is_archived": "isArchived",
145
+ "product_id": "productId",
140
146
  "price_currency": "priceCurrency",
141
147
  "minimum_amount": "minimumAmount",
142
148
  "maximum_amount": "maximumAmount",
@@ -151,6 +157,7 @@ export type ProductPriceOneTimeCustom$Outbound = {
151
157
  id: string;
152
158
  amount_type: "custom";
153
159
  is_archived: boolean;
160
+ product_id: string;
154
161
  price_currency: string;
155
162
  minimum_amount: number | null;
156
163
  maximum_amount: number | null;
@@ -169,6 +176,7 @@ export const ProductPriceOneTimeCustom$outboundSchema: z.ZodType<
169
176
  id: z.string(),
170
177
  amountType: z.literal("custom").default("custom"),
171
178
  isArchived: z.boolean(),
179
+ productId: z.string(),
172
180
  priceCurrency: z.string(),
173
181
  minimumAmount: z.nullable(z.number().int()),
174
182
  maximumAmount: z.nullable(z.number().int()),
@@ -180,6 +188,7 @@ export const ProductPriceOneTimeCustom$outboundSchema: z.ZodType<
180
188
  modifiedAt: "modified_at",
181
189
  amountType: "amount_type",
182
190
  isArchived: "is_archived",
191
+ productId: "product_id",
183
192
  priceCurrency: "price_currency",
184
193
  minimumAmount: "minimum_amount",
185
194
  maximumAmount: "maximum_amount",
@@ -47,6 +47,10 @@ export type ProductPriceOneTimeFixed = {
47
47
  * Whether the price is archived and no longer available.
48
48
  */
49
49
  isArchived: boolean;
50
+ /**
51
+ * The ID of the product owning the price.
52
+ */
53
+ productId: string;
50
54
  /**
51
55
  * The currency.
52
56
  */
@@ -117,6 +121,7 @@ export const ProductPriceOneTimeFixed$inboundSchema: z.ZodType<
117
121
  id: z.string(),
118
122
  amount_type: z.literal("fixed").optional(),
119
123
  is_archived: z.boolean(),
124
+ product_id: z.string(),
120
125
  price_currency: z.string(),
121
126
  price_amount: z.number().int(),
122
127
  type: z.literal("one_time").optional(),
@@ -126,6 +131,7 @@ export const ProductPriceOneTimeFixed$inboundSchema: z.ZodType<
126
131
  "modified_at": "modifiedAt",
127
132
  "amount_type": "amountType",
128
133
  "is_archived": "isArchived",
134
+ "product_id": "productId",
129
135
  "price_currency": "priceCurrency",
130
136
  "price_amount": "priceAmount",
131
137
  });
@@ -138,6 +144,7 @@ export type ProductPriceOneTimeFixed$Outbound = {
138
144
  id: string;
139
145
  amount_type: "fixed";
140
146
  is_archived: boolean;
147
+ product_id: string;
141
148
  price_currency: string;
142
149
  price_amount: number;
143
150
  type: "one_time";
@@ -154,6 +161,7 @@ export const ProductPriceOneTimeFixed$outboundSchema: z.ZodType<
154
161
  id: z.string(),
155
162
  amountType: z.literal("fixed").default("fixed"),
156
163
  isArchived: z.boolean(),
164
+ productId: z.string(),
157
165
  priceCurrency: z.string(),
158
166
  priceAmount: z.number().int(),
159
167
  type: z.literal("one_time").default("one_time"),
@@ -163,6 +171,7 @@ export const ProductPriceOneTimeFixed$outboundSchema: z.ZodType<
163
171
  modifiedAt: "modified_at",
164
172
  amountType: "amount_type",
165
173
  isArchived: "is_archived",
174
+ productId: "product_id",
166
175
  priceCurrency: "price_currency",
167
176
  priceAmount: "price_amount",
168
177
  });
@@ -47,6 +47,10 @@ export type ProductPriceOneTimeFree = {
47
47
  * Whether the price is archived and no longer available.
48
48
  */
49
49
  isArchived: boolean;
50
+ /**
51
+ * The ID of the product owning the price.
52
+ */
53
+ productId: string;
50
54
  /**
51
55
  * The type of the price.
52
56
  */
@@ -109,6 +113,7 @@ export const ProductPriceOneTimeFree$inboundSchema: z.ZodType<
109
113
  id: z.string(),
110
114
  amount_type: z.literal("free").optional(),
111
115
  is_archived: z.boolean(),
116
+ product_id: z.string(),
112
117
  type: z.literal("one_time").optional(),
113
118
  }).transform((v) => {
114
119
  return remap$(v, {
@@ -116,6 +121,7 @@ export const ProductPriceOneTimeFree$inboundSchema: z.ZodType<
116
121
  "modified_at": "modifiedAt",
117
122
  "amount_type": "amountType",
118
123
  "is_archived": "isArchived",
124
+ "product_id": "productId",
119
125
  });
120
126
  });
121
127
 
@@ -126,6 +132,7 @@ export type ProductPriceOneTimeFree$Outbound = {
126
132
  id: string;
127
133
  amount_type: "free";
128
134
  is_archived: boolean;
135
+ product_id: string;
129
136
  type: "one_time";
130
137
  };
131
138
 
@@ -140,6 +147,7 @@ export const ProductPriceOneTimeFree$outboundSchema: z.ZodType<
140
147
  id: z.string(),
141
148
  amountType: z.literal("free").default("free"),
142
149
  isArchived: z.boolean(),
150
+ productId: z.string(),
143
151
  type: z.literal("one_time").default("one_time"),
144
152
  }).transform((v) => {
145
153
  return remap$(v, {
@@ -147,6 +155,7 @@ export const ProductPriceOneTimeFree$outboundSchema: z.ZodType<
147
155
  modifiedAt: "modified_at",
148
156
  amountType: "amount_type",
149
157
  isArchived: "is_archived",
158
+ productId: "product_id",
150
159
  });
151
160
  });
152
161
 
@@ -52,6 +52,10 @@ export type ProductPriceRecurringCustom = {
52
52
  * Whether the price is archived and no longer available.
53
53
  */
54
54
  isArchived: boolean;
55
+ /**
56
+ * The ID of the product owning the price.
57
+ */
58
+ productId: string;
55
59
  /**
56
60
  * The currency.
57
61
  */
@@ -133,6 +137,7 @@ export const ProductPriceRecurringCustom$inboundSchema: z.ZodType<
133
137
  id: z.string(),
134
138
  amount_type: z.literal("custom").optional(),
135
139
  is_archived: z.boolean(),
140
+ product_id: z.string(),
136
141
  price_currency: z.string(),
137
142
  minimum_amount: z.nullable(z.number().int()),
138
143
  maximum_amount: z.nullable(z.number().int()),
@@ -145,6 +150,7 @@ export const ProductPriceRecurringCustom$inboundSchema: z.ZodType<
145
150
  "modified_at": "modifiedAt",
146
151
  "amount_type": "amountType",
147
152
  "is_archived": "isArchived",
153
+ "product_id": "productId",
148
154
  "price_currency": "priceCurrency",
149
155
  "minimum_amount": "minimumAmount",
150
156
  "maximum_amount": "maximumAmount",
@@ -160,6 +166,7 @@ export type ProductPriceRecurringCustom$Outbound = {
160
166
  id: string;
161
167
  amount_type: "custom";
162
168
  is_archived: boolean;
169
+ product_id: string;
163
170
  price_currency: string;
164
171
  minimum_amount: number | null;
165
172
  maximum_amount: number | null;
@@ -179,6 +186,7 @@ export const ProductPriceRecurringCustom$outboundSchema: z.ZodType<
179
186
  id: z.string(),
180
187
  amountType: z.literal("custom").default("custom"),
181
188
  isArchived: z.boolean(),
189
+ productId: z.string(),
182
190
  priceCurrency: z.string(),
183
191
  minimumAmount: z.nullable(z.number().int()),
184
192
  maximumAmount: z.nullable(z.number().int()),
@@ -191,6 +199,7 @@ export const ProductPriceRecurringCustom$outboundSchema: z.ZodType<
191
199
  modifiedAt: "modified_at",
192
200
  amountType: "amount_type",
193
201
  isArchived: "is_archived",
202
+ productId: "product_id",
194
203
  priceCurrency: "price_currency",
195
204
  minimumAmount: "minimum_amount",
196
205
  maximumAmount: "maximum_amount",