@moovio/sdk 0.16.4 → 0.16.6
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.
- package/README.md +62 -44
- package/bin/mcp-server.js +1867 -585
- package/bin/mcp-server.js.map +37 -9
- package/docs/sdks/products/README.md +616 -0
- package/examples/package-lock.json +1 -1
- package/funcs/productsCreate.d.ts +15 -0
- package/funcs/productsCreate.d.ts.map +1 -0
- package/funcs/productsCreate.js +138 -0
- package/funcs/productsCreate.js.map +1 -0
- package/funcs/productsDisable.d.ts +17 -0
- package/funcs/productsDisable.d.ts.map +1 -0
- package/funcs/productsDisable.js +139 -0
- package/funcs/productsDisable.js.map +1 -0
- package/funcs/productsGet.d.ts +14 -0
- package/funcs/productsGet.d.ts.map +1 -0
- package/funcs/productsGet.js +126 -0
- package/funcs/productsGet.js.map +1 -0
- package/funcs/productsList.d.ts +14 -0
- package/funcs/productsList.d.ts.map +1 -0
- package/funcs/productsList.js +127 -0
- package/funcs/productsList.js.map +1 -0
- package/funcs/productsUpdate.d.ts +15 -0
- package/funcs/productsUpdate.d.ts.map +1 -0
- package/funcs/productsUpdate.js +142 -0
- package/funcs/productsUpdate.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +11 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/productsCreate.d.ts +8 -0
- package/mcp-server/tools/productsCreate.d.ts.map +1 -0
- package/mcp-server/tools/productsCreate.js +62 -0
- package/mcp-server/tools/productsCreate.js.map +1 -0
- package/mcp-server/tools/productsDisable.d.ts +8 -0
- package/mcp-server/tools/productsDisable.d.ts.map +1 -0
- package/mcp-server/tools/productsDisable.js +63 -0
- package/mcp-server/tools/productsDisable.js.map +1 -0
- package/mcp-server/tools/productsGet.d.ts +8 -0
- package/mcp-server/tools/productsGet.d.ts.map +1 -0
- package/mcp-server/tools/productsGet.js +62 -0
- package/mcp-server/tools/productsGet.js.map +1 -0
- package/mcp-server/tools/productsList.d.ts +8 -0
- package/mcp-server/tools/productsList.d.ts.map +1 -0
- package/mcp-server/tools/productsList.js +62 -0
- package/mcp-server/tools/productsList.js.map +1 -0
- package/mcp-server/tools/productsUpdate.d.ts +8 -0
- package/mcp-server/tools/productsUpdate.d.ts.map +1 -0
- package/mcp-server/tools/productsUpdate.js +62 -0
- package/mcp-server/tools/productsUpdate.js.map +1 -0
- package/models/components/amountdecimalvalidationerror.d.ts +31 -0
- package/models/components/amountdecimalvalidationerror.d.ts.map +1 -0
- package/models/components/amountdecimalvalidationerror.js +71 -0
- package/models/components/amountdecimalvalidationerror.js.map +1 -0
- package/models/components/assignproductimage.d.ts +32 -0
- package/models/components/assignproductimage.d.ts.map +1 -0
- package/models/components/assignproductimage.js +69 -0
- package/models/components/assignproductimage.js.map +1 -0
- package/models/components/assignproductimagevalidationerror.d.ts +29 -0
- package/models/components/assignproductimagevalidationerror.d.ts.map +1 -0
- package/models/components/assignproductimagevalidationerror.js +69 -0
- package/models/components/assignproductimagevalidationerror.js.map +1 -0
- package/models/components/createproductoption.d.ts +55 -0
- package/models/components/createproductoption.d.ts.map +1 -0
- package/models/components/createproductoption.js +77 -0
- package/models/components/createproductoption.js.map +1 -0
- package/models/components/createproductoptiongroup.d.ts +60 -0
- package/models/components/createproductoptiongroup.d.ts.map +1 -0
- package/models/components/createproductoptiongroup.js +78 -0
- package/models/components/createproductoptiongroup.js.map +1 -0
- package/models/components/index.d.ts +12 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +12 -0
- package/models/components/index.js.map +1 -1
- package/models/components/product.d.ts +81 -0
- package/models/components/product.d.ts.map +1 -0
- package/models/components/product.js +88 -0
- package/models/components/product.js.map +1 -0
- package/models/components/productimagemetadata.d.ts +42 -0
- package/models/components/productimagemetadata.d.ts.map +1 -0
- package/models/components/productimagemetadata.js +73 -0
- package/models/components/productimagemetadata.js.map +1 -0
- package/models/components/productoption.d.ts +58 -0
- package/models/components/productoption.d.ts.map +1 -0
- package/models/components/productoption.js +77 -0
- package/models/components/productoption.js.map +1 -0
- package/models/components/productoptiongroup.d.ts +63 -0
- package/models/components/productoptiongroup.d.ts.map +1 -0
- package/models/components/productoptiongroup.js +78 -0
- package/models/components/productoptiongroup.js.map +1 -0
- package/models/components/productoptiongroupvalidationerror.d.ts +42 -0
- package/models/components/productoptiongroupvalidationerror.d.ts.map +1 -0
- package/models/components/productoptiongroupvalidationerror.js +78 -0
- package/models/components/productoptiongroupvalidationerror.js.map +1 -0
- package/models/components/productoptionvalidationerror.d.ts +41 -0
- package/models/components/productoptionvalidationerror.d.ts.map +1 -0
- package/models/components/productoptionvalidationerror.js +77 -0
- package/models/components/productoptionvalidationerror.js.map +1 -0
- package/models/components/productrequest.d.ts +61 -0
- package/models/components/productrequest.d.ts.map +1 -0
- package/models/components/productrequest.js +80 -0
- package/models/components/productrequest.js.map +1 -0
- package/models/errors/index.d.ts +1 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/productrequestvalidationerror.d.ts +61 -0
- package/models/errors/productrequestvalidationerror.d.ts.map +1 -0
- package/models/errors/productrequestvalidationerror.js +105 -0
- package/models/errors/productrequestvalidationerror.js.map +1 -0
- package/models/operations/createproduct.d.ts +101 -0
- package/models/operations/createproduct.d.ts.map +1 -0
- package/models/operations/createproduct.js +155 -0
- package/models/operations/createproduct.js.map +1 -0
- package/models/operations/disableproduct.d.ts +98 -0
- package/models/operations/disableproduct.d.ts.map +1 -0
- package/models/operations/disableproduct.js +142 -0
- package/models/operations/disableproduct.js.map +1 -0
- package/models/operations/getproduct.d.ts +101 -0
- package/models/operations/getproduct.d.ts.map +1 -0
- package/models/operations/getproduct.js +147 -0
- package/models/operations/getproduct.js.map +1 -0
- package/models/operations/index.d.ts +5 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +5 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listproducts.d.ts +103 -0
- package/models/operations/listproducts.d.ts.map +1 -0
- package/models/operations/listproducts.js +149 -0
- package/models/operations/listproducts.js.map +1 -0
- package/models/operations/updateproduct.d.ts +103 -0
- package/models/operations/updateproduct.d.ts.map +1 -0
- package/models/operations/updateproduct.js +157 -0
- package/models/operations/updateproduct.js.map +1 -0
- package/package.json +1 -1
- package/sdk/products.d.ts +27 -0
- package/sdk/products.d.ts.map +1 -0
- package/sdk/products.js +49 -0
- package/sdk/products.js.map +1 -0
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/src/funcs/productsCreate.ts +200 -0
- package/src/funcs/productsDisable.ts +199 -0
- package/src/funcs/productsGet.ts +182 -0
- package/src/funcs/productsList.ts +182 -0
- package/src/funcs/productsUpdate.ts +206 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +11 -1
- package/src/mcp-server/tools/productsCreate.ts +35 -0
- package/src/mcp-server/tools/productsDisable.ts +35 -0
- package/src/mcp-server/tools/productsGet.ts +35 -0
- package/src/mcp-server/tools/productsList.ts +35 -0
- package/src/mcp-server/tools/productsUpdate.ts +35 -0
- package/src/models/components/amountdecimalvalidationerror.ts +72 -0
- package/src/models/components/assignproductimage.ts +69 -0
- package/src/models/components/assignproductimagevalidationerror.ts +69 -0
- package/src/models/components/createproductoption.ts +108 -0
- package/src/models/components/createproductoptiongroup.ts +110 -0
- package/src/models/components/index.ts +12 -0
- package/src/models/components/product.ts +148 -0
- package/src/models/components/productimagemetadata.ts +83 -0
- package/src/models/components/productoption.ts +107 -0
- package/src/models/components/productoptiongroup.ts +113 -0
- package/src/models/components/productoptiongroupvalidationerror.ts +91 -0
- package/src/models/components/productoptionvalidationerror.ts +94 -0
- package/src/models/components/productrequest.ts +117 -0
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/productrequestvalidationerror.ts +124 -0
- package/src/models/operations/createproduct.ts +231 -0
- package/src/models/operations/disableproduct.ts +216 -0
- package/src/models/operations/getproduct.ts +223 -0
- package/src/models/operations/index.ts +5 -0
- package/src/models/operations/listproducts.ts +227 -0
- package/src/models/operations/updateproduct.ts +235 -0
- package/src/sdk/products.ts +86 -0
- 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,108 @@
|
|
|
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
|
+
AssignProductImage,
|
|
17
|
+
AssignProductImage$inboundSchema,
|
|
18
|
+
AssignProductImage$Outbound,
|
|
19
|
+
AssignProductImage$outboundSchema,
|
|
20
|
+
} from "./assignproductimage.js";
|
|
21
|
+
|
|
22
|
+
export type CreateProductOption = {
|
|
23
|
+
/**
|
|
24
|
+
* The display name of a product option.
|
|
25
|
+
*/
|
|
26
|
+
name: string;
|
|
27
|
+
/**
|
|
28
|
+
* A detailed description of the option.
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
*
|
|
32
|
+
* - Must be valid UTF-8 text
|
|
33
|
+
* - Supports Markdown for formatting
|
|
34
|
+
* - HTML is not permitted and will be rejected
|
|
35
|
+
*/
|
|
36
|
+
description?: string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* The adjustment applied to a product's base price by this option. Can be negative, positive, or zero.
|
|
39
|
+
*/
|
|
40
|
+
priceModifier?: AmountDecimal | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Assign previously uploaded images to a product or option.
|
|
43
|
+
*/
|
|
44
|
+
images?: Array<AssignProductImage> | undefined;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
export const CreateProductOption$inboundSchema: z.ZodType<
|
|
49
|
+
CreateProductOption,
|
|
50
|
+
z.ZodTypeDef,
|
|
51
|
+
unknown
|
|
52
|
+
> = z.object({
|
|
53
|
+
name: z.string(),
|
|
54
|
+
description: z.string().optional(),
|
|
55
|
+
priceModifier: AmountDecimal$inboundSchema.optional(),
|
|
56
|
+
images: z.array(AssignProductImage$inboundSchema).optional(),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
/** @internal */
|
|
60
|
+
export type CreateProductOption$Outbound = {
|
|
61
|
+
name: string;
|
|
62
|
+
description?: string | undefined;
|
|
63
|
+
priceModifier?: AmountDecimal$Outbound | undefined;
|
|
64
|
+
images?: Array<AssignProductImage$Outbound> | undefined;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** @internal */
|
|
68
|
+
export const CreateProductOption$outboundSchema: z.ZodType<
|
|
69
|
+
CreateProductOption$Outbound,
|
|
70
|
+
z.ZodTypeDef,
|
|
71
|
+
CreateProductOption
|
|
72
|
+
> = z.object({
|
|
73
|
+
name: z.string(),
|
|
74
|
+
description: z.string().optional(),
|
|
75
|
+
priceModifier: AmountDecimal$outboundSchema.optional(),
|
|
76
|
+
images: z.array(AssignProductImage$outboundSchema).optional(),
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @internal
|
|
81
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
82
|
+
*/
|
|
83
|
+
export namespace CreateProductOption$ {
|
|
84
|
+
/** @deprecated use `CreateProductOption$inboundSchema` instead. */
|
|
85
|
+
export const inboundSchema = CreateProductOption$inboundSchema;
|
|
86
|
+
/** @deprecated use `CreateProductOption$outboundSchema` instead. */
|
|
87
|
+
export const outboundSchema = CreateProductOption$outboundSchema;
|
|
88
|
+
/** @deprecated use `CreateProductOption$Outbound` instead. */
|
|
89
|
+
export type Outbound = CreateProductOption$Outbound;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function createProductOptionToJSON(
|
|
93
|
+
createProductOption: CreateProductOption,
|
|
94
|
+
): string {
|
|
95
|
+
return JSON.stringify(
|
|
96
|
+
CreateProductOption$outboundSchema.parse(createProductOption),
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function createProductOptionFromJSON(
|
|
101
|
+
jsonString: string,
|
|
102
|
+
): SafeParseResult<CreateProductOption, SDKValidationError> {
|
|
103
|
+
return safeParse(
|
|
104
|
+
jsonString,
|
|
105
|
+
(x) => CreateProductOption$inboundSchema.parse(JSON.parse(x)),
|
|
106
|
+
`Failed to parse 'CreateProductOption' from JSON`,
|
|
107
|
+
);
|
|
108
|
+
}
|
|
@@ -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
|
+
}
|