@wix/auto_sdk_metro_products 1.0.2 → 1.0.4

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 (123) hide show
  1. package/build/cjs/index.d.ts +81 -1
  2. package/build/cjs/index.js +1514 -15
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +574 -1
  5. package/build/cjs/index.typings.js +1425 -15
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +447 -1
  8. package/build/cjs/meta.js +940 -15
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +81 -0
  11. package/build/es/index.mjs +1481 -0
  12. package/build/es/index.mjs.map +1 -0
  13. package/build/es/{src/metroinspector-v1-product-products.universal.d.ts → index.typings.d.mts} +138 -190
  14. package/build/es/index.typings.mjs +1392 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/es/{src/metroinspector-v1-product-products.types.d.ts → meta.d.mts} +92 -232
  17. package/build/es/meta.mjs +907 -0
  18. package/build/es/meta.mjs.map +1 -0
  19. package/build/internal/cjs/index.d.ts +81 -1
  20. package/build/internal/cjs/index.js +1514 -15
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +574 -1
  23. package/build/internal/cjs/index.typings.js +1425 -15
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +447 -1
  26. package/build/internal/cjs/meta.js +940 -15
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +81 -0
  29. package/build/internal/es/index.mjs +1481 -0
  30. package/build/internal/es/index.mjs.map +1 -0
  31. package/build/internal/{cjs/src/metroinspector-v1-product-products.universal.d.ts → es/index.typings.d.mts} +138 -190
  32. package/build/internal/es/index.typings.mjs +1392 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -0
  34. package/build/{cjs/src/metroinspector-v1-product-products.types.d.ts → internal/es/meta.d.mts} +92 -232
  35. package/build/internal/es/meta.mjs +907 -0
  36. package/build/internal/es/meta.mjs.map +1 -0
  37. package/package.json +12 -10
  38. package/build/cjs/src/metroinspector-v1-product-products.context.d.ts +0 -14
  39. package/build/cjs/src/metroinspector-v1-product-products.context.js +0 -20
  40. package/build/cjs/src/metroinspector-v1-product-products.context.js.map +0 -1
  41. package/build/cjs/src/metroinspector-v1-product-products.http.d.ts +0 -16
  42. package/build/cjs/src/metroinspector-v1-product-products.http.js +0 -728
  43. package/build/cjs/src/metroinspector-v1-product-products.http.js.map +0 -1
  44. package/build/cjs/src/metroinspector-v1-product-products.meta.d.ts +0 -30
  45. package/build/cjs/src/metroinspector-v1-product-products.meta.js +0 -218
  46. package/build/cjs/src/metroinspector-v1-product-products.meta.js.map +0 -1
  47. package/build/cjs/src/metroinspector-v1-product-products.public.d.ts +0 -68
  48. package/build/cjs/src/metroinspector-v1-product-products.public.js +0 -70
  49. package/build/cjs/src/metroinspector-v1-product-products.public.js.map +0 -1
  50. package/build/cjs/src/metroinspector-v1-product-products.types.js +0 -43
  51. package/build/cjs/src/metroinspector-v1-product-products.types.js.map +0 -1
  52. package/build/cjs/src/metroinspector-v1-product-products.universal.d.ts +0 -626
  53. package/build/cjs/src/metroinspector-v1-product-products.universal.js +0 -721
  54. package/build/cjs/src/metroinspector-v1-product-products.universal.js.map +0 -1
  55. package/build/es/index.d.ts +0 -1
  56. package/build/es/index.js +0 -2
  57. package/build/es/index.js.map +0 -1
  58. package/build/es/index.typings.d.ts +0 -1
  59. package/build/es/index.typings.js +0 -2
  60. package/build/es/index.typings.js.map +0 -1
  61. package/build/es/meta.d.ts +0 -1
  62. package/build/es/meta.js +0 -2
  63. package/build/es/meta.js.map +0 -1
  64. package/build/es/src/metroinspector-v1-product-products.context.d.ts +0 -14
  65. package/build/es/src/metroinspector-v1-product-products.context.js +0 -14
  66. package/build/es/src/metroinspector-v1-product-products.context.js.map +0 -1
  67. package/build/es/src/metroinspector-v1-product-products.http.d.ts +0 -16
  68. package/build/es/src/metroinspector-v1-product-products.http.js +0 -715
  69. package/build/es/src/metroinspector-v1-product-products.http.js.map +0 -1
  70. package/build/es/src/metroinspector-v1-product-products.meta.d.ts +0 -30
  71. package/build/es/src/metroinspector-v1-product-products.meta.js +0 -182
  72. package/build/es/src/metroinspector-v1-product-products.meta.js.map +0 -1
  73. package/build/es/src/metroinspector-v1-product-products.public.d.ts +0 -68
  74. package/build/es/src/metroinspector-v1-product-products.public.js +0 -54
  75. package/build/es/src/metroinspector-v1-product-products.public.js.map +0 -1
  76. package/build/es/src/metroinspector-v1-product-products.types.js +0 -40
  77. package/build/es/src/metroinspector-v1-product-products.types.js.map +0 -1
  78. package/build/es/src/metroinspector-v1-product-products.universal.js +0 -685
  79. package/build/es/src/metroinspector-v1-product-products.universal.js.map +0 -1
  80. package/build/internal/cjs/src/metroinspector-v1-product-products.context.d.ts +0 -14
  81. package/build/internal/cjs/src/metroinspector-v1-product-products.context.js +0 -20
  82. package/build/internal/cjs/src/metroinspector-v1-product-products.context.js.map +0 -1
  83. package/build/internal/cjs/src/metroinspector-v1-product-products.http.d.ts +0 -16
  84. package/build/internal/cjs/src/metroinspector-v1-product-products.http.js +0 -728
  85. package/build/internal/cjs/src/metroinspector-v1-product-products.http.js.map +0 -1
  86. package/build/internal/cjs/src/metroinspector-v1-product-products.meta.d.ts +0 -30
  87. package/build/internal/cjs/src/metroinspector-v1-product-products.meta.js +0 -218
  88. package/build/internal/cjs/src/metroinspector-v1-product-products.meta.js.map +0 -1
  89. package/build/internal/cjs/src/metroinspector-v1-product-products.public.d.ts +0 -68
  90. package/build/internal/cjs/src/metroinspector-v1-product-products.public.js +0 -70
  91. package/build/internal/cjs/src/metroinspector-v1-product-products.public.js.map +0 -1
  92. package/build/internal/cjs/src/metroinspector-v1-product-products.types.d.ts +0 -587
  93. package/build/internal/cjs/src/metroinspector-v1-product-products.types.js +0 -43
  94. package/build/internal/cjs/src/metroinspector-v1-product-products.types.js.map +0 -1
  95. package/build/internal/cjs/src/metroinspector-v1-product-products.universal.js +0 -721
  96. package/build/internal/cjs/src/metroinspector-v1-product-products.universal.js.map +0 -1
  97. package/build/internal/es/index.d.ts +0 -1
  98. package/build/internal/es/index.js +0 -2
  99. package/build/internal/es/index.js.map +0 -1
  100. package/build/internal/es/index.typings.d.ts +0 -1
  101. package/build/internal/es/index.typings.js +0 -2
  102. package/build/internal/es/index.typings.js.map +0 -1
  103. package/build/internal/es/meta.d.ts +0 -1
  104. package/build/internal/es/meta.js +0 -2
  105. package/build/internal/es/meta.js.map +0 -1
  106. package/build/internal/es/src/metroinspector-v1-product-products.context.d.ts +0 -14
  107. package/build/internal/es/src/metroinspector-v1-product-products.context.js +0 -14
  108. package/build/internal/es/src/metroinspector-v1-product-products.context.js.map +0 -1
  109. package/build/internal/es/src/metroinspector-v1-product-products.http.d.ts +0 -16
  110. package/build/internal/es/src/metroinspector-v1-product-products.http.js +0 -715
  111. package/build/internal/es/src/metroinspector-v1-product-products.http.js.map +0 -1
  112. package/build/internal/es/src/metroinspector-v1-product-products.meta.d.ts +0 -30
  113. package/build/internal/es/src/metroinspector-v1-product-products.meta.js +0 -182
  114. package/build/internal/es/src/metroinspector-v1-product-products.meta.js.map +0 -1
  115. package/build/internal/es/src/metroinspector-v1-product-products.public.d.ts +0 -68
  116. package/build/internal/es/src/metroinspector-v1-product-products.public.js +0 -54
  117. package/build/internal/es/src/metroinspector-v1-product-products.public.js.map +0 -1
  118. package/build/internal/es/src/metroinspector-v1-product-products.types.d.ts +0 -587
  119. package/build/internal/es/src/metroinspector-v1-product-products.types.js +0 -40
  120. package/build/internal/es/src/metroinspector-v1-product-products.types.js.map +0 -1
  121. package/build/internal/es/src/metroinspector-v1-product-products.universal.d.ts +0 -626
  122. package/build/internal/es/src/metroinspector-v1-product-products.universal.js +0 -685
  123. package/build/internal/es/src/metroinspector-v1-product-products.universal.js.map +0 -1
@@ -0,0 +1,1481 @@
1
+ // src/metroinspector-v1-product-products.universal.ts
2
+ import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
3
+ import { queryBuilder } from "@wix/sdk-runtime/query-builder";
4
+ import {
5
+ renameKeysFromSDKRequestToRESTRequest,
6
+ renameKeysFromRESTResponseToSDKResponse
7
+ } from "@wix/sdk-runtime/rename-all-nested-keys";
8
+
9
+ // src/metroinspector-v1-product-products.http.ts
10
+ import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
11
+ import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
12
+ import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
13
+ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
14
+ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
15
+ import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
16
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
17
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
18
+ function resolveWixCoreservicesMetroinspectorV1ProductsProductsServiceUrl(opts) {
19
+ const domainToMappings = {
20
+ "apps._base_domain_": [
21
+ {
22
+ srcPath: "/_api/metro-inspector",
23
+ destPath: "/api"
24
+ }
25
+ ],
26
+ "api._api_base_domain_": [
27
+ {
28
+ srcPath: "/metro-inspector",
29
+ destPath: ""
30
+ }
31
+ ],
32
+ "www._base_domain_": [
33
+ {
34
+ srcPath: "/metro-inspector",
35
+ destPath: "/api"
36
+ }
37
+ ],
38
+ "manage._base_domain_": [
39
+ {
40
+ srcPath: "/metro-inspector",
41
+ destPath: ""
42
+ }
43
+ ],
44
+ "www.wixgateway.com": [
45
+ {
46
+ srcPath: "/_api/metro-inspector",
47
+ destPath: "/api"
48
+ }
49
+ ],
50
+ _: [
51
+ {
52
+ srcPath: "/_api/metro-inspector",
53
+ destPath: "/api"
54
+ }
55
+ ],
56
+ "www.wixapis.com": [
57
+ {
58
+ srcPath: "/_api/metro-inspector",
59
+ destPath: "/api"
60
+ },
61
+ {
62
+ srcPath: "/metro-inspector",
63
+ destPath: ""
64
+ }
65
+ ],
66
+ "editor._base_domain_": [
67
+ {
68
+ srcPath: "/metro-insepctor",
69
+ destPath: ""
70
+ },
71
+ {
72
+ srcPath: "/_api/metro-inspector",
73
+ destPath: "/api"
74
+ }
75
+ ],
76
+ "blocks._base_domain_": [
77
+ {
78
+ srcPath: "/metro-insepctor",
79
+ destPath: ""
80
+ },
81
+ {
82
+ srcPath: "/_api/metro-inspector",
83
+ destPath: "/api"
84
+ }
85
+ ],
86
+ "create.editorx": [
87
+ {
88
+ srcPath: "/metro-insepctor",
89
+ destPath: ""
90
+ },
91
+ {
92
+ srcPath: "/_api/metro-inspector",
93
+ destPath: "/api"
94
+ }
95
+ ]
96
+ };
97
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
98
+ }
99
+ var PACKAGE_NAME = "@wix/auto_sdk_metro_products";
100
+ function createProduct(payload) {
101
+ function __createProduct({ host }) {
102
+ const serializedData = transformPaths(payload, [
103
+ {
104
+ transformFn: transformSDKTimestampToRESTTimestamp,
105
+ paths: [
106
+ { path: "product.createdDate" },
107
+ { path: "product.modifiedDate" },
108
+ { path: "product.image.urlExpirationDate" },
109
+ { path: "product.document.urlExpirationDate" },
110
+ { path: "product.document.thumbnail.urlExpirationDate" },
111
+ { path: "product.video.urlExpirationDate" },
112
+ { path: "product.video.resolutions.urlExpirationDate" },
113
+ { path: "product.video.resolutions.poster.urlExpirationDate" },
114
+ { path: "product.video.posters.urlExpirationDate" },
115
+ { path: "product.audio.urlExpirationDate" },
116
+ { path: "product.variants.image.urlExpirationDate" },
117
+ { path: "product.mainVariant.image.urlExpirationDate" }
118
+ ]
119
+ },
120
+ {
121
+ transformFn: transformSDKFloatToRESTFloat,
122
+ paths: [
123
+ { path: "product.image.focalPoint.x" },
124
+ { path: "product.image.focalPoint.y" },
125
+ { path: "product.document.thumbnail.focalPoint.x" },
126
+ { path: "product.document.thumbnail.focalPoint.y" },
127
+ { path: "product.video.resolutions.poster.focalPoint.x" },
128
+ { path: "product.video.resolutions.poster.focalPoint.y" },
129
+ { path: "product.video.posters.focalPoint.x" },
130
+ { path: "product.video.posters.focalPoint.y" },
131
+ { path: "product.variants.image.focalPoint.x" },
132
+ { path: "product.variants.image.focalPoint.y" },
133
+ { path: "product.mainVariant.image.focalPoint.x" },
134
+ { path: "product.mainVariant.image.focalPoint.y" },
135
+ { path: "product.address.geocode.latitude" },
136
+ { path: "product.address.geocode.longitude" }
137
+ ]
138
+ }
139
+ ]);
140
+ const metadata = {
141
+ entityFqdn: "wix.metroinspector.v1.product",
142
+ method: "POST",
143
+ methodFqn: "wix.coreservices.metroinspector.v1.products.ProductsService.CreateProduct",
144
+ packageName: PACKAGE_NAME,
145
+ url: resolveWixCoreservicesMetroinspectorV1ProductsProductsServiceUrl({
146
+ protoPath: "/api/v1/products",
147
+ data: serializedData,
148
+ host
149
+ }),
150
+ data: serializedData,
151
+ transformResponse: (payload2) => transformPaths(payload2, [
152
+ {
153
+ transformFn: transformRESTTimestampToSDKTimestamp,
154
+ paths: [
155
+ { path: "product.createdDate" },
156
+ { path: "product.modifiedDate" },
157
+ { path: "product.image.urlExpirationDate" },
158
+ { path: "product.document.urlExpirationDate" },
159
+ { path: "product.document.thumbnail.urlExpirationDate" },
160
+ { path: "product.video.urlExpirationDate" },
161
+ { path: "product.video.resolutions.urlExpirationDate" },
162
+ { path: "product.video.resolutions.poster.urlExpirationDate" },
163
+ { path: "product.video.posters.urlExpirationDate" },
164
+ { path: "product.audio.urlExpirationDate" },
165
+ { path: "product.variants.image.urlExpirationDate" },
166
+ { path: "product.mainVariant.image.urlExpirationDate" }
167
+ ]
168
+ },
169
+ {
170
+ transformFn: transformRESTFloatToSDKFloat,
171
+ paths: [
172
+ { path: "product.image.focalPoint.x" },
173
+ { path: "product.image.focalPoint.y" },
174
+ { path: "product.document.thumbnail.focalPoint.x" },
175
+ { path: "product.document.thumbnail.focalPoint.y" },
176
+ { path: "product.video.resolutions.poster.focalPoint.x" },
177
+ { path: "product.video.resolutions.poster.focalPoint.y" },
178
+ { path: "product.video.posters.focalPoint.x" },
179
+ { path: "product.video.posters.focalPoint.y" },
180
+ { path: "product.variants.image.focalPoint.x" },
181
+ { path: "product.variants.image.focalPoint.y" },
182
+ { path: "product.mainVariant.image.focalPoint.x" },
183
+ { path: "product.mainVariant.image.focalPoint.y" },
184
+ { path: "product.address.geocode.latitude" },
185
+ { path: "product.address.geocode.longitude" }
186
+ ]
187
+ }
188
+ ])
189
+ };
190
+ return metadata;
191
+ }
192
+ return __createProduct;
193
+ }
194
+ function deleteProduct(payload) {
195
+ function __deleteProduct({ host }) {
196
+ const metadata = {
197
+ entityFqdn: "wix.metroinspector.v1.product",
198
+ method: "DELETE",
199
+ methodFqn: "wix.coreservices.metroinspector.v1.products.ProductsService.DeleteProduct",
200
+ packageName: PACKAGE_NAME,
201
+ url: resolveWixCoreservicesMetroinspectorV1ProductsProductsServiceUrl({
202
+ protoPath: "/api/v1/products/{productId}",
203
+ data: payload,
204
+ host
205
+ }),
206
+ params: toURLSearchParams(payload)
207
+ };
208
+ return metadata;
209
+ }
210
+ return __deleteProduct;
211
+ }
212
+ function updateProduct(payload) {
213
+ function __updateProduct({ host }) {
214
+ const serializedData = transformPaths(payload, [
215
+ {
216
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
217
+ paths: [{ path: "mask" }]
218
+ },
219
+ {
220
+ transformFn: transformSDKTimestampToRESTTimestamp,
221
+ paths: [
222
+ { path: "product.createdDate" },
223
+ { path: "product.modifiedDate" },
224
+ { path: "product.image.urlExpirationDate" },
225
+ { path: "product.document.urlExpirationDate" },
226
+ { path: "product.document.thumbnail.urlExpirationDate" },
227
+ { path: "product.video.urlExpirationDate" },
228
+ { path: "product.video.resolutions.urlExpirationDate" },
229
+ { path: "product.video.resolutions.poster.urlExpirationDate" },
230
+ { path: "product.video.posters.urlExpirationDate" },
231
+ { path: "product.audio.urlExpirationDate" },
232
+ { path: "product.variants.image.urlExpirationDate" },
233
+ { path: "product.mainVariant.image.urlExpirationDate" }
234
+ ]
235
+ },
236
+ {
237
+ transformFn: transformSDKFloatToRESTFloat,
238
+ paths: [
239
+ { path: "product.image.focalPoint.x" },
240
+ { path: "product.image.focalPoint.y" },
241
+ { path: "product.document.thumbnail.focalPoint.x" },
242
+ { path: "product.document.thumbnail.focalPoint.y" },
243
+ { path: "product.video.resolutions.poster.focalPoint.x" },
244
+ { path: "product.video.resolutions.poster.focalPoint.y" },
245
+ { path: "product.video.posters.focalPoint.x" },
246
+ { path: "product.video.posters.focalPoint.y" },
247
+ { path: "product.variants.image.focalPoint.x" },
248
+ { path: "product.variants.image.focalPoint.y" },
249
+ { path: "product.mainVariant.image.focalPoint.x" },
250
+ { path: "product.mainVariant.image.focalPoint.y" },
251
+ { path: "product.address.geocode.latitude" },
252
+ { path: "product.address.geocode.longitude" }
253
+ ]
254
+ }
255
+ ]);
256
+ const metadata = {
257
+ entityFqdn: "wix.metroinspector.v1.product",
258
+ method: "PUT",
259
+ methodFqn: "wix.coreservices.metroinspector.v1.products.ProductsService.UpdateProduct",
260
+ packageName: PACKAGE_NAME,
261
+ url: resolveWixCoreservicesMetroinspectorV1ProductsProductsServiceUrl({
262
+ protoPath: "/api/v1/products/{productId}",
263
+ data: serializedData,
264
+ host
265
+ }),
266
+ data: serializedData,
267
+ transformResponse: (payload2) => transformPaths(payload2, [
268
+ {
269
+ transformFn: transformRESTTimestampToSDKTimestamp,
270
+ paths: [
271
+ { path: "product.createdDate" },
272
+ { path: "product.modifiedDate" },
273
+ { path: "product.image.urlExpirationDate" },
274
+ { path: "product.document.urlExpirationDate" },
275
+ { path: "product.document.thumbnail.urlExpirationDate" },
276
+ { path: "product.video.urlExpirationDate" },
277
+ { path: "product.video.resolutions.urlExpirationDate" },
278
+ { path: "product.video.resolutions.poster.urlExpirationDate" },
279
+ { path: "product.video.posters.urlExpirationDate" },
280
+ { path: "product.audio.urlExpirationDate" },
281
+ { path: "product.variants.image.urlExpirationDate" },
282
+ { path: "product.mainVariant.image.urlExpirationDate" }
283
+ ]
284
+ },
285
+ {
286
+ transformFn: transformRESTFloatToSDKFloat,
287
+ paths: [
288
+ { path: "product.image.focalPoint.x" },
289
+ { path: "product.image.focalPoint.y" },
290
+ { path: "product.document.thumbnail.focalPoint.x" },
291
+ { path: "product.document.thumbnail.focalPoint.y" },
292
+ { path: "product.video.resolutions.poster.focalPoint.x" },
293
+ { path: "product.video.resolutions.poster.focalPoint.y" },
294
+ { path: "product.video.posters.focalPoint.x" },
295
+ { path: "product.video.posters.focalPoint.y" },
296
+ { path: "product.variants.image.focalPoint.x" },
297
+ { path: "product.variants.image.focalPoint.y" },
298
+ { path: "product.mainVariant.image.focalPoint.x" },
299
+ { path: "product.mainVariant.image.focalPoint.y" },
300
+ { path: "product.address.geocode.latitude" },
301
+ { path: "product.address.geocode.longitude" }
302
+ ]
303
+ }
304
+ ])
305
+ };
306
+ return metadata;
307
+ }
308
+ return __updateProduct;
309
+ }
310
+ function getProduct(payload) {
311
+ function __getProduct({ host }) {
312
+ const metadata = {
313
+ entityFqdn: "wix.metroinspector.v1.product",
314
+ method: "GET",
315
+ methodFqn: "wix.coreservices.metroinspector.v1.products.ProductsService.GetProduct",
316
+ packageName: PACKAGE_NAME,
317
+ url: resolveWixCoreservicesMetroinspectorV1ProductsProductsServiceUrl({
318
+ protoPath: "/api/v1/products/{productId}",
319
+ data: payload,
320
+ host
321
+ }),
322
+ params: toURLSearchParams(payload),
323
+ transformResponse: (payload2) => transformPaths(payload2, [
324
+ {
325
+ transformFn: transformRESTTimestampToSDKTimestamp,
326
+ paths: [
327
+ { path: "product.createdDate" },
328
+ { path: "product.modifiedDate" },
329
+ { path: "product.image.urlExpirationDate" },
330
+ { path: "product.document.urlExpirationDate" },
331
+ { path: "product.document.thumbnail.urlExpirationDate" },
332
+ { path: "product.video.urlExpirationDate" },
333
+ { path: "product.video.resolutions.urlExpirationDate" },
334
+ { path: "product.video.resolutions.poster.urlExpirationDate" },
335
+ { path: "product.video.posters.urlExpirationDate" },
336
+ { path: "product.audio.urlExpirationDate" },
337
+ { path: "product.variants.image.urlExpirationDate" },
338
+ { path: "product.mainVariant.image.urlExpirationDate" }
339
+ ]
340
+ },
341
+ {
342
+ transformFn: transformRESTFloatToSDKFloat,
343
+ paths: [
344
+ { path: "product.image.focalPoint.x" },
345
+ { path: "product.image.focalPoint.y" },
346
+ { path: "product.document.thumbnail.focalPoint.x" },
347
+ { path: "product.document.thumbnail.focalPoint.y" },
348
+ { path: "product.video.resolutions.poster.focalPoint.x" },
349
+ { path: "product.video.resolutions.poster.focalPoint.y" },
350
+ { path: "product.video.posters.focalPoint.x" },
351
+ { path: "product.video.posters.focalPoint.y" },
352
+ { path: "product.variants.image.focalPoint.x" },
353
+ { path: "product.variants.image.focalPoint.y" },
354
+ { path: "product.mainVariant.image.focalPoint.x" },
355
+ { path: "product.mainVariant.image.focalPoint.y" },
356
+ { path: "product.address.geocode.latitude" },
357
+ { path: "product.address.geocode.longitude" }
358
+ ]
359
+ }
360
+ ])
361
+ };
362
+ return metadata;
363
+ }
364
+ return __getProduct;
365
+ }
366
+ function countProducts(payload) {
367
+ function __countProducts({ host }) {
368
+ const metadata = {
369
+ entityFqdn: "wix.metroinspector.v1.product",
370
+ method: "POST",
371
+ methodFqn: "wix.coreservices.metroinspector.v1.products.ProductsService.CountProducts",
372
+ packageName: PACKAGE_NAME,
373
+ url: resolveWixCoreservicesMetroinspectorV1ProductsProductsServiceUrl({
374
+ protoPath: "/api/v1/products/count",
375
+ data: payload,
376
+ host
377
+ }),
378
+ data: payload
379
+ };
380
+ return metadata;
381
+ }
382
+ return __countProducts;
383
+ }
384
+ function getProductsStartWith(payload) {
385
+ function __getProductsStartWith({ host }) {
386
+ const metadata = {
387
+ entityFqdn: "wix.metroinspector.v1.product",
388
+ method: "GET",
389
+ methodFqn: "wix.coreservices.metroinspector.v1.products.ProductsService.GetProductsStartWith",
390
+ packageName: PACKAGE_NAME,
391
+ url: resolveWixCoreservicesMetroinspectorV1ProductsProductsServiceUrl({
392
+ protoPath: "/api/v1/products/start-with/{title}",
393
+ data: payload,
394
+ host
395
+ }),
396
+ params: toURLSearchParams(payload),
397
+ transformResponse: (payload2) => transformPaths(payload2, [
398
+ {
399
+ transformFn: transformRESTTimestampToSDKTimestamp,
400
+ paths: [
401
+ { path: "products.createdDate" },
402
+ { path: "products.modifiedDate" },
403
+ { path: "products.image.urlExpirationDate" },
404
+ { path: "products.document.urlExpirationDate" },
405
+ { path: "products.document.thumbnail.urlExpirationDate" },
406
+ { path: "products.video.urlExpirationDate" },
407
+ { path: "products.video.resolutions.urlExpirationDate" },
408
+ { path: "products.video.resolutions.poster.urlExpirationDate" },
409
+ { path: "products.video.posters.urlExpirationDate" },
410
+ { path: "products.audio.urlExpirationDate" },
411
+ { path: "products.variants.image.urlExpirationDate" },
412
+ { path: "products.mainVariant.image.urlExpirationDate" }
413
+ ]
414
+ },
415
+ {
416
+ transformFn: transformRESTFloatToSDKFloat,
417
+ paths: [
418
+ { path: "products.image.focalPoint.x" },
419
+ { path: "products.image.focalPoint.y" },
420
+ { path: "products.document.thumbnail.focalPoint.x" },
421
+ { path: "products.document.thumbnail.focalPoint.y" },
422
+ { path: "products.video.resolutions.poster.focalPoint.x" },
423
+ { path: "products.video.resolutions.poster.focalPoint.y" },
424
+ { path: "products.video.posters.focalPoint.x" },
425
+ { path: "products.video.posters.focalPoint.y" },
426
+ { path: "products.variants.image.focalPoint.x" },
427
+ { path: "products.variants.image.focalPoint.y" },
428
+ { path: "products.mainVariant.image.focalPoint.x" },
429
+ { path: "products.mainVariant.image.focalPoint.y" },
430
+ { path: "products.address.geocode.latitude" },
431
+ { path: "products.address.geocode.longitude" }
432
+ ]
433
+ }
434
+ ])
435
+ };
436
+ return metadata;
437
+ }
438
+ return __getProductsStartWith;
439
+ }
440
+ function queryProducts(payload) {
441
+ function __queryProducts({ host }) {
442
+ const metadata = {
443
+ entityFqdn: "wix.metroinspector.v1.product",
444
+ method: "GET",
445
+ methodFqn: "wix.coreservices.metroinspector.v1.products.ProductsService.QueryProducts",
446
+ packageName: PACKAGE_NAME,
447
+ url: resolveWixCoreservicesMetroinspectorV1ProductsProductsServiceUrl({
448
+ protoPath: "/api/v1/query-products",
449
+ data: payload,
450
+ host
451
+ }),
452
+ params: toURLSearchParams(payload, true),
453
+ transformResponse: (payload2) => transformPaths(payload2, [
454
+ {
455
+ transformFn: transformRESTTimestampToSDKTimestamp,
456
+ paths: [
457
+ { path: "products.createdDate" },
458
+ { path: "products.modifiedDate" },
459
+ { path: "products.image.urlExpirationDate" },
460
+ { path: "products.document.urlExpirationDate" },
461
+ { path: "products.document.thumbnail.urlExpirationDate" },
462
+ { path: "products.video.urlExpirationDate" },
463
+ { path: "products.video.resolutions.urlExpirationDate" },
464
+ { path: "products.video.resolutions.poster.urlExpirationDate" },
465
+ { path: "products.video.posters.urlExpirationDate" },
466
+ { path: "products.audio.urlExpirationDate" },
467
+ { path: "products.variants.image.urlExpirationDate" },
468
+ { path: "products.mainVariant.image.urlExpirationDate" }
469
+ ]
470
+ },
471
+ {
472
+ transformFn: transformRESTFloatToSDKFloat,
473
+ paths: [
474
+ { path: "products.image.focalPoint.x" },
475
+ { path: "products.image.focalPoint.y" },
476
+ { path: "products.document.thumbnail.focalPoint.x" },
477
+ { path: "products.document.thumbnail.focalPoint.y" },
478
+ { path: "products.video.resolutions.poster.focalPoint.x" },
479
+ { path: "products.video.resolutions.poster.focalPoint.y" },
480
+ { path: "products.video.posters.focalPoint.x" },
481
+ { path: "products.video.posters.focalPoint.y" },
482
+ { path: "products.variants.image.focalPoint.x" },
483
+ { path: "products.variants.image.focalPoint.y" },
484
+ { path: "products.mainVariant.image.focalPoint.x" },
485
+ { path: "products.mainVariant.image.focalPoint.y" },
486
+ { path: "products.address.geocode.latitude" },
487
+ { path: "products.address.geocode.longitude" }
488
+ ]
489
+ }
490
+ ]),
491
+ fallback: [
492
+ {
493
+ method: "POST",
494
+ url: resolveWixCoreservicesMetroinspectorV1ProductsProductsServiceUrl(
495
+ { protoPath: "/api/v1/query-products", data: payload, host }
496
+ ),
497
+ data: payload
498
+ }
499
+ ]
500
+ };
501
+ return metadata;
502
+ }
503
+ return __queryProducts;
504
+ }
505
+ function bulkCreateProducts(payload) {
506
+ function __bulkCreateProducts({ host }) {
507
+ const serializedData = transformPaths(payload, [
508
+ {
509
+ transformFn: transformSDKTimestampToRESTTimestamp,
510
+ paths: [
511
+ { path: "products.createdDate" },
512
+ { path: "products.modifiedDate" },
513
+ { path: "products.image.urlExpirationDate" },
514
+ { path: "products.document.urlExpirationDate" },
515
+ { path: "products.document.thumbnail.urlExpirationDate" },
516
+ { path: "products.video.urlExpirationDate" },
517
+ { path: "products.video.resolutions.urlExpirationDate" },
518
+ { path: "products.video.resolutions.poster.urlExpirationDate" },
519
+ { path: "products.video.posters.urlExpirationDate" },
520
+ { path: "products.audio.urlExpirationDate" },
521
+ { path: "products.variants.image.urlExpirationDate" },
522
+ { path: "products.mainVariant.image.urlExpirationDate" }
523
+ ]
524
+ },
525
+ {
526
+ transformFn: transformSDKFloatToRESTFloat,
527
+ paths: [
528
+ { path: "products.image.focalPoint.x" },
529
+ { path: "products.image.focalPoint.y" },
530
+ { path: "products.document.thumbnail.focalPoint.x" },
531
+ { path: "products.document.thumbnail.focalPoint.y" },
532
+ { path: "products.video.resolutions.poster.focalPoint.x" },
533
+ { path: "products.video.resolutions.poster.focalPoint.y" },
534
+ { path: "products.video.posters.focalPoint.x" },
535
+ { path: "products.video.posters.focalPoint.y" },
536
+ { path: "products.variants.image.focalPoint.x" },
537
+ { path: "products.variants.image.focalPoint.y" },
538
+ { path: "products.mainVariant.image.focalPoint.x" },
539
+ { path: "products.mainVariant.image.focalPoint.y" },
540
+ { path: "products.address.geocode.latitude" },
541
+ { path: "products.address.geocode.longitude" }
542
+ ]
543
+ }
544
+ ]);
545
+ const metadata = {
546
+ entityFqdn: "wix.metroinspector.v1.product",
547
+ method: "POST",
548
+ methodFqn: "wix.coreservices.metroinspector.v1.products.ProductsService.BulkCreateProducts",
549
+ packageName: PACKAGE_NAME,
550
+ url: resolveWixCoreservicesMetroinspectorV1ProductsProductsServiceUrl({
551
+ protoPath: "/api/v1/bulk/products/create",
552
+ data: serializedData,
553
+ host
554
+ }),
555
+ data: serializedData,
556
+ transformResponse: (payload2) => transformPaths(payload2, [
557
+ {
558
+ transformFn: transformRESTTimestampToSDKTimestamp,
559
+ paths: [
560
+ { path: "results.item.createdDate" },
561
+ { path: "results.item.modifiedDate" },
562
+ { path: "results.item.image.urlExpirationDate" },
563
+ { path: "results.item.document.urlExpirationDate" },
564
+ { path: "results.item.document.thumbnail.urlExpirationDate" },
565
+ { path: "results.item.video.urlExpirationDate" },
566
+ { path: "results.item.video.resolutions.urlExpirationDate" },
567
+ {
568
+ path: "results.item.video.resolutions.poster.urlExpirationDate"
569
+ },
570
+ { path: "results.item.video.posters.urlExpirationDate" },
571
+ { path: "results.item.audio.urlExpirationDate" },
572
+ { path: "results.item.variants.image.urlExpirationDate" },
573
+ { path: "results.item.mainVariant.image.urlExpirationDate" }
574
+ ]
575
+ },
576
+ {
577
+ transformFn: transformRESTFloatToSDKFloat,
578
+ paths: [
579
+ { path: "results.item.image.focalPoint.x" },
580
+ { path: "results.item.image.focalPoint.y" },
581
+ { path: "results.item.document.thumbnail.focalPoint.x" },
582
+ { path: "results.item.document.thumbnail.focalPoint.y" },
583
+ { path: "results.item.video.resolutions.poster.focalPoint.x" },
584
+ { path: "results.item.video.resolutions.poster.focalPoint.y" },
585
+ { path: "results.item.video.posters.focalPoint.x" },
586
+ { path: "results.item.video.posters.focalPoint.y" },
587
+ { path: "results.item.variants.image.focalPoint.x" },
588
+ { path: "results.item.variants.image.focalPoint.y" },
589
+ { path: "results.item.mainVariant.image.focalPoint.x" },
590
+ { path: "results.item.mainVariant.image.focalPoint.y" },
591
+ { path: "results.item.address.geocode.latitude" },
592
+ { path: "results.item.address.geocode.longitude" }
593
+ ]
594
+ }
595
+ ])
596
+ };
597
+ return metadata;
598
+ }
599
+ return __bulkCreateProducts;
600
+ }
601
+ function bulkUpdateProducts(payload) {
602
+ function __bulkUpdateProducts({ host }) {
603
+ const serializedData = transformPaths(payload, [
604
+ {
605
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
606
+ paths: [{ path: "products.fieldMask" }]
607
+ },
608
+ {
609
+ transformFn: transformSDKTimestampToRESTTimestamp,
610
+ paths: [
611
+ { path: "products.product.createdDate" },
612
+ { path: "products.product.modifiedDate" },
613
+ { path: "products.product.image.urlExpirationDate" },
614
+ { path: "products.product.document.urlExpirationDate" },
615
+ { path: "products.product.document.thumbnail.urlExpirationDate" },
616
+ { path: "products.product.video.urlExpirationDate" },
617
+ { path: "products.product.video.resolutions.urlExpirationDate" },
618
+ {
619
+ path: "products.product.video.resolutions.poster.urlExpirationDate"
620
+ },
621
+ { path: "products.product.video.posters.urlExpirationDate" },
622
+ { path: "products.product.audio.urlExpirationDate" },
623
+ { path: "products.product.variants.image.urlExpirationDate" },
624
+ { path: "products.product.mainVariant.image.urlExpirationDate" }
625
+ ]
626
+ },
627
+ {
628
+ transformFn: transformSDKFloatToRESTFloat,
629
+ paths: [
630
+ { path: "products.product.image.focalPoint.x" },
631
+ { path: "products.product.image.focalPoint.y" },
632
+ { path: "products.product.document.thumbnail.focalPoint.x" },
633
+ { path: "products.product.document.thumbnail.focalPoint.y" },
634
+ { path: "products.product.video.resolutions.poster.focalPoint.x" },
635
+ { path: "products.product.video.resolutions.poster.focalPoint.y" },
636
+ { path: "products.product.video.posters.focalPoint.x" },
637
+ { path: "products.product.video.posters.focalPoint.y" },
638
+ { path: "products.product.variants.image.focalPoint.x" },
639
+ { path: "products.product.variants.image.focalPoint.y" },
640
+ { path: "products.product.mainVariant.image.focalPoint.x" },
641
+ { path: "products.product.mainVariant.image.focalPoint.y" },
642
+ { path: "products.product.address.geocode.latitude" },
643
+ { path: "products.product.address.geocode.longitude" }
644
+ ]
645
+ }
646
+ ]);
647
+ const metadata = {
648
+ entityFqdn: "wix.metroinspector.v1.product",
649
+ method: "PATCH",
650
+ methodFqn: "wix.coreservices.metroinspector.v1.products.ProductsService.BulkUpdateProducts",
651
+ packageName: PACKAGE_NAME,
652
+ url: resolveWixCoreservicesMetroinspectorV1ProductsProductsServiceUrl({
653
+ protoPath: "/api/v1/bulk/products/update",
654
+ data: serializedData,
655
+ host
656
+ }),
657
+ data: serializedData,
658
+ transformResponse: (payload2) => transformPaths(payload2, [
659
+ {
660
+ transformFn: transformRESTTimestampToSDKTimestamp,
661
+ paths: [
662
+ { path: "results.item.createdDate" },
663
+ { path: "results.item.modifiedDate" },
664
+ { path: "results.item.image.urlExpirationDate" },
665
+ { path: "results.item.document.urlExpirationDate" },
666
+ { path: "results.item.document.thumbnail.urlExpirationDate" },
667
+ { path: "results.item.video.urlExpirationDate" },
668
+ { path: "results.item.video.resolutions.urlExpirationDate" },
669
+ {
670
+ path: "results.item.video.resolutions.poster.urlExpirationDate"
671
+ },
672
+ { path: "results.item.video.posters.urlExpirationDate" },
673
+ { path: "results.item.audio.urlExpirationDate" },
674
+ { path: "results.item.variants.image.urlExpirationDate" },
675
+ { path: "results.item.mainVariant.image.urlExpirationDate" }
676
+ ]
677
+ },
678
+ {
679
+ transformFn: transformRESTFloatToSDKFloat,
680
+ paths: [
681
+ { path: "results.item.image.focalPoint.x" },
682
+ { path: "results.item.image.focalPoint.y" },
683
+ { path: "results.item.document.thumbnail.focalPoint.x" },
684
+ { path: "results.item.document.thumbnail.focalPoint.y" },
685
+ { path: "results.item.video.resolutions.poster.focalPoint.x" },
686
+ { path: "results.item.video.resolutions.poster.focalPoint.y" },
687
+ { path: "results.item.video.posters.focalPoint.x" },
688
+ { path: "results.item.video.posters.focalPoint.y" },
689
+ { path: "results.item.variants.image.focalPoint.x" },
690
+ { path: "results.item.variants.image.focalPoint.y" },
691
+ { path: "results.item.mainVariant.image.focalPoint.x" },
692
+ { path: "results.item.mainVariant.image.focalPoint.y" },
693
+ { path: "results.item.address.geocode.latitude" },
694
+ { path: "results.item.address.geocode.longitude" }
695
+ ]
696
+ }
697
+ ])
698
+ };
699
+ return metadata;
700
+ }
701
+ return __bulkUpdateProducts;
702
+ }
703
+ function bulkDeleteProducts(payload) {
704
+ function __bulkDeleteProducts({ host }) {
705
+ const metadata = {
706
+ entityFqdn: "wix.metroinspector.v1.product",
707
+ method: "POST",
708
+ methodFqn: "wix.coreservices.metroinspector.v1.products.ProductsService.BulkDeleteProducts",
709
+ packageName: PACKAGE_NAME,
710
+ url: resolveWixCoreservicesMetroinspectorV1ProductsProductsServiceUrl({
711
+ protoPath: "/api/v1/bulk/products/delete",
712
+ data: payload,
713
+ host
714
+ }),
715
+ data: payload
716
+ };
717
+ return metadata;
718
+ }
719
+ return __bulkDeleteProducts;
720
+ }
721
+
722
+ // src/metroinspector-v1-product-products.universal.ts
723
+ import { transformSDKAudioToRESTAudio } from "@wix/sdk-runtime/transformations/audio";
724
+ import { transformRESTAudioToSDKAudio } from "@wix/sdk-runtime/transformations/audio";
725
+ import { transformSDKAddressToRESTAddress } from "@wix/sdk-runtime/transformations/address";
726
+ import { transformRESTAddressToSDKAddress } from "@wix/sdk-runtime/transformations/address";
727
+ import { transformSDKImageToRESTImage } from "@wix/sdk-runtime/transformations/image";
728
+ import { transformRESTImageToSDKImage } from "@wix/sdk-runtime/transformations/image";
729
+ import { transformSDKVideoV2ToRESTVideoV2 } from "@wix/sdk-runtime/transformations/video-v2";
730
+ import { transformRESTVideoV2ToSDKVideoV2 } from "@wix/sdk-runtime/transformations/video-v2";
731
+ import { transformSDKDocumentToRESTDocument } from "@wix/sdk-runtime/transformations/document";
732
+ import { transformRESTDocumentToSDKDocument } from "@wix/sdk-runtime/transformations/document";
733
+ import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
734
+ var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
735
+ SubdivisionType2["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
736
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
737
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
738
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
739
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
740
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
741
+ SubdivisionType2["COUNTRY"] = "COUNTRY";
742
+ return SubdivisionType2;
743
+ })(SubdivisionType || {});
744
+ var LinkRel = /* @__PURE__ */ ((LinkRel2) => {
745
+ LinkRel2["unknown_link_rel"] = "unknown_link_rel";
746
+ LinkRel2["nofollow"] = "nofollow";
747
+ LinkRel2["noopener"] = "noopener";
748
+ LinkRel2["noreferrer"] = "noreferrer";
749
+ LinkRel2["sponsored"] = "sponsored";
750
+ return LinkRel2;
751
+ })(LinkRel || {});
752
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
753
+ SortOrder2["ASC"] = "ASC";
754
+ SortOrder2["DESC"] = "DESC";
755
+ return SortOrder2;
756
+ })(SortOrder || {});
757
+ async function createProduct2(options) {
758
+ const { httpClient, sideEffects } = arguments[1];
759
+ const payload = transformPaths2(
760
+ renameKeysFromSDKRequestToRESTRequest({ product: options?.product }),
761
+ [
762
+ {
763
+ transformFn: transformSDKImageToRESTImage,
764
+ paths: [
765
+ { path: "product.image" },
766
+ { path: "product.variants.image" },
767
+ { path: "product.mainVariant.image" }
768
+ ]
769
+ },
770
+ {
771
+ transformFn: transformSDKAddressToRESTAddress,
772
+ paths: [{ path: "product.address" }, { path: "product.customAddress" }]
773
+ },
774
+ {
775
+ transformFn: transformSDKDocumentToRESTDocument,
776
+ paths: [{ path: "product.document" }]
777
+ },
778
+ {
779
+ transformFn: transformSDKVideoV2ToRESTVideoV2,
780
+ paths: [{ path: "product.video" }]
781
+ },
782
+ {
783
+ transformFn: transformSDKAudioToRESTAudio,
784
+ paths: [{ path: "product.audio" }]
785
+ }
786
+ ]
787
+ );
788
+ const reqOpts = createProduct(payload);
789
+ sideEffects?.onSiteCall?.();
790
+ try {
791
+ const result = await httpClient.request(reqOpts);
792
+ sideEffects?.onSuccess?.(result);
793
+ return renameKeysFromRESTResponseToSDKResponse(
794
+ transformPaths2(result.data, [
795
+ {
796
+ transformFn: transformRESTImageToSDKImage,
797
+ paths: [
798
+ { path: "product.image" },
799
+ { path: "product.variants.image" },
800
+ { path: "product.mainVariant.image" }
801
+ ]
802
+ },
803
+ {
804
+ transformFn: transformRESTAddressToSDKAddress,
805
+ paths: [
806
+ { path: "product.address" },
807
+ { path: "product.customAddress" }
808
+ ]
809
+ },
810
+ {
811
+ transformFn: transformRESTDocumentToSDKDocument,
812
+ paths: [{ path: "product.document" }]
813
+ },
814
+ {
815
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
816
+ paths: [{ path: "product.video" }]
817
+ },
818
+ {
819
+ transformFn: transformRESTAudioToSDKAudio,
820
+ paths: [{ path: "product.audio" }]
821
+ }
822
+ ])
823
+ )?.product;
824
+ } catch (err) {
825
+ const transformedError = sdkTransformError(
826
+ err,
827
+ {
828
+ spreadPathsToArguments: {},
829
+ explicitPathsToArguments: { product: "$[0].product" },
830
+ singleArgumentUnchanged: false
831
+ },
832
+ ["options"]
833
+ );
834
+ sideEffects?.onError?.(err);
835
+ throw transformedError;
836
+ }
837
+ }
838
+ async function deleteProduct2(productId) {
839
+ const { httpClient, sideEffects } = arguments[1];
840
+ const payload = renameKeysFromSDKRequestToRESTRequest({
841
+ productId
842
+ });
843
+ const reqOpts = deleteProduct(payload);
844
+ sideEffects?.onSiteCall?.();
845
+ try {
846
+ const result = await httpClient.request(reqOpts);
847
+ sideEffects?.onSuccess?.(result);
848
+ } catch (err) {
849
+ const transformedError = sdkTransformError(
850
+ err,
851
+ {
852
+ spreadPathsToArguments: {},
853
+ explicitPathsToArguments: { productId: "$[0]" },
854
+ singleArgumentUnchanged: false
855
+ },
856
+ ["productId"]
857
+ );
858
+ sideEffects?.onError?.(err);
859
+ throw transformedError;
860
+ }
861
+ }
862
+ async function updateProduct2(productId, options) {
863
+ const { httpClient, sideEffects } = arguments[2];
864
+ const payload = transformPaths2(
865
+ renameKeysFromSDKRequestToRESTRequest({
866
+ productId,
867
+ product: options?.product,
868
+ mask: options?.mask
869
+ }),
870
+ [
871
+ {
872
+ transformFn: transformSDKImageToRESTImage,
873
+ paths: [
874
+ { path: "product.image" },
875
+ { path: "product.variants.image" },
876
+ { path: "product.mainVariant.image" }
877
+ ]
878
+ },
879
+ {
880
+ transformFn: transformSDKAddressToRESTAddress,
881
+ paths: [{ path: "product.address" }, { path: "product.customAddress" }]
882
+ },
883
+ {
884
+ transformFn: transformSDKDocumentToRESTDocument,
885
+ paths: [{ path: "product.document" }]
886
+ },
887
+ {
888
+ transformFn: transformSDKVideoV2ToRESTVideoV2,
889
+ paths: [{ path: "product.video" }]
890
+ },
891
+ {
892
+ transformFn: transformSDKAudioToRESTAudio,
893
+ paths: [{ path: "product.audio" }]
894
+ }
895
+ ]
896
+ );
897
+ const reqOpts = updateProduct(payload);
898
+ sideEffects?.onSiteCall?.();
899
+ try {
900
+ const result = await httpClient.request(reqOpts);
901
+ sideEffects?.onSuccess?.(result);
902
+ return renameKeysFromRESTResponseToSDKResponse(
903
+ transformPaths2(result.data, [
904
+ {
905
+ transformFn: transformRESTImageToSDKImage,
906
+ paths: [
907
+ { path: "product.image" },
908
+ { path: "product.variants.image" },
909
+ { path: "product.mainVariant.image" }
910
+ ]
911
+ },
912
+ {
913
+ transformFn: transformRESTAddressToSDKAddress,
914
+ paths: [
915
+ { path: "product.address" },
916
+ { path: "product.customAddress" }
917
+ ]
918
+ },
919
+ {
920
+ transformFn: transformRESTDocumentToSDKDocument,
921
+ paths: [{ path: "product.document" }]
922
+ },
923
+ {
924
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
925
+ paths: [{ path: "product.video" }]
926
+ },
927
+ {
928
+ transformFn: transformRESTAudioToSDKAudio,
929
+ paths: [{ path: "product.audio" }]
930
+ }
931
+ ])
932
+ )?.product;
933
+ } catch (err) {
934
+ const transformedError = sdkTransformError(
935
+ err,
936
+ {
937
+ spreadPathsToArguments: {},
938
+ explicitPathsToArguments: {
939
+ productId: "$[0]",
940
+ product: "$[1].product",
941
+ mask: "$[1].mask"
942
+ },
943
+ singleArgumentUnchanged: false
944
+ },
945
+ ["productId", "options"]
946
+ );
947
+ sideEffects?.onError?.(err);
948
+ throw transformedError;
949
+ }
950
+ }
951
+ async function getProduct2(productId) {
952
+ const { httpClient, sideEffects } = arguments[1];
953
+ const payload = renameKeysFromSDKRequestToRESTRequest({
954
+ productId
955
+ });
956
+ const reqOpts = getProduct(payload);
957
+ sideEffects?.onSiteCall?.();
958
+ try {
959
+ const result = await httpClient.request(reqOpts);
960
+ sideEffects?.onSuccess?.(result);
961
+ return renameKeysFromRESTResponseToSDKResponse(
962
+ transformPaths2(result.data, [
963
+ {
964
+ transformFn: transformRESTImageToSDKImage,
965
+ paths: [
966
+ { path: "product.image" },
967
+ { path: "product.variants.image" },
968
+ { path: "product.mainVariant.image" }
969
+ ]
970
+ },
971
+ {
972
+ transformFn: transformRESTAddressToSDKAddress,
973
+ paths: [
974
+ { path: "product.address" },
975
+ { path: "product.customAddress" }
976
+ ]
977
+ },
978
+ {
979
+ transformFn: transformRESTDocumentToSDKDocument,
980
+ paths: [{ path: "product.document" }]
981
+ },
982
+ {
983
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
984
+ paths: [{ path: "product.video" }]
985
+ },
986
+ {
987
+ transformFn: transformRESTAudioToSDKAudio,
988
+ paths: [{ path: "product.audio" }]
989
+ }
990
+ ])
991
+ )?.product;
992
+ } catch (err) {
993
+ const transformedError = sdkTransformError(
994
+ err,
995
+ {
996
+ spreadPathsToArguments: {},
997
+ explicitPathsToArguments: { productId: "$[0]" },
998
+ singleArgumentUnchanged: false
999
+ },
1000
+ ["productId"]
1001
+ );
1002
+ sideEffects?.onError?.(err);
1003
+ throw transformedError;
1004
+ }
1005
+ }
1006
+ async function countProducts2(options) {
1007
+ const { httpClient, sideEffects } = arguments[1];
1008
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1009
+ filter: options?.filter,
1010
+ includeVariants: options?.includeVariants,
1011
+ includeHiddenProducts: options?.includeHiddenProducts,
1012
+ includeMerchantSpecificData: options?.includeMerchantSpecificData
1013
+ });
1014
+ const reqOpts = countProducts(payload);
1015
+ sideEffects?.onSiteCall?.();
1016
+ try {
1017
+ const result = await httpClient.request(reqOpts);
1018
+ sideEffects?.onSuccess?.(result);
1019
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1020
+ } catch (err) {
1021
+ const transformedError = sdkTransformError(
1022
+ err,
1023
+ {
1024
+ spreadPathsToArguments: {},
1025
+ explicitPathsToArguments: {
1026
+ filter: "$[0].filter",
1027
+ includeVariants: "$[0].includeVariants",
1028
+ includeHiddenProducts: "$[0].includeHiddenProducts",
1029
+ includeMerchantSpecificData: "$[0].includeMerchantSpecificData"
1030
+ },
1031
+ singleArgumentUnchanged: false
1032
+ },
1033
+ ["options"]
1034
+ );
1035
+ sideEffects?.onError?.(err);
1036
+ throw transformedError;
1037
+ }
1038
+ }
1039
+ async function getProductsStartWith2(title, options) {
1040
+ const { httpClient, sideEffects } = arguments[2];
1041
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1042
+ title,
1043
+ addressLine2: options?.addressLine2
1044
+ });
1045
+ const reqOpts = getProductsStartWith(payload);
1046
+ sideEffects?.onSiteCall?.();
1047
+ try {
1048
+ const result = await httpClient.request(reqOpts);
1049
+ sideEffects?.onSuccess?.(result);
1050
+ return renameKeysFromRESTResponseToSDKResponse(
1051
+ transformPaths2(result.data, [
1052
+ {
1053
+ transformFn: transformRESTImageToSDKImage,
1054
+ paths: [
1055
+ { path: "products.image" },
1056
+ { path: "products.variants.image" },
1057
+ { path: "products.mainVariant.image" }
1058
+ ]
1059
+ },
1060
+ {
1061
+ transformFn: transformRESTAddressToSDKAddress,
1062
+ paths: [
1063
+ { path: "products.address" },
1064
+ { path: "products.customAddress" }
1065
+ ]
1066
+ },
1067
+ {
1068
+ transformFn: transformRESTDocumentToSDKDocument,
1069
+ paths: [{ path: "products.document" }]
1070
+ },
1071
+ {
1072
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1073
+ paths: [{ path: "products.video" }]
1074
+ },
1075
+ {
1076
+ transformFn: transformRESTAudioToSDKAudio,
1077
+ paths: [{ path: "products.audio" }]
1078
+ }
1079
+ ])
1080
+ );
1081
+ } catch (err) {
1082
+ const transformedError = sdkTransformError(
1083
+ err,
1084
+ {
1085
+ spreadPathsToArguments: {},
1086
+ explicitPathsToArguments: {
1087
+ title: "$[0]",
1088
+ addressLine2: "$[1].addressLine2"
1089
+ },
1090
+ singleArgumentUnchanged: false
1091
+ },
1092
+ ["title", "options"]
1093
+ );
1094
+ sideEffects?.onError?.(err);
1095
+ throw transformedError;
1096
+ }
1097
+ }
1098
+ function queryProducts2(options) {
1099
+ const { httpClient, sideEffects } = arguments[1];
1100
+ return queryBuilder({
1101
+ func: async (payload) => {
1102
+ const reqOpts = queryProducts({
1103
+ ...payload,
1104
+ ...options ?? {}
1105
+ });
1106
+ sideEffects?.onSiteCall?.();
1107
+ try {
1108
+ const result = await httpClient.request(reqOpts);
1109
+ sideEffects?.onSuccess?.(result);
1110
+ return result;
1111
+ } catch (err) {
1112
+ sideEffects?.onError?.(err);
1113
+ throw err;
1114
+ }
1115
+ },
1116
+ requestTransformer: (query) => {
1117
+ const args = [query, options];
1118
+ return renameKeysFromSDKRequestToRESTRequest({
1119
+ ...args?.[1],
1120
+ query: args?.[0]
1121
+ });
1122
+ },
1123
+ responseTransformer: ({ data }) => {
1124
+ const transformedData = renameKeysFromRESTResponseToSDKResponse(
1125
+ transformPaths2(data, [
1126
+ {
1127
+ transformFn: transformRESTImageToSDKImage,
1128
+ paths: [
1129
+ { path: "products.image" },
1130
+ { path: "products.variants.image" },
1131
+ { path: "products.mainVariant.image" }
1132
+ ]
1133
+ },
1134
+ {
1135
+ transformFn: transformRESTAddressToSDKAddress,
1136
+ paths: [
1137
+ { path: "products.address" },
1138
+ { path: "products.customAddress" }
1139
+ ]
1140
+ },
1141
+ {
1142
+ transformFn: transformRESTDocumentToSDKDocument,
1143
+ paths: [{ path: "products.document" }]
1144
+ },
1145
+ {
1146
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1147
+ paths: [{ path: "products.video" }]
1148
+ },
1149
+ {
1150
+ transformFn: transformRESTAudioToSDKAudio,
1151
+ paths: [{ path: "products.audio" }]
1152
+ }
1153
+ ])
1154
+ );
1155
+ return {
1156
+ items: transformedData?.products,
1157
+ pagingMetadata: transformedData?.metadata
1158
+ };
1159
+ },
1160
+ errorTransformer: (err) => {
1161
+ const transformedError = sdkTransformError(err, {
1162
+ spreadPathsToArguments: {},
1163
+ explicitPathsToArguments: { query: "$[0]" },
1164
+ singleArgumentUnchanged: false
1165
+ });
1166
+ throw transformedError;
1167
+ },
1168
+ pagingMethod: "CURSOR",
1169
+ transformationPaths: {}
1170
+ });
1171
+ }
1172
+ async function bulkCreateProducts2(products, options) {
1173
+ const { httpClient, sideEffects } = arguments[2];
1174
+ const payload = transformPaths2(
1175
+ renameKeysFromSDKRequestToRESTRequest({
1176
+ products,
1177
+ returnEntity: options?.returnEntity
1178
+ }),
1179
+ [
1180
+ {
1181
+ transformFn: transformSDKImageToRESTImage,
1182
+ paths: [
1183
+ { path: "products.image" },
1184
+ { path: "products.variants.image" },
1185
+ { path: "products.mainVariant.image" }
1186
+ ]
1187
+ },
1188
+ {
1189
+ transformFn: transformSDKAddressToRESTAddress,
1190
+ paths: [
1191
+ { path: "products.address" },
1192
+ { path: "products.customAddress" }
1193
+ ]
1194
+ },
1195
+ {
1196
+ transformFn: transformSDKDocumentToRESTDocument,
1197
+ paths: [{ path: "products.document" }]
1198
+ },
1199
+ {
1200
+ transformFn: transformSDKVideoV2ToRESTVideoV2,
1201
+ paths: [{ path: "products.video" }]
1202
+ },
1203
+ {
1204
+ transformFn: transformSDKAudioToRESTAudio,
1205
+ paths: [{ path: "products.audio" }]
1206
+ }
1207
+ ]
1208
+ );
1209
+ const reqOpts = bulkCreateProducts(payload);
1210
+ sideEffects?.onSiteCall?.();
1211
+ try {
1212
+ const result = await httpClient.request(reqOpts);
1213
+ sideEffects?.onSuccess?.(result);
1214
+ return renameKeysFromRESTResponseToSDKResponse(
1215
+ transformPaths2(result.data, [
1216
+ {
1217
+ transformFn: transformRESTImageToSDKImage,
1218
+ paths: [
1219
+ { path: "results.item.image" },
1220
+ { path: "results.item.variants.image" },
1221
+ { path: "results.item.mainVariant.image" }
1222
+ ]
1223
+ },
1224
+ {
1225
+ transformFn: transformRESTAddressToSDKAddress,
1226
+ paths: [
1227
+ { path: "results.item.address" },
1228
+ { path: "results.item.customAddress" }
1229
+ ]
1230
+ },
1231
+ {
1232
+ transformFn: transformRESTDocumentToSDKDocument,
1233
+ paths: [{ path: "results.item.document" }]
1234
+ },
1235
+ {
1236
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1237
+ paths: [{ path: "results.item.video" }]
1238
+ },
1239
+ {
1240
+ transformFn: transformRESTAudioToSDKAudio,
1241
+ paths: [{ path: "results.item.audio" }]
1242
+ }
1243
+ ])
1244
+ );
1245
+ } catch (err) {
1246
+ const transformedError = sdkTransformError(
1247
+ err,
1248
+ {
1249
+ spreadPathsToArguments: {},
1250
+ explicitPathsToArguments: {
1251
+ products: "$[0]",
1252
+ returnEntity: "$[1].returnEntity"
1253
+ },
1254
+ singleArgumentUnchanged: false
1255
+ },
1256
+ ["products", "options"]
1257
+ );
1258
+ sideEffects?.onError?.(err);
1259
+ throw transformedError;
1260
+ }
1261
+ }
1262
+ async function bulkUpdateProducts2(products, options) {
1263
+ const { httpClient, sideEffects } = arguments[2];
1264
+ const payload = transformPaths2(
1265
+ renameKeysFromSDKRequestToRESTRequest({
1266
+ products,
1267
+ returnEntity: options?.returnEntity
1268
+ }),
1269
+ [
1270
+ {
1271
+ transformFn: transformSDKImageToRESTImage,
1272
+ paths: [
1273
+ { path: "products.product.image" },
1274
+ { path: "products.product.variants.image" },
1275
+ { path: "products.product.mainVariant.image" }
1276
+ ]
1277
+ },
1278
+ {
1279
+ transformFn: transformSDKAddressToRESTAddress,
1280
+ paths: [
1281
+ { path: "products.product.address" },
1282
+ { path: "products.product.customAddress" }
1283
+ ]
1284
+ },
1285
+ {
1286
+ transformFn: transformSDKDocumentToRESTDocument,
1287
+ paths: [{ path: "products.product.document" }]
1288
+ },
1289
+ {
1290
+ transformFn: transformSDKVideoV2ToRESTVideoV2,
1291
+ paths: [{ path: "products.product.video" }]
1292
+ },
1293
+ {
1294
+ transformFn: transformSDKAudioToRESTAudio,
1295
+ paths: [{ path: "products.product.audio" }]
1296
+ }
1297
+ ]
1298
+ );
1299
+ const reqOpts = bulkUpdateProducts(payload);
1300
+ sideEffects?.onSiteCall?.();
1301
+ try {
1302
+ const result = await httpClient.request(reqOpts);
1303
+ sideEffects?.onSuccess?.(result);
1304
+ return renameKeysFromRESTResponseToSDKResponse(
1305
+ transformPaths2(result.data, [
1306
+ {
1307
+ transformFn: transformRESTImageToSDKImage,
1308
+ paths: [
1309
+ { path: "results.item.image" },
1310
+ { path: "results.item.variants.image" },
1311
+ { path: "results.item.mainVariant.image" }
1312
+ ]
1313
+ },
1314
+ {
1315
+ transformFn: transformRESTAddressToSDKAddress,
1316
+ paths: [
1317
+ { path: "results.item.address" },
1318
+ { path: "results.item.customAddress" }
1319
+ ]
1320
+ },
1321
+ {
1322
+ transformFn: transformRESTDocumentToSDKDocument,
1323
+ paths: [{ path: "results.item.document" }]
1324
+ },
1325
+ {
1326
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1327
+ paths: [{ path: "results.item.video" }]
1328
+ },
1329
+ {
1330
+ transformFn: transformRESTAudioToSDKAudio,
1331
+ paths: [{ path: "results.item.audio" }]
1332
+ }
1333
+ ])
1334
+ );
1335
+ } catch (err) {
1336
+ const transformedError = sdkTransformError(
1337
+ err,
1338
+ {
1339
+ spreadPathsToArguments: {},
1340
+ explicitPathsToArguments: {
1341
+ products: "$[0]",
1342
+ returnEntity: "$[1].returnEntity"
1343
+ },
1344
+ singleArgumentUnchanged: false
1345
+ },
1346
+ ["products", "options"]
1347
+ );
1348
+ sideEffects?.onError?.(err);
1349
+ throw transformedError;
1350
+ }
1351
+ }
1352
+ async function bulkDeleteProducts2(productIds) {
1353
+ const { httpClient, sideEffects } = arguments[1];
1354
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1355
+ productIds
1356
+ });
1357
+ const reqOpts = bulkDeleteProducts(payload);
1358
+ sideEffects?.onSiteCall?.();
1359
+ try {
1360
+ const result = await httpClient.request(reqOpts);
1361
+ sideEffects?.onSuccess?.(result);
1362
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1363
+ } catch (err) {
1364
+ const transformedError = sdkTransformError(
1365
+ err,
1366
+ {
1367
+ spreadPathsToArguments: {},
1368
+ explicitPathsToArguments: { productIds: "$[0]" },
1369
+ singleArgumentUnchanged: false
1370
+ },
1371
+ ["productIds"]
1372
+ );
1373
+ sideEffects?.onError?.(err);
1374
+ throw transformedError;
1375
+ }
1376
+ }
1377
+
1378
+ // src/metroinspector-v1-product-products.public.ts
1379
+ function createProduct3(httpClient) {
1380
+ return (options) => createProduct2(
1381
+ options,
1382
+ // @ts-ignore
1383
+ { httpClient }
1384
+ );
1385
+ }
1386
+ function deleteProduct3(httpClient) {
1387
+ return (productId) => deleteProduct2(
1388
+ productId,
1389
+ // @ts-ignore
1390
+ { httpClient }
1391
+ );
1392
+ }
1393
+ function updateProduct3(httpClient) {
1394
+ return (productId, options) => updateProduct2(
1395
+ productId,
1396
+ options,
1397
+ // @ts-ignore
1398
+ { httpClient }
1399
+ );
1400
+ }
1401
+ function getProduct3(httpClient) {
1402
+ return (productId) => getProduct2(
1403
+ productId,
1404
+ // @ts-ignore
1405
+ { httpClient }
1406
+ );
1407
+ }
1408
+ function countProducts3(httpClient) {
1409
+ return (options) => countProducts2(
1410
+ options,
1411
+ // @ts-ignore
1412
+ { httpClient }
1413
+ );
1414
+ }
1415
+ function getProductsStartWith3(httpClient) {
1416
+ return (title, options) => getProductsStartWith2(
1417
+ title,
1418
+ options,
1419
+ // @ts-ignore
1420
+ { httpClient }
1421
+ );
1422
+ }
1423
+ function queryProducts3(httpClient) {
1424
+ return (options) => queryProducts2(
1425
+ options,
1426
+ // @ts-ignore
1427
+ { httpClient }
1428
+ );
1429
+ }
1430
+ function bulkCreateProducts3(httpClient) {
1431
+ return (products, options) => bulkCreateProducts2(
1432
+ products,
1433
+ options,
1434
+ // @ts-ignore
1435
+ { httpClient }
1436
+ );
1437
+ }
1438
+ function bulkUpdateProducts3(httpClient) {
1439
+ return (products, options) => bulkUpdateProducts2(
1440
+ products,
1441
+ options,
1442
+ // @ts-ignore
1443
+ { httpClient }
1444
+ );
1445
+ }
1446
+ function bulkDeleteProducts3(httpClient) {
1447
+ return (productIds) => bulkDeleteProducts2(
1448
+ productIds,
1449
+ // @ts-ignore
1450
+ { httpClient }
1451
+ );
1452
+ }
1453
+
1454
+ // src/metroinspector-v1-product-products.context.ts
1455
+ import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
1456
+ var createProduct4 = /* @__PURE__ */ createRESTModule(createProduct3);
1457
+ var deleteProduct4 = /* @__PURE__ */ createRESTModule(deleteProduct3);
1458
+ var updateProduct4 = /* @__PURE__ */ createRESTModule(updateProduct3);
1459
+ var getProduct4 = /* @__PURE__ */ createRESTModule(getProduct3);
1460
+ var countProducts4 = /* @__PURE__ */ createRESTModule(countProducts3);
1461
+ var getProductsStartWith4 = /* @__PURE__ */ createRESTModule(getProductsStartWith3);
1462
+ var queryProducts4 = /* @__PURE__ */ createRESTModule(queryProducts3);
1463
+ var bulkCreateProducts4 = /* @__PURE__ */ createRESTModule(bulkCreateProducts3);
1464
+ var bulkUpdateProducts4 = /* @__PURE__ */ createRESTModule(bulkUpdateProducts3);
1465
+ var bulkDeleteProducts4 = /* @__PURE__ */ createRESTModule(bulkDeleteProducts3);
1466
+ export {
1467
+ LinkRel,
1468
+ SortOrder,
1469
+ SubdivisionType,
1470
+ bulkCreateProducts4 as bulkCreateProducts,
1471
+ bulkDeleteProducts4 as bulkDeleteProducts,
1472
+ bulkUpdateProducts4 as bulkUpdateProducts,
1473
+ countProducts4 as countProducts,
1474
+ createProduct4 as createProduct,
1475
+ deleteProduct4 as deleteProduct,
1476
+ getProduct4 as getProduct,
1477
+ getProductsStartWith4 as getProductsStartWith,
1478
+ queryProducts4 as queryProducts,
1479
+ updateProduct4 as updateProduct
1480
+ };
1481
+ //# sourceMappingURL=index.mjs.map