@moovio/sdk 0.16.4 → 0.16.5

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 (181) hide show
  1. package/README.md +62 -44
  2. package/bin/mcp-server.js +1864 -585
  3. package/bin/mcp-server.js.map +37 -9
  4. package/docs/sdks/products/README.md +592 -0
  5. package/examples/package-lock.json +1 -1
  6. package/funcs/productsCreate.d.ts +15 -0
  7. package/funcs/productsCreate.d.ts.map +1 -0
  8. package/funcs/productsCreate.js +138 -0
  9. package/funcs/productsCreate.js.map +1 -0
  10. package/funcs/productsDisable.d.ts +17 -0
  11. package/funcs/productsDisable.d.ts.map +1 -0
  12. package/funcs/productsDisable.js +139 -0
  13. package/funcs/productsDisable.js.map +1 -0
  14. package/funcs/productsGet.d.ts +14 -0
  15. package/funcs/productsGet.d.ts.map +1 -0
  16. package/funcs/productsGet.js +126 -0
  17. package/funcs/productsGet.js.map +1 -0
  18. package/funcs/productsList.d.ts +14 -0
  19. package/funcs/productsList.d.ts.map +1 -0
  20. package/funcs/productsList.js +127 -0
  21. package/funcs/productsList.js.map +1 -0
  22. package/funcs/productsUpdate.d.ts +15 -0
  23. package/funcs/productsUpdate.d.ts.map +1 -0
  24. package/funcs/productsUpdate.js +142 -0
  25. package/funcs/productsUpdate.js.map +1 -0
  26. package/jsr.json +1 -1
  27. package/lib/config.d.ts +2 -2
  28. package/lib/config.js +2 -2
  29. package/mcp-server/mcp-server.js +1 -1
  30. package/mcp-server/server.d.ts.map +1 -1
  31. package/mcp-server/server.js +11 -1
  32. package/mcp-server/server.js.map +1 -1
  33. package/mcp-server/tools/productsCreate.d.ts +8 -0
  34. package/mcp-server/tools/productsCreate.d.ts.map +1 -0
  35. package/mcp-server/tools/productsCreate.js +62 -0
  36. package/mcp-server/tools/productsCreate.js.map +1 -0
  37. package/mcp-server/tools/productsDisable.d.ts +8 -0
  38. package/mcp-server/tools/productsDisable.d.ts.map +1 -0
  39. package/mcp-server/tools/productsDisable.js +63 -0
  40. package/mcp-server/tools/productsDisable.js.map +1 -0
  41. package/mcp-server/tools/productsGet.d.ts +8 -0
  42. package/mcp-server/tools/productsGet.d.ts.map +1 -0
  43. package/mcp-server/tools/productsGet.js +62 -0
  44. package/mcp-server/tools/productsGet.js.map +1 -0
  45. package/mcp-server/tools/productsList.d.ts +8 -0
  46. package/mcp-server/tools/productsList.d.ts.map +1 -0
  47. package/mcp-server/tools/productsList.js +62 -0
  48. package/mcp-server/tools/productsList.js.map +1 -0
  49. package/mcp-server/tools/productsUpdate.d.ts +8 -0
  50. package/mcp-server/tools/productsUpdate.d.ts.map +1 -0
  51. package/mcp-server/tools/productsUpdate.js +62 -0
  52. package/mcp-server/tools/productsUpdate.js.map +1 -0
  53. package/models/components/amountdecimalvalidationerror.d.ts +31 -0
  54. package/models/components/amountdecimalvalidationerror.d.ts.map +1 -0
  55. package/models/components/amountdecimalvalidationerror.js +71 -0
  56. package/models/components/amountdecimalvalidationerror.js.map +1 -0
  57. package/models/components/assignproductimage.d.ts +32 -0
  58. package/models/components/assignproductimage.d.ts.map +1 -0
  59. package/models/components/assignproductimage.js +69 -0
  60. package/models/components/assignproductimage.js.map +1 -0
  61. package/models/components/assignproductimagevalidationerror.d.ts +29 -0
  62. package/models/components/assignproductimagevalidationerror.d.ts.map +1 -0
  63. package/models/components/assignproductimagevalidationerror.js +69 -0
  64. package/models/components/assignproductimagevalidationerror.js.map +1 -0
  65. package/models/components/createproductoption.d.ts +54 -0
  66. package/models/components/createproductoption.d.ts.map +1 -0
  67. package/models/components/createproductoption.js +76 -0
  68. package/models/components/createproductoption.js.map +1 -0
  69. package/models/components/createproductoptiongroup.d.ts +60 -0
  70. package/models/components/createproductoptiongroup.d.ts.map +1 -0
  71. package/models/components/createproductoptiongroup.js +78 -0
  72. package/models/components/createproductoptiongroup.js.map +1 -0
  73. package/models/components/index.d.ts +12 -0
  74. package/models/components/index.d.ts.map +1 -1
  75. package/models/components/index.js +12 -0
  76. package/models/components/index.js.map +1 -1
  77. package/models/components/product.d.ts +81 -0
  78. package/models/components/product.d.ts.map +1 -0
  79. package/models/components/product.js +88 -0
  80. package/models/components/product.js.map +1 -0
  81. package/models/components/productimagemetadata.d.ts +42 -0
  82. package/models/components/productimagemetadata.d.ts.map +1 -0
  83. package/models/components/productimagemetadata.js +73 -0
  84. package/models/components/productimagemetadata.js.map +1 -0
  85. package/models/components/productoption.d.ts +57 -0
  86. package/models/components/productoption.d.ts.map +1 -0
  87. package/models/components/productoption.js +76 -0
  88. package/models/components/productoption.js.map +1 -0
  89. package/models/components/productoptiongroup.d.ts +63 -0
  90. package/models/components/productoptiongroup.d.ts.map +1 -0
  91. package/models/components/productoptiongroup.js +78 -0
  92. package/models/components/productoptiongroup.js.map +1 -0
  93. package/models/components/productoptiongroupvalidationerror.d.ts +42 -0
  94. package/models/components/productoptiongroupvalidationerror.d.ts.map +1 -0
  95. package/models/components/productoptiongroupvalidationerror.js +78 -0
  96. package/models/components/productoptiongroupvalidationerror.js.map +1 -0
  97. package/models/components/productoptionvalidationerror.d.ts +40 -0
  98. package/models/components/productoptionvalidationerror.d.ts.map +1 -0
  99. package/models/components/productoptionvalidationerror.js +76 -0
  100. package/models/components/productoptionvalidationerror.js.map +1 -0
  101. package/models/components/productrequest.d.ts +61 -0
  102. package/models/components/productrequest.d.ts.map +1 -0
  103. package/models/components/productrequest.js +80 -0
  104. package/models/components/productrequest.js.map +1 -0
  105. package/models/errors/index.d.ts +1 -0
  106. package/models/errors/index.d.ts.map +1 -1
  107. package/models/errors/index.js +1 -0
  108. package/models/errors/index.js.map +1 -1
  109. package/models/errors/productrequestvalidationerror.d.ts +61 -0
  110. package/models/errors/productrequestvalidationerror.d.ts.map +1 -0
  111. package/models/errors/productrequestvalidationerror.js +105 -0
  112. package/models/errors/productrequestvalidationerror.js.map +1 -0
  113. package/models/operations/createproduct.d.ts +101 -0
  114. package/models/operations/createproduct.d.ts.map +1 -0
  115. package/models/operations/createproduct.js +155 -0
  116. package/models/operations/createproduct.js.map +1 -0
  117. package/models/operations/disableproduct.d.ts +98 -0
  118. package/models/operations/disableproduct.d.ts.map +1 -0
  119. package/models/operations/disableproduct.js +142 -0
  120. package/models/operations/disableproduct.js.map +1 -0
  121. package/models/operations/getproduct.d.ts +101 -0
  122. package/models/operations/getproduct.d.ts.map +1 -0
  123. package/models/operations/getproduct.js +147 -0
  124. package/models/operations/getproduct.js.map +1 -0
  125. package/models/operations/index.d.ts +5 -0
  126. package/models/operations/index.d.ts.map +1 -1
  127. package/models/operations/index.js +5 -0
  128. package/models/operations/index.js.map +1 -1
  129. package/models/operations/listproducts.d.ts +103 -0
  130. package/models/operations/listproducts.d.ts.map +1 -0
  131. package/models/operations/listproducts.js +149 -0
  132. package/models/operations/listproducts.js.map +1 -0
  133. package/models/operations/updateproduct.d.ts +103 -0
  134. package/models/operations/updateproduct.d.ts.map +1 -0
  135. package/models/operations/updateproduct.js +157 -0
  136. package/models/operations/updateproduct.js.map +1 -0
  137. package/package.json +1 -1
  138. package/sdk/products.d.ts +27 -0
  139. package/sdk/products.d.ts.map +1 -0
  140. package/sdk/products.js +49 -0
  141. package/sdk/products.js.map +1 -0
  142. package/sdk/sdk.d.ts +3 -0
  143. package/sdk/sdk.d.ts.map +1 -1
  144. package/sdk/sdk.js +4 -0
  145. package/sdk/sdk.js.map +1 -1
  146. package/src/funcs/productsCreate.ts +200 -0
  147. package/src/funcs/productsDisable.ts +199 -0
  148. package/src/funcs/productsGet.ts +182 -0
  149. package/src/funcs/productsList.ts +182 -0
  150. package/src/funcs/productsUpdate.ts +206 -0
  151. package/src/lib/config.ts +2 -2
  152. package/src/mcp-server/mcp-server.ts +1 -1
  153. package/src/mcp-server/server.ts +11 -1
  154. package/src/mcp-server/tools/productsCreate.ts +35 -0
  155. package/src/mcp-server/tools/productsDisable.ts +35 -0
  156. package/src/mcp-server/tools/productsGet.ts +35 -0
  157. package/src/mcp-server/tools/productsList.ts +35 -0
  158. package/src/mcp-server/tools/productsUpdate.ts +35 -0
  159. package/src/models/components/amountdecimalvalidationerror.ts +72 -0
  160. package/src/models/components/assignproductimage.ts +69 -0
  161. package/src/models/components/assignproductimagevalidationerror.ts +69 -0
  162. package/src/models/components/createproductoption.ts +102 -0
  163. package/src/models/components/createproductoptiongroup.ts +110 -0
  164. package/src/models/components/index.ts +12 -0
  165. package/src/models/components/product.ts +148 -0
  166. package/src/models/components/productimagemetadata.ts +83 -0
  167. package/src/models/components/productoption.ts +101 -0
  168. package/src/models/components/productoptiongroup.ts +113 -0
  169. package/src/models/components/productoptiongroupvalidationerror.ts +91 -0
  170. package/src/models/components/productoptionvalidationerror.ts +88 -0
  171. package/src/models/components/productrequest.ts +117 -0
  172. package/src/models/errors/index.ts +1 -0
  173. package/src/models/errors/productrequestvalidationerror.ts +124 -0
  174. package/src/models/operations/createproduct.ts +231 -0
  175. package/src/models/operations/disableproduct.ts +216 -0
  176. package/src/models/operations/getproduct.ts +223 -0
  177. package/src/models/operations/index.ts +5 -0
  178. package/src/models/operations/listproducts.ts +227 -0
  179. package/src/models/operations/updateproduct.ts +235 -0
  180. package/src/sdk/products.ts +86 -0
  181. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,227 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type ListProductsGlobals = {
13
+ /**
14
+ * Specify an API version.
15
+ *
16
+ * @remarks
17
+ *
18
+ * API versioning follows the format `vYYYY.QQ.BB`, where
19
+ * - `YYYY` is the year
20
+ * - `QQ` is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
21
+ * - `BB` is the build number, starting at `.01`, for subsequent builds in the same quarter.
22
+ * - For example, `v2024.01.00` is the initial release of the first quarter of 2024.
23
+ *
24
+ * The `latest` version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
25
+ */
26
+ xMoovVersion?: string | undefined;
27
+ };
28
+
29
+ export type ListProductsRequest = {
30
+ accountID: string;
31
+ skip?: number | undefined;
32
+ count?: number | undefined;
33
+ };
34
+
35
+ export type ListProductsResponse = {
36
+ headers: { [k: string]: Array<string> };
37
+ result: Array<components.Product>;
38
+ };
39
+
40
+ /** @internal */
41
+ export const ListProductsGlobals$inboundSchema: z.ZodType<
42
+ ListProductsGlobals,
43
+ z.ZodTypeDef,
44
+ unknown
45
+ > = z.object({
46
+ "x-moov-version": z.string().default("v2024.01.00"),
47
+ }).transform((v) => {
48
+ return remap$(v, {
49
+ "x-moov-version": "xMoovVersion",
50
+ });
51
+ });
52
+
53
+ /** @internal */
54
+ export type ListProductsGlobals$Outbound = {
55
+ "x-moov-version": string;
56
+ };
57
+
58
+ /** @internal */
59
+ export const ListProductsGlobals$outboundSchema: z.ZodType<
60
+ ListProductsGlobals$Outbound,
61
+ z.ZodTypeDef,
62
+ ListProductsGlobals
63
+ > = z.object({
64
+ xMoovVersion: z.string().default("v2024.01.00"),
65
+ }).transform((v) => {
66
+ return remap$(v, {
67
+ xMoovVersion: "x-moov-version",
68
+ });
69
+ });
70
+
71
+ /**
72
+ * @internal
73
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
74
+ */
75
+ export namespace ListProductsGlobals$ {
76
+ /** @deprecated use `ListProductsGlobals$inboundSchema` instead. */
77
+ export const inboundSchema = ListProductsGlobals$inboundSchema;
78
+ /** @deprecated use `ListProductsGlobals$outboundSchema` instead. */
79
+ export const outboundSchema = ListProductsGlobals$outboundSchema;
80
+ /** @deprecated use `ListProductsGlobals$Outbound` instead. */
81
+ export type Outbound = ListProductsGlobals$Outbound;
82
+ }
83
+
84
+ export function listProductsGlobalsToJSON(
85
+ listProductsGlobals: ListProductsGlobals,
86
+ ): string {
87
+ return JSON.stringify(
88
+ ListProductsGlobals$outboundSchema.parse(listProductsGlobals),
89
+ );
90
+ }
91
+
92
+ export function listProductsGlobalsFromJSON(
93
+ jsonString: string,
94
+ ): SafeParseResult<ListProductsGlobals, SDKValidationError> {
95
+ return safeParse(
96
+ jsonString,
97
+ (x) => ListProductsGlobals$inboundSchema.parse(JSON.parse(x)),
98
+ `Failed to parse 'ListProductsGlobals' from JSON`,
99
+ );
100
+ }
101
+
102
+ /** @internal */
103
+ export const ListProductsRequest$inboundSchema: z.ZodType<
104
+ ListProductsRequest,
105
+ z.ZodTypeDef,
106
+ unknown
107
+ > = z.object({
108
+ accountID: z.string(),
109
+ skip: z.number().int().optional(),
110
+ count: z.number().int().optional(),
111
+ });
112
+
113
+ /** @internal */
114
+ export type ListProductsRequest$Outbound = {
115
+ accountID: string;
116
+ skip?: number | undefined;
117
+ count?: number | undefined;
118
+ };
119
+
120
+ /** @internal */
121
+ export const ListProductsRequest$outboundSchema: z.ZodType<
122
+ ListProductsRequest$Outbound,
123
+ z.ZodTypeDef,
124
+ ListProductsRequest
125
+ > = z.object({
126
+ accountID: z.string(),
127
+ skip: z.number().int().optional(),
128
+ count: z.number().int().optional(),
129
+ });
130
+
131
+ /**
132
+ * @internal
133
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
134
+ */
135
+ export namespace ListProductsRequest$ {
136
+ /** @deprecated use `ListProductsRequest$inboundSchema` instead. */
137
+ export const inboundSchema = ListProductsRequest$inboundSchema;
138
+ /** @deprecated use `ListProductsRequest$outboundSchema` instead. */
139
+ export const outboundSchema = ListProductsRequest$outboundSchema;
140
+ /** @deprecated use `ListProductsRequest$Outbound` instead. */
141
+ export type Outbound = ListProductsRequest$Outbound;
142
+ }
143
+
144
+ export function listProductsRequestToJSON(
145
+ listProductsRequest: ListProductsRequest,
146
+ ): string {
147
+ return JSON.stringify(
148
+ ListProductsRequest$outboundSchema.parse(listProductsRequest),
149
+ );
150
+ }
151
+
152
+ export function listProductsRequestFromJSON(
153
+ jsonString: string,
154
+ ): SafeParseResult<ListProductsRequest, SDKValidationError> {
155
+ return safeParse(
156
+ jsonString,
157
+ (x) => ListProductsRequest$inboundSchema.parse(JSON.parse(x)),
158
+ `Failed to parse 'ListProductsRequest' from JSON`,
159
+ );
160
+ }
161
+
162
+ /** @internal */
163
+ export const ListProductsResponse$inboundSchema: z.ZodType<
164
+ ListProductsResponse,
165
+ z.ZodTypeDef,
166
+ unknown
167
+ > = z.object({
168
+ Headers: z.record(z.array(z.string())),
169
+ Result: z.array(components.Product$inboundSchema),
170
+ }).transform((v) => {
171
+ return remap$(v, {
172
+ "Headers": "headers",
173
+ "Result": "result",
174
+ });
175
+ });
176
+
177
+ /** @internal */
178
+ export type ListProductsResponse$Outbound = {
179
+ Headers: { [k: string]: Array<string> };
180
+ Result: Array<components.Product$Outbound>;
181
+ };
182
+
183
+ /** @internal */
184
+ export const ListProductsResponse$outboundSchema: z.ZodType<
185
+ ListProductsResponse$Outbound,
186
+ z.ZodTypeDef,
187
+ ListProductsResponse
188
+ > = z.object({
189
+ headers: z.record(z.array(z.string())),
190
+ result: z.array(components.Product$outboundSchema),
191
+ }).transform((v) => {
192
+ return remap$(v, {
193
+ headers: "Headers",
194
+ result: "Result",
195
+ });
196
+ });
197
+
198
+ /**
199
+ * @internal
200
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
201
+ */
202
+ export namespace ListProductsResponse$ {
203
+ /** @deprecated use `ListProductsResponse$inboundSchema` instead. */
204
+ export const inboundSchema = ListProductsResponse$inboundSchema;
205
+ /** @deprecated use `ListProductsResponse$outboundSchema` instead. */
206
+ export const outboundSchema = ListProductsResponse$outboundSchema;
207
+ /** @deprecated use `ListProductsResponse$Outbound` instead. */
208
+ export type Outbound = ListProductsResponse$Outbound;
209
+ }
210
+
211
+ export function listProductsResponseToJSON(
212
+ listProductsResponse: ListProductsResponse,
213
+ ): string {
214
+ return JSON.stringify(
215
+ ListProductsResponse$outboundSchema.parse(listProductsResponse),
216
+ );
217
+ }
218
+
219
+ export function listProductsResponseFromJSON(
220
+ jsonString: string,
221
+ ): SafeParseResult<ListProductsResponse, SDKValidationError> {
222
+ return safeParse(
223
+ jsonString,
224
+ (x) => ListProductsResponse$inboundSchema.parse(JSON.parse(x)),
225
+ `Failed to parse 'ListProductsResponse' from JSON`,
226
+ );
227
+ }
@@ -0,0 +1,235 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type UpdateProductGlobals = {
13
+ /**
14
+ * Specify an API version.
15
+ *
16
+ * @remarks
17
+ *
18
+ * API versioning follows the format `vYYYY.QQ.BB`, where
19
+ * - `YYYY` is the year
20
+ * - `QQ` is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
21
+ * - `BB` is the build number, starting at `.01`, for subsequent builds in the same quarter.
22
+ * - For example, `v2024.01.00` is the initial release of the first quarter of 2024.
23
+ *
24
+ * The `latest` version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
25
+ */
26
+ xMoovVersion?: string | undefined;
27
+ };
28
+
29
+ export type UpdateProductRequest = {
30
+ accountID: string;
31
+ productID: string;
32
+ productRequest: components.ProductRequest;
33
+ };
34
+
35
+ export type UpdateProductResponse = {
36
+ headers: { [k: string]: Array<string> };
37
+ result: components.Product;
38
+ };
39
+
40
+ /** @internal */
41
+ export const UpdateProductGlobals$inboundSchema: z.ZodType<
42
+ UpdateProductGlobals,
43
+ z.ZodTypeDef,
44
+ unknown
45
+ > = z.object({
46
+ "x-moov-version": z.string().default("v2024.01.00"),
47
+ }).transform((v) => {
48
+ return remap$(v, {
49
+ "x-moov-version": "xMoovVersion",
50
+ });
51
+ });
52
+
53
+ /** @internal */
54
+ export type UpdateProductGlobals$Outbound = {
55
+ "x-moov-version": string;
56
+ };
57
+
58
+ /** @internal */
59
+ export const UpdateProductGlobals$outboundSchema: z.ZodType<
60
+ UpdateProductGlobals$Outbound,
61
+ z.ZodTypeDef,
62
+ UpdateProductGlobals
63
+ > = z.object({
64
+ xMoovVersion: z.string().default("v2024.01.00"),
65
+ }).transform((v) => {
66
+ return remap$(v, {
67
+ xMoovVersion: "x-moov-version",
68
+ });
69
+ });
70
+
71
+ /**
72
+ * @internal
73
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
74
+ */
75
+ export namespace UpdateProductGlobals$ {
76
+ /** @deprecated use `UpdateProductGlobals$inboundSchema` instead. */
77
+ export const inboundSchema = UpdateProductGlobals$inboundSchema;
78
+ /** @deprecated use `UpdateProductGlobals$outboundSchema` instead. */
79
+ export const outboundSchema = UpdateProductGlobals$outboundSchema;
80
+ /** @deprecated use `UpdateProductGlobals$Outbound` instead. */
81
+ export type Outbound = UpdateProductGlobals$Outbound;
82
+ }
83
+
84
+ export function updateProductGlobalsToJSON(
85
+ updateProductGlobals: UpdateProductGlobals,
86
+ ): string {
87
+ return JSON.stringify(
88
+ UpdateProductGlobals$outboundSchema.parse(updateProductGlobals),
89
+ );
90
+ }
91
+
92
+ export function updateProductGlobalsFromJSON(
93
+ jsonString: string,
94
+ ): SafeParseResult<UpdateProductGlobals, SDKValidationError> {
95
+ return safeParse(
96
+ jsonString,
97
+ (x) => UpdateProductGlobals$inboundSchema.parse(JSON.parse(x)),
98
+ `Failed to parse 'UpdateProductGlobals' from JSON`,
99
+ );
100
+ }
101
+
102
+ /** @internal */
103
+ export const UpdateProductRequest$inboundSchema: z.ZodType<
104
+ UpdateProductRequest,
105
+ z.ZodTypeDef,
106
+ unknown
107
+ > = z.object({
108
+ accountID: z.string(),
109
+ productID: z.string(),
110
+ ProductRequest: components.ProductRequest$inboundSchema,
111
+ }).transform((v) => {
112
+ return remap$(v, {
113
+ "ProductRequest": "productRequest",
114
+ });
115
+ });
116
+
117
+ /** @internal */
118
+ export type UpdateProductRequest$Outbound = {
119
+ accountID: string;
120
+ productID: string;
121
+ ProductRequest: components.ProductRequest$Outbound;
122
+ };
123
+
124
+ /** @internal */
125
+ export const UpdateProductRequest$outboundSchema: z.ZodType<
126
+ UpdateProductRequest$Outbound,
127
+ z.ZodTypeDef,
128
+ UpdateProductRequest
129
+ > = z.object({
130
+ accountID: z.string(),
131
+ productID: z.string(),
132
+ productRequest: components.ProductRequest$outboundSchema,
133
+ }).transform((v) => {
134
+ return remap$(v, {
135
+ productRequest: "ProductRequest",
136
+ });
137
+ });
138
+
139
+ /**
140
+ * @internal
141
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
142
+ */
143
+ export namespace UpdateProductRequest$ {
144
+ /** @deprecated use `UpdateProductRequest$inboundSchema` instead. */
145
+ export const inboundSchema = UpdateProductRequest$inboundSchema;
146
+ /** @deprecated use `UpdateProductRequest$outboundSchema` instead. */
147
+ export const outboundSchema = UpdateProductRequest$outboundSchema;
148
+ /** @deprecated use `UpdateProductRequest$Outbound` instead. */
149
+ export type Outbound = UpdateProductRequest$Outbound;
150
+ }
151
+
152
+ export function updateProductRequestToJSON(
153
+ updateProductRequest: UpdateProductRequest,
154
+ ): string {
155
+ return JSON.stringify(
156
+ UpdateProductRequest$outboundSchema.parse(updateProductRequest),
157
+ );
158
+ }
159
+
160
+ export function updateProductRequestFromJSON(
161
+ jsonString: string,
162
+ ): SafeParseResult<UpdateProductRequest, SDKValidationError> {
163
+ return safeParse(
164
+ jsonString,
165
+ (x) => UpdateProductRequest$inboundSchema.parse(JSON.parse(x)),
166
+ `Failed to parse 'UpdateProductRequest' from JSON`,
167
+ );
168
+ }
169
+
170
+ /** @internal */
171
+ export const UpdateProductResponse$inboundSchema: z.ZodType<
172
+ UpdateProductResponse,
173
+ z.ZodTypeDef,
174
+ unknown
175
+ > = z.object({
176
+ Headers: z.record(z.array(z.string())),
177
+ Result: components.Product$inboundSchema,
178
+ }).transform((v) => {
179
+ return remap$(v, {
180
+ "Headers": "headers",
181
+ "Result": "result",
182
+ });
183
+ });
184
+
185
+ /** @internal */
186
+ export type UpdateProductResponse$Outbound = {
187
+ Headers: { [k: string]: Array<string> };
188
+ Result: components.Product$Outbound;
189
+ };
190
+
191
+ /** @internal */
192
+ export const UpdateProductResponse$outboundSchema: z.ZodType<
193
+ UpdateProductResponse$Outbound,
194
+ z.ZodTypeDef,
195
+ UpdateProductResponse
196
+ > = z.object({
197
+ headers: z.record(z.array(z.string())),
198
+ result: components.Product$outboundSchema,
199
+ }).transform((v) => {
200
+ return remap$(v, {
201
+ headers: "Headers",
202
+ result: "Result",
203
+ });
204
+ });
205
+
206
+ /**
207
+ * @internal
208
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
209
+ */
210
+ export namespace UpdateProductResponse$ {
211
+ /** @deprecated use `UpdateProductResponse$inboundSchema` instead. */
212
+ export const inboundSchema = UpdateProductResponse$inboundSchema;
213
+ /** @deprecated use `UpdateProductResponse$outboundSchema` instead. */
214
+ export const outboundSchema = UpdateProductResponse$outboundSchema;
215
+ /** @deprecated use `UpdateProductResponse$Outbound` instead. */
216
+ export type Outbound = UpdateProductResponse$Outbound;
217
+ }
218
+
219
+ export function updateProductResponseToJSON(
220
+ updateProductResponse: UpdateProductResponse,
221
+ ): string {
222
+ return JSON.stringify(
223
+ UpdateProductResponse$outboundSchema.parse(updateProductResponse),
224
+ );
225
+ }
226
+
227
+ export function updateProductResponseFromJSON(
228
+ jsonString: string,
229
+ ): SafeParseResult<UpdateProductResponse, SDKValidationError> {
230
+ return safeParse(
231
+ jsonString,
232
+ (x) => UpdateProductResponse$inboundSchema.parse(JSON.parse(x)),
233
+ `Failed to parse 'UpdateProductResponse' from JSON`,
234
+ );
235
+ }
@@ -0,0 +1,86 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { productsCreate } from "../funcs/productsCreate.js";
6
+ import { productsDisable } from "../funcs/productsDisable.js";
7
+ import { productsGet } from "../funcs/productsGet.js";
8
+ import { productsList } from "../funcs/productsList.js";
9
+ import { productsUpdate } from "../funcs/productsUpdate.js";
10
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
11
+ import * as operations from "../models/operations/index.js";
12
+ import { unwrapAsync } from "../types/fp.js";
13
+
14
+ export class Products extends ClientSDK {
15
+ /**
16
+ * List active (non-disabled) products for an account.
17
+ */
18
+ async list(
19
+ request: operations.ListProductsRequest,
20
+ options?: RequestOptions,
21
+ ): Promise<operations.ListProductsResponse> {
22
+ return unwrapAsync(productsList(
23
+ this,
24
+ request,
25
+ options,
26
+ ));
27
+ }
28
+
29
+ /**
30
+ * Creates a new product for the specified account.
31
+ */
32
+ async create(
33
+ request: operations.CreateProductRequest,
34
+ options?: RequestOptions,
35
+ ): Promise<operations.CreateProductResponse> {
36
+ return unwrapAsync(productsCreate(
37
+ this,
38
+ request,
39
+ options,
40
+ ));
41
+ }
42
+
43
+ /**
44
+ * Retrieve a product by ID.
45
+ */
46
+ async get(
47
+ request: operations.GetProductRequest,
48
+ options?: RequestOptions,
49
+ ): Promise<operations.GetProductResponse> {
50
+ return unwrapAsync(productsGet(
51
+ this,
52
+ request,
53
+ options,
54
+ ));
55
+ }
56
+
57
+ /**
58
+ * Update a product and its options.
59
+ */
60
+ async update(
61
+ request: operations.UpdateProductRequest,
62
+ options?: RequestOptions,
63
+ ): Promise<operations.UpdateProductResponse> {
64
+ return unwrapAsync(productsUpdate(
65
+ this,
66
+ request,
67
+ options,
68
+ ));
69
+ }
70
+
71
+ /**
72
+ * Disable a product by ID.
73
+ *
74
+ * The product will no longer be available, but will remain in the system for historical and reporting purposes.
75
+ */
76
+ async disable(
77
+ request: operations.DisableProductRequest,
78
+ options?: RequestOptions,
79
+ ): Promise<operations.DisableProductResponse | undefined> {
80
+ return unwrapAsync(productsDisable(
81
+ this,
82
+ request,
83
+ options,
84
+ ));
85
+ }
86
+ }
package/src/sdk/sdk.ts CHANGED
@@ -28,6 +28,7 @@ import { Onboarding } from "./onboarding.js";
28
28
  import { PaymentLinks } from "./paymentlinks.js";
29
29
  import { PaymentMethods } from "./paymentmethods.js";
30
30
  import { Ping } from "./ping.js";
31
+ import { Products } from "./products.js";
31
32
  import { Receipts } from "./receipts.js";
32
33
  import { Representatives } from "./representatives.js";
33
34
  import { Scheduling } from "./scheduling.js";
@@ -106,6 +107,11 @@ export class Moov extends ClientSDK {
106
107
  return (this._paymentMethods ??= new PaymentMethods(this._options));
107
108
  }
108
109
 
110
+ private _products?: Products;
111
+ get products(): Products {
112
+ return (this._products ??= new Products(this._options));
113
+ }
114
+
109
115
  private _representatives?: Representatives;
110
116
  get representatives(): Representatives {
111
117
  return (this._representatives ??= new Representatives(this._options));