@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,69 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type AssignProductImage = {
11
+ /**
12
+ * Unique identifier for a product or product option image resource.
13
+ */
14
+ imageID: string;
15
+ };
16
+
17
+ /** @internal */
18
+ export const AssignProductImage$inboundSchema: z.ZodType<
19
+ AssignProductImage,
20
+ z.ZodTypeDef,
21
+ unknown
22
+ > = z.object({
23
+ imageID: z.string(),
24
+ });
25
+
26
+ /** @internal */
27
+ export type AssignProductImage$Outbound = {
28
+ imageID: string;
29
+ };
30
+
31
+ /** @internal */
32
+ export const AssignProductImage$outboundSchema: z.ZodType<
33
+ AssignProductImage$Outbound,
34
+ z.ZodTypeDef,
35
+ AssignProductImage
36
+ > = z.object({
37
+ imageID: z.string(),
38
+ });
39
+
40
+ /**
41
+ * @internal
42
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
43
+ */
44
+ export namespace AssignProductImage$ {
45
+ /** @deprecated use `AssignProductImage$inboundSchema` instead. */
46
+ export const inboundSchema = AssignProductImage$inboundSchema;
47
+ /** @deprecated use `AssignProductImage$outboundSchema` instead. */
48
+ export const outboundSchema = AssignProductImage$outboundSchema;
49
+ /** @deprecated use `AssignProductImage$Outbound` instead. */
50
+ export type Outbound = AssignProductImage$Outbound;
51
+ }
52
+
53
+ export function assignProductImageToJSON(
54
+ assignProductImage: AssignProductImage,
55
+ ): string {
56
+ return JSON.stringify(
57
+ AssignProductImage$outboundSchema.parse(assignProductImage),
58
+ );
59
+ }
60
+
61
+ export function assignProductImageFromJSON(
62
+ jsonString: string,
63
+ ): SafeParseResult<AssignProductImage, SDKValidationError> {
64
+ return safeParse(
65
+ jsonString,
66
+ (x) => AssignProductImage$inboundSchema.parse(JSON.parse(x)),
67
+ `Failed to parse 'AssignProductImage' from JSON`,
68
+ );
69
+ }
@@ -0,0 +1,69 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type AssignProductImageValidationError = {
11
+ imageID?: string | undefined;
12
+ };
13
+
14
+ /** @internal */
15
+ export const AssignProductImageValidationError$inboundSchema: z.ZodType<
16
+ AssignProductImageValidationError,
17
+ z.ZodTypeDef,
18
+ unknown
19
+ > = z.object({
20
+ imageID: z.string().optional(),
21
+ });
22
+
23
+ /** @internal */
24
+ export type AssignProductImageValidationError$Outbound = {
25
+ imageID?: string | undefined;
26
+ };
27
+
28
+ /** @internal */
29
+ export const AssignProductImageValidationError$outboundSchema: z.ZodType<
30
+ AssignProductImageValidationError$Outbound,
31
+ z.ZodTypeDef,
32
+ AssignProductImageValidationError
33
+ > = z.object({
34
+ imageID: z.string().optional(),
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 AssignProductImageValidationError$ {
42
+ /** @deprecated use `AssignProductImageValidationError$inboundSchema` instead. */
43
+ export const inboundSchema = AssignProductImageValidationError$inboundSchema;
44
+ /** @deprecated use `AssignProductImageValidationError$outboundSchema` instead. */
45
+ export const outboundSchema =
46
+ AssignProductImageValidationError$outboundSchema;
47
+ /** @deprecated use `AssignProductImageValidationError$Outbound` instead. */
48
+ export type Outbound = AssignProductImageValidationError$Outbound;
49
+ }
50
+
51
+ export function assignProductImageValidationErrorToJSON(
52
+ assignProductImageValidationError: AssignProductImageValidationError,
53
+ ): string {
54
+ return JSON.stringify(
55
+ AssignProductImageValidationError$outboundSchema.parse(
56
+ assignProductImageValidationError,
57
+ ),
58
+ );
59
+ }
60
+
61
+ export function assignProductImageValidationErrorFromJSON(
62
+ jsonString: string,
63
+ ): SafeParseResult<AssignProductImageValidationError, SDKValidationError> {
64
+ return safeParse(
65
+ jsonString,
66
+ (x) => AssignProductImageValidationError$inboundSchema.parse(JSON.parse(x)),
67
+ `Failed to parse 'AssignProductImageValidationError' from JSON`,
68
+ );
69
+ }
@@ -0,0 +1,102 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ AssignProductImage,
11
+ AssignProductImage$inboundSchema,
12
+ AssignProductImage$Outbound,
13
+ AssignProductImage$outboundSchema,
14
+ } from "./assignproductimage.js";
15
+
16
+ export type CreateProductOption = {
17
+ /**
18
+ * The display name of a product option.
19
+ */
20
+ name: string;
21
+ /**
22
+ * A detailed description of the option.
23
+ *
24
+ * @remarks
25
+ *
26
+ * - Must be valid UTF-8 text
27
+ * - Supports Markdown for formatting
28
+ * - HTML is not permitted and will be rejected
29
+ */
30
+ description?: string | undefined;
31
+ /**
32
+ * The adjustment applied to a product's base price by this option. Can be negative, positive, or zero.
33
+ */
34
+ priceModifier?: string | undefined;
35
+ /**
36
+ * Assign previously uploaded images to a product or option.
37
+ */
38
+ images?: Array<AssignProductImage> | undefined;
39
+ };
40
+
41
+ /** @internal */
42
+ export const CreateProductOption$inboundSchema: z.ZodType<
43
+ CreateProductOption,
44
+ z.ZodTypeDef,
45
+ unknown
46
+ > = z.object({
47
+ name: z.string(),
48
+ description: z.string().optional(),
49
+ priceModifier: z.string().optional(),
50
+ images: z.array(AssignProductImage$inboundSchema).optional(),
51
+ });
52
+
53
+ /** @internal */
54
+ export type CreateProductOption$Outbound = {
55
+ name: string;
56
+ description?: string | undefined;
57
+ priceModifier?: string | undefined;
58
+ images?: Array<AssignProductImage$Outbound> | undefined;
59
+ };
60
+
61
+ /** @internal */
62
+ export const CreateProductOption$outboundSchema: z.ZodType<
63
+ CreateProductOption$Outbound,
64
+ z.ZodTypeDef,
65
+ CreateProductOption
66
+ > = z.object({
67
+ name: z.string(),
68
+ description: z.string().optional(),
69
+ priceModifier: z.string().optional(),
70
+ images: z.array(AssignProductImage$outboundSchema).optional(),
71
+ });
72
+
73
+ /**
74
+ * @internal
75
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
76
+ */
77
+ export namespace CreateProductOption$ {
78
+ /** @deprecated use `CreateProductOption$inboundSchema` instead. */
79
+ export const inboundSchema = CreateProductOption$inboundSchema;
80
+ /** @deprecated use `CreateProductOption$outboundSchema` instead. */
81
+ export const outboundSchema = CreateProductOption$outboundSchema;
82
+ /** @deprecated use `CreateProductOption$Outbound` instead. */
83
+ export type Outbound = CreateProductOption$Outbound;
84
+ }
85
+
86
+ export function createProductOptionToJSON(
87
+ createProductOption: CreateProductOption,
88
+ ): string {
89
+ return JSON.stringify(
90
+ CreateProductOption$outboundSchema.parse(createProductOption),
91
+ );
92
+ }
93
+
94
+ export function createProductOptionFromJSON(
95
+ jsonString: string,
96
+ ): SafeParseResult<CreateProductOption, SDKValidationError> {
97
+ return safeParse(
98
+ jsonString,
99
+ (x) => CreateProductOption$inboundSchema.parse(JSON.parse(x)),
100
+ `Failed to parse 'CreateProductOption' from JSON`,
101
+ );
102
+ }
@@ -0,0 +1,110 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ CreateProductOption,
11
+ CreateProductOption$inboundSchema,
12
+ CreateProductOption$Outbound,
13
+ CreateProductOption$outboundSchema,
14
+ } from "./createproductoption.js";
15
+
16
+ export type CreateProductOptionGroup = {
17
+ name: string;
18
+ /**
19
+ * A detailed description of the option group.
20
+ *
21
+ * @remarks
22
+ *
23
+ * - Must be valid UTF-8 text
24
+ * - Supports Markdown for formatting
25
+ * - HTML is not permitted and will be rejected
26
+ */
27
+ description?: string | undefined;
28
+ /**
29
+ * The minimum number of options that must be selected from this group.
30
+ *
31
+ * @remarks
32
+ *
33
+ * A value of 0 indicates that no selection from this group is required.
34
+ */
35
+ minSelect: number;
36
+ /**
37
+ * The maximum number of options that can be selected from this group.
38
+ */
39
+ maxSelect: number;
40
+ /**
41
+ * The options available within this group.
42
+ */
43
+ options: Array<CreateProductOption>;
44
+ };
45
+
46
+ /** @internal */
47
+ export const CreateProductOptionGroup$inboundSchema: z.ZodType<
48
+ CreateProductOptionGroup,
49
+ z.ZodTypeDef,
50
+ unknown
51
+ > = z.object({
52
+ name: z.string(),
53
+ description: z.string().optional(),
54
+ minSelect: z.number().int(),
55
+ maxSelect: z.number().int(),
56
+ options: z.array(CreateProductOption$inboundSchema),
57
+ });
58
+
59
+ /** @internal */
60
+ export type CreateProductOptionGroup$Outbound = {
61
+ name: string;
62
+ description?: string | undefined;
63
+ minSelect: number;
64
+ maxSelect: number;
65
+ options: Array<CreateProductOption$Outbound>;
66
+ };
67
+
68
+ /** @internal */
69
+ export const CreateProductOptionGroup$outboundSchema: z.ZodType<
70
+ CreateProductOptionGroup$Outbound,
71
+ z.ZodTypeDef,
72
+ CreateProductOptionGroup
73
+ > = z.object({
74
+ name: z.string(),
75
+ description: z.string().optional(),
76
+ minSelect: z.number().int(),
77
+ maxSelect: z.number().int(),
78
+ options: z.array(CreateProductOption$outboundSchema),
79
+ });
80
+
81
+ /**
82
+ * @internal
83
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
84
+ */
85
+ export namespace CreateProductOptionGroup$ {
86
+ /** @deprecated use `CreateProductOptionGroup$inboundSchema` instead. */
87
+ export const inboundSchema = CreateProductOptionGroup$inboundSchema;
88
+ /** @deprecated use `CreateProductOptionGroup$outboundSchema` instead. */
89
+ export const outboundSchema = CreateProductOptionGroup$outboundSchema;
90
+ /** @deprecated use `CreateProductOptionGroup$Outbound` instead. */
91
+ export type Outbound = CreateProductOptionGroup$Outbound;
92
+ }
93
+
94
+ export function createProductOptionGroupToJSON(
95
+ createProductOptionGroup: CreateProductOptionGroup,
96
+ ): string {
97
+ return JSON.stringify(
98
+ CreateProductOptionGroup$outboundSchema.parse(createProductOptionGroup),
99
+ );
100
+ }
101
+
102
+ export function createProductOptionGroupFromJSON(
103
+ jsonString: string,
104
+ ): SafeParseResult<CreateProductOptionGroup, SDKValidationError> {
105
+ return safeParse(
106
+ jsonString,
107
+ (x) => CreateProductOptionGroup$inboundSchema.parse(JSON.parse(x)),
108
+ `Failed to parse 'CreateProductOptionGroup' from JSON`,
109
+ );
110
+ }
@@ -32,6 +32,7 @@ export * from "./addressupdate.js";
32
32
  export * from "./adjustment.js";
33
33
  export * from "./amount.js";
34
34
  export * from "./amountdecimal.js";
35
+ export * from "./amountdecimalvalidationerror.js";
35
36
  export * from "./amountupdate.js";
36
37
  export * from "./amountvalidationerror.js";
37
38
  export * from "./applebillingcontact.js";
@@ -40,6 +41,8 @@ export * from "./applepaymerchantdomains.js";
40
41
  export * from "./applepaypaymentmethod.js";
41
42
  export * from "./applepayresponse.js";
42
43
  export * from "./applicationscope.js";
44
+ export * from "./assignproductimage.js";
45
+ export * from "./assignproductimagevalidationerror.js";
43
46
  export * from "./asynccreatedrefund.js";
44
47
  export * from "./asynctransfer.js";
45
48
  export * from "./authorizeduser.js";
@@ -139,6 +142,8 @@ export * from "./createfeeplanagreement.js";
139
142
  export * from "./createindividualerror.js";
140
143
  export * from "./createindividualprofile.js";
141
144
  export * from "./createpaymentlink.js";
145
+ export * from "./createproductoption.js";
146
+ export * from "./createproductoptiongroup.js";
142
147
  export * from "./createprofile.js";
143
148
  export * from "./createprofileerror.js";
144
149
  export * from "./createrefund.js";
@@ -317,6 +322,13 @@ export * from "./plaidlinkpayload.js";
317
322
  export * from "./plaidpayload.js";
318
323
  export * from "./platformfees.js";
319
324
  export * from "./primaryregulator.js";
325
+ export * from "./product.js";
326
+ export * from "./productimagemetadata.js";
327
+ export * from "./productoption.js";
328
+ export * from "./productoptiongroup.js";
329
+ export * from "./productoptiongroupvalidationerror.js";
330
+ export * from "./productoptionvalidationerror.js";
331
+ export * from "./productrequest.js";
320
332
  export * from "./profile.js";
321
333
  export * from "./pullfromcardpaymentmethod.js";
322
334
  export * from "./pushtocardpaymentmethod.js";
@@ -0,0 +1,148 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ AmountDecimal,
11
+ AmountDecimal$inboundSchema,
12
+ AmountDecimal$Outbound,
13
+ AmountDecimal$outboundSchema,
14
+ } from "./amountdecimal.js";
15
+ import {
16
+ ProductImageMetadata,
17
+ ProductImageMetadata$inboundSchema,
18
+ ProductImageMetadata$Outbound,
19
+ ProductImageMetadata$outboundSchema,
20
+ } from "./productimagemetadata.js";
21
+ import {
22
+ ProductOptionGroup,
23
+ ProductOptionGroup$inboundSchema,
24
+ ProductOptionGroup$Outbound,
25
+ ProductOptionGroup$outboundSchema,
26
+ } from "./productoptiongroup.js";
27
+
28
+ /**
29
+ * A product available for purchase, which may have optional configuration options.
30
+ */
31
+ export type Product = {
32
+ /**
33
+ * Unique identifier for a product.
34
+ */
35
+ productID: string;
36
+ title: string;
37
+ /**
38
+ * A detailed description of the product.
39
+ *
40
+ * @remarks
41
+ *
42
+ * - Must be valid UTF-8 text
43
+ * - Supports Markdown for formatting
44
+ * - HTML is not permitted and will be rejected
45
+ */
46
+ description?: string | undefined;
47
+ /**
48
+ * A product's starting price, before applying modifiers.
49
+ */
50
+ basePrice: AmountDecimal;
51
+ /**
52
+ * Optional configuration options for a product, such as size or color.
53
+ */
54
+ optionGroups?: Array<ProductOptionGroup> | undefined;
55
+ /**
56
+ * Optional images associated with the product.
57
+ */
58
+ images?: Array<ProductImageMetadata> | undefined;
59
+ /**
60
+ * The date and time when the product was added.
61
+ */
62
+ createdOn: Date;
63
+ /**
64
+ * The date and time when the product was last updated.
65
+ */
66
+ updatedOn: Date;
67
+ /**
68
+ * The date and time when the product was disabled.
69
+ */
70
+ disabledOn?: Date | undefined;
71
+ };
72
+
73
+ /** @internal */
74
+ export const Product$inboundSchema: z.ZodType<Product, z.ZodTypeDef, unknown> =
75
+ z.object({
76
+ productID: z.string(),
77
+ title: z.string(),
78
+ description: z.string().optional(),
79
+ basePrice: AmountDecimal$inboundSchema,
80
+ optionGroups: z.array(ProductOptionGroup$inboundSchema).optional(),
81
+ images: z.array(ProductImageMetadata$inboundSchema).optional(),
82
+ createdOn: z.string().datetime({ offset: true }).transform(v =>
83
+ new Date(v)
84
+ ),
85
+ updatedOn: z.string().datetime({ offset: true }).transform(v =>
86
+ new Date(v)
87
+ ),
88
+ disabledOn: z.string().datetime({ offset: true }).transform(v =>
89
+ new Date(v)
90
+ ).optional(),
91
+ });
92
+
93
+ /** @internal */
94
+ export type Product$Outbound = {
95
+ productID: string;
96
+ title: string;
97
+ description?: string | undefined;
98
+ basePrice: AmountDecimal$Outbound;
99
+ optionGroups?: Array<ProductOptionGroup$Outbound> | undefined;
100
+ images?: Array<ProductImageMetadata$Outbound> | undefined;
101
+ createdOn: string;
102
+ updatedOn: string;
103
+ disabledOn?: string | undefined;
104
+ };
105
+
106
+ /** @internal */
107
+ export const Product$outboundSchema: z.ZodType<
108
+ Product$Outbound,
109
+ z.ZodTypeDef,
110
+ Product
111
+ > = z.object({
112
+ productID: z.string(),
113
+ title: z.string(),
114
+ description: z.string().optional(),
115
+ basePrice: AmountDecimal$outboundSchema,
116
+ optionGroups: z.array(ProductOptionGroup$outboundSchema).optional(),
117
+ images: z.array(ProductImageMetadata$outboundSchema).optional(),
118
+ createdOn: z.date().transform(v => v.toISOString()),
119
+ updatedOn: z.date().transform(v => v.toISOString()),
120
+ disabledOn: z.date().transform(v => v.toISOString()).optional(),
121
+ });
122
+
123
+ /**
124
+ * @internal
125
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
126
+ */
127
+ export namespace Product$ {
128
+ /** @deprecated use `Product$inboundSchema` instead. */
129
+ export const inboundSchema = Product$inboundSchema;
130
+ /** @deprecated use `Product$outboundSchema` instead. */
131
+ export const outboundSchema = Product$outboundSchema;
132
+ /** @deprecated use `Product$Outbound` instead. */
133
+ export type Outbound = Product$Outbound;
134
+ }
135
+
136
+ export function productToJSON(product: Product): string {
137
+ return JSON.stringify(Product$outboundSchema.parse(product));
138
+ }
139
+
140
+ export function productFromJSON(
141
+ jsonString: string,
142
+ ): SafeParseResult<Product, SDKValidationError> {
143
+ return safeParse(
144
+ jsonString,
145
+ (x) => Product$inboundSchema.parse(JSON.parse(x)),
146
+ `Failed to parse 'Product' from JSON`,
147
+ );
148
+ }
@@ -0,0 +1,83 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type ProductImageMetadata = {
11
+ /**
12
+ * Unique identifier for a product or product option image resource.
13
+ */
14
+ imageID: string;
15
+ /**
16
+ * Alternative text for the image.
17
+ */
18
+ altText?: string | undefined;
19
+ /**
20
+ * The image's public URL.
21
+ */
22
+ link: string;
23
+ };
24
+
25
+ /** @internal */
26
+ export const ProductImageMetadata$inboundSchema: z.ZodType<
27
+ ProductImageMetadata,
28
+ z.ZodTypeDef,
29
+ unknown
30
+ > = z.object({
31
+ imageID: z.string(),
32
+ altText: z.string().optional(),
33
+ link: z.string(),
34
+ });
35
+
36
+ /** @internal */
37
+ export type ProductImageMetadata$Outbound = {
38
+ imageID: string;
39
+ altText?: string | undefined;
40
+ link: string;
41
+ };
42
+
43
+ /** @internal */
44
+ export const ProductImageMetadata$outboundSchema: z.ZodType<
45
+ ProductImageMetadata$Outbound,
46
+ z.ZodTypeDef,
47
+ ProductImageMetadata
48
+ > = z.object({
49
+ imageID: z.string(),
50
+ altText: z.string().optional(),
51
+ link: z.string(),
52
+ });
53
+
54
+ /**
55
+ * @internal
56
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
57
+ */
58
+ export namespace ProductImageMetadata$ {
59
+ /** @deprecated use `ProductImageMetadata$inboundSchema` instead. */
60
+ export const inboundSchema = ProductImageMetadata$inboundSchema;
61
+ /** @deprecated use `ProductImageMetadata$outboundSchema` instead. */
62
+ export const outboundSchema = ProductImageMetadata$outboundSchema;
63
+ /** @deprecated use `ProductImageMetadata$Outbound` instead. */
64
+ export type Outbound = ProductImageMetadata$Outbound;
65
+ }
66
+
67
+ export function productImageMetadataToJSON(
68
+ productImageMetadata: ProductImageMetadata,
69
+ ): string {
70
+ return JSON.stringify(
71
+ ProductImageMetadata$outboundSchema.parse(productImageMetadata),
72
+ );
73
+ }
74
+
75
+ export function productImageMetadataFromJSON(
76
+ jsonString: string,
77
+ ): SafeParseResult<ProductImageMetadata, SDKValidationError> {
78
+ return safeParse(
79
+ jsonString,
80
+ (x) => ProductImageMetadata$inboundSchema.parse(JSON.parse(x)),
81
+ `Failed to parse 'ProductImageMetadata' from JSON`,
82
+ );
83
+ }