@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.
Files changed (194) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/business/client/Client.d.ts +0 -3
  3. package/dist/cjs/api/resources/business/client/Client.js +14 -19
  4. package/dist/cjs/api/resources/business/resources/commerce/client/Client.d.ts +9 -0
  5. package/dist/cjs/api/resources/business/resources/commerce/client/Client.js +27 -12
  6. package/dist/cjs/api/resources/business/resources/commerce/resources/catalog/client/Client.d.ts +30 -0
  7. package/dist/cjs/api/resources/business/resources/commerce/resources/catalog/client/Client.js +116 -0
  8. package/dist/cjs/api/resources/business/resources/commerce/resources/catalog/exports.d.ts +2 -0
  9. package/dist/cjs/api/resources/business/resources/commerce/resources/catalog/exports.js +21 -0
  10. package/dist/cjs/api/resources/business/resources/{productCategories → commerce/resources/catalog}/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/business/resources/{productCategories → commerce/resources/catalog}/index.js +1 -0
  12. package/dist/cjs/api/resources/business/resources/commerce/resources/catalog/types/GetOptionsCatalogResponse.d.ts +4 -0
  13. package/dist/cjs/api/resources/business/resources/commerce/resources/catalog/types/index.d.ts +1 -0
  14. package/dist/cjs/api/resources/business/resources/commerce/resources/catalog/types/index.js +17 -0
  15. package/dist/cjs/api/resources/business/resources/commerce/resources/index.d.ts +8 -0
  16. package/dist/cjs/api/resources/business/resources/commerce/resources/index.js +12 -4
  17. package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/Client.d.ts +46 -0
  18. package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/Client.js +137 -0
  19. package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/GetProductsLocationsRequest.d.ts +10 -0
  20. package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/SetLocationProductsRequest.d.ts +15 -0
  21. package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/SetLocationProductsRequest.js +3 -0
  22. package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/index.d.ts +2 -0
  23. package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/GetProductsLocationsResponse.d.ts +4 -0
  24. package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/GetProductsLocationsResponse.js +3 -0
  25. package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/SetProductsLocationsResponse.d.ts +4 -0
  26. package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/SetProductsLocationsResponse.js +3 -0
  27. package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/index.d.ts +2 -0
  28. package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/index.js +2 -0
  29. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/client/Client.d.ts +80 -0
  30. package/dist/cjs/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/client/Client.js +142 -49
  31. package/dist/cjs/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/client/requests/DeleteProductCategoriesRequest.d.ts +1 -0
  32. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/client/requests/DeleteProductCategoriesRequest.js +3 -0
  33. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/client/requests/StoreProductCategoryRequest.d.ts +14 -0
  34. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/client/requests/StoreProductCategoryRequest.js +3 -0
  35. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/client/requests/UpdateProductCategoryRequest.d.ts +14 -0
  36. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/client/requests/UpdateProductCategoryRequest.js +3 -0
  37. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/client/requests/index.d.ts +3 -0
  38. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/client/requests/index.js +2 -0
  39. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/index.d.ts +2 -0
  40. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/index.js +18 -0
  41. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/types/CreateProductCategoriesResponse.d.ts +4 -0
  42. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/types/CreateProductCategoriesResponse.js +3 -0
  43. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/types/ListProductCategoriesResponse.d.ts +4 -0
  44. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/types/ListProductCategoriesResponse.js +3 -0
  45. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/types/UpdateProductCategoriesResponse.d.ts +4 -0
  46. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/types/UpdateProductCategoriesResponse.js +3 -0
  47. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/types/index.d.ts +3 -0
  48. package/dist/cjs/api/resources/business/resources/commerce/resources/productCategories/types/index.js +19 -0
  49. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/Client.d.ts +92 -0
  50. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/Client.js +338 -0
  51. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/index.d.ts +1 -0
  52. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/index.js +17 -0
  53. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/DeleteProductImagesRequest.d.ts +13 -0
  54. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/DeleteProductImagesRequest.js +3 -0
  55. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/ReorderProductImagesRequest.d.ts +24 -0
  56. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/ReorderProductImagesRequest.js +3 -0
  57. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/StoreProductImageRequest.d.ts +18 -0
  58. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/StoreProductImageRequest.js +3 -0
  59. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/UpdateProductImageRequest.d.ts +14 -0
  60. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/UpdateProductImageRequest.js +3 -0
  61. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/index.d.ts +4 -0
  62. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/client/requests/index.js +2 -0
  63. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/exports.d.ts +2 -0
  64. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/exports.js +21 -0
  65. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/index.d.ts +2 -0
  66. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/index.js +18 -0
  67. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/types/ReorderProductImagesResponse.d.ts +4 -0
  68. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/types/ReorderProductImagesResponse.js +3 -0
  69. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/types/UpdateProductImagesResponse.d.ts +4 -0
  70. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/types/UpdateProductImagesResponse.js +3 -0
  71. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/types/UploadProductImagesResponse.d.ts +4 -0
  72. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/types/UploadProductImagesResponse.js +3 -0
  73. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/types/index.d.ts +3 -0
  74. package/dist/cjs/api/resources/business/resources/commerce/resources/productImages/types/index.js +19 -0
  75. package/dist/cjs/api/resources/business/resources/index.d.ts +0 -2
  76. package/dist/cjs/api/resources/business/resources/index.js +1 -3
  77. package/dist/cjs/api/types/CatalogFormOptionsResource.d.ts +87 -0
  78. package/dist/cjs/api/types/CatalogFormOptionsResource.js +17 -0
  79. package/dist/cjs/api/types/LocationProductsResource.d.ts +42 -0
  80. package/dist/cjs/api/types/LocationProductsResource.js +19 -0
  81. package/dist/cjs/api/types/ProductCategoryResource.d.ts +4 -0
  82. package/dist/cjs/api/types/index.d.ts +2 -0
  83. package/dist/cjs/api/types/index.js +2 -0
  84. package/dist/cjs/version.d.ts +1 -1
  85. package/dist/cjs/version.js +1 -1
  86. package/dist/esm/BaseClient.mjs +2 -2
  87. package/dist/esm/api/resources/business/client/Client.d.mts +0 -3
  88. package/dist/esm/api/resources/business/client/Client.mjs +0 -5
  89. package/dist/esm/api/resources/business/resources/commerce/client/Client.d.mts +9 -0
  90. package/dist/esm/api/resources/business/resources/commerce/client/Client.mjs +15 -0
  91. package/dist/esm/api/resources/business/resources/commerce/resources/catalog/client/Client.d.mts +30 -0
  92. package/dist/esm/api/resources/business/resources/commerce/resources/catalog/client/Client.mjs +79 -0
  93. package/dist/esm/api/resources/business/resources/commerce/resources/catalog/client/index.d.mts +1 -0
  94. package/dist/esm/api/resources/business/resources/commerce/resources/catalog/client/index.mjs +1 -0
  95. package/dist/esm/api/resources/business/resources/commerce/resources/catalog/exports.d.mts +2 -0
  96. package/dist/esm/api/resources/business/resources/commerce/resources/catalog/exports.mjs +3 -0
  97. package/dist/esm/api/resources/business/resources/{productCategories → commerce/resources/catalog}/index.d.mts +1 -0
  98. package/dist/esm/api/resources/business/resources/{productCategories → commerce/resources/catalog}/index.mjs +1 -0
  99. package/dist/esm/api/resources/business/resources/commerce/resources/catalog/types/GetOptionsCatalogResponse.d.mts +4 -0
  100. package/dist/esm/api/resources/business/resources/commerce/resources/catalog/types/index.d.mts +1 -0
  101. package/dist/esm/api/resources/business/resources/commerce/resources/catalog/types/index.mjs +1 -0
  102. package/dist/esm/api/resources/business/resources/commerce/resources/index.d.mts +8 -0
  103. package/dist/esm/api/resources/business/resources/commerce/resources/index.mjs +8 -0
  104. package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/Client.d.mts +46 -0
  105. package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/Client.mjs +137 -0
  106. package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/GetProductsLocationsRequest.d.mts +10 -0
  107. package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/SetLocationProductsRequest.d.mts +15 -0
  108. package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/SetLocationProductsRequest.mjs +2 -0
  109. package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/index.d.mts +2 -0
  110. package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/GetProductsLocationsResponse.d.mts +4 -0
  111. package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/GetProductsLocationsResponse.mjs +2 -0
  112. package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/SetProductsLocationsResponse.d.mts +4 -0
  113. package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/SetProductsLocationsResponse.mjs +2 -0
  114. package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/index.d.mts +2 -0
  115. package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/index.mjs +2 -0
  116. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/client/Client.d.mts +80 -0
  117. package/dist/esm/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/client/Client.mjs +142 -49
  118. package/dist/esm/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/client/requests/DeleteProductCategoriesRequest.d.mts +1 -0
  119. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/client/requests/DeleteProductCategoriesRequest.mjs +2 -0
  120. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/client/requests/StoreProductCategoryRequest.d.mts +14 -0
  121. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/client/requests/StoreProductCategoryRequest.mjs +2 -0
  122. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/client/requests/UpdateProductCategoryRequest.d.mts +14 -0
  123. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/client/requests/UpdateProductCategoryRequest.mjs +2 -0
  124. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/client/requests/index.d.mts +3 -0
  125. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/client/requests/index.mjs +1 -0
  126. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/index.d.mts +2 -0
  127. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/index.mjs +2 -0
  128. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/types/CreateProductCategoriesResponse.d.mts +4 -0
  129. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/types/CreateProductCategoriesResponse.mjs +2 -0
  130. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/types/ListProductCategoriesResponse.d.mts +4 -0
  131. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/types/ListProductCategoriesResponse.mjs +2 -0
  132. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/types/UpdateProductCategoriesResponse.d.mts +4 -0
  133. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/types/UpdateProductCategoriesResponse.mjs +2 -0
  134. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/types/index.d.mts +3 -0
  135. package/dist/esm/api/resources/business/resources/commerce/resources/productCategories/types/index.mjs +3 -0
  136. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/Client.d.mts +92 -0
  137. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/Client.mjs +301 -0
  138. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/index.d.mts +1 -0
  139. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/index.mjs +1 -0
  140. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/DeleteProductImagesRequest.d.mts +13 -0
  141. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/DeleteProductImagesRequest.mjs +2 -0
  142. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/ReorderProductImagesRequest.d.mts +24 -0
  143. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/ReorderProductImagesRequest.mjs +2 -0
  144. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/StoreProductImageRequest.d.mts +18 -0
  145. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/StoreProductImageRequest.mjs +2 -0
  146. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/UpdateProductImageRequest.d.mts +14 -0
  147. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/UpdateProductImageRequest.mjs +2 -0
  148. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/index.d.mts +4 -0
  149. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/client/requests/index.mjs +1 -0
  150. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/exports.d.mts +2 -0
  151. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/exports.mjs +3 -0
  152. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/index.d.mts +2 -0
  153. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/index.mjs +2 -0
  154. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/types/ReorderProductImagesResponse.d.mts +4 -0
  155. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/types/ReorderProductImagesResponse.mjs +2 -0
  156. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/types/UpdateProductImagesResponse.d.mts +4 -0
  157. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/types/UpdateProductImagesResponse.mjs +2 -0
  158. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/types/UploadProductImagesResponse.d.mts +4 -0
  159. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/types/UploadProductImagesResponse.mjs +2 -0
  160. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/types/index.d.mts +3 -0
  161. package/dist/esm/api/resources/business/resources/commerce/resources/productImages/types/index.mjs +3 -0
  162. package/dist/esm/api/resources/business/resources/index.d.mts +0 -2
  163. package/dist/esm/api/resources/business/resources/index.mjs +0 -2
  164. package/dist/esm/api/types/CatalogFormOptionsResource.d.mts +87 -0
  165. package/dist/esm/api/types/CatalogFormOptionsResource.mjs +14 -0
  166. package/dist/esm/api/types/LocationProductsResource.d.mts +42 -0
  167. package/dist/esm/api/types/LocationProductsResource.mjs +16 -0
  168. package/dist/esm/api/types/ProductCategoryResource.d.mts +4 -0
  169. package/dist/esm/api/types/index.d.mts +2 -0
  170. package/dist/esm/api/types/index.mjs +2 -0
  171. package/dist/esm/version.d.mts +1 -1
  172. package/dist/esm/version.mjs +1 -1
  173. package/package.json +34 -12
  174. package/reference.md +543 -42
  175. package/dist/cjs/api/resources/business/resources/productCategories/client/Client.d.ts +0 -51
  176. package/dist/cjs/api/resources/business/resources/productCategories/client/requests/UpdateProductCategoriesRequest.d.ts +0 -9
  177. package/dist/cjs/api/resources/business/resources/productCategories/client/requests/index.d.ts +0 -2
  178. package/dist/esm/api/resources/business/resources/productCategories/client/Client.d.mts +0 -51
  179. package/dist/esm/api/resources/business/resources/productCategories/client/requests/UpdateProductCategoriesRequest.d.mts +0 -9
  180. package/dist/esm/api/resources/business/resources/productCategories/client/requests/index.d.mts +0 -2
  181. /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
  182. /package/dist/cjs/api/resources/business/resources/{productCategories/client/requests → commerce/resources/catalog/client}/index.js +0 -0
  183. /package/dist/cjs/api/resources/business/resources/{productCategories/client/requests/DeleteProductCategoriesRequest.js → commerce/resources/catalog/types/GetOptionsCatalogResponse.js} +0 -0
  184. /package/dist/cjs/api/resources/business/resources/{productCategories/client/requests/UpdateProductCategoriesRequest.js → commerce/resources/locations/client/requests/GetProductsLocationsRequest.js} +0 -0
  185. /package/dist/cjs/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/client/index.d.ts +0 -0
  186. /package/dist/cjs/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/client/index.js +0 -0
  187. /package/dist/cjs/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/exports.d.ts +0 -0
  188. /package/dist/cjs/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/exports.js +0 -0
  189. /package/dist/esm/api/resources/business/resources/{productCategories/client/requests/DeleteProductCategoriesRequest.mjs → commerce/resources/catalog/types/GetOptionsCatalogResponse.mjs} +0 -0
  190. /package/dist/esm/api/resources/business/resources/{productCategories/client/requests/UpdateProductCategoriesRequest.mjs → commerce/resources/locations/client/requests/GetProductsLocationsRequest.mjs} +0 -0
  191. /package/dist/esm/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/client/index.d.mts +0 -0
  192. /package/dist/esm/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/client/index.mjs +0 -0
  193. /package/dist/esm/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/exports.d.mts +0 -0
  194. /package/dist/esm/api/resources/business/resources/{productCategories → commerce/resources/productCategories}/exports.mjs +0 -0
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * "Idempotency-Key": "Idempotency-Key",
5
+ * name: "name"
6
+ * }
7
+ */
8
+ export interface StoreProductCategoryRequest {
9
+ /** Required, 1–255 characters, new for each category you mean to add: a retry with the same key never adds twice. */
10
+ "Idempotency-Key": string;
11
+ name: string;
12
+ parent_id?: string | null;
13
+ sort_order?: number | null;
14
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * productCategory: "productCategory",
5
+ * name: "name"
6
+ * }
7
+ */
8
+ export interface UpdateProductCategoryRequest {
9
+ /** The product category ID */
10
+ productCategory: string;
11
+ name: string;
12
+ parent_id?: string | null;
13
+ sort_order?: number | null;
14
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export type { DeleteProductCategoriesRequest } from "./DeleteProductCategoriesRequest.js";
2
+ export type { StoreProductCategoryRequest } from "./StoreProductCategoryRequest.js";
3
+ export type { UpdateProductCategoryRequest } from "./UpdateProductCategoryRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
18
+ __exportStar(require("./types/index.js"), exports);
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../../../../../index.js";
2
+ export interface CreateProductCategoriesResponse {
3
+ data: FiveOneEat.ProductCategoryResource;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../../../../../index.js";
2
+ export interface ListProductCategoriesResponse {
3
+ data: FiveOneEat.ProductCategoryResource[];
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../../../../../index.js";
2
+ export interface UpdateProductCategoriesResponse {
3
+ data: FiveOneEat.ProductCategoryResource;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export * from "./CreateProductCategoriesResponse.js";
2
+ export * from "./ListProductCategoriesResponse.js";
3
+ export * from "./UpdateProductCategoriesResponse.js";
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./CreateProductCategoriesResponse.js"), exports);
18
+ __exportStar(require("./ListProductCategoriesResponse.js"), exports);
19
+ __exportStar(require("./UpdateProductCategoriesResponse.js"), exports);
@@ -0,0 +1,92 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../BaseClient.js";
3
+ import * as core from "../../../../../../../../core/index.js";
4
+ import * as FiveOneEat from "../../../../../../../index.js";
5
+ export declare namespace ProductImagesClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class ProductImagesClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<ProductImagesClient.Options>;
12
+ constructor(options?: ProductImagesClient.Options);
13
+ /**
14
+ * Multipart, with the photo in `image` (up to 10 MB) and optional
15
+ * `alt_text`. Answers 201. It goes after the product's other photos.
16
+ *
17
+ * @param {FiveOneEat.business.commerce.StoreProductImageRequest} request
18
+ * @param {ProductImagesClient.RequestOptions} requestOptions - Request-specific configuration.
19
+ *
20
+ * @throws {@link FiveOneEat.UnauthorizedError}
21
+ * @throws {@link FiveOneEat.ForbiddenError}
22
+ * @throws {@link FiveOneEat.NotFoundError}
23
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
24
+ *
25
+ * @example
26
+ * import { createReadStream } from "fs";
27
+ * await client.business.commerce.productImages.upload({
28
+ * image: fs.createReadStream("/path/to/your/file"),
29
+ * "Idempotency-Key": "Idempotency-Key",
30
+ * product: "product"
31
+ * })
32
+ */
33
+ upload(request: FiveOneEat.business.commerce.StoreProductImageRequest, requestOptions?: ProductImagesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.commerce.UploadProductImagesResponse>;
34
+ private __upload;
35
+ /**
36
+ * Sets each listed photo's `sort_order`; the first is the product's main
37
+ * photo. A listed photo of another product is left alone. Answers with
38
+ * all the product's photos in their new order.
39
+ *
40
+ * @param {FiveOneEat.business.commerce.ReorderProductImagesRequest} request
41
+ * @param {ProductImagesClient.RequestOptions} requestOptions - Request-specific configuration.
42
+ *
43
+ * @throws {@link FiveOneEat.UnauthorizedError}
44
+ * @throws {@link FiveOneEat.ForbiddenError}
45
+ * @throws {@link FiveOneEat.NotFoundError}
46
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
47
+ *
48
+ * @example
49
+ * await client.business.commerce.productImages.reorder({
50
+ * product: "product",
51
+ * images: [{
52
+ * id: "id",
53
+ * sort_order: 1
54
+ * }]
55
+ * })
56
+ */
57
+ reorder(request: FiveOneEat.business.commerce.ReorderProductImagesRequest, requestOptions?: ProductImagesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.commerce.ReorderProductImagesResponse>;
58
+ private __reorder;
59
+ /**
60
+ * @param {FiveOneEat.business.commerce.UpdateProductImageRequest} request
61
+ * @param {ProductImagesClient.RequestOptions} requestOptions - Request-specific configuration.
62
+ *
63
+ * @throws {@link FiveOneEat.UnauthorizedError}
64
+ * @throws {@link FiveOneEat.ForbiddenError}
65
+ * @throws {@link FiveOneEat.NotFoundError}
66
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
67
+ *
68
+ * @example
69
+ * await client.business.commerce.productImages.update({
70
+ * product: "product",
71
+ * image: "image"
72
+ * })
73
+ */
74
+ update(request: FiveOneEat.business.commerce.UpdateProductImageRequest, requestOptions?: ProductImagesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.commerce.UpdateProductImagesResponse>;
75
+ private __update;
76
+ /**
77
+ * @param {FiveOneEat.business.commerce.DeleteProductImagesRequest} request
78
+ * @param {ProductImagesClient.RequestOptions} requestOptions - Request-specific configuration.
79
+ *
80
+ * @throws {@link FiveOneEat.UnauthorizedError}
81
+ * @throws {@link FiveOneEat.ForbiddenError}
82
+ * @throws {@link FiveOneEat.NotFoundError}
83
+ *
84
+ * @example
85
+ * await client.business.commerce.productImages.delete({
86
+ * product: "product",
87
+ * image: "image"
88
+ * })
89
+ */
90
+ delete(request: FiveOneEat.business.commerce.DeleteProductImagesRequest, requestOptions?: ProductImagesClient.RequestOptions): core.HttpResponsePromise<void>;
91
+ private __delete;
92
+ }
@@ -0,0 +1,338 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ var __rest = (this && this.__rest) || function (s, e) {
46
+ var t = {};
47
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
48
+ t[p] = s[p];
49
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
50
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
51
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
52
+ t[p[i]] = s[p[i]];
53
+ }
54
+ return t;
55
+ };
56
+ Object.defineProperty(exports, "__esModule", { value: true });
57
+ exports.ProductImagesClient = void 0;
58
+ const BaseClient_js_1 = require("../../../../../../../../BaseClient.js");
59
+ const headers_js_1 = require("../../../../../../../../core/headers.js");
60
+ const core = __importStar(require("../../../../../../../../core/index.js"));
61
+ const environments = __importStar(require("../../../../../../../../environments.js"));
62
+ const handleNonStatusCodeError_js_1 = require("../../../../../../../../errors/handleNonStatusCodeError.js");
63
+ const errors = __importStar(require("../../../../../../../../errors/index.js"));
64
+ const FiveOneEat = __importStar(require("../../../../../../../index.js"));
65
+ class ProductImagesClient {
66
+ constructor(options = {}) {
67
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
68
+ }
69
+ /**
70
+ * Multipart, with the photo in `image` (up to 10 MB) and optional
71
+ * `alt_text`. Answers 201. It goes after the product's other photos.
72
+ *
73
+ * @param {FiveOneEat.business.commerce.StoreProductImageRequest} request
74
+ * @param {ProductImagesClient.RequestOptions} requestOptions - Request-specific configuration.
75
+ *
76
+ * @throws {@link FiveOneEat.UnauthorizedError}
77
+ * @throws {@link FiveOneEat.ForbiddenError}
78
+ * @throws {@link FiveOneEat.NotFoundError}
79
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
80
+ *
81
+ * @example
82
+ * import { createReadStream } from "fs";
83
+ * await client.business.commerce.productImages.upload({
84
+ * image: fs.createReadStream("/path/to/your/file"),
85
+ * "Idempotency-Key": "Idempotency-Key",
86
+ * product: "product"
87
+ * })
88
+ */
89
+ upload(request, requestOptions) {
90
+ return core.HttpResponsePromise.fromPromise(this.__upload(request, requestOptions));
91
+ }
92
+ __upload(request, requestOptions) {
93
+ return __awaiter(this, void 0, void 0, function* () {
94
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
95
+ const _body = yield core.newFormData();
96
+ yield _body.appendFile("image", request.image);
97
+ if (request.alt_text != null) {
98
+ _body.append("alt_text", request.alt_text);
99
+ }
100
+ const _maybeEncodedRequest = yield _body.getRequest();
101
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
102
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ "Idempotency-Key": request["Idempotency-Key"] }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
103
+ const _response = yield core.fetcher({
104
+ 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`),
105
+ method: "POST",
106
+ headers: _headers,
107
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
108
+ requestType: "file",
109
+ duplex: _maybeEncodedRequest.duplex,
110
+ body: _maybeEncodedRequest.body,
111
+ 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,
112
+ 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,
113
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
114
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
115
+ logging: this._options.logging,
116
+ });
117
+ if (_response.ok) {
118
+ return {
119
+ data: _response.body,
120
+ rawResponse: _response.rawResponse,
121
+ };
122
+ }
123
+ if (_response.error.reason === "status-code") {
124
+ switch (_response.error.statusCode) {
125
+ case 401:
126
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
127
+ case 403:
128
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
129
+ case 404:
130
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
131
+ case 422:
132
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
133
+ default:
134
+ throw new errors.FiveOneEatError({
135
+ statusCode: _response.error.statusCode,
136
+ body: _response.error.body,
137
+ rawResponse: _response.rawResponse,
138
+ });
139
+ }
140
+ }
141
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/commerce/products/{product}/images");
142
+ });
143
+ }
144
+ /**
145
+ * Sets each listed photo's `sort_order`; the first is the product's main
146
+ * photo. A listed photo of another product is left alone. Answers with
147
+ * all the product's photos in their new order.
148
+ *
149
+ * @param {FiveOneEat.business.commerce.ReorderProductImagesRequest} request
150
+ * @param {ProductImagesClient.RequestOptions} requestOptions - Request-specific configuration.
151
+ *
152
+ * @throws {@link FiveOneEat.UnauthorizedError}
153
+ * @throws {@link FiveOneEat.ForbiddenError}
154
+ * @throws {@link FiveOneEat.NotFoundError}
155
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
156
+ *
157
+ * @example
158
+ * await client.business.commerce.productImages.reorder({
159
+ * product: "product",
160
+ * images: [{
161
+ * id: "id",
162
+ * sort_order: 1
163
+ * }]
164
+ * })
165
+ */
166
+ reorder(request, requestOptions) {
167
+ return core.HttpResponsePromise.fromPromise(this.__reorder(request, requestOptions));
168
+ }
169
+ __reorder(request, requestOptions) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
172
+ const { product } = request, _body = __rest(request, ["product"]);
173
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
174
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
175
+ const _response = yield core.fetcher({
176
+ 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`),
177
+ method: "PUT",
178
+ headers: _headers,
179
+ contentType: "application/json",
180
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
181
+ requestType: "json",
182
+ body: _body,
183
+ 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,
184
+ 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,
185
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
186
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
187
+ logging: this._options.logging,
188
+ });
189
+ if (_response.ok) {
190
+ return {
191
+ data: _response.body,
192
+ rawResponse: _response.rawResponse,
193
+ };
194
+ }
195
+ if (_response.error.reason === "status-code") {
196
+ switch (_response.error.statusCode) {
197
+ case 401:
198
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
199
+ case 403:
200
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
201
+ case 404:
202
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
203
+ case 422:
204
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
205
+ default:
206
+ throw new errors.FiveOneEatError({
207
+ statusCode: _response.error.statusCode,
208
+ body: _response.error.body,
209
+ rawResponse: _response.rawResponse,
210
+ });
211
+ }
212
+ }
213
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/business/commerce/products/{product}/images/reorder");
214
+ });
215
+ }
216
+ /**
217
+ * @param {FiveOneEat.business.commerce.UpdateProductImageRequest} request
218
+ * @param {ProductImagesClient.RequestOptions} requestOptions - Request-specific configuration.
219
+ *
220
+ * @throws {@link FiveOneEat.UnauthorizedError}
221
+ * @throws {@link FiveOneEat.ForbiddenError}
222
+ * @throws {@link FiveOneEat.NotFoundError}
223
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
224
+ *
225
+ * @example
226
+ * await client.business.commerce.productImages.update({
227
+ * product: "product",
228
+ * image: "image"
229
+ * })
230
+ */
231
+ update(request, requestOptions) {
232
+ return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
233
+ }
234
+ __update(request, requestOptions) {
235
+ return __awaiter(this, void 0, void 0, function* () {
236
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
237
+ const { product, image } = request, _body = __rest(request, ["product", "image"]);
238
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
239
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
240
+ const _response = yield core.fetcher({
241
+ 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)}`),
242
+ method: "PUT",
243
+ headers: _headers,
244
+ contentType: "application/json",
245
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
246
+ requestType: "json",
247
+ body: _body,
248
+ 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,
249
+ 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,
250
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
251
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
252
+ logging: this._options.logging,
253
+ });
254
+ if (_response.ok) {
255
+ return {
256
+ data: _response.body,
257
+ rawResponse: _response.rawResponse,
258
+ };
259
+ }
260
+ if (_response.error.reason === "status-code") {
261
+ switch (_response.error.statusCode) {
262
+ case 401:
263
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
264
+ case 403:
265
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
266
+ case 404:
267
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
268
+ case 422:
269
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
270
+ default:
271
+ throw new errors.FiveOneEatError({
272
+ statusCode: _response.error.statusCode,
273
+ body: _response.error.body,
274
+ rawResponse: _response.rawResponse,
275
+ });
276
+ }
277
+ }
278
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/business/commerce/products/{product}/images/{image}");
279
+ });
280
+ }
281
+ /**
282
+ * @param {FiveOneEat.business.commerce.DeleteProductImagesRequest} request
283
+ * @param {ProductImagesClient.RequestOptions} requestOptions - Request-specific configuration.
284
+ *
285
+ * @throws {@link FiveOneEat.UnauthorizedError}
286
+ * @throws {@link FiveOneEat.ForbiddenError}
287
+ * @throws {@link FiveOneEat.NotFoundError}
288
+ *
289
+ * @example
290
+ * await client.business.commerce.productImages.delete({
291
+ * product: "product",
292
+ * image: "image"
293
+ * })
294
+ */
295
+ delete(request, requestOptions) {
296
+ return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
297
+ }
298
+ __delete(request, requestOptions) {
299
+ return __awaiter(this, void 0, void 0, function* () {
300
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
301
+ const { product, image } = request;
302
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
303
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
304
+ const _response = yield core.fetcher({
305
+ 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)}`),
306
+ method: "DELETE",
307
+ headers: _headers,
308
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
309
+ 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,
310
+ 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,
311
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
312
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
313
+ logging: this._options.logging,
314
+ });
315
+ if (_response.ok) {
316
+ return { data: undefined, rawResponse: _response.rawResponse };
317
+ }
318
+ if (_response.error.reason === "status-code") {
319
+ switch (_response.error.statusCode) {
320
+ case 401:
321
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
322
+ case 403:
323
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
324
+ case 404:
325
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
326
+ default:
327
+ throw new errors.FiveOneEatError({
328
+ statusCode: _response.error.statusCode,
329
+ body: _response.error.body,
330
+ rawResponse: _response.rawResponse,
331
+ });
332
+ }
333
+ }
334
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/business/commerce/products/{product}/images/{image}");
335
+ });
336
+ }
337
+ }
338
+ exports.ProductImagesClient = ProductImagesClient;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * product: "product",
5
+ * image: "image"
6
+ * }
7
+ */
8
+ export interface DeleteProductImagesRequest {
9
+ /** The product ID */
10
+ product: string;
11
+ /** The image ID */
12
+ image: string;
13
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });