@wix/auto_sdk_bookings_resources 1.0.20 → 1.0.22

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 (129) hide show
  1. package/build/{internal/cjs/src/bookings-resources-v2-resource-resources.universal.d.ts → bookings-resources-v2-resource-resources.universal-BvcAlBYB.d.mts} +328 -409
  2. package/build/{cjs/src/bookings-resources-v2-resource-resources.universal.d.ts → bookings-resources-v2-resource-resources.universal-BvcAlBYB.d.ts} +328 -409
  3. package/build/index.d.mts +168 -0
  4. package/build/index.d.ts +168 -0
  5. package/build/index.js +883 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +837 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/internal/{es/src/bookings-resources-v2-resource-resources.universal.d.ts → bookings-resources-v2-resource-resources.universal-BvcAlBYB.d.mts} +328 -409
  10. package/build/{es/src/bookings-resources-v2-resource-resources.universal.d.ts → internal/bookings-resources-v2-resource-resources.universal-BvcAlBYB.d.ts} +328 -409
  11. package/build/internal/index.d.mts +168 -0
  12. package/build/internal/index.d.ts +168 -0
  13. package/build/internal/index.js +883 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +837 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/{es/src/bookings-resources-v2-resource-resources.types.d.ts → internal/meta.d.mts} +145 -347
  18. package/build/internal/{cjs/src/bookings-resources-v2-resource-resources.types.d.ts → meta.d.ts} +145 -347
  19. package/build/internal/meta.js +559 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +524 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/{cjs/src/bookings-resources-v2-resource-resources.types.d.ts → meta.d.mts} +145 -347
  24. package/build/{internal/es/src/bookings-resources-v2-resource-resources.types.d.ts → meta.d.ts} +145 -347
  25. package/build/meta.js +559 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +524 -0
  28. package/build/meta.mjs.map +1 -0
  29. package/package.json +13 -12
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -27
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/bookings-resources-v2-resource-resources.context.d.ts +0 -29
  40. package/build/cjs/src/bookings-resources-v2-resource-resources.context.js +0 -43
  41. package/build/cjs/src/bookings-resources-v2-resource-resources.context.js.map +0 -1
  42. package/build/cjs/src/bookings-resources-v2-resource-resources.http.d.ts +0 -96
  43. package/build/cjs/src/bookings-resources-v2-resource-resources.http.js +0 -446
  44. package/build/cjs/src/bookings-resources-v2-resource-resources.http.js.map +0 -1
  45. package/build/cjs/src/bookings-resources-v2-resource-resources.meta.d.ts +0 -27
  46. package/build/cjs/src/bookings-resources-v2-resource-resources.meta.js +0 -199
  47. package/build/cjs/src/bookings-resources-v2-resource-resources.meta.js.map +0 -1
  48. package/build/cjs/src/bookings-resources-v2-resource-resources.public.d.ts +0 -143
  49. package/build/cjs/src/bookings-resources-v2-resource-resources.public.js +0 -106
  50. package/build/cjs/src/bookings-resources-v2-resource-resources.public.js.map +0 -1
  51. package/build/cjs/src/bookings-resources-v2-resource-resources.types.js +0 -104
  52. package/build/cjs/src/bookings-resources-v2-resource-resources.types.js.map +0 -1
  53. package/build/cjs/src/bookings-resources-v2-resource-resources.universal.js +0 -589
  54. package/build/cjs/src/bookings-resources-v2-resource-resources.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 -27
  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/bookings-resources-v2-resource-resources.context.d.ts +0 -29
  65. package/build/es/src/bookings-resources-v2-resource-resources.context.js +0 -29
  66. package/build/es/src/bookings-resources-v2-resource-resources.context.js.map +0 -1
  67. package/build/es/src/bookings-resources-v2-resource-resources.http.d.ts +0 -96
  68. package/build/es/src/bookings-resources-v2-resource-resources.http.js +0 -434
  69. package/build/es/src/bookings-resources-v2-resource-resources.http.js.map +0 -1
  70. package/build/es/src/bookings-resources-v2-resource-resources.meta.d.ts +0 -27
  71. package/build/es/src/bookings-resources-v2-resource-resources.meta.js +0 -164
  72. package/build/es/src/bookings-resources-v2-resource-resources.meta.js.map +0 -1
  73. package/build/es/src/bookings-resources-v2-resource-resources.public.d.ts +0 -143
  74. package/build/es/src/bookings-resources-v2-resource-resources.public.js +0 -83
  75. package/build/es/src/bookings-resources-v2-resource-resources.public.js.map +0 -1
  76. package/build/es/src/bookings-resources-v2-resource-resources.types.js +0 -101
  77. package/build/es/src/bookings-resources-v2-resource-resources.types.js.map +0 -1
  78. package/build/es/src/bookings-resources-v2-resource-resources.universal.js +0 -554
  79. package/build/es/src/bookings-resources-v2-resource-resources.universal.js.map +0 -1
  80. package/build/internal/cjs/index.d.ts +0 -1
  81. package/build/internal/cjs/index.js +0 -18
  82. package/build/internal/cjs/index.js.map +0 -1
  83. package/build/internal/cjs/index.typings.d.ts +0 -27
  84. package/build/internal/cjs/index.typings.js +0 -18
  85. package/build/internal/cjs/index.typings.js.map +0 -1
  86. package/build/internal/cjs/meta.d.ts +0 -1
  87. package/build/internal/cjs/meta.js +0 -18
  88. package/build/internal/cjs/meta.js.map +0 -1
  89. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.context.d.ts +0 -29
  90. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.context.js +0 -43
  91. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.context.js.map +0 -1
  92. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.http.d.ts +0 -96
  93. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.http.js +0 -446
  94. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.http.js.map +0 -1
  95. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.meta.d.ts +0 -27
  96. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.meta.js +0 -199
  97. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.meta.js.map +0 -1
  98. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.public.d.ts +0 -143
  99. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.public.js +0 -106
  100. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.public.js.map +0 -1
  101. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.types.js +0 -104
  102. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.types.js.map +0 -1
  103. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.universal.js +0 -589
  104. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.universal.js.map +0 -1
  105. package/build/internal/es/index.d.ts +0 -1
  106. package/build/internal/es/index.js +0 -2
  107. package/build/internal/es/index.js.map +0 -1
  108. package/build/internal/es/index.typings.d.ts +0 -27
  109. package/build/internal/es/index.typings.js +0 -2
  110. package/build/internal/es/index.typings.js.map +0 -1
  111. package/build/internal/es/meta.d.ts +0 -1
  112. package/build/internal/es/meta.js +0 -2
  113. package/build/internal/es/meta.js.map +0 -1
  114. package/build/internal/es/src/bookings-resources-v2-resource-resources.context.d.ts +0 -29
  115. package/build/internal/es/src/bookings-resources-v2-resource-resources.context.js +0 -29
  116. package/build/internal/es/src/bookings-resources-v2-resource-resources.context.js.map +0 -1
  117. package/build/internal/es/src/bookings-resources-v2-resource-resources.http.d.ts +0 -96
  118. package/build/internal/es/src/bookings-resources-v2-resource-resources.http.js +0 -434
  119. package/build/internal/es/src/bookings-resources-v2-resource-resources.http.js.map +0 -1
  120. package/build/internal/es/src/bookings-resources-v2-resource-resources.meta.d.ts +0 -27
  121. package/build/internal/es/src/bookings-resources-v2-resource-resources.meta.js +0 -164
  122. package/build/internal/es/src/bookings-resources-v2-resource-resources.meta.js.map +0 -1
  123. package/build/internal/es/src/bookings-resources-v2-resource-resources.public.d.ts +0 -143
  124. package/build/internal/es/src/bookings-resources-v2-resource-resources.public.js +0 -83
  125. package/build/internal/es/src/bookings-resources-v2-resource-resources.public.js.map +0 -1
  126. package/build/internal/es/src/bookings-resources-v2-resource-resources.types.js +0 -101
  127. package/build/internal/es/src/bookings-resources-v2-resource-resources.types.js.map +0 -1
  128. package/build/internal/es/src/bookings-resources-v2-resource-resources.universal.js +0 -554
  129. package/build/internal/es/src/bookings-resources-v2-resource-resources.universal.js.map +0 -1
@@ -0,0 +1,837 @@
1
+ // src/bookings-resources-v2-resource-resources.public.ts
2
+ import { renameKeysFromRESTResponseToSDKResponse as renameKeysFromRESTResponseToSDKResponse2 } from "@wix/sdk-runtime/rename-all-nested-keys";
3
+ import { transformRESTTimestampToSDKTimestamp as transformRESTTimestampToSDKTimestamp2 } from "@wix/sdk-runtime/transformations/timestamp";
4
+ import { transformPaths as transformPaths3 } from "@wix/sdk-runtime/transformations/transform-paths";
5
+ import { EventDefinition } from "@wix/sdk-types";
6
+
7
+ // src/bookings-resources-v2-resource-resources.universal.ts
8
+ import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
9
+ import { queryBuilder } from "@wix/sdk-runtime/query-builder";
10
+ import {
11
+ renameKeysFromSDKRequestToRESTRequest,
12
+ renameKeysFromRESTResponseToSDKResponse
13
+ } from "@wix/sdk-runtime/rename-all-nested-keys";
14
+
15
+ // src/bookings-resources-v2-resource-resources.http.ts
16
+ import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
17
+ import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
18
+ import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
19
+ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
20
+ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
21
+ import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
22
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
23
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
24
+ function resolveWixBookingsResourcesV2ResourcesServiceUrl(opts) {
25
+ const domainToMappings = {
26
+ "manage._base_domain_": [
27
+ {
28
+ srcPath: "/bookings/v2/resources",
29
+ destPath: "/v2/resources"
30
+ },
31
+ {
32
+ srcPath: "/_api/bookings/v2/resources",
33
+ destPath: "/v2/resources"
34
+ },
35
+ {
36
+ srcPath: "/v2/bulk/resources",
37
+ destPath: "/v2/bulk/resources"
38
+ }
39
+ ],
40
+ "api._api_base_domain_": [
41
+ {
42
+ srcPath: "/resources-2",
43
+ destPath: ""
44
+ }
45
+ ],
46
+ "www.wixapis.com": [
47
+ {
48
+ srcPath: "/bookings/v2/resources",
49
+ destPath: "/v2/resources"
50
+ },
51
+ {
52
+ srcPath: "/bookings/v2/bulk/resources",
53
+ destPath: "/v2/bulk/resources"
54
+ }
55
+ ],
56
+ "*.dev.wix-code.com": [
57
+ {
58
+ srcPath: "/_api/resources-2",
59
+ destPath: ""
60
+ }
61
+ ]
62
+ };
63
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
64
+ }
65
+ var PACKAGE_NAME = "@wix/auto_sdk_bookings_resources";
66
+ function createResource(payload) {
67
+ function __createResource({ host }) {
68
+ const serializedData = transformPaths(payload, [
69
+ {
70
+ transformFn: transformSDKTimestampToRESTTimestamp,
71
+ paths: [
72
+ { path: "resource.createdDate" },
73
+ { path: "resource.updatedDate" }
74
+ ]
75
+ }
76
+ ]);
77
+ const metadata = {
78
+ entityFqdn: "wix.bookings.resources.v2.resource",
79
+ method: "POST",
80
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.CreateResource",
81
+ packageName: PACKAGE_NAME,
82
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
83
+ protoPath: "/v2/resources",
84
+ data: serializedData,
85
+ host
86
+ }),
87
+ data: serializedData,
88
+ transformResponse: (payload2) => transformPaths(payload2, [
89
+ {
90
+ transformFn: transformRESTTimestampToSDKTimestamp,
91
+ paths: [
92
+ { path: "resource.createdDate" },
93
+ { path: "resource.updatedDate" }
94
+ ]
95
+ }
96
+ ])
97
+ };
98
+ return metadata;
99
+ }
100
+ return __createResource;
101
+ }
102
+ function bulkCreateResources(payload) {
103
+ function __bulkCreateResources({ host }) {
104
+ const serializedData = transformPaths(payload, [
105
+ {
106
+ transformFn: transformSDKTimestampToRESTTimestamp,
107
+ paths: [
108
+ { path: "resources.createdDate" },
109
+ { path: "resources.updatedDate" }
110
+ ]
111
+ }
112
+ ]);
113
+ const metadata = {
114
+ entityFqdn: "wix.bookings.resources.v2.resource",
115
+ method: "POST",
116
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.BulkCreateResources",
117
+ packageName: PACKAGE_NAME,
118
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
119
+ protoPath: "/v2/bulk/resources/create",
120
+ data: serializedData,
121
+ host
122
+ }),
123
+ data: serializedData,
124
+ transformResponse: (payload2) => transformPaths(payload2, [
125
+ {
126
+ transformFn: transformRESTTimestampToSDKTimestamp,
127
+ paths: [
128
+ { path: "results.item.createdDate" },
129
+ { path: "results.item.updatedDate" }
130
+ ]
131
+ }
132
+ ])
133
+ };
134
+ return metadata;
135
+ }
136
+ return __bulkCreateResources;
137
+ }
138
+ function getResource(payload) {
139
+ function __getResource({ host }) {
140
+ const metadata = {
141
+ entityFqdn: "wix.bookings.resources.v2.resource",
142
+ method: "GET",
143
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.GetResource",
144
+ packageName: PACKAGE_NAME,
145
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
146
+ protoPath: "/v2/resources/{resourceId}",
147
+ data: payload,
148
+ host
149
+ }),
150
+ params: toURLSearchParams(payload),
151
+ transformResponse: (payload2) => transformPaths(payload2, [
152
+ {
153
+ transformFn: transformRESTTimestampToSDKTimestamp,
154
+ paths: [
155
+ { path: "resource.createdDate" },
156
+ { path: "resource.updatedDate" }
157
+ ]
158
+ }
159
+ ])
160
+ };
161
+ return metadata;
162
+ }
163
+ return __getResource;
164
+ }
165
+ function updateResource(payload) {
166
+ function __updateResource({ host }) {
167
+ const serializedData = transformPaths(payload, [
168
+ {
169
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
170
+ paths: [{ path: "mask" }]
171
+ },
172
+ {
173
+ transformFn: transformSDKTimestampToRESTTimestamp,
174
+ paths: [
175
+ { path: "resource.createdDate" },
176
+ { path: "resource.updatedDate" }
177
+ ]
178
+ }
179
+ ]);
180
+ const metadata = {
181
+ entityFqdn: "wix.bookings.resources.v2.resource",
182
+ method: "PATCH",
183
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.UpdateResource",
184
+ packageName: PACKAGE_NAME,
185
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
186
+ protoPath: "/v2/resources/{resource.id}",
187
+ data: serializedData,
188
+ host
189
+ }),
190
+ data: serializedData,
191
+ transformResponse: (payload2) => transformPaths(payload2, [
192
+ {
193
+ transformFn: transformRESTTimestampToSDKTimestamp,
194
+ paths: [
195
+ { path: "resource.createdDate" },
196
+ { path: "resource.updatedDate" }
197
+ ]
198
+ }
199
+ ])
200
+ };
201
+ return metadata;
202
+ }
203
+ return __updateResource;
204
+ }
205
+ function deleteResource(payload) {
206
+ function __deleteResource({ host }) {
207
+ const metadata = {
208
+ entityFqdn: "wix.bookings.resources.v2.resource",
209
+ method: "DELETE",
210
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.DeleteResource",
211
+ packageName: PACKAGE_NAME,
212
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
213
+ protoPath: "/v2/resources/{resourceId}",
214
+ data: payload,
215
+ host
216
+ }),
217
+ params: toURLSearchParams(payload)
218
+ };
219
+ return metadata;
220
+ }
221
+ return __deleteResource;
222
+ }
223
+ function bulkDeleteResources(payload) {
224
+ function __bulkDeleteResources({ host }) {
225
+ const metadata = {
226
+ entityFqdn: "wix.bookings.resources.v2.resource",
227
+ method: "POST",
228
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.BulkDeleteResources",
229
+ packageName: PACKAGE_NAME,
230
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
231
+ protoPath: "/v2/bulk/resources/delete",
232
+ data: payload,
233
+ host
234
+ }),
235
+ data: payload,
236
+ transformResponse: (payload2) => transformPaths(payload2, [
237
+ {
238
+ transformFn: transformRESTTimestampToSDKTimestamp,
239
+ paths: [
240
+ { path: "results.item.createdDate" },
241
+ { path: "results.item.updatedDate" }
242
+ ]
243
+ }
244
+ ])
245
+ };
246
+ return metadata;
247
+ }
248
+ return __bulkDeleteResources;
249
+ }
250
+ function searchResources(payload) {
251
+ function __searchResources({ host }) {
252
+ const serializedData = transformPaths(payload, [
253
+ {
254
+ transformFn: transformSDKFloatToRESTFloat,
255
+ paths: [
256
+ { path: "search.aggregations.range.buckets.from" },
257
+ { path: "search.aggregations.range.buckets.to" },
258
+ {
259
+ path: "search.aggregations.nested.nestedAggregations.range.buckets.from"
260
+ },
261
+ {
262
+ path: "search.aggregations.nested.nestedAggregations.range.buckets.to"
263
+ }
264
+ ]
265
+ }
266
+ ]);
267
+ const metadata = {
268
+ entityFqdn: "wix.bookings.resources.v2.resource",
269
+ method: "POST",
270
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.SearchResources",
271
+ packageName: PACKAGE_NAME,
272
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
273
+ protoPath: "/v2/resources/search",
274
+ data: serializedData,
275
+ host
276
+ }),
277
+ data: serializedData,
278
+ transformResponse: (payload2) => transformPaths(payload2, [
279
+ {
280
+ transformFn: transformRESTTimestampToSDKTimestamp,
281
+ paths: [
282
+ { path: "resources.createdDate" },
283
+ { path: "resources.updatedDate" }
284
+ ]
285
+ },
286
+ {
287
+ transformFn: transformRESTFloatToSDKFloat,
288
+ paths: [
289
+ { path: "aggregationData.results.ranges.results.from" },
290
+ { path: "aggregationData.results.ranges.results.to" },
291
+ {
292
+ path: "aggregationData.results.groupedByValue.results.nestedResults.ranges.results.from"
293
+ },
294
+ {
295
+ path: "aggregationData.results.groupedByValue.results.nestedResults.ranges.results.to"
296
+ },
297
+ {
298
+ path: "aggregationData.results.nested.results.results.*.range.from"
299
+ },
300
+ {
301
+ path: "aggregationData.results.nested.results.results.*.range.to"
302
+ },
303
+ { path: "aggregationData.results.scalar.value" },
304
+ {
305
+ path: "aggregationData.results.groupedByValue.results.nestedResults.scalar.value"
306
+ },
307
+ {
308
+ path: "aggregationData.results.nested.results.results.*.scalar.value"
309
+ }
310
+ ]
311
+ }
312
+ ])
313
+ };
314
+ return metadata;
315
+ }
316
+ return __searchResources;
317
+ }
318
+ function queryResources(payload) {
319
+ function __queryResources({ host }) {
320
+ const metadata = {
321
+ entityFqdn: "wix.bookings.resources.v2.resource",
322
+ method: "POST",
323
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.QueryResources",
324
+ packageName: PACKAGE_NAME,
325
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
326
+ protoPath: "/v2/resources/query",
327
+ data: payload,
328
+ host
329
+ }),
330
+ data: payload,
331
+ transformResponse: (payload2) => transformPaths(payload2, [
332
+ {
333
+ transformFn: transformRESTTimestampToSDKTimestamp,
334
+ paths: [
335
+ { path: "resources.createdDate" },
336
+ { path: "resources.updatedDate" }
337
+ ]
338
+ }
339
+ ])
340
+ };
341
+ return metadata;
342
+ }
343
+ return __queryResources;
344
+ }
345
+ function countResources(payload) {
346
+ function __countResources({ host }) {
347
+ const metadata = {
348
+ entityFqdn: "wix.bookings.resources.v2.resource",
349
+ method: "POST",
350
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.CountResources",
351
+ packageName: PACKAGE_NAME,
352
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
353
+ protoPath: "/v2/resources/count",
354
+ data: payload,
355
+ host
356
+ }),
357
+ data: payload
358
+ };
359
+ return metadata;
360
+ }
361
+ return __countResources;
362
+ }
363
+
364
+ // src/bookings-resources-v2-resource-resources.universal.ts
365
+ import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
366
+ var ManagementType = /* @__PURE__ */ ((ManagementType2) => {
367
+ ManagementType2["WIX_USER"] = "WIX_USER";
368
+ return ManagementType2;
369
+ })(ManagementType || {});
370
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
371
+ SortOrder2["ASC"] = "ASC";
372
+ SortOrder2["DESC"] = "DESC";
373
+ return SortOrder2;
374
+ })(SortOrder || {});
375
+ var SortType = /* @__PURE__ */ ((SortType2) => {
376
+ SortType2["COUNT"] = "COUNT";
377
+ SortType2["VALUE"] = "VALUE";
378
+ return SortType2;
379
+ })(SortType || {});
380
+ var SortDirection = /* @__PURE__ */ ((SortDirection2) => {
381
+ SortDirection2["DESC"] = "DESC";
382
+ SortDirection2["ASC"] = "ASC";
383
+ return SortDirection2;
384
+ })(SortDirection || {});
385
+ var MissingValues = /* @__PURE__ */ ((MissingValues2) => {
386
+ MissingValues2["EXCLUDE"] = "EXCLUDE";
387
+ MissingValues2["INCLUDE"] = "INCLUDE";
388
+ return MissingValues2;
389
+ })(MissingValues || {});
390
+ var ScalarType = /* @__PURE__ */ ((ScalarType2) => {
391
+ ScalarType2["UNKNOWN_SCALAR_TYPE"] = "UNKNOWN_SCALAR_TYPE";
392
+ ScalarType2["COUNT_DISTINCT"] = "COUNT_DISTINCT";
393
+ ScalarType2["MIN"] = "MIN";
394
+ ScalarType2["MAX"] = "MAX";
395
+ return ScalarType2;
396
+ })(ScalarType || {});
397
+ var NestedAggregationType = /* @__PURE__ */ ((NestedAggregationType2) => {
398
+ NestedAggregationType2["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
399
+ NestedAggregationType2["VALUE"] = "VALUE";
400
+ NestedAggregationType2["RANGE"] = "RANGE";
401
+ NestedAggregationType2["SCALAR"] = "SCALAR";
402
+ NestedAggregationType2["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
403
+ return NestedAggregationType2;
404
+ })(NestedAggregationType || {});
405
+ var Interval = /* @__PURE__ */ ((Interval2) => {
406
+ Interval2["UNKNOWN_INTERVAL"] = "UNKNOWN_INTERVAL";
407
+ Interval2["YEAR"] = "YEAR";
408
+ Interval2["MONTH"] = "MONTH";
409
+ Interval2["WEEK"] = "WEEK";
410
+ Interval2["DAY"] = "DAY";
411
+ Interval2["HOUR"] = "HOUR";
412
+ Interval2["MINUTE"] = "MINUTE";
413
+ Interval2["SECOND"] = "SECOND";
414
+ return Interval2;
415
+ })(Interval || {});
416
+ var AggregationType = /* @__PURE__ */ ((AggregationType2) => {
417
+ AggregationType2["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
418
+ AggregationType2["VALUE"] = "VALUE";
419
+ AggregationType2["RANGE"] = "RANGE";
420
+ AggregationType2["SCALAR"] = "SCALAR";
421
+ AggregationType2["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
422
+ AggregationType2["NESTED"] = "NESTED";
423
+ return AggregationType2;
424
+ })(AggregationType || {});
425
+ var Mode = /* @__PURE__ */ ((Mode2) => {
426
+ Mode2["OR"] = "OR";
427
+ Mode2["AND"] = "AND";
428
+ return Mode2;
429
+ })(Mode || {});
430
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
431
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
432
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
433
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
434
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
435
+ WebhookIdentityType2["APP"] = "APP";
436
+ return WebhookIdentityType2;
437
+ })(WebhookIdentityType || {});
438
+ async function createResource2(resource) {
439
+ const { httpClient, sideEffects } = arguments[1];
440
+ const payload = renameKeysFromSDKRequestToRESTRequest({ resource });
441
+ const reqOpts = createResource(payload);
442
+ sideEffects?.onSiteCall?.();
443
+ try {
444
+ const result = await httpClient.request(reqOpts);
445
+ sideEffects?.onSuccess?.(result);
446
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.resource;
447
+ } catch (err) {
448
+ const transformedError = sdkTransformError(
449
+ err,
450
+ {
451
+ spreadPathsToArguments: {},
452
+ explicitPathsToArguments: { resource: "$[0]" },
453
+ singleArgumentUnchanged: false
454
+ },
455
+ ["resource"]
456
+ );
457
+ sideEffects?.onError?.(err);
458
+ throw transformedError;
459
+ }
460
+ }
461
+ async function bulkCreateResources2(resources, options) {
462
+ const { httpClient, sideEffects } = arguments[2];
463
+ const payload = renameKeysFromSDKRequestToRESTRequest({
464
+ resources,
465
+ returnEntity: options?.returnEntity
466
+ });
467
+ const reqOpts = bulkCreateResources(payload);
468
+ sideEffects?.onSiteCall?.();
469
+ try {
470
+ const result = await httpClient.request(reqOpts);
471
+ sideEffects?.onSuccess?.(result);
472
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
473
+ } catch (err) {
474
+ const transformedError = sdkTransformError(
475
+ err,
476
+ {
477
+ spreadPathsToArguments: {},
478
+ explicitPathsToArguments: {
479
+ resources: "$[0]",
480
+ returnEntity: "$[1].returnEntity"
481
+ },
482
+ singleArgumentUnchanged: false
483
+ },
484
+ ["resources", "options"]
485
+ );
486
+ sideEffects?.onError?.(err);
487
+ throw transformedError;
488
+ }
489
+ }
490
+ async function getResource2(resourceId) {
491
+ const { httpClient, sideEffects } = arguments[1];
492
+ const payload = renameKeysFromSDKRequestToRESTRequest({
493
+ resourceId
494
+ });
495
+ const reqOpts = getResource(payload);
496
+ sideEffects?.onSiteCall?.();
497
+ try {
498
+ const result = await httpClient.request(reqOpts);
499
+ sideEffects?.onSuccess?.(result);
500
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.resource;
501
+ } catch (err) {
502
+ const transformedError = sdkTransformError(
503
+ err,
504
+ {
505
+ spreadPathsToArguments: {},
506
+ explicitPathsToArguments: { resourceId: "$[0]" },
507
+ singleArgumentUnchanged: false
508
+ },
509
+ ["resourceId"]
510
+ );
511
+ sideEffects?.onError?.(err);
512
+ throw transformedError;
513
+ }
514
+ }
515
+ async function updateResource2(_id, resource) {
516
+ const { httpClient, sideEffects } = arguments[2];
517
+ const payload = renameKeysFromSDKRequestToRESTRequest({
518
+ resource: { ...resource, id: _id }
519
+ });
520
+ const reqOpts = updateResource(payload);
521
+ sideEffects?.onSiteCall?.();
522
+ try {
523
+ const result = await httpClient.request(reqOpts);
524
+ sideEffects?.onSuccess?.(result);
525
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.resource;
526
+ } catch (err) {
527
+ const transformedError = sdkTransformError(
528
+ err,
529
+ {
530
+ spreadPathsToArguments: { resource: "$[1]" },
531
+ explicitPathsToArguments: { "resource.id": "$[0]" },
532
+ singleArgumentUnchanged: false
533
+ },
534
+ ["_id", "resource"]
535
+ );
536
+ sideEffects?.onError?.(err);
537
+ throw transformedError;
538
+ }
539
+ }
540
+ async function deleteResource2(resourceId) {
541
+ const { httpClient, sideEffects } = arguments[1];
542
+ const payload = renameKeysFromSDKRequestToRESTRequest({
543
+ resourceId
544
+ });
545
+ const reqOpts = deleteResource(payload);
546
+ sideEffects?.onSiteCall?.();
547
+ try {
548
+ const result = await httpClient.request(reqOpts);
549
+ sideEffects?.onSuccess?.(result);
550
+ } catch (err) {
551
+ const transformedError = sdkTransformError(
552
+ err,
553
+ {
554
+ spreadPathsToArguments: {},
555
+ explicitPathsToArguments: { resourceId: "$[0]" },
556
+ singleArgumentUnchanged: false
557
+ },
558
+ ["resourceId"]
559
+ );
560
+ sideEffects?.onError?.(err);
561
+ throw transformedError;
562
+ }
563
+ }
564
+ async function bulkDeleteResources2(ids) {
565
+ const { httpClient, sideEffects } = arguments[1];
566
+ const payload = renameKeysFromSDKRequestToRESTRequest({ ids });
567
+ const reqOpts = bulkDeleteResources(payload);
568
+ sideEffects?.onSiteCall?.();
569
+ try {
570
+ const result = await httpClient.request(reqOpts);
571
+ sideEffects?.onSuccess?.(result);
572
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
573
+ } catch (err) {
574
+ const transformedError = sdkTransformError(
575
+ err,
576
+ {
577
+ spreadPathsToArguments: {},
578
+ explicitPathsToArguments: { ids: "$[0]" },
579
+ singleArgumentUnchanged: false
580
+ },
581
+ ["ids"]
582
+ );
583
+ sideEffects?.onError?.(err);
584
+ throw transformedError;
585
+ }
586
+ }
587
+ async function searchResources2(search) {
588
+ const { httpClient, sideEffects } = arguments[1];
589
+ const payload = renameKeysFromSDKRequestToRESTRequest({ search });
590
+ const reqOpts = searchResources(payload);
591
+ sideEffects?.onSiteCall?.();
592
+ try {
593
+ const result = await httpClient.request(reqOpts);
594
+ sideEffects?.onSuccess?.(result);
595
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
596
+ } catch (err) {
597
+ const transformedError = sdkTransformError(
598
+ err,
599
+ {
600
+ spreadPathsToArguments: {},
601
+ explicitPathsToArguments: { search: "$[0]" },
602
+ singleArgumentUnchanged: false
603
+ },
604
+ ["search"]
605
+ );
606
+ sideEffects?.onError?.(err);
607
+ throw transformedError;
608
+ }
609
+ }
610
+ function queryResources2() {
611
+ const { httpClient, sideEffects } = arguments[0];
612
+ return queryBuilder({
613
+ func: async (payload) => {
614
+ const reqOpts = queryResources(payload);
615
+ sideEffects?.onSiteCall?.();
616
+ try {
617
+ const result = await httpClient.request(reqOpts);
618
+ sideEffects?.onSuccess?.(result);
619
+ return result;
620
+ } catch (err) {
621
+ sideEffects?.onError?.(err);
622
+ throw err;
623
+ }
624
+ },
625
+ requestTransformer: (query) => {
626
+ const args = [query, {}];
627
+ return renameKeysFromSDKRequestToRESTRequest({
628
+ ...args?.[1],
629
+ query: args?.[0]
630
+ });
631
+ },
632
+ responseTransformer: ({ data }) => {
633
+ const transformedData = renameKeysFromRESTResponseToSDKResponse(
634
+ transformPaths2(data, [])
635
+ );
636
+ return {
637
+ items: transformedData?.resources,
638
+ pagingMetadata: transformedData?.pagingMetadata
639
+ };
640
+ },
641
+ errorTransformer: (err) => {
642
+ const transformedError = sdkTransformError(err, {
643
+ spreadPathsToArguments: {},
644
+ explicitPathsToArguments: { query: "$[0]" },
645
+ singleArgumentUnchanged: false
646
+ });
647
+ throw transformedError;
648
+ },
649
+ pagingMethod: "CURSOR",
650
+ transformationPaths: {}
651
+ });
652
+ }
653
+ async function countResources2(options) {
654
+ const { httpClient, sideEffects } = arguments[1];
655
+ const payload = renameKeysFromSDKRequestToRESTRequest({
656
+ filter: options?.filter,
657
+ search: options?.search
658
+ });
659
+ const reqOpts = countResources(payload);
660
+ sideEffects?.onSiteCall?.();
661
+ try {
662
+ const result = await httpClient.request(reqOpts);
663
+ sideEffects?.onSuccess?.(result);
664
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
665
+ } catch (err) {
666
+ const transformedError = sdkTransformError(
667
+ err,
668
+ {
669
+ spreadPathsToArguments: {},
670
+ explicitPathsToArguments: {
671
+ filter: "$[0].filter",
672
+ search: "$[0].search"
673
+ },
674
+ singleArgumentUnchanged: false
675
+ },
676
+ ["options"]
677
+ );
678
+ sideEffects?.onError?.(err);
679
+ throw transformedError;
680
+ }
681
+ }
682
+
683
+ // src/bookings-resources-v2-resource-resources.public.ts
684
+ function createResource3(httpClient) {
685
+ return (resource) => createResource2(
686
+ resource,
687
+ // @ts-ignore
688
+ { httpClient }
689
+ );
690
+ }
691
+ function bulkCreateResources3(httpClient) {
692
+ return (resources, options) => bulkCreateResources2(
693
+ resources,
694
+ options,
695
+ // @ts-ignore
696
+ { httpClient }
697
+ );
698
+ }
699
+ function getResource3(httpClient) {
700
+ return (resourceId) => getResource2(
701
+ resourceId,
702
+ // @ts-ignore
703
+ { httpClient }
704
+ );
705
+ }
706
+ function updateResource3(httpClient) {
707
+ return (_id, resource) => updateResource2(
708
+ _id,
709
+ resource,
710
+ // @ts-ignore
711
+ { httpClient }
712
+ );
713
+ }
714
+ function deleteResource3(httpClient) {
715
+ return (resourceId) => deleteResource2(
716
+ resourceId,
717
+ // @ts-ignore
718
+ { httpClient }
719
+ );
720
+ }
721
+ function bulkDeleteResources3(httpClient) {
722
+ return (ids) => bulkDeleteResources2(
723
+ ids,
724
+ // @ts-ignore
725
+ { httpClient }
726
+ );
727
+ }
728
+ function searchResources3(httpClient) {
729
+ return (search) => searchResources2(
730
+ search,
731
+ // @ts-ignore
732
+ { httpClient }
733
+ );
734
+ }
735
+ function queryResources3(httpClient) {
736
+ return () => queryResources2(
737
+ // @ts-ignore
738
+ { httpClient }
739
+ );
740
+ }
741
+ function countResources3(httpClient) {
742
+ return (options) => countResources2(
743
+ options,
744
+ // @ts-ignore
745
+ { httpClient }
746
+ );
747
+ }
748
+ var onResourceCreated = EventDefinition(
749
+ "wix.bookings.resources.v2.resource_created",
750
+ true,
751
+ (event) => renameKeysFromRESTResponseToSDKResponse2(
752
+ transformPaths3(event, [
753
+ {
754
+ transformFn: transformRESTTimestampToSDKTimestamp2,
755
+ paths: [
756
+ { path: "entity.createdDate" },
757
+ { path: "entity.updatedDate" },
758
+ { path: "metadata.eventTime" }
759
+ ]
760
+ }
761
+ ])
762
+ )
763
+ )();
764
+ var onResourceDeleted = EventDefinition(
765
+ "wix.bookings.resources.v2.resource_deleted",
766
+ true,
767
+ (event) => renameKeysFromRESTResponseToSDKResponse2(
768
+ transformPaths3(event, [
769
+ {
770
+ transformFn: transformRESTTimestampToSDKTimestamp2,
771
+ paths: [
772
+ { path: "undefined.createdDate" },
773
+ { path: "undefined.updatedDate" },
774
+ { path: "metadata.eventTime" }
775
+ ]
776
+ }
777
+ ])
778
+ )
779
+ )();
780
+ var onResourceUpdated = EventDefinition(
781
+ "wix.bookings.resources.v2.resource_updated",
782
+ true,
783
+ (event) => renameKeysFromRESTResponseToSDKResponse2(
784
+ transformPaths3(event, [
785
+ {
786
+ transformFn: transformRESTTimestampToSDKTimestamp2,
787
+ paths: [
788
+ { path: "entity.createdDate" },
789
+ { path: "entity.updatedDate" },
790
+ { path: "metadata.eventTime" }
791
+ ]
792
+ }
793
+ ])
794
+ )
795
+ )();
796
+
797
+ // src/bookings-resources-v2-resource-resources.context.ts
798
+ import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
799
+ import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
800
+ var createResource4 = /* @__PURE__ */ createRESTModule(createResource3);
801
+ var bulkCreateResources4 = /* @__PURE__ */ createRESTModule(bulkCreateResources3);
802
+ var getResource4 = /* @__PURE__ */ createRESTModule(getResource3);
803
+ var updateResource4 = /* @__PURE__ */ createRESTModule(updateResource3);
804
+ var deleteResource4 = /* @__PURE__ */ createRESTModule(deleteResource3);
805
+ var bulkDeleteResources4 = /* @__PURE__ */ createRESTModule(bulkDeleteResources3);
806
+ var searchResources4 = /* @__PURE__ */ createRESTModule(searchResources3);
807
+ var queryResources4 = /* @__PURE__ */ createRESTModule(queryResources3);
808
+ var countResources4 = /* @__PURE__ */ createRESTModule(countResources3);
809
+ var onResourceCreated2 = createEventModule(onResourceCreated);
810
+ var onResourceDeleted2 = createEventModule(onResourceDeleted);
811
+ var onResourceUpdated2 = createEventModule(onResourceUpdated);
812
+ export {
813
+ AggregationType,
814
+ Interval,
815
+ ManagementType,
816
+ MissingValues,
817
+ Mode,
818
+ NestedAggregationType,
819
+ ScalarType,
820
+ SortDirection,
821
+ SortOrder,
822
+ SortType,
823
+ WebhookIdentityType,
824
+ bulkCreateResources4 as bulkCreateResources,
825
+ bulkDeleteResources4 as bulkDeleteResources,
826
+ countResources4 as countResources,
827
+ createResource4 as createResource,
828
+ deleteResource4 as deleteResource,
829
+ getResource4 as getResource,
830
+ onResourceCreated2 as onResourceCreated,
831
+ onResourceDeleted2 as onResourceDeleted,
832
+ onResourceUpdated2 as onResourceUpdated,
833
+ queryResources4 as queryResources,
834
+ searchResources4 as searchResources,
835
+ updateResource4 as updateResource
836
+ };
837
+ //# sourceMappingURL=index.mjs.map