@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,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.productsCreate = productsCreate;
|
|
40
|
+
const encodings_js_1 = require("../lib/encodings.js");
|
|
41
|
+
const M = __importStar(require("../lib/matchers.js"));
|
|
42
|
+
const primitives_js_1 = require("../lib/primitives.js");
|
|
43
|
+
const schemas_js_1 = require("../lib/schemas.js");
|
|
44
|
+
const security_js_1 = require("../lib/security.js");
|
|
45
|
+
const url_js_1 = require("../lib/url.js");
|
|
46
|
+
const errors = __importStar(require("../models/errors/index.js"));
|
|
47
|
+
const operations = __importStar(require("../models/operations/index.js"));
|
|
48
|
+
const async_js_1 = require("../types/async.js");
|
|
49
|
+
/**
|
|
50
|
+
* Creates a new product for the specified account.
|
|
51
|
+
*/
|
|
52
|
+
function productsCreate(client, request, options) {
|
|
53
|
+
return new async_js_1.APIPromise($do(client, request, options));
|
|
54
|
+
}
|
|
55
|
+
async function $do(client, request, options) {
|
|
56
|
+
const parsed = (0, schemas_js_1.safeParse)(request, (value) => operations.CreateProductRequest$outboundSchema.parse(value), "Input validation failed");
|
|
57
|
+
if (!parsed.ok) {
|
|
58
|
+
return [parsed, { status: "invalid" }];
|
|
59
|
+
}
|
|
60
|
+
const payload = parsed.value;
|
|
61
|
+
const body = (0, encodings_js_1.encodeJSON)("body", payload.ProductRequest, { explode: true });
|
|
62
|
+
const pathParams = {
|
|
63
|
+
accountID: (0, encodings_js_1.encodeSimple)("accountID", payload.accountID, {
|
|
64
|
+
explode: false,
|
|
65
|
+
charEncoding: "percent",
|
|
66
|
+
}),
|
|
67
|
+
};
|
|
68
|
+
const path = (0, url_js_1.pathToFunc)("/accounts/{accountID}/products")(pathParams);
|
|
69
|
+
const headers = new Headers((0, primitives_js_1.compactMap)({
|
|
70
|
+
"Content-Type": "application/json",
|
|
71
|
+
Accept: "application/json",
|
|
72
|
+
"x-moov-version": (0, encodings_js_1.encodeSimple)("x-moov-version", client._options.xMoovVersion, { explode: false, charEncoding: "none" }),
|
|
73
|
+
}));
|
|
74
|
+
const securityInput = await (0, security_js_1.extractSecurity)(client._options.security);
|
|
75
|
+
const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
|
|
76
|
+
const context = {
|
|
77
|
+
options: client._options,
|
|
78
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
79
|
+
operationID: "createProduct",
|
|
80
|
+
oAuth2Scopes: null,
|
|
81
|
+
resolvedSecurity: requestSecurity,
|
|
82
|
+
securitySource: client._options.security,
|
|
83
|
+
retryConfig: options?.retries
|
|
84
|
+
|| client._options.retryConfig
|
|
85
|
+
|| { strategy: "none" },
|
|
86
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
87
|
+
};
|
|
88
|
+
const requestRes = client._createRequest(context, {
|
|
89
|
+
security: requestSecurity,
|
|
90
|
+
method: "POST",
|
|
91
|
+
baseURL: options?.serverURL,
|
|
92
|
+
path: path,
|
|
93
|
+
headers: headers,
|
|
94
|
+
body: body,
|
|
95
|
+
userAgent: client._options.userAgent,
|
|
96
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
97
|
+
}, options);
|
|
98
|
+
if (!requestRes.ok) {
|
|
99
|
+
return [requestRes, { status: "invalid" }];
|
|
100
|
+
}
|
|
101
|
+
const req = requestRes.value;
|
|
102
|
+
const doResult = await client._do(req, {
|
|
103
|
+
context,
|
|
104
|
+
errorCodes: [
|
|
105
|
+
"400",
|
|
106
|
+
"401",
|
|
107
|
+
"403",
|
|
108
|
+
"404",
|
|
109
|
+
"409",
|
|
110
|
+
"422",
|
|
111
|
+
"429",
|
|
112
|
+
"4XX",
|
|
113
|
+
"500",
|
|
114
|
+
"504",
|
|
115
|
+
"5XX",
|
|
116
|
+
],
|
|
117
|
+
retryConfig: context.retryConfig,
|
|
118
|
+
retryCodes: context.retryCodes,
|
|
119
|
+
});
|
|
120
|
+
if (!doResult.ok) {
|
|
121
|
+
return [doResult, { status: "request-error", request: req }];
|
|
122
|
+
}
|
|
123
|
+
const response = doResult.value;
|
|
124
|
+
const responseFields = {
|
|
125
|
+
HttpMeta: { Response: response, Request: req },
|
|
126
|
+
};
|
|
127
|
+
const [result] = await M.match(M.json(201, operations.CreateProductResponse$inboundSchema, {
|
|
128
|
+
hdrs: true,
|
|
129
|
+
key: "Result",
|
|
130
|
+
}), M.jsonErr([400, 409], errors.GenericError$inboundSchema, { hdrs: true }), M.jsonErr(422, errors.ProductRequestValidationError$inboundSchema, {
|
|
131
|
+
hdrs: true,
|
|
132
|
+
}), M.fail([401, 403, 404, 429]), M.fail([500, 504]), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
133
|
+
if (!result.ok) {
|
|
134
|
+
return [result, { status: "complete", request: req, response }];
|
|
135
|
+
}
|
|
136
|
+
return [result, { status: "complete", request: req, response }];
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=productsCreate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productsCreate.js","sourceRoot":"","sources":["../src/funcs/productsCreate.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BH,wCAwBC;AAjDD,sDAA+D;AAC/D,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAQ3C,kEAAoD;AAIpD,0EAA4D;AAC5D,gDAAwD;AAGxD;;GAEG;AACH,SAAgB,cAAc,CAC5B,MAAgB,EAChB,OAAwC,EACxC,OAAwB;IAgBxB,OAAO,IAAI,qBAAU,CAAC,GAAG,CACvB,MAAM,EACN,OAAO,EACP,OAAO,CACR,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,GAAG,CAChB,MAAgB,EAChB,OAAwC,EACxC,OAAwB;IAmBxB,MAAM,MAAM,GAAG,IAAA,sBAAS,EACtB,OAAO,EACP,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,mCAAmC,CAAC,KAAK,CAAC,KAAK,CAAC,EACtE,yBAAyB,CAC1B,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IACzC,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAA,yBAAU,EAAC,MAAM,EAAE,OAAO,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAE3E,MAAM,UAAU,GAAG;QACjB,SAAS,EAAE,IAAA,2BAAY,EAAC,W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AC1D,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,QAAQ;KACd,CAAC,EACF,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EACxE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,2CAA2C,EAAE;QACjE,IAAI,EAAE,IAAI;KACX,CAAC,EACF,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,EAC5B,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAClB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EACb,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACd,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MoovCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import * as errors from "../models/errors/index.js";
|
|
5
|
+
import { MoovError } from "../models/errors/mooverror.js";
|
|
6
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
+
import * as operations from "../models/operations/index.js";
|
|
9
|
+
import { APIPromise } from "../types/async.js";
|
|
10
|
+
import { Result } from "../types/fp.js";
|
|
11
|
+
/**
|
|
12
|
+
* Disable a product by ID.
|
|
13
|
+
*
|
|
14
|
+
* The product will no longer be available, but will remain in the system for historical and reporting purposes.
|
|
15
|
+
*/
|
|
16
|
+
export declare function productsDisable(client: MoovCore, request: operations.DisableProductRequest, options?: RequestOptions): APIPromise<Result<operations.DisableProductResponse | undefined, errors.GenericError | MoovError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
17
|
+
//# sourceMappingURL=productsDisable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productsDisable.d.ts","sourceRoot":"","sources":["../src/funcs/productsDisable.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKtC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,sBAAsB,GAAG,SAAS,EAC3C,MAAM,CAAC,YAAY,GACnB,SAAS,GACT,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.productsDisable = productsDisable;
|
|
40
|
+
const encodings_js_1 = require("../lib/encodings.js");
|
|
41
|
+
const M = __importStar(require("../lib/matchers.js"));
|
|
42
|
+
const primitives_js_1 = require("../lib/primitives.js");
|
|
43
|
+
const schemas_js_1 = require("../lib/schemas.js");
|
|
44
|
+
const security_js_1 = require("../lib/security.js");
|
|
45
|
+
const url_js_1 = require("../lib/url.js");
|
|
46
|
+
const errors = __importStar(require("../models/errors/index.js"));
|
|
47
|
+
const operations = __importStar(require("../models/operations/index.js"));
|
|
48
|
+
const async_js_1 = require("../types/async.js");
|
|
49
|
+
/**
|
|
50
|
+
* Disable a product by ID.
|
|
51
|
+
*
|
|
52
|
+
* The product will no longer be available, but will remain in the system for historical and reporting purposes.
|
|
53
|
+
*/
|
|
54
|
+
function productsDisable(client, request, options) {
|
|
55
|
+
return new async_js_1.APIPromise($do(client, request, options));
|
|
56
|
+
}
|
|
57
|
+
async function $do(client, request, options) {
|
|
58
|
+
const parsed = (0, schemas_js_1.safeParse)(request, (value) => operations.DisableProductRequest$outboundSchema.parse(value), "Input validation failed");
|
|
59
|
+
if (!parsed.ok) {
|
|
60
|
+
return [parsed, { status: "invalid" }];
|
|
61
|
+
}
|
|
62
|
+
const payload = parsed.value;
|
|
63
|
+
const body = null;
|
|
64
|
+
const pathParams = {
|
|
65
|
+
accountID: (0, encodings_js_1.encodeSimple)("accountID", payload.accountID, {
|
|
66
|
+
explode: false,
|
|
67
|
+
charEncoding: "percent",
|
|
68
|
+
}),
|
|
69
|
+
productID: (0, encodings_js_1.encodeSimple)("productID", payload.productID, {
|
|
70
|
+
explode: false,
|
|
71
|
+
charEncoding: "percent",
|
|
72
|
+
}),
|
|
73
|
+
};
|
|
74
|
+
const path = (0, url_js_1.pathToFunc)("/accounts/{accountID}/products/{productID}")(pathParams);
|
|
75
|
+
const headers = new Headers((0, primitives_js_1.compactMap)({
|
|
76
|
+
Accept: "application/json",
|
|
77
|
+
"x-moov-version": (0, encodings_js_1.encodeSimple)("x-moov-version", client._options.xMoovVersion, { explode: false, charEncoding: "none" }),
|
|
78
|
+
}));
|
|
79
|
+
const securityInput = await (0, security_js_1.extractSecurity)(client._options.security);
|
|
80
|
+
const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
|
|
81
|
+
const context = {
|
|
82
|
+
options: client._options,
|
|
83
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
84
|
+
operationID: "disableProduct",
|
|
85
|
+
oAuth2Scopes: null,
|
|
86
|
+
resolvedSecurity: requestSecurity,
|
|
87
|
+
securitySource: client._options.security,
|
|
88
|
+
retryConfig: options?.retries
|
|
89
|
+
|| client._options.retryConfig
|
|
90
|
+
|| { strategy: "none" },
|
|
91
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
92
|
+
};
|
|
93
|
+
const requestRes = client._createRequest(context, {
|
|
94
|
+
security: requestSecurity,
|
|
95
|
+
method: "DELETE",
|
|
96
|
+
baseURL: options?.serverURL,
|
|
97
|
+
path: path,
|
|
98
|
+
headers: headers,
|
|
99
|
+
body: body,
|
|
100
|
+
userAgent: client._options.userAgent,
|
|
101
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
102
|
+
}, options);
|
|
103
|
+
if (!requestRes.ok) {
|
|
104
|
+
return [requestRes, { status: "invalid" }];
|
|
105
|
+
}
|
|
106
|
+
const req = requestRes.value;
|
|
107
|
+
const doResult = await client._do(req, {
|
|
108
|
+
context,
|
|
109
|
+
errorCodes: [
|
|
110
|
+
"400",
|
|
111
|
+
"401",
|
|
112
|
+
"403",
|
|
113
|
+
"404",
|
|
114
|
+
"409",
|
|
115
|
+
"429",
|
|
116
|
+
"4XX",
|
|
117
|
+
"500",
|
|
118
|
+
"504",
|
|
119
|
+
"5XX",
|
|
120
|
+
],
|
|
121
|
+
retryConfig: context.retryConfig,
|
|
122
|
+
retryCodes: context.retryCodes,
|
|
123
|
+
});
|
|
124
|
+
if (!doResult.ok) {
|
|
125
|
+
return [doResult, { status: "request-error", request: req }];
|
|
126
|
+
}
|
|
127
|
+
const response = doResult.value;
|
|
128
|
+
const responseFields = {
|
|
129
|
+
HttpMeta: { Response: response, Request: req },
|
|
130
|
+
};
|
|
131
|
+
const [result] = await M.match(M.nil(204, operations.DisableProductResponse$inboundSchema.optional(), {
|
|
132
|
+
hdrs: true,
|
|
133
|
+
}), M.jsonErr([400, 409], errors.GenericError$inboundSchema, { hdrs: true }), M.fail([401, 403, 404, 429]), M.fail([500, 504]), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
134
|
+
if (!result.ok) {
|
|
135
|
+
return [result, { status: "complete", request: req, response }];
|
|
136
|
+
}
|
|
137
|
+
return [result, { status: "complete", request: req, response }];
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=productsDisable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productsDisable.js","sourceRoot":"","sources":["../src/funcs/productsDisable.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BH,0CAuBC;AAlDD,sDAAmD;AACnD,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAQ3C,kEAAoD;AAIpD,0EAA4D;AAC5D,gDAAwD;AAGxD;;;;GAIG;AACH,SAAgB,eAAe,CAC7B,MAAgB,EAChB,OAAyC,EACzC,OAAwB;IAexB,OAAO,IAAI,qBAAU,CAAC,GAAG,CACvB,MAAM,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MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MoovCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import { MoovError } from "../models/errors/mooverror.js";
|
|
5
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
6
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
7
|
+
import * as operations from "../models/operations/index.js";
|
|
8
|
+
import { APIPromise } from "../types/async.js";
|
|
9
|
+
import { Result } from "../types/fp.js";
|
|
10
|
+
/**
|
|
11
|
+
* Retrieve a product by ID.
|
|
12
|
+
*/
|
|
13
|
+
export declare function productsGet(client: MoovCore, request: operations.GetProductRequest, options?: RequestOptions): APIPromise<Result<operations.GetProductResponse, MoovError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
14
|
+
//# sourceMappingURL=productsGet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productsGet.d.ts","sourceRoot":"","sources":["../src/funcs/productsGet.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKtC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;GAEG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,UAAU,CAAC,iBAAiB,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,kBAAkB,EAC3B,SAAS,GACT,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.productsGet = productsGet;
|
|
40
|
+
const encodings_js_1 = require("../lib/encodings.js");
|
|
41
|
+
const M = __importStar(require("../lib/matchers.js"));
|
|
42
|
+
const primitives_js_1 = require("../lib/primitives.js");
|
|
43
|
+
const schemas_js_1 = require("../lib/schemas.js");
|
|
44
|
+
const security_js_1 = require("../lib/security.js");
|
|
45
|
+
const url_js_1 = require("../lib/url.js");
|
|
46
|
+
const operations = __importStar(require("../models/operations/index.js"));
|
|
47
|
+
const async_js_1 = require("../types/async.js");
|
|
48
|
+
/**
|
|
49
|
+
* Retrieve a product by ID.
|
|
50
|
+
*/
|
|
51
|
+
function productsGet(client, request, options) {
|
|
52
|
+
return new async_js_1.APIPromise($do(client, request, options));
|
|
53
|
+
}
|
|
54
|
+
async function $do(client, request, options) {
|
|
55
|
+
const parsed = (0, schemas_js_1.safeParse)(request, (value) => operations.GetProductRequest$outboundSchema.parse(value), "Input validation failed");
|
|
56
|
+
if (!parsed.ok) {
|
|
57
|
+
return [parsed, { status: "invalid" }];
|
|
58
|
+
}
|
|
59
|
+
const payload = parsed.value;
|
|
60
|
+
const body = null;
|
|
61
|
+
const pathParams = {
|
|
62
|
+
accountID: (0, encodings_js_1.encodeSimple)("accountID", payload.accountID, {
|
|
63
|
+
explode: false,
|
|
64
|
+
charEncoding: "percent",
|
|
65
|
+
}),
|
|
66
|
+
productID: (0, encodings_js_1.encodeSimple)("productID", payload.productID, {
|
|
67
|
+
explode: false,
|
|
68
|
+
charEncoding: "percent",
|
|
69
|
+
}),
|
|
70
|
+
};
|
|
71
|
+
const path = (0, url_js_1.pathToFunc)("/accounts/{accountID}/products/{productID}")(pathParams);
|
|
72
|
+
const headers = new Headers((0, primitives_js_1.compactMap)({
|
|
73
|
+
Accept: "application/json",
|
|
74
|
+
"x-moov-version": (0, encodings_js_1.encodeSimple)("x-moov-version", client._options.xMoovVersion, { explode: false, charEncoding: "none" }),
|
|
75
|
+
}));
|
|
76
|
+
const securityInput = await (0, security_js_1.extractSecurity)(client._options.security);
|
|
77
|
+
const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
|
|
78
|
+
const context = {
|
|
79
|
+
options: client._options,
|
|
80
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
81
|
+
operationID: "getProduct",
|
|
82
|
+
oAuth2Scopes: null,
|
|
83
|
+
resolvedSecurity: requestSecurity,
|
|
84
|
+
securitySource: client._options.security,
|
|
85
|
+
retryConfig: options?.retries
|
|
86
|
+
|| client._options.retryConfig
|
|
87
|
+
|| { strategy: "none" },
|
|
88
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
89
|
+
};
|
|
90
|
+
const requestRes = client._createRequest(context, {
|
|
91
|
+
security: requestSecurity,
|
|
92
|
+
method: "GET",
|
|
93
|
+
baseURL: options?.serverURL,
|
|
94
|
+
path: path,
|
|
95
|
+
headers: headers,
|
|
96
|
+
body: body,
|
|
97
|
+
userAgent: client._options.userAgent,
|
|
98
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
99
|
+
}, options);
|
|
100
|
+
if (!requestRes.ok) {
|
|
101
|
+
return [requestRes, { status: "invalid" }];
|
|
102
|
+
}
|
|
103
|
+
const req = requestRes.value;
|
|
104
|
+
const doResult = await client._do(req, {
|
|
105
|
+
context,
|
|
106
|
+
errorCodes: ["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
|
107
|
+
retryConfig: context.retryConfig,
|
|
108
|
+
retryCodes: context.retryCodes,
|
|
109
|
+
});
|
|
110
|
+
if (!doResult.ok) {
|
|
111
|
+
return [doResult, { status: "request-error", request: req }];
|
|
112
|
+
}
|
|
113
|
+
const response = doResult.value;
|
|
114
|
+
const responseFields = {
|
|
115
|
+
HttpMeta: { Response: response, Request: req },
|
|
116
|
+
};
|
|
117
|
+
const [result] = await M.match(M.json(200, operations.GetProductResponse$inboundSchema, {
|
|
118
|
+
hdrs: true,
|
|
119
|
+
key: "Result",
|
|
120
|
+
}), M.fail([401, 403, 404, 429]), M.fail([500, 504]), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
121
|
+
if (!result.ok) {
|
|
122
|
+
return [result, { status: "complete", request: req, response }];
|
|
123
|
+
}
|
|
124
|
+
return [result, { status: "complete", request: req, response }];
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=productsGet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productsGet.js","sourceRoot":"","sources":["../src/funcs/productsGet.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BH,kCAsBC;AA9CD,sDAAmD;AACnD,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAW3C,0EAA4D;AAC5D,gDAAwD;AAGxD;;GAEG;AACH,SAAgB,WAAW,CACzB,MAAgB,EAChB,OAAqC,EACrC,OAAwB;IAcxB,OAAO,IAAI,qB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AE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MoovCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import { MoovError } from "../models/errors/mooverror.js";
|
|
5
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
6
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
7
|
+
import * as operations from "../models/operations/index.js";
|
|
8
|
+
import { APIPromise } from "../types/async.js";
|
|
9
|
+
import { Result } from "../types/fp.js";
|
|
10
|
+
/**
|
|
11
|
+
* List active (non-disabled) products for an account.
|
|
12
|
+
*/
|
|
13
|
+
export declare function productsList(client: MoovCore, request: operations.ListProductsRequest, options?: RequestOptions): APIPromise<Result<operations.ListProductsResponse, MoovError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
14
|
+
//# sourceMappingURL=productsList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productsList.d.ts","sourceRoot":"","sources":["../src/funcs/productsList.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKtC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;GAEG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,UAAU,CAAC,mBAAmB,EACvC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,oBAAoB,EAC7B,SAAS,GACT,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.productsList = productsList;
|
|
40
|
+
const encodings_js_1 = require("../lib/encodings.js");
|
|
41
|
+
const M = __importStar(require("../lib/matchers.js"));
|
|
42
|
+
const primitives_js_1 = require("../lib/primitives.js");
|
|
43
|
+
const schemas_js_1 = require("../lib/schemas.js");
|
|
44
|
+
const security_js_1 = require("../lib/security.js");
|
|
45
|
+
const url_js_1 = require("../lib/url.js");
|
|
46
|
+
const operations = __importStar(require("../models/operations/index.js"));
|
|
47
|
+
const async_js_1 = require("../types/async.js");
|
|
48
|
+
/**
|
|
49
|
+
* List active (non-disabled) products for an account.
|
|
50
|
+
*/
|
|
51
|
+
function productsList(client, request, options) {
|
|
52
|
+
return new async_js_1.APIPromise($do(client, request, options));
|
|
53
|
+
}
|
|
54
|
+
async function $do(client, request, options) {
|
|
55
|
+
const parsed = (0, schemas_js_1.safeParse)(request, (value) => operations.ListProductsRequest$outboundSchema.parse(value), "Input validation failed");
|
|
56
|
+
if (!parsed.ok) {
|
|
57
|
+
return [parsed, { status: "invalid" }];
|
|
58
|
+
}
|
|
59
|
+
const payload = parsed.value;
|
|
60
|
+
const body = null;
|
|
61
|
+
const pathParams = {
|
|
62
|
+
accountID: (0, encodings_js_1.encodeSimple)("accountID", payload.accountID, {
|
|
63
|
+
explode: false,
|
|
64
|
+
charEncoding: "percent",
|
|
65
|
+
}),
|
|
66
|
+
};
|
|
67
|
+
const path = (0, url_js_1.pathToFunc)("/accounts/{accountID}/products")(pathParams);
|
|
68
|
+
const query = (0, encodings_js_1.encodeFormQuery)({
|
|
69
|
+
"count": payload.count,
|
|
70
|
+
"skip": payload.skip,
|
|
71
|
+
}, { explode: false });
|
|
72
|
+
const headers = new Headers((0, primitives_js_1.compactMap)({
|
|
73
|
+
Accept: "application/json",
|
|
74
|
+
"x-moov-version": (0, encodings_js_1.encodeSimple)("x-moov-version", client._options.xMoovVersion, { explode: false, charEncoding: "none" }),
|
|
75
|
+
}));
|
|
76
|
+
const securityInput = await (0, security_js_1.extractSecurity)(client._options.security);
|
|
77
|
+
const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
|
|
78
|
+
const context = {
|
|
79
|
+
options: client._options,
|
|
80
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
81
|
+
operationID: "listProducts",
|
|
82
|
+
oAuth2Scopes: null,
|
|
83
|
+
resolvedSecurity: requestSecurity,
|
|
84
|
+
securitySource: client._options.security,
|
|
85
|
+
retryConfig: options?.retries
|
|
86
|
+
|| client._options.retryConfig
|
|
87
|
+
|| { strategy: "none" },
|
|
88
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
89
|
+
};
|
|
90
|
+
const requestRes = client._createRequest(context, {
|
|
91
|
+
security: requestSecurity,
|
|
92
|
+
method: "GET",
|
|
93
|
+
baseURL: options?.serverURL,
|
|
94
|
+
path: path,
|
|
95
|
+
headers: headers,
|
|
96
|
+
query: query,
|
|
97
|
+
body: body,
|
|
98
|
+
userAgent: client._options.userAgent,
|
|
99
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
100
|
+
}, options);
|
|
101
|
+
if (!requestRes.ok) {
|
|
102
|
+
return [requestRes, { status: "invalid" }];
|
|
103
|
+
}
|
|
104
|
+
const req = requestRes.value;
|
|
105
|
+
const doResult = await client._do(req, {
|
|
106
|
+
context,
|
|
107
|
+
errorCodes: ["401", "403", "429", "4XX", "500", "504", "5XX"],
|
|
108
|
+
retryConfig: context.retryConfig,
|
|
109
|
+
retryCodes: context.retryCodes,
|
|
110
|
+
});
|
|
111
|
+
if (!doResult.ok) {
|
|
112
|
+
return [doResult, { status: "request-error", request: req }];
|
|
113
|
+
}
|
|
114
|
+
const response = doResult.value;
|
|
115
|
+
const responseFields = {
|
|
116
|
+
HttpMeta: { Response: response, Request: req },
|
|
117
|
+
};
|
|
118
|
+
const [result] = await M.match(M.json(200, operations.ListProductsResponse$inboundSchema, {
|
|
119
|
+
hdrs: true,
|
|
120
|
+
key: "Result",
|
|
121
|
+
}), M.fail([401, 403, 429]), M.fail([500, 504]), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
122
|
+
if (!result.ok) {
|
|
123
|
+
return [result, { status: "complete", request: req, response }];
|
|
124
|
+
}
|
|
125
|
+
return [result, { status: "complete", request: req, response }];
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=productsList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productsList.js","sourceRoot":"","sources":["../src/funcs/productsList.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BH,oCAsBC;AA9CD,sDAAoE;AACpE,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAW3C,0EAA4D;AAC5D,gDAAwD;AAGxD;;GAEG;AACH,SAAgB,YAAY,CAC1B,MAAgB,EAChB,OAAuC,EACvC,OAAwB;IAcxB,OAAO,IAAI,qBAAU,CAAC,GAAG,CACvB,MAAM,EACN,OAAO,EACP,OAAO,CACR,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,GAAG,C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QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MoovCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import * as errors from "../models/errors/index.js";
|
|
5
|
+
import { MoovError } from "../models/errors/mooverror.js";
|
|
6
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
+
import * as operations from "../models/operations/index.js";
|
|
9
|
+
import { APIPromise } from "../types/async.js";
|
|
10
|
+
import { Result } from "../types/fp.js";
|
|
11
|
+
/**
|
|
12
|
+
* Update a product and its options.
|
|
13
|
+
*/
|
|
14
|
+
export declare function productsUpdate(client: MoovCore, request: operations.UpdateProductRequest, options?: RequestOptions): APIPromise<Result<operations.UpdateProductResponse, errors.GenericError | errors.ProductRequestValidationError | MoovError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
15
|
+
//# sourceMappingURL=productsUpdate.d.ts.map
|