@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
@@ -50,6 +50,10 @@ export type ProductPriceRecurringFixed = {
50
50
  * Whether the price is archived and no longer available.
51
51
  */
52
52
  isArchived: boolean;
53
+ /**
54
+ * The ID of the product owning the price.
55
+ */
56
+ productId: string;
53
57
  /**
54
58
  * The currency.
55
59
  */
@@ -118,6 +122,7 @@ export const ProductPriceRecurringFixed$inboundSchema: z.ZodType<
118
122
  id: z.string(),
119
123
  amount_type: z.literal("fixed").optional(),
120
124
  is_archived: z.boolean(),
125
+ product_id: z.string(),
121
126
  price_currency: z.string(),
122
127
  price_amount: z.number().int(),
123
128
  type: z.literal("recurring").optional(),
@@ -128,6 +133,7 @@ export const ProductPriceRecurringFixed$inboundSchema: z.ZodType<
128
133
  "modified_at": "modifiedAt",
129
134
  "amount_type": "amountType",
130
135
  "is_archived": "isArchived",
136
+ "product_id": "productId",
131
137
  "price_currency": "priceCurrency",
132
138
  "price_amount": "priceAmount",
133
139
  "recurring_interval": "recurringInterval",
@@ -141,6 +147,7 @@ export type ProductPriceRecurringFixed$Outbound = {
141
147
  id: string;
142
148
  amount_type: "fixed";
143
149
  is_archived: boolean;
150
+ product_id: string;
144
151
  price_currency: string;
145
152
  price_amount: number;
146
153
  type: "recurring";
@@ -158,6 +165,7 @@ export const ProductPriceRecurringFixed$outboundSchema: z.ZodType<
158
165
  id: z.string(),
159
166
  amountType: z.literal("fixed").default("fixed"),
160
167
  isArchived: z.boolean(),
168
+ productId: z.string(),
161
169
  priceCurrency: z.string(),
162
170
  priceAmount: z.number().int(),
163
171
  type: z.literal("recurring").default("recurring"),
@@ -168,6 +176,7 @@ export const ProductPriceRecurringFixed$outboundSchema: z.ZodType<
168
176
  modifiedAt: "modified_at",
169
177
  amountType: "amount_type",
170
178
  isArchived: "is_archived",
179
+ productId: "product_id",
171
180
  priceCurrency: "price_currency",
172
181
  priceAmount: "price_amount",
173
182
  recurringInterval: "recurring_interval",
@@ -52,6 +52,10 @@ export type ProductPriceRecurringFree = {
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 type of the price.
57
61
  */
@@ -116,6 +120,7 @@ export const ProductPriceRecurringFree$inboundSchema: z.ZodType<
116
120
  id: z.string(),
117
121
  amount_type: z.literal("free").optional(),
118
122
  is_archived: z.boolean(),
123
+ product_id: z.string(),
119
124
  type: z.literal("recurring").optional(),
120
125
  recurring_interval: SubscriptionRecurringInterval$inboundSchema,
121
126
  }).transform((v) => {
@@ -124,6 +129,7 @@ export const ProductPriceRecurringFree$inboundSchema: z.ZodType<
124
129
  "modified_at": "modifiedAt",
125
130
  "amount_type": "amountType",
126
131
  "is_archived": "isArchived",
132
+ "product_id": "productId",
127
133
  "recurring_interval": "recurringInterval",
128
134
  });
129
135
  });
@@ -135,6 +141,7 @@ export type ProductPriceRecurringFree$Outbound = {
135
141
  id: string;
136
142
  amount_type: "free";
137
143
  is_archived: boolean;
144
+ product_id: string;
138
145
  type: "recurring";
139
146
  recurring_interval: string;
140
147
  };
@@ -150,6 +157,7 @@ export const ProductPriceRecurringFree$outboundSchema: z.ZodType<
150
157
  id: z.string(),
151
158
  amountType: z.literal("free").default("free"),
152
159
  isArchived: z.boolean(),
160
+ productId: z.string(),
153
161
  type: z.literal("recurring").default("recurring"),
154
162
  recurringInterval: SubscriptionRecurringInterval$outboundSchema,
155
163
  }).transform((v) => {
@@ -158,6 +166,7 @@ export const ProductPriceRecurringFree$outboundSchema: z.ZodType<
158
166
  modifiedAt: "modified_at",
159
167
  amountType: "amount_type",
160
168
  isArchived: "is_archived",
169
+ productId: "product_id",
161
170
  recurringInterval: "recurring_interval",
162
171
  });
163
172
  });
@@ -5,10 +5,10 @@
5
5
  import * as z from "zod";
6
6
  import { ClosedEnum } from "../../types/enums.js";
7
7
  import {
8
- PolarCheckoutSchemasCheckoutInput,
9
- PolarCheckoutSchemasCheckoutInput$inboundSchema,
10
- PolarCheckoutSchemasCheckoutInput$Outbound,
11
- PolarCheckoutSchemasCheckoutInput$outboundSchema,
8
+ PolarCheckoutSchemasCheckout,
9
+ PolarCheckoutSchemasCheckout$inboundSchema,
10
+ PolarCheckoutSchemasCheckout$Outbound,
11
+ PolarCheckoutSchemasCheckout$outboundSchema,
12
12
  } from "./polarcheckoutschemascheckout.js";
13
13
 
14
14
  export const WebhookCheckoutCreatedPayloadType = {
@@ -30,7 +30,7 @@ export type WebhookCheckoutCreatedPayload = {
30
30
  /**
31
31
  * Checkout session data retrieved using an access token.
32
32
  */
33
- data: PolarCheckoutSchemasCheckoutInput;
33
+ data: PolarCheckoutSchemasCheckout;
34
34
  };
35
35
 
36
36
  /** @internal */
@@ -62,13 +62,13 @@ export const WebhookCheckoutCreatedPayload$inboundSchema: z.ZodType<
62
62
  unknown
63
63
  > = z.object({
64
64
  type: z.literal("checkout.created").optional(),
65
- data: PolarCheckoutSchemasCheckoutInput$inboundSchema,
65
+ data: PolarCheckoutSchemasCheckout$inboundSchema,
66
66
  });
67
67
 
68
68
  /** @internal */
69
69
  export type WebhookCheckoutCreatedPayload$Outbound = {
70
70
  type: "checkout.created";
71
- data: PolarCheckoutSchemasCheckoutInput$Outbound;
71
+ data: PolarCheckoutSchemasCheckout$Outbound;
72
72
  };
73
73
 
74
74
  /** @internal */
@@ -78,7 +78,7 @@ export const WebhookCheckoutCreatedPayload$outboundSchema: z.ZodType<
78
78
  WebhookCheckoutCreatedPayload
79
79
  > = z.object({
80
80
  type: z.literal("checkout.created").default("checkout.created"),
81
- data: PolarCheckoutSchemasCheckoutInput$outboundSchema,
81
+ data: PolarCheckoutSchemasCheckout$outboundSchema,
82
82
  });
83
83
 
84
84
  /**
@@ -5,10 +5,10 @@
5
5
  import * as z from "zod";
6
6
  import { ClosedEnum } from "../../types/enums.js";
7
7
  import {
8
- PolarCheckoutSchemasCheckoutInput,
9
- PolarCheckoutSchemasCheckoutInput$inboundSchema,
10
- PolarCheckoutSchemasCheckoutInput$Outbound,
11
- PolarCheckoutSchemasCheckoutInput$outboundSchema,
8
+ PolarCheckoutSchemasCheckout,
9
+ PolarCheckoutSchemasCheckout$inboundSchema,
10
+ PolarCheckoutSchemasCheckout$Outbound,
11
+ PolarCheckoutSchemasCheckout$outboundSchema,
12
12
  } from "./polarcheckoutschemascheckout.js";
13
13
 
14
14
  export const WebhookCheckoutUpdatedPayloadType = {
@@ -30,7 +30,7 @@ export type WebhookCheckoutUpdatedPayload = {
30
30
  /**
31
31
  * Checkout session data retrieved using an access token.
32
32
  */
33
- data: PolarCheckoutSchemasCheckoutInput;
33
+ data: PolarCheckoutSchemasCheckout;
34
34
  };
35
35
 
36
36
  /** @internal */
@@ -62,13 +62,13 @@ export const WebhookCheckoutUpdatedPayload$inboundSchema: z.ZodType<
62
62
  unknown
63
63
  > = z.object({
64
64
  type: z.literal("checkout.updated").optional(),
65
- data: PolarCheckoutSchemasCheckoutInput$inboundSchema,
65
+ data: PolarCheckoutSchemasCheckout$inboundSchema,
66
66
  });
67
67
 
68
68
  /** @internal */
69
69
  export type WebhookCheckoutUpdatedPayload$Outbound = {
70
70
  type: "checkout.updated";
71
- data: PolarCheckoutSchemasCheckoutInput$Outbound;
71
+ data: PolarCheckoutSchemasCheckout$Outbound;
72
72
  };
73
73
 
74
74
  /** @internal */
@@ -78,7 +78,7 @@ export const WebhookCheckoutUpdatedPayload$outboundSchema: z.ZodType<
78
78
  WebhookCheckoutUpdatedPayload
79
79
  > = z.object({
80
80
  type: z.literal("checkout.updated").default("checkout.updated"),
81
- data: PolarCheckoutSchemasCheckoutInput$outboundSchema,
81
+ data: PolarCheckoutSchemasCheckout$outboundSchema,
82
82
  });
83
83
 
84
84
  /**
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+
7
+ export type CheckoutLinksDeleteRequest = {
8
+ /**
9
+ * The checkout link ID.
10
+ */
11
+ id: string;
12
+ };
13
+
14
+ /** @internal */
15
+ export const CheckoutLinksDeleteRequest$inboundSchema: z.ZodType<
16
+ CheckoutLinksDeleteRequest,
17
+ z.ZodTypeDef,
18
+ unknown
19
+ > = z.object({
20
+ id: z.string(),
21
+ });
22
+
23
+ /** @internal */
24
+ export type CheckoutLinksDeleteRequest$Outbound = {
25
+ id: string;
26
+ };
27
+
28
+ /** @internal */
29
+ export const CheckoutLinksDeleteRequest$outboundSchema: z.ZodType<
30
+ CheckoutLinksDeleteRequest$Outbound,
31
+ z.ZodTypeDef,
32
+ CheckoutLinksDeleteRequest
33
+ > = z.object({
34
+ id: z.string(),
35
+ });
36
+
37
+ /**
38
+ * @internal
39
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
40
+ */
41
+ export namespace CheckoutLinksDeleteRequest$ {
42
+ /** @deprecated use `CheckoutLinksDeleteRequest$inboundSchema` instead. */
43
+ export const inboundSchema = CheckoutLinksDeleteRequest$inboundSchema;
44
+ /** @deprecated use `CheckoutLinksDeleteRequest$outboundSchema` instead. */
45
+ export const outboundSchema = CheckoutLinksDeleteRequest$outboundSchema;
46
+ /** @deprecated use `CheckoutLinksDeleteRequest$Outbound` instead. */
47
+ export type Outbound = CheckoutLinksDeleteRequest$Outbound;
48
+ }
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+
7
+ export type CheckoutLinksGetRequest = {
8
+ /**
9
+ * The checkout link ID.
10
+ */
11
+ id: string;
12
+ };
13
+
14
+ /** @internal */
15
+ export const CheckoutLinksGetRequest$inboundSchema: z.ZodType<
16
+ CheckoutLinksGetRequest,
17
+ z.ZodTypeDef,
18
+ unknown
19
+ > = z.object({
20
+ id: z.string(),
21
+ });
22
+
23
+ /** @internal */
24
+ export type CheckoutLinksGetRequest$Outbound = {
25
+ id: string;
26
+ };
27
+
28
+ /** @internal */
29
+ export const CheckoutLinksGetRequest$outboundSchema: z.ZodType<
30
+ CheckoutLinksGetRequest$Outbound,
31
+ z.ZodTypeDef,
32
+ CheckoutLinksGetRequest
33
+ > = z.object({
34
+ id: z.string(),
35
+ });
36
+
37
+ /**
38
+ * @internal
39
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
40
+ */
41
+ export namespace CheckoutLinksGetRequest$ {
42
+ /** @deprecated use `CheckoutLinksGetRequest$inboundSchema` instead. */
43
+ export const inboundSchema = CheckoutLinksGetRequest$inboundSchema;
44
+ /** @deprecated use `CheckoutLinksGetRequest$outboundSchema` instead. */
45
+ export const outboundSchema = CheckoutLinksGetRequest$outboundSchema;
46
+ /** @deprecated use `CheckoutLinksGetRequest$Outbound` instead. */
47
+ export type Outbound = CheckoutLinksGetRequest$Outbound;
48
+ }
@@ -0,0 +1,224 @@
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 * as components from "../components/index.js";
8
+
9
+ /**
10
+ * Filter by organization ID.
11
+ */
12
+ export type CheckoutLinksListQueryParamOrganizationIDFilter =
13
+ | string
14
+ | Array<string>;
15
+
16
+ /**
17
+ * Filter by product ID.
18
+ */
19
+ export type CheckoutLinksListQueryParamProductIDFilter = string | Array<string>;
20
+
21
+ export type CheckoutLinksListRequest = {
22
+ /**
23
+ * Filter by organization ID.
24
+ */
25
+ organizationId?: string | Array<string> | null | undefined;
26
+ /**
27
+ * Filter by product ID.
28
+ */
29
+ productId?: string | Array<string> | null | undefined;
30
+ /**
31
+ * Page number, defaults to 1.
32
+ */
33
+ page?: number | undefined;
34
+ /**
35
+ * Size of a page, defaults to 10. Maximum is 100.
36
+ */
37
+ limit?: number | undefined;
38
+ /**
39
+ * Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order.
40
+ */
41
+ sorting?: Array<components.CheckoutLinkSortProperty> | null | undefined;
42
+ };
43
+
44
+ export type CheckoutLinksListResponse = {
45
+ result: components.ListResourceCheckoutLink;
46
+ };
47
+
48
+ /** @internal */
49
+ export const CheckoutLinksListQueryParamOrganizationIDFilter$inboundSchema:
50
+ z.ZodType<
51
+ CheckoutLinksListQueryParamOrganizationIDFilter,
52
+ z.ZodTypeDef,
53
+ unknown
54
+ > = z.union([z.string(), z.array(z.string())]);
55
+
56
+ /** @internal */
57
+ export type CheckoutLinksListQueryParamOrganizationIDFilter$Outbound =
58
+ | string
59
+ | Array<string>;
60
+
61
+ /** @internal */
62
+ export const CheckoutLinksListQueryParamOrganizationIDFilter$outboundSchema:
63
+ z.ZodType<
64
+ CheckoutLinksListQueryParamOrganizationIDFilter$Outbound,
65
+ z.ZodTypeDef,
66
+ CheckoutLinksListQueryParamOrganizationIDFilter
67
+ > = z.union([z.string(), z.array(z.string())]);
68
+
69
+ /**
70
+ * @internal
71
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
72
+ */
73
+ export namespace CheckoutLinksListQueryParamOrganizationIDFilter$ {
74
+ /** @deprecated use `CheckoutLinksListQueryParamOrganizationIDFilter$inboundSchema` instead. */
75
+ export const inboundSchema =
76
+ CheckoutLinksListQueryParamOrganizationIDFilter$inboundSchema;
77
+ /** @deprecated use `CheckoutLinksListQueryParamOrganizationIDFilter$outboundSchema` instead. */
78
+ export const outboundSchema =
79
+ CheckoutLinksListQueryParamOrganizationIDFilter$outboundSchema;
80
+ /** @deprecated use `CheckoutLinksListQueryParamOrganizationIDFilter$Outbound` instead. */
81
+ export type Outbound =
82
+ CheckoutLinksListQueryParamOrganizationIDFilter$Outbound;
83
+ }
84
+
85
+ /** @internal */
86
+ export const CheckoutLinksListQueryParamProductIDFilter$inboundSchema:
87
+ z.ZodType<CheckoutLinksListQueryParamProductIDFilter, z.ZodTypeDef, unknown> =
88
+ z.union([z.string(), z.array(z.string())]);
89
+
90
+ /** @internal */
91
+ export type CheckoutLinksListQueryParamProductIDFilter$Outbound =
92
+ | string
93
+ | Array<string>;
94
+
95
+ /** @internal */
96
+ export const CheckoutLinksListQueryParamProductIDFilter$outboundSchema:
97
+ z.ZodType<
98
+ CheckoutLinksListQueryParamProductIDFilter$Outbound,
99
+ z.ZodTypeDef,
100
+ CheckoutLinksListQueryParamProductIDFilter
101
+ > = z.union([z.string(), z.array(z.string())]);
102
+
103
+ /**
104
+ * @internal
105
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
106
+ */
107
+ export namespace CheckoutLinksListQueryParamProductIDFilter$ {
108
+ /** @deprecated use `CheckoutLinksListQueryParamProductIDFilter$inboundSchema` instead. */
109
+ export const inboundSchema =
110
+ CheckoutLinksListQueryParamProductIDFilter$inboundSchema;
111
+ /** @deprecated use `CheckoutLinksListQueryParamProductIDFilter$outboundSchema` instead. */
112
+ export const outboundSchema =
113
+ CheckoutLinksListQueryParamProductIDFilter$outboundSchema;
114
+ /** @deprecated use `CheckoutLinksListQueryParamProductIDFilter$Outbound` instead. */
115
+ export type Outbound = CheckoutLinksListQueryParamProductIDFilter$Outbound;
116
+ }
117
+
118
+ /** @internal */
119
+ export const CheckoutLinksListRequest$inboundSchema: z.ZodType<
120
+ CheckoutLinksListRequest,
121
+ z.ZodTypeDef,
122
+ unknown
123
+ > = z.object({
124
+ organization_id: z.nullable(z.union([z.string(), z.array(z.string())]))
125
+ .optional(),
126
+ product_id: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
127
+ page: z.number().int().default(1),
128
+ limit: z.number().int().default(10),
129
+ sorting: z.nullable(
130
+ z.array(components.CheckoutLinkSortProperty$inboundSchema),
131
+ ).optional(),
132
+ }).transform((v) => {
133
+ return remap$(v, {
134
+ "organization_id": "organizationId",
135
+ "product_id": "productId",
136
+ });
137
+ });
138
+
139
+ /** @internal */
140
+ export type CheckoutLinksListRequest$Outbound = {
141
+ organization_id?: string | Array<string> | null | undefined;
142
+ product_id?: string | Array<string> | null | undefined;
143
+ page: number;
144
+ limit: number;
145
+ sorting?: Array<string> | null | undefined;
146
+ };
147
+
148
+ /** @internal */
149
+ export const CheckoutLinksListRequest$outboundSchema: z.ZodType<
150
+ CheckoutLinksListRequest$Outbound,
151
+ z.ZodTypeDef,
152
+ CheckoutLinksListRequest
153
+ > = z.object({
154
+ organizationId: z.nullable(z.union([z.string(), z.array(z.string())]))
155
+ .optional(),
156
+ productId: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
157
+ page: z.number().int().default(1),
158
+ limit: z.number().int().default(10),
159
+ sorting: z.nullable(
160
+ z.array(components.CheckoutLinkSortProperty$outboundSchema),
161
+ ).optional(),
162
+ }).transform((v) => {
163
+ return remap$(v, {
164
+ organizationId: "organization_id",
165
+ productId: "product_id",
166
+ });
167
+ });
168
+
169
+ /**
170
+ * @internal
171
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
172
+ */
173
+ export namespace CheckoutLinksListRequest$ {
174
+ /** @deprecated use `CheckoutLinksListRequest$inboundSchema` instead. */
175
+ export const inboundSchema = CheckoutLinksListRequest$inboundSchema;
176
+ /** @deprecated use `CheckoutLinksListRequest$outboundSchema` instead. */
177
+ export const outboundSchema = CheckoutLinksListRequest$outboundSchema;
178
+ /** @deprecated use `CheckoutLinksListRequest$Outbound` instead. */
179
+ export type Outbound = CheckoutLinksListRequest$Outbound;
180
+ }
181
+
182
+ /** @internal */
183
+ export const CheckoutLinksListResponse$inboundSchema: z.ZodType<
184
+ CheckoutLinksListResponse,
185
+ z.ZodTypeDef,
186
+ unknown
187
+ > = z.object({
188
+ Result: components.ListResourceCheckoutLink$inboundSchema,
189
+ }).transform((v) => {
190
+ return remap$(v, {
191
+ "Result": "result",
192
+ });
193
+ });
194
+
195
+ /** @internal */
196
+ export type CheckoutLinksListResponse$Outbound = {
197
+ Result: components.ListResourceCheckoutLink$Outbound;
198
+ };
199
+
200
+ /** @internal */
201
+ export const CheckoutLinksListResponse$outboundSchema: z.ZodType<
202
+ CheckoutLinksListResponse$Outbound,
203
+ z.ZodTypeDef,
204
+ CheckoutLinksListResponse
205
+ > = z.object({
206
+ result: components.ListResourceCheckoutLink$outboundSchema,
207
+ }).transform((v) => {
208
+ return remap$(v, {
209
+ result: "Result",
210
+ });
211
+ });
212
+
213
+ /**
214
+ * @internal
215
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
216
+ */
217
+ export namespace CheckoutLinksListResponse$ {
218
+ /** @deprecated use `CheckoutLinksListResponse$inboundSchema` instead. */
219
+ export const inboundSchema = CheckoutLinksListResponse$inboundSchema;
220
+ /** @deprecated use `CheckoutLinksListResponse$outboundSchema` instead. */
221
+ export const outboundSchema = CheckoutLinksListResponse$outboundSchema;
222
+ /** @deprecated use `CheckoutLinksListResponse$Outbound` instead. */
223
+ export type Outbound = CheckoutLinksListResponse$Outbound;
224
+ }
@@ -0,0 +1,62 @@
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 * as components from "../components/index.js";
8
+
9
+ export type CheckoutLinksUpdateRequest = {
10
+ /**
11
+ * The checkout link ID.
12
+ */
13
+ id: string;
14
+ checkoutLinkUpdate: components.CheckoutLinkUpdate;
15
+ };
16
+
17
+ /** @internal */
18
+ export const CheckoutLinksUpdateRequest$inboundSchema: z.ZodType<
19
+ CheckoutLinksUpdateRequest,
20
+ z.ZodTypeDef,
21
+ unknown
22
+ > = z.object({
23
+ id: z.string(),
24
+ CheckoutLinkUpdate: components.CheckoutLinkUpdate$inboundSchema,
25
+ }).transform((v) => {
26
+ return remap$(v, {
27
+ "CheckoutLinkUpdate": "checkoutLinkUpdate",
28
+ });
29
+ });
30
+
31
+ /** @internal */
32
+ export type CheckoutLinksUpdateRequest$Outbound = {
33
+ id: string;
34
+ CheckoutLinkUpdate: components.CheckoutLinkUpdate$Outbound;
35
+ };
36
+
37
+ /** @internal */
38
+ export const CheckoutLinksUpdateRequest$outboundSchema: z.ZodType<
39
+ CheckoutLinksUpdateRequest$Outbound,
40
+ z.ZodTypeDef,
41
+ CheckoutLinksUpdateRequest
42
+ > = z.object({
43
+ id: z.string(),
44
+ checkoutLinkUpdate: components.CheckoutLinkUpdate$outboundSchema,
45
+ }).transform((v) => {
46
+ return remap$(v, {
47
+ checkoutLinkUpdate: "CheckoutLinkUpdate",
48
+ });
49
+ });
50
+
51
+ /**
52
+ * @internal
53
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
54
+ */
55
+ export namespace CheckoutLinksUpdateRequest$ {
56
+ /** @deprecated use `CheckoutLinksUpdateRequest$inboundSchema` instead. */
57
+ export const inboundSchema = CheckoutLinksUpdateRequest$inboundSchema;
58
+ /** @deprecated use `CheckoutLinksUpdateRequest$outboundSchema` instead. */
59
+ export const outboundSchema = CheckoutLinksUpdateRequest$outboundSchema;
60
+ /** @deprecated use `CheckoutLinksUpdateRequest$Outbound` instead. */
61
+ export type Outbound = CheckoutLinksUpdateRequest$Outbound;
62
+ }
@@ -18,6 +18,10 @@ export * from "./benefitsget.js";
18
18
  export * from "./benefitsgrants.js";
19
19
  export * from "./benefitslist.js";
20
20
  export * from "./benefitsupdate.js";
21
+ export * from "./checkoutlinksdelete.js";
22
+ export * from "./checkoutlinksget.js";
23
+ export * from "./checkoutlinkslist.js";
24
+ export * from "./checkoutlinksupdate.js";
21
25
  export * from "./checkoutscustomclientconfirm.js";
22
26
  export * from "./checkoutscustomclientget.js";
23
27
  export * from "./checkoutscustomclientupdate.js";
@@ -0,0 +1,101 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { checkoutLinksCreate } from "../funcs/checkoutLinksCreate.js";
6
+ import { checkoutLinksDelete } from "../funcs/checkoutLinksDelete.js";
7
+ import { checkoutLinksGet } from "../funcs/checkoutLinksGet.js";
8
+ import { checkoutLinksList } from "../funcs/checkoutLinksList.js";
9
+ import { checkoutLinksUpdate } from "../funcs/checkoutLinksUpdate.js";
10
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
11
+ import * as components from "../models/components/index.js";
12
+ import * as operations from "../models/operations/index.js";
13
+ import { unwrapAsync } from "../types/fp.js";
14
+ import { PageIterator, unwrapResultIterator } from "../types/operations.js";
15
+
16
+ export class CheckoutLinks extends ClientSDK {
17
+ /**
18
+ * List Checkout Links
19
+ *
20
+ * @remarks
21
+ * List checkout links.
22
+ */
23
+ async list(
24
+ request: operations.CheckoutLinksListRequest,
25
+ options?: RequestOptions,
26
+ ): Promise<PageIterator<operations.CheckoutLinksListResponse>> {
27
+ return unwrapResultIterator(checkoutLinksList(
28
+ this,
29
+ request,
30
+ options,
31
+ ));
32
+ }
33
+
34
+ /**
35
+ * Create Checkout Link
36
+ *
37
+ * @remarks
38
+ * Create a checkout link.
39
+ */
40
+ async create(
41
+ request: components.CheckoutLinkCreate,
42
+ options?: RequestOptions,
43
+ ): Promise<components.CheckoutLink> {
44
+ return unwrapAsync(checkoutLinksCreate(
45
+ this,
46
+ request,
47
+ options,
48
+ ));
49
+ }
50
+
51
+ /**
52
+ * Get Checkout Link
53
+ *
54
+ * @remarks
55
+ * Get a checkout link by ID.
56
+ */
57
+ async get(
58
+ request: operations.CheckoutLinksGetRequest,
59
+ options?: RequestOptions,
60
+ ): Promise<components.CheckoutLink> {
61
+ return unwrapAsync(checkoutLinksGet(
62
+ this,
63
+ request,
64
+ options,
65
+ ));
66
+ }
67
+
68
+ /**
69
+ * Update Checkout Link
70
+ *
71
+ * @remarks
72
+ * Update a checkout link.
73
+ */
74
+ async update(
75
+ request: operations.CheckoutLinksUpdateRequest,
76
+ options?: RequestOptions,
77
+ ): Promise<components.CheckoutLink> {
78
+ return unwrapAsync(checkoutLinksUpdate(
79
+ this,
80
+ request,
81
+ options,
82
+ ));
83
+ }
84
+
85
+ /**
86
+ * Delete Checkout Link
87
+ *
88
+ * @remarks
89
+ * Delete a checkout link.
90
+ */
91
+ async delete(
92
+ request: operations.CheckoutLinksDeleteRequest,
93
+ options?: RequestOptions,
94
+ ): Promise<void> {
95
+ return unwrapAsync(checkoutLinksDelete(
96
+ this,
97
+ request,
98
+ options,
99
+ ));
100
+ }
101
+ }