@polar-sh/sdk 0.8.2 → 0.9.0

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 (199) hide show
  1. package/README.md +7 -6
  2. package/docs/sdks/products/README.md +2 -2
  3. package/funcs/advertisementsList.js +2 -2
  4. package/funcs/advertisementsList.js.map +1 -1
  5. package/funcs/articlesList.js +2 -2
  6. package/funcs/articlesList.js.map +1 -1
  7. package/funcs/benefitsGrants.js +2 -2
  8. package/funcs/benefitsGrants.js.map +1 -1
  9. package/funcs/benefitsList.js +2 -2
  10. package/funcs/benefitsList.js.map +1 -1
  11. package/funcs/externalOrganizationsList.js +2 -2
  12. package/funcs/externalOrganizationsList.js.map +1 -1
  13. package/funcs/filesList.js +2 -2
  14. package/funcs/filesList.js.map +1 -1
  15. package/funcs/licenseKeysList.js +2 -2
  16. package/funcs/licenseKeysList.js.map +1 -1
  17. package/funcs/oauth2ClientsList.js +2 -2
  18. package/funcs/oauth2ClientsList.js.map +1 -1
  19. package/funcs/ordersList.js +2 -2
  20. package/funcs/ordersList.js.map +1 -1
  21. package/funcs/organizationsList.js +2 -2
  22. package/funcs/organizationsList.js.map +1 -1
  23. package/funcs/productsList.js +2 -2
  24. package/funcs/productsList.js.map +1 -1
  25. package/funcs/repositoriesList.js +2 -2
  26. package/funcs/repositoriesList.js.map +1 -1
  27. package/funcs/subscriptionsList.js +2 -2
  28. package/funcs/subscriptionsList.js.map +1 -1
  29. package/funcs/usersAdvertisementsList.js +2 -2
  30. package/funcs/usersAdvertisementsList.js.map +1 -1
  31. package/funcs/usersBenefitsList.js +2 -2
  32. package/funcs/usersBenefitsList.js.map +1 -1
  33. package/funcs/usersDownloadablesList.js +2 -2
  34. package/funcs/usersDownloadablesList.js.map +1 -1
  35. package/funcs/usersLicenseKeysList.js +2 -2
  36. package/funcs/usersLicenseKeysList.js.map +1 -1
  37. package/funcs/usersOrdersList.js +2 -2
  38. package/funcs/usersOrdersList.js.map +1 -1
  39. package/funcs/usersSubscriptionsList.js +2 -2
  40. package/funcs/usersSubscriptionsList.js.map +1 -1
  41. package/lib/config.d.ts +16 -5
  42. package/lib/config.d.ts.map +1 -1
  43. package/lib/config.js +18 -12
  44. package/lib/config.js.map +1 -1
  45. package/models/components/bodysubscriptionsimport.d.ts +2 -2
  46. package/models/components/bodysubscriptionsimport.d.ts.map +1 -1
  47. package/models/components/bodysubscriptionsimport.js +2 -0
  48. package/models/components/bodysubscriptionsimport.js.map +1 -1
  49. package/models/components/index.d.ts +9 -3
  50. package/models/components/index.d.ts.map +1 -1
  51. package/models/components/index.js +9 -3
  52. package/models/components/index.js.map +1 -1
  53. package/models/components/ordersubscription.d.ts +7 -0
  54. package/models/components/ordersubscription.d.ts.map +1 -1
  55. package/models/components/ordersubscription.js +9 -0
  56. package/models/components/ordersubscription.js.map +1 -1
  57. package/models/components/organizationfeaturesettings.d.ts +0 -5
  58. package/models/components/organizationfeaturesettings.d.ts.map +1 -1
  59. package/models/components/organizationfeaturesettings.js +0 -4
  60. package/models/components/organizationfeaturesettings.js.map +1 -1
  61. package/models/components/productonetimecreate.d.ts +23 -3
  62. package/models/components/productonetimecreate.d.ts.map +1 -1
  63. package/models/components/productonetimecreate.js +33 -4
  64. package/models/components/productonetimecreate.js.map +1 -1
  65. package/models/components/productpriceinput.d.ts +3 -11
  66. package/models/components/productpriceinput.d.ts.map +1 -1
  67. package/models/components/productpriceinput.js +5 -13
  68. package/models/components/productpriceinput.js.map +1 -1
  69. package/models/components/productpriceonetime.d.ts +4 -71
  70. package/models/components/productpriceonetime.d.ts.map +1 -1
  71. package/models/components/productpriceonetime.js +11 -57
  72. package/models/components/productpriceonetime.js.map +1 -1
  73. package/models/components/productpriceonetimecustom.d.ts +124 -0
  74. package/models/components/productpriceonetimecustom.d.ts.map +1 -0
  75. package/models/components/productpriceonetimecustom.js +130 -0
  76. package/models/components/productpriceonetimecustom.js.map +1 -0
  77. package/models/components/productpriceonetimecustomcreate.d.ts +71 -0
  78. package/models/components/productpriceonetimecustomcreate.d.ts.map +1 -0
  79. package/models/components/productpriceonetimecustomcreate.js +91 -0
  80. package/models/components/productpriceonetimecustomcreate.js.map +1 -0
  81. package/models/components/productpriceonetimefixed.d.ts +114 -0
  82. package/models/components/productpriceonetimefixed.d.ts.map +1 -0
  83. package/models/components/productpriceonetimefixed.js +122 -0
  84. package/models/components/productpriceonetimefixed.js.map +1 -0
  85. package/models/components/productpriceonetimefixedcreate.d.ts +61 -0
  86. package/models/components/productpriceonetimefixedcreate.d.ts.map +1 -0
  87. package/models/components/{productpriceonetimecreate.js → productpriceonetimefixedcreate.js} +25 -25
  88. package/models/components/productpriceonetimefixedcreate.js.map +1 -0
  89. package/models/components/productpriceoutput.d.ts +3 -11
  90. package/models/components/productpriceoutput.d.ts.map +1 -1
  91. package/models/components/productpriceoutput.js +5 -13
  92. package/models/components/productpriceoutput.js.map +1 -1
  93. package/models/components/productpricerecurringcreate.d.ts +7 -7
  94. package/models/components/productpricerecurringcreate.d.ts.map +1 -1
  95. package/models/components/productpricerecurringcreate.js +9 -9
  96. package/models/components/productpricerecurringcreate.js.map +1 -1
  97. package/models/components/productpricerecurringcustom.d.ts +130 -0
  98. package/models/components/productpricerecurringcustom.d.ts.map +1 -0
  99. package/models/components/productpricerecurringcustom.js +135 -0
  100. package/models/components/productpricerecurringcustom.js.map +1 -0
  101. package/models/components/productpricerecurringfixed.d.ts +120 -0
  102. package/models/components/productpricerecurringfixed.d.ts.map +1 -0
  103. package/models/components/productpricerecurringfixed.js +128 -0
  104. package/models/components/productpricerecurringfixed.js.map +1 -0
  105. package/models/components/productpricerecurringinput.d.ts +31 -0
  106. package/models/components/productpricerecurringinput.d.ts.map +1 -0
  107. package/models/components/productpricerecurringinput.js +62 -0
  108. package/models/components/productpricerecurringinput.js.map +1 -0
  109. package/models/components/productpricerecurringoutput.d.ts +31 -0
  110. package/models/components/productpricerecurringoutput.d.ts.map +1 -0
  111. package/models/components/productpricerecurringoutput.js +62 -0
  112. package/models/components/productpricerecurringoutput.js.map +1 -0
  113. package/models/components/productupdate.d.ts +15 -14
  114. package/models/components/productupdate.d.ts.map +1 -1
  115. package/models/components/productupdate.js +20 -16
  116. package/models/components/productupdate.js.map +1 -1
  117. package/models/components/subscriptioninput.d.ts +7 -0
  118. package/models/components/subscriptioninput.d.ts.map +1 -1
  119. package/models/components/subscriptioninput.js +9 -0
  120. package/models/components/subscriptioninput.js.map +1 -1
  121. package/models/components/subscriptionoutput.d.ts +7 -0
  122. package/models/components/subscriptionoutput.d.ts.map +1 -1
  123. package/models/components/subscriptionoutput.js +9 -0
  124. package/models/components/subscriptionoutput.js.map +1 -1
  125. package/models/components/subscriptionrecurringinterval.d.ts +28 -0
  126. package/models/components/{productpricerecurringinterval.d.ts.map → subscriptionrecurringinterval.d.ts.map} +1 -1
  127. package/models/components/{productpricerecurringinterval.js → subscriptionrecurringinterval.js} +12 -12
  128. package/models/components/{productpricerecurringinterval.js.map → subscriptionrecurringinterval.js.map} +1 -1
  129. package/models/components/subscriptionsortproperty.d.ts +6 -6
  130. package/models/components/subscriptionsortproperty.js +2 -2
  131. package/models/components/subscriptionsortproperty.js.map +1 -1
  132. package/models/components/userordersubscription.d.ts +7 -0
  133. package/models/components/userordersubscription.d.ts.map +1 -1
  134. package/models/components/userordersubscription.js +9 -0
  135. package/models/components/userordersubscription.js.map +1 -1
  136. package/models/components/usersubscription.d.ts +10 -0
  137. package/models/components/usersubscription.d.ts.map +1 -1
  138. package/models/components/usersubscription.js +9 -0
  139. package/models/components/usersubscription.js.map +1 -1
  140. package/models/components/usersubscriptionsortproperty.d.ts +6 -6
  141. package/models/components/usersubscriptionsortproperty.js +2 -2
  142. package/models/components/usersubscriptionsortproperty.js.map +1 -1
  143. package/package.json +1 -1
  144. package/src/funcs/advertisementsList.ts +2 -2
  145. package/src/funcs/articlesList.ts +2 -2
  146. package/src/funcs/benefitsGrants.ts +2 -2
  147. package/src/funcs/benefitsList.ts +2 -2
  148. package/src/funcs/externalOrganizationsList.ts +2 -2
  149. package/src/funcs/filesList.ts +2 -2
  150. package/src/funcs/licenseKeysList.ts +2 -2
  151. package/src/funcs/oauth2ClientsList.ts +2 -2
  152. package/src/funcs/ordersList.ts +2 -2
  153. package/src/funcs/organizationsList.ts +2 -2
  154. package/src/funcs/productsList.ts +2 -2
  155. package/src/funcs/repositoriesList.ts +2 -2
  156. package/src/funcs/subscriptionsList.ts +2 -2
  157. package/src/funcs/usersAdvertisementsList.ts +2 -2
  158. package/src/funcs/usersBenefitsList.ts +2 -2
  159. package/src/funcs/usersDownloadablesList.ts +2 -2
  160. package/src/funcs/usersLicenseKeysList.ts +2 -2
  161. package/src/funcs/usersOrdersList.ts +2 -2
  162. package/src/funcs/usersSubscriptionsList.ts +2 -2
  163. package/src/lib/config.ts +18 -12
  164. package/src/models/components/bodysubscriptionsimport.ts +4 -2
  165. package/src/models/components/index.ts +9 -3
  166. package/src/models/components/ordersubscription.ts +19 -0
  167. package/src/models/components/organizationfeaturesettings.ts +0 -9
  168. package/src/models/components/productonetimecreate.ts +69 -9
  169. package/src/models/components/productpriceinput.ts +13 -29
  170. package/src/models/components/productpriceonetime.ts +27 -115
  171. package/src/models/components/productpriceonetimecustom.ts +201 -0
  172. package/src/models/components/productpriceonetimecustomcreate.ts +122 -0
  173. package/src/models/components/productpriceonetimefixed.ts +182 -0
  174. package/src/models/components/productpriceonetimefixedcreate.ts +103 -0
  175. package/src/models/components/productpriceoutput.ts +13 -29
  176. package/src/models/components/productpricerecurringcreate.ts +18 -18
  177. package/src/models/components/productpricerecurringcustom.ts +216 -0
  178. package/src/models/components/productpricerecurringfixed.ts +191 -0
  179. package/src/models/components/productpricerecurringinput.ts +75 -0
  180. package/src/models/components/productpricerecurringoutput.ts +75 -0
  181. package/src/models/components/productupdate.ts +49 -32
  182. package/src/models/components/subscriptioninput.ts +19 -0
  183. package/src/models/components/subscriptionoutput.ts +19 -0
  184. package/src/models/components/subscriptionrecurringinterval.ts +35 -0
  185. package/src/models/components/subscriptionsortproperty.ts +2 -2
  186. package/src/models/components/userordersubscription.ts +19 -0
  187. package/src/models/components/usersubscription.ts +22 -0
  188. package/src/models/components/usersubscriptionsortproperty.ts +2 -2
  189. package/models/components/productpriceonetimecreate.d.ts +0 -61
  190. package/models/components/productpriceonetimecreate.d.ts.map +0 -1
  191. package/models/components/productpriceonetimecreate.js.map +0 -1
  192. package/models/components/productpricerecurring.d.ts +0 -96
  193. package/models/components/productpricerecurring.d.ts.map +0 -1
  194. package/models/components/productpricerecurring.js +0 -105
  195. package/models/components/productpricerecurring.js.map +0 -1
  196. package/models/components/productpricerecurringinterval.d.ts +0 -28
  197. package/src/models/components/productpriceonetimecreate.ts +0 -102
  198. package/src/models/components/productpricerecurring.ts +0 -161
  199. package/src/models/components/productpricerecurringinterval.ts +0 -35
@@ -1,161 +0,0 @@
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 { ClosedEnum } from "../../types/enums.js";
8
- import {
9
- ProductPriceRecurringInterval,
10
- ProductPriceRecurringInterval$inboundSchema,
11
- ProductPriceRecurringInterval$outboundSchema,
12
- } from "./productpricerecurringinterval.js";
13
-
14
- /**
15
- * The type of the price.
16
- */
17
- export const ProductPriceRecurringType = {
18
- Recurring: "recurring",
19
- } as const;
20
- /**
21
- * The type of the price.
22
- */
23
- export type ProductPriceRecurringType = ClosedEnum<
24
- typeof ProductPriceRecurringType
25
- >;
26
-
27
- /**
28
- * A recurring price for a product, i.e. a subscription.
29
- */
30
- export type ProductPriceRecurring = {
31
- /**
32
- * Creation timestamp of the object.
33
- */
34
- createdAt: Date;
35
- /**
36
- * Last modification timestamp of the object.
37
- */
38
- modifiedAt: Date | null;
39
- /**
40
- * The ID of the price.
41
- */
42
- id: string;
43
- /**
44
- * The price in cents.
45
- */
46
- priceAmount: number;
47
- /**
48
- * The currency.
49
- */
50
- priceCurrency: string;
51
- /**
52
- * Whether the price is archived and no longer available.
53
- */
54
- isArchived: boolean;
55
- /**
56
- * The type of the price.
57
- */
58
- type?: "recurring" | undefined;
59
- /**
60
- * The recurring interval of the price, if type is `recurring`.
61
- */
62
- recurringInterval: ProductPriceRecurringInterval | null;
63
- };
64
-
65
- /** @internal */
66
- export const ProductPriceRecurringType$inboundSchema: z.ZodNativeEnum<
67
- typeof ProductPriceRecurringType
68
- > = z.nativeEnum(ProductPriceRecurringType);
69
-
70
- /** @internal */
71
- export const ProductPriceRecurringType$outboundSchema: z.ZodNativeEnum<
72
- typeof ProductPriceRecurringType
73
- > = ProductPriceRecurringType$inboundSchema;
74
-
75
- /**
76
- * @internal
77
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
78
- */
79
- export namespace ProductPriceRecurringType$ {
80
- /** @deprecated use `ProductPriceRecurringType$inboundSchema` instead. */
81
- export const inboundSchema = ProductPriceRecurringType$inboundSchema;
82
- /** @deprecated use `ProductPriceRecurringType$outboundSchema` instead. */
83
- export const outboundSchema = ProductPriceRecurringType$outboundSchema;
84
- }
85
-
86
- /** @internal */
87
- export const ProductPriceRecurring$inboundSchema: z.ZodType<
88
- ProductPriceRecurring,
89
- z.ZodTypeDef,
90
- unknown
91
- > = z.object({
92
- created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
93
- modified_at: z.nullable(
94
- z.string().datetime({ offset: true }).transform(v => new Date(v)),
95
- ),
96
- id: z.string(),
97
- price_amount: z.number().int(),
98
- price_currency: z.string(),
99
- is_archived: z.boolean(),
100
- type: z.literal("recurring").optional(),
101
- recurring_interval: z.nullable(ProductPriceRecurringInterval$inboundSchema),
102
- }).transform((v) => {
103
- return remap$(v, {
104
- "created_at": "createdAt",
105
- "modified_at": "modifiedAt",
106
- "price_amount": "priceAmount",
107
- "price_currency": "priceCurrency",
108
- "is_archived": "isArchived",
109
- "recurring_interval": "recurringInterval",
110
- });
111
- });
112
-
113
- /** @internal */
114
- export type ProductPriceRecurring$Outbound = {
115
- created_at: string;
116
- modified_at: string | null;
117
- id: string;
118
- price_amount: number;
119
- price_currency: string;
120
- is_archived: boolean;
121
- type: "recurring";
122
- recurring_interval: string | null;
123
- };
124
-
125
- /** @internal */
126
- export const ProductPriceRecurring$outboundSchema: z.ZodType<
127
- ProductPriceRecurring$Outbound,
128
- z.ZodTypeDef,
129
- ProductPriceRecurring
130
- > = z.object({
131
- createdAt: z.date().transform(v => v.toISOString()),
132
- modifiedAt: z.nullable(z.date().transform(v => v.toISOString())),
133
- id: z.string(),
134
- priceAmount: z.number().int(),
135
- priceCurrency: z.string(),
136
- isArchived: z.boolean(),
137
- type: z.literal("recurring").default("recurring"),
138
- recurringInterval: z.nullable(ProductPriceRecurringInterval$outboundSchema),
139
- }).transform((v) => {
140
- return remap$(v, {
141
- createdAt: "created_at",
142
- modifiedAt: "modified_at",
143
- priceAmount: "price_amount",
144
- priceCurrency: "price_currency",
145
- isArchived: "is_archived",
146
- recurringInterval: "recurring_interval",
147
- });
148
- });
149
-
150
- /**
151
- * @internal
152
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
153
- */
154
- export namespace ProductPriceRecurring$ {
155
- /** @deprecated use `ProductPriceRecurring$inboundSchema` instead. */
156
- export const inboundSchema = ProductPriceRecurring$inboundSchema;
157
- /** @deprecated use `ProductPriceRecurring$outboundSchema` instead. */
158
- export const outboundSchema = ProductPriceRecurring$outboundSchema;
159
- /** @deprecated use `ProductPriceRecurring$Outbound` instead. */
160
- export type Outbound = ProductPriceRecurring$Outbound;
161
- }
@@ -1,35 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { ClosedEnum } from "../../types/enums.js";
7
-
8
- export const ProductPriceRecurringInterval = {
9
- Month: "month",
10
- Year: "year",
11
- } as const;
12
- export type ProductPriceRecurringInterval = ClosedEnum<
13
- typeof ProductPriceRecurringInterval
14
- >;
15
-
16
- /** @internal */
17
- export const ProductPriceRecurringInterval$inboundSchema: z.ZodNativeEnum<
18
- typeof ProductPriceRecurringInterval
19
- > = z.nativeEnum(ProductPriceRecurringInterval);
20
-
21
- /** @internal */
22
- export const ProductPriceRecurringInterval$outboundSchema: z.ZodNativeEnum<
23
- typeof ProductPriceRecurringInterval
24
- > = ProductPriceRecurringInterval$inboundSchema;
25
-
26
- /**
27
- * @internal
28
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
29
- */
30
- export namespace ProductPriceRecurringInterval$ {
31
- /** @deprecated use `ProductPriceRecurringInterval$inboundSchema` instead. */
32
- export const inboundSchema = ProductPriceRecurringInterval$inboundSchema;
33
- /** @deprecated use `ProductPriceRecurringInterval$outboundSchema` instead. */
34
- export const outboundSchema = ProductPriceRecurringInterval$outboundSchema;
35
- }