@moovio/sdk 0.16.3 → 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.
- package/README.md +62 -44
- package/bin/mcp-server.js +1897 -591
- package/bin/mcp-server.js.map +41 -12
- package/docs/sdks/products/README.md +592 -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 +54 -0
- package/models/components/createproductoption.d.ts.map +1 -0
- package/models/components/createproductoption.js +76 -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/feeproperties.d.ts +6 -0
- package/models/components/feeproperties.d.ts.map +1 -1
- package/models/components/feeproperties.js +3 -0
- package/models/components/feeproperties.js.map +1 -1
- package/models/components/index.d.ts +13 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +13 -0
- package/models/components/index.js.map +1 -1
- package/models/components/partnerpricing.d.ts +8 -4
- package/models/components/partnerpricing.d.ts.map +1 -1
- package/models/components/partnerpricing.js +2 -2
- package/models/components/partnerpricing.js.map +1 -1
- package/models/components/partnerpricingagreement.d.ts +7 -3
- package/models/components/partnerpricingagreement.d.ts.map +1 -1
- package/models/components/partnerpricingagreement.js +2 -2
- package/models/components/partnerpricingagreement.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 +57 -0
- package/models/components/productoption.d.ts.map +1 -0
- package/models/components/productoption.js +76 -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 +40 -0
- package/models/components/productoptionvalidationerror.d.ts.map +1 -0
- package/models/components/productoptionvalidationerror.js +76 -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/components/volumerange.d.ts +51 -0
- package/models/components/volumerange.d.ts.map +1 -0
- package/models/components/volumerange.js +76 -0
- package/models/components/volumerange.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 +102 -0
- package/src/models/components/createproductoptiongroup.ts +110 -0
- package/src/models/components/feeproperties.ts +13 -0
- package/src/models/components/index.ts +13 -0
- package/src/models/components/partnerpricing.ts +10 -6
- package/src/models/components/partnerpricingagreement.ts +9 -5
- package/src/models/components/product.ts +148 -0
- package/src/models/components/productimagemetadata.ts +83 -0
- package/src/models/components/productoption.ts +101 -0
- package/src/models/components/productoptiongroup.ts +113 -0
- package/src/models/components/productoptiongroupvalidationerror.ts +91 -0
- package/src/models/components/productoptionvalidationerror.ts +88 -0
- package/src/models/components/productrequest.ts +117 -0
- package/src/models/components/volumerange.ts +95 -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,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));
|