@51eat/sdk 2.1.0 → 2.2.0
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/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/business/client/Client.d.ts +0 -3
- package/dist/cjs/api/resources/business/client/Client.js +14 -19
- package/dist/cjs/api/resources/business/resources/commerce/client/Client.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/commerce/client/Client.js +27 -12
- package/dist/cjs/api/resources/business/resources/commerce/resources/catalog/client/Client.d.ts +30 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/catalog/client/Client.js +116 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/catalog/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/catalog/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/{productCategories → commerce/resources/catalog}/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/{productCategories → commerce/resources/catalog}/index.js +1 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/catalog/types/GetOptionsCatalogResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/catalog/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/catalog/types/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/index.d.ts +8 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/index.js +12 -4
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/Client.d.ts +46 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/Client.js +137 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/GetProductsLocationsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/SetLocationProductsRequest.d.ts +15 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/SetLocationProductsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/GetProductsLocationsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/GetProductsLocationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/SetProductsLocationsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/SetProductsLocationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/client/Client.d.ts +80 -0
- package/dist/cjs/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/client/Client.js +142 -49
- package/dist/cjs/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/client/requests/DeleteProductCategoriesRequest.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/client/requests/DeleteProductCategoriesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/client/requests/StoreProductCategoryRequest.d.ts +14 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/client/requests/StoreProductCategoryRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/client/requests/UpdateProductCategoryRequest.d.ts +14 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/client/requests/UpdateProductCategoryRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/types/CreateProductCategoriesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/types/CreateProductCategoriesResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/types/ListProductCategoriesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/types/ListProductCategoriesResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/types/UpdateProductCategoriesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/types/UpdateProductCategoriesResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/types/index.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/types/index.js +19 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/Client.d.ts +92 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/Client.js +338 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/DeleteProductImagesRequest.d.ts +13 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/DeleteProductImagesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/ReorderProductImagesRequest.d.ts +24 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/ReorderProductImagesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/StoreProductImageRequest.d.ts +18 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/StoreProductImageRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/UpdateProductImageRequest.d.ts +14 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/UpdateProductImageRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/types/ReorderProductImagesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/types/ReorderProductImagesResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/types/UpdateProductImagesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/types/UpdateProductImagesResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/types/UploadProductImagesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/types/UploadProductImagesResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/types/index.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/types/index.js +19 -0
- package/dist/cjs/api/resources/business/resources/index.d.ts +0 -2
- package/dist/cjs/api/resources/business/resources/index.js +1 -3
- package/dist/cjs/api/types/CatalogFormOptionsResource.d.ts +87 -0
- package/dist/cjs/api/types/CatalogFormOptionsResource.js +17 -0
- package/dist/cjs/api/types/LocationProductsResource.d.ts +42 -0
- package/dist/cjs/api/types/LocationProductsResource.js +19 -0
- package/dist/cjs/api/types/ProductCategoryResource.d.ts +4 -0
- package/dist/cjs/api/types/index.d.ts +2 -0
- package/dist/cjs/api/types/index.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/business/client/Client.d.mts +0 -3
- package/dist/esm/api/resources/business/client/Client.mjs +0 -5
- package/dist/esm/api/resources/business/resources/commerce/client/Client.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/commerce/client/Client.mjs +15 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/catalog/client/Client.d.mts +30 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/catalog/client/Client.mjs +79 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/catalog/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/catalog/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/catalog/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/catalog/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/{productCategories → commerce/resources/catalog}/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/{productCategories → commerce/resources/catalog}/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/catalog/types/GetOptionsCatalogResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/catalog/types/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/catalog/types/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/index.d.mts +8 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/index.mjs +8 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/Client.d.mts +46 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/Client.mjs +137 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/GetProductsLocationsRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/SetLocationProductsRequest.d.mts +15 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/SetLocationProductsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/GetProductsLocationsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/GetProductsLocationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/SetProductsLocationsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/SetProductsLocationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/client/Client.d.mts +80 -0
- package/dist/esm/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/client/Client.mjs +142 -49
- package/dist/esm/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/client/requests/DeleteProductCategoriesRequest.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/client/requests/DeleteProductCategoriesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/client/requests/StoreProductCategoryRequest.d.mts +14 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/client/requests/StoreProductCategoryRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/client/requests/UpdateProductCategoryRequest.d.mts +14 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/client/requests/UpdateProductCategoryRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/types/CreateProductCategoriesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/types/CreateProductCategoriesResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/types/ListProductCategoriesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/types/ListProductCategoriesResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/types/UpdateProductCategoriesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/types/UpdateProductCategoriesResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/types/index.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/types/index.mjs +3 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/Client.d.mts +92 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/Client.mjs +301 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/DeleteProductImagesRequest.d.mts +13 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/DeleteProductImagesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/ReorderProductImagesRequest.d.mts +24 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/ReorderProductImagesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/StoreProductImageRequest.d.mts +18 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/StoreProductImageRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/UpdateProductImageRequest.d.mts +14 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/UpdateProductImageRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/types/ReorderProductImagesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/types/ReorderProductImagesResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/types/UpdateProductImagesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/types/UpdateProductImagesResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/types/UploadProductImagesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/types/UploadProductImagesResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/types/index.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/productImages/types/index.mjs +3 -0
- package/dist/esm/api/resources/business/resources/index.d.mts +0 -2
- package/dist/esm/api/resources/business/resources/index.mjs +0 -2
- package/dist/esm/api/types/CatalogFormOptionsResource.d.mts +87 -0
- package/dist/esm/api/types/CatalogFormOptionsResource.mjs +14 -0
- package/dist/esm/api/types/LocationProductsResource.d.mts +42 -0
- package/dist/esm/api/types/LocationProductsResource.mjs +16 -0
- package/dist/esm/api/types/ProductCategoryResource.d.mts +4 -0
- package/dist/esm/api/types/index.d.mts +2 -0
- package/dist/esm/api/types/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +34 -12
- package/reference.md +543 -42
- package/dist/cjs/api/resources/business/resources/productCategories/client/Client.d.ts +0 -51
- package/dist/cjs/api/resources/business/resources/productCategories/client/requests/UpdateProductCategoriesRequest.d.ts +0 -9
- package/dist/cjs/api/resources/business/resources/productCategories/client/requests/index.d.ts +0 -2
- package/dist/esm/api/resources/business/resources/productCategories/client/Client.d.mts +0 -51
- package/dist/esm/api/resources/business/resources/productCategories/client/requests/UpdateProductCategoriesRequest.d.mts +0 -9
- package/dist/esm/api/resources/business/resources/productCategories/client/requests/index.d.mts +0 -2
- /package/dist/{esm/api/resources/business/resources/productCategories/client/requests/index.mjs → cjs/api/resources/business/resources/commerce/resources/catalog/client/index.d.ts} +0 -0
- /package/dist/cjs/api/resources/business/resources/{productCategories/client/requests → commerce/resources/catalog/client}/index.js +0 -0
- /package/dist/cjs/api/resources/business/resources/{productCategories/client/requests/DeleteProductCategoriesRequest.js → commerce/resources/catalog/types/GetOptionsCatalogResponse.js} +0 -0
- /package/dist/cjs/api/resources/business/resources/{productCategories/client/requests/UpdateProductCategoriesRequest.js → commerce/resources/locations/client/requests/GetProductsLocationsRequest.js} +0 -0
- /package/dist/cjs/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/client/index.js +0 -0
- /package/dist/cjs/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/exports.d.ts +0 -0
- /package/dist/cjs/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/exports.js +0 -0
- /package/dist/esm/api/resources/business/resources/{productCategories/client/requests/DeleteProductCategoriesRequest.mjs → commerce/resources/catalog/types/GetOptionsCatalogResponse.mjs} +0 -0
- /package/dist/esm/api/resources/business/resources/{productCategories/client/requests/UpdateProductCategoriesRequest.mjs → commerce/resources/locations/client/requests/GetProductsLocationsRequest.mjs} +0 -0
- /package/dist/esm/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/exports.d.mts +0 -0
- /package/dist/esm/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/exports.mjs +0 -0
package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/Client.mjs
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
import { normalizeClientOptionsWithAuth, } from "../../../../../../../../BaseClient.mjs";
|
|
23
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.mjs";
|
|
24
|
+
import * as core from "../../../../../../../../core/index.mjs";
|
|
25
|
+
import * as environments from "../../../../../../../../environments.mjs";
|
|
26
|
+
import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
|
+
import * as errors from "../../../../../../../../errors/index.mjs";
|
|
28
|
+
import * as FiveOneEat from "../../../../../../../index.mjs";
|
|
29
|
+
export class ProductImagesClient {
|
|
30
|
+
constructor(options = {}) {
|
|
31
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Multipart, with the photo in `image` (up to 10 MB) and optional
|
|
35
|
+
* `alt_text`. Answers 201. It goes after the product's other photos.
|
|
36
|
+
*
|
|
37
|
+
* @param {FiveOneEat.business.commerce.StoreProductImageRequest} request
|
|
38
|
+
* @param {ProductImagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
41
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
42
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
43
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* import { createReadStream } from "fs";
|
|
47
|
+
* await client.business.commerce.productImages.upload({
|
|
48
|
+
* image: fs.createReadStream("/path/to/your/file"),
|
|
49
|
+
* "Idempotency-Key": "Idempotency-Key",
|
|
50
|
+
* product: "product"
|
|
51
|
+
* })
|
|
52
|
+
*/
|
|
53
|
+
upload(request, requestOptions) {
|
|
54
|
+
return core.HttpResponsePromise.fromPromise(this.__upload(request, requestOptions));
|
|
55
|
+
}
|
|
56
|
+
__upload(request, requestOptions) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
59
|
+
const _body = yield core.newFormData();
|
|
60
|
+
yield _body.appendFile("image", request.image);
|
|
61
|
+
if (request.alt_text != null) {
|
|
62
|
+
_body.append("alt_text", request.alt_text);
|
|
63
|
+
}
|
|
64
|
+
const _maybeEncodedRequest = yield _body.getRequest();
|
|
65
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
66
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({ "Idempotency-Key": request["Idempotency-Key"] }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
67
|
+
const _response = yield core.fetcher({
|
|
68
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `business/commerce/products/${core.url.encodePathParam(request.product)}/images`),
|
|
69
|
+
method: "POST",
|
|
70
|
+
headers: _headers,
|
|
71
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
72
|
+
requestType: "file",
|
|
73
|
+
duplex: _maybeEncodedRequest.duplex,
|
|
74
|
+
body: _maybeEncodedRequest.body,
|
|
75
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
76
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
77
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
78
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
79
|
+
logging: this._options.logging,
|
|
80
|
+
});
|
|
81
|
+
if (_response.ok) {
|
|
82
|
+
return {
|
|
83
|
+
data: _response.body,
|
|
84
|
+
rawResponse: _response.rawResponse,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
if (_response.error.reason === "status-code") {
|
|
88
|
+
switch (_response.error.statusCode) {
|
|
89
|
+
case 401:
|
|
90
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
91
|
+
case 403:
|
|
92
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
93
|
+
case 404:
|
|
94
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
95
|
+
case 422:
|
|
96
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
97
|
+
default:
|
|
98
|
+
throw new errors.FiveOneEatError({
|
|
99
|
+
statusCode: _response.error.statusCode,
|
|
100
|
+
body: _response.error.body,
|
|
101
|
+
rawResponse: _response.rawResponse,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/commerce/products/{product}/images");
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Sets each listed photo's `sort_order`; the first is the product's main
|
|
110
|
+
* photo. A listed photo of another product is left alone. Answers with
|
|
111
|
+
* all the product's photos in their new order.
|
|
112
|
+
*
|
|
113
|
+
* @param {FiveOneEat.business.commerce.ReorderProductImagesRequest} request
|
|
114
|
+
* @param {ProductImagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
115
|
+
*
|
|
116
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
117
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
118
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
119
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* await client.business.commerce.productImages.reorder({
|
|
123
|
+
* product: "product",
|
|
124
|
+
* images: [{
|
|
125
|
+
* id: "id",
|
|
126
|
+
* sort_order: 1
|
|
127
|
+
* }]
|
|
128
|
+
* })
|
|
129
|
+
*/
|
|
130
|
+
reorder(request, requestOptions) {
|
|
131
|
+
return core.HttpResponsePromise.fromPromise(this.__reorder(request, requestOptions));
|
|
132
|
+
}
|
|
133
|
+
__reorder(request, requestOptions) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
136
|
+
const { product } = request, _body = __rest(request, ["product"]);
|
|
137
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
138
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
139
|
+
const _response = yield core.fetcher({
|
|
140
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `business/commerce/products/${core.url.encodePathParam(product)}/images/reorder`),
|
|
141
|
+
method: "PUT",
|
|
142
|
+
headers: _headers,
|
|
143
|
+
contentType: "application/json",
|
|
144
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
145
|
+
requestType: "json",
|
|
146
|
+
body: _body,
|
|
147
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
148
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
149
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
150
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
151
|
+
logging: this._options.logging,
|
|
152
|
+
});
|
|
153
|
+
if (_response.ok) {
|
|
154
|
+
return {
|
|
155
|
+
data: _response.body,
|
|
156
|
+
rawResponse: _response.rawResponse,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
if (_response.error.reason === "status-code") {
|
|
160
|
+
switch (_response.error.statusCode) {
|
|
161
|
+
case 401:
|
|
162
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
163
|
+
case 403:
|
|
164
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
165
|
+
case 404:
|
|
166
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
167
|
+
case 422:
|
|
168
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
169
|
+
default:
|
|
170
|
+
throw new errors.FiveOneEatError({
|
|
171
|
+
statusCode: _response.error.statusCode,
|
|
172
|
+
body: _response.error.body,
|
|
173
|
+
rawResponse: _response.rawResponse,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/business/commerce/products/{product}/images/reorder");
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* @param {FiveOneEat.business.commerce.UpdateProductImageRequest} request
|
|
182
|
+
* @param {ProductImagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
183
|
+
*
|
|
184
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
185
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
186
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
187
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* await client.business.commerce.productImages.update({
|
|
191
|
+
* product: "product",
|
|
192
|
+
* image: "image"
|
|
193
|
+
* })
|
|
194
|
+
*/
|
|
195
|
+
update(request, requestOptions) {
|
|
196
|
+
return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
|
|
197
|
+
}
|
|
198
|
+
__update(request, requestOptions) {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
201
|
+
const { product, image } = request, _body = __rest(request, ["product", "image"]);
|
|
202
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
203
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
204
|
+
const _response = yield core.fetcher({
|
|
205
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `business/commerce/products/${core.url.encodePathParam(product)}/images/${core.url.encodePathParam(image)}`),
|
|
206
|
+
method: "PUT",
|
|
207
|
+
headers: _headers,
|
|
208
|
+
contentType: "application/json",
|
|
209
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
210
|
+
requestType: "json",
|
|
211
|
+
body: _body,
|
|
212
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
213
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
214
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
215
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
216
|
+
logging: this._options.logging,
|
|
217
|
+
});
|
|
218
|
+
if (_response.ok) {
|
|
219
|
+
return {
|
|
220
|
+
data: _response.body,
|
|
221
|
+
rawResponse: _response.rawResponse,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
if (_response.error.reason === "status-code") {
|
|
225
|
+
switch (_response.error.statusCode) {
|
|
226
|
+
case 401:
|
|
227
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
228
|
+
case 403:
|
|
229
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
230
|
+
case 404:
|
|
231
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
232
|
+
case 422:
|
|
233
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
234
|
+
default:
|
|
235
|
+
throw new errors.FiveOneEatError({
|
|
236
|
+
statusCode: _response.error.statusCode,
|
|
237
|
+
body: _response.error.body,
|
|
238
|
+
rawResponse: _response.rawResponse,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/business/commerce/products/{product}/images/{image}");
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* @param {FiveOneEat.business.commerce.DeleteProductImagesRequest} request
|
|
247
|
+
* @param {ProductImagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
248
|
+
*
|
|
249
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
250
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
251
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
252
|
+
*
|
|
253
|
+
* @example
|
|
254
|
+
* await client.business.commerce.productImages.delete({
|
|
255
|
+
* product: "product",
|
|
256
|
+
* image: "image"
|
|
257
|
+
* })
|
|
258
|
+
*/
|
|
259
|
+
delete(request, requestOptions) {
|
|
260
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
|
|
261
|
+
}
|
|
262
|
+
__delete(request, requestOptions) {
|
|
263
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
264
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
265
|
+
const { product, image } = request;
|
|
266
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
267
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
268
|
+
const _response = yield core.fetcher({
|
|
269
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `business/commerce/products/${core.url.encodePathParam(product)}/images/${core.url.encodePathParam(image)}`),
|
|
270
|
+
method: "DELETE",
|
|
271
|
+
headers: _headers,
|
|
272
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
273
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
274
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
275
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
276
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
277
|
+
logging: this._options.logging,
|
|
278
|
+
});
|
|
279
|
+
if (_response.ok) {
|
|
280
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
281
|
+
}
|
|
282
|
+
if (_response.error.reason === "status-code") {
|
|
283
|
+
switch (_response.error.statusCode) {
|
|
284
|
+
case 401:
|
|
285
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
286
|
+
case 403:
|
|
287
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
288
|
+
case 404:
|
|
289
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
290
|
+
default:
|
|
291
|
+
throw new errors.FiveOneEatError({
|
|
292
|
+
statusCode: _response.error.statusCode,
|
|
293
|
+
body: _response.error.body,
|
|
294
|
+
rawResponse: _response.rawResponse,
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/business/commerce/products/{product}/images/{image}");
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* product: "product",
|
|
5
|
+
* images: [{
|
|
6
|
+
* id: "id",
|
|
7
|
+
* sort_order: 1
|
|
8
|
+
* }]
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface ReorderProductImagesRequest {
|
|
12
|
+
/** The product ID */
|
|
13
|
+
product: string;
|
|
14
|
+
images: ReorderProductImagesRequest.Images.Item[];
|
|
15
|
+
}
|
|
16
|
+
export declare namespace ReorderProductImagesRequest {
|
|
17
|
+
type Images = Images.Item[];
|
|
18
|
+
namespace Images {
|
|
19
|
+
interface Item {
|
|
20
|
+
id: string;
|
|
21
|
+
sort_order: number;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type * as core from "../../../../../../../../../core/index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* image: fs.createReadStream("/path/to/your/file"),
|
|
6
|
+
* "Idempotency-Key": "Idempotency-Key",
|
|
7
|
+
* product: "product"
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface StoreProductImageRequest {
|
|
11
|
+
/** The product ID */
|
|
12
|
+
product: string;
|
|
13
|
+
/** Required, 1–255 characters, new for each photo you mean to add: a retry with the same key never adds twice. */
|
|
14
|
+
"Idempotency-Key": string;
|
|
15
|
+
/** Maximum file size: 10240 kilobytes. */
|
|
16
|
+
image: core.file.Uploadable;
|
|
17
|
+
alt_text?: string | null;
|
|
18
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { DeleteProductImagesRequest } from "./DeleteProductImagesRequest.mjs";
|
|
2
|
+
export type { ReorderProductImagesRequest } from "./ReorderProductImagesRequest.mjs";
|
|
3
|
+
export type { StoreProductImageRequest } from "./StoreProductImageRequest.mjs";
|
|
4
|
+
export type { UpdateProductImageRequest } from "./UpdateProductImageRequest.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -33,8 +33,6 @@ export * as menus from "./menus/index.mjs";
|
|
|
33
33
|
export * from "./menus/types/index.mjs";
|
|
34
34
|
export * from "./messaging/client/requests/index.mjs";
|
|
35
35
|
export * as messaging from "./messaging/index.mjs";
|
|
36
|
-
export * from "./productCategories/client/requests/index.mjs";
|
|
37
|
-
export * as productCategories from "./productCategories/index.mjs";
|
|
38
36
|
export * from "./productOrders/client/requests/index.mjs";
|
|
39
37
|
export * as productOrders from "./productOrders/index.mjs";
|
|
40
38
|
export * from "./productOrders/types/index.mjs";
|
|
@@ -33,8 +33,6 @@ export * as menus from "./menus/index.mjs";
|
|
|
33
33
|
export * from "./menus/types/index.mjs";
|
|
34
34
|
export * from "./messaging/client/requests/index.mjs";
|
|
35
35
|
export * as messaging from "./messaging/index.mjs";
|
|
36
|
-
export * from "./productCategories/client/requests/index.mjs";
|
|
37
|
-
export * as productCategories from "./productCategories/index.mjs";
|
|
38
36
|
export * from "./productOrders/client/requests/index.mjs";
|
|
39
37
|
export * as productOrders from "./productOrders/index.mjs";
|
|
40
38
|
export * from "./productOrders/types/index.mjs";
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export interface CatalogFormOptionsResource {
|
|
2
|
+
/** Every unit an option is sold in. */
|
|
3
|
+
units: CatalogFormOptionsResource.Units.Item[];
|
|
4
|
+
/** The tax codes its products may use: a restaurant seller's are food and drink, everyone else's general goods. */
|
|
5
|
+
tax_codes: CatalogFormOptionsResource.TaxCodes.Item[];
|
|
6
|
+
/** The groups `tax_codes` fall into, in the order the picker shows them. */
|
|
7
|
+
tax_code_categories: CatalogFormOptionsResource.TaxCodeCategories.Item[];
|
|
8
|
+
/** A restaurant seller's new products start on it; null for everyone else. */
|
|
9
|
+
prepared_food_tax_code: string | null;
|
|
10
|
+
/** Its product categories, flat: a child names its parent. */
|
|
11
|
+
categories: CatalogFormOptionsResource.Categories.Item[];
|
|
12
|
+
/**
|
|
13
|
+
* Its unarchived stores and stands: the main store first, then stores, then stands, each by name.
|
|
14
|
+
* `holds_stock` says whether it counts its own stock, so a new product's starting counts are asked for there.
|
|
15
|
+
*/
|
|
16
|
+
locations: CatalogFormOptionsResource.Locations.Item[];
|
|
17
|
+
/**
|
|
18
|
+
* Whether it can sell (`commerce_ready`; `reason` is why not, the web's banner's reason,
|
|
19
|
+
* or `ready`), take payments (adding a product needs it) and put a product on sale
|
|
20
|
+
* (`approved_to_sell`).
|
|
21
|
+
*/
|
|
22
|
+
readiness: CatalogFormOptionsResource.Readiness;
|
|
23
|
+
}
|
|
24
|
+
export declare namespace CatalogFormOptionsResource {
|
|
25
|
+
type Units = Units.Item[];
|
|
26
|
+
namespace Units {
|
|
27
|
+
interface Item {
|
|
28
|
+
value: string;
|
|
29
|
+
label: string;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
type TaxCodes = TaxCodes.Item[];
|
|
33
|
+
namespace TaxCodes {
|
|
34
|
+
interface Item {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
description: string | null;
|
|
38
|
+
category: string;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
type TaxCodeCategories = TaxCodeCategories.Item[];
|
|
42
|
+
namespace TaxCodeCategories {
|
|
43
|
+
interface Item {
|
|
44
|
+
value: string;
|
|
45
|
+
label: string;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
type Categories = Categories.Item[];
|
|
49
|
+
namespace Categories {
|
|
50
|
+
interface Item {
|
|
51
|
+
id: string;
|
|
52
|
+
name: string;
|
|
53
|
+
parent_id: string | null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
type Locations = Locations.Item[];
|
|
57
|
+
namespace Locations {
|
|
58
|
+
interface Item {
|
|
59
|
+
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
kind: Item.Kind;
|
|
62
|
+
is_main: boolean;
|
|
63
|
+
is_active: boolean;
|
|
64
|
+
offers_pickup: boolean;
|
|
65
|
+
offers_in_person: boolean;
|
|
66
|
+
holds_stock: boolean;
|
|
67
|
+
}
|
|
68
|
+
namespace Item {
|
|
69
|
+
const Kind: {
|
|
70
|
+
readonly Store: "store";
|
|
71
|
+
readonly Stand: "stand";
|
|
72
|
+
};
|
|
73
|
+
type Kind = (typeof Kind)[keyof typeof Kind];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Whether it can sell (`commerce_ready`; `reason` is why not, the web's banner's reason,
|
|
78
|
+
* or `ready`), take payments (adding a product needs it) and put a product on sale
|
|
79
|
+
* (`approved_to_sell`).
|
|
80
|
+
*/
|
|
81
|
+
interface Readiness {
|
|
82
|
+
commerce_ready: boolean;
|
|
83
|
+
reason: string;
|
|
84
|
+
payments_ready: boolean;
|
|
85
|
+
approved_to_sell: boolean;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var CatalogFormOptionsResource;
|
|
3
|
+
(function (CatalogFormOptionsResource) {
|
|
4
|
+
let Locations;
|
|
5
|
+
(function (Locations) {
|
|
6
|
+
let Item;
|
|
7
|
+
(function (Item) {
|
|
8
|
+
Item.Kind = {
|
|
9
|
+
Store: "store",
|
|
10
|
+
Stand: "stand",
|
|
11
|
+
};
|
|
12
|
+
})(Item = Locations.Item || (Locations.Item = {}));
|
|
13
|
+
})(Locations = CatalogFormOptionsResource.Locations || (CatalogFormOptionsResource.Locations = {}));
|
|
14
|
+
})(CatalogFormOptionsResource || (CatalogFormOptionsResource = {}));
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface LocationProductsResource {
|
|
2
|
+
location: LocationProductsResource.Location;
|
|
3
|
+
/** How the products here are sold: `online`, for pickup, at a store; `in_person` at a stand. */
|
|
4
|
+
channel: LocationProductsResource.Channel;
|
|
5
|
+
/** Every product of the business, by name. `live` is whether it's on sale. */
|
|
6
|
+
products: LocationProductsResource.Products.Item[];
|
|
7
|
+
/** The IDs of the products sold here that way. */
|
|
8
|
+
selected: string[];
|
|
9
|
+
}
|
|
10
|
+
export declare namespace LocationProductsResource {
|
|
11
|
+
interface Location {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
kind: Location.Kind;
|
|
15
|
+
is_main: boolean;
|
|
16
|
+
is_active: boolean;
|
|
17
|
+
archived: boolean;
|
|
18
|
+
sells_this_way: boolean;
|
|
19
|
+
}
|
|
20
|
+
namespace Location {
|
|
21
|
+
const Kind: {
|
|
22
|
+
readonly Store: "store";
|
|
23
|
+
readonly Stand: "stand";
|
|
24
|
+
};
|
|
25
|
+
type Kind = (typeof Kind)[keyof typeof Kind];
|
|
26
|
+
}
|
|
27
|
+
/** How the products here are sold: `online`, for pickup, at a store; `in_person` at a stand. */
|
|
28
|
+
const Channel: {
|
|
29
|
+
readonly Online: "online";
|
|
30
|
+
readonly InPerson: "in_person";
|
|
31
|
+
};
|
|
32
|
+
type Channel = (typeof Channel)[keyof typeof Channel];
|
|
33
|
+
type Products = Products.Item[];
|
|
34
|
+
namespace Products {
|
|
35
|
+
interface Item {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
category: string | null;
|
|
39
|
+
live: boolean;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|