@wix/auto_sdk_bookings_resources 1.0.10 → 1.0.12

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 (126) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/bookings-resources-v2-resource-resources.context.d.ts +29 -0
  11. package/build/cjs/src/bookings-resources-v2-resource-resources.context.js +43 -0
  12. package/build/cjs/src/bookings-resources-v2-resource-resources.context.js.map +1 -0
  13. package/build/cjs/src/bookings-resources-v2-resource-resources.http.d.ts +96 -0
  14. package/build/cjs/src/bookings-resources-v2-resource-resources.http.js +446 -0
  15. package/build/cjs/src/bookings-resources-v2-resource-resources.http.js.map +1 -0
  16. package/build/cjs/src/bookings-resources-v2-resource-resources.meta.d.ts +27 -0
  17. package/build/cjs/src/bookings-resources-v2-resource-resources.meta.js +199 -0
  18. package/build/cjs/src/bookings-resources-v2-resource-resources.meta.js.map +1 -0
  19. package/build/{internal/index.d.ts → cjs/src/bookings-resources-v2-resource-resources.public.d.ts} +18 -38
  20. package/build/cjs/src/bookings-resources-v2-resource-resources.public.js +106 -0
  21. package/build/cjs/src/bookings-resources-v2-resource-resources.public.js.map +1 -0
  22. package/build/{internal/meta.d.mts → cjs/src/bookings-resources-v2-resource-resources.types.d.ts} +351 -114
  23. package/build/cjs/src/bookings-resources-v2-resource-resources.types.js +104 -0
  24. package/build/cjs/src/bookings-resources-v2-resource-resources.types.js.map +1 -0
  25. package/build/{bookings-resources-v2-resource-resources.universal-hYjNdpWu.d.mts → cjs/src/bookings-resources-v2-resource-resources.universal.d.ts} +387 -127
  26. package/build/cjs/src/bookings-resources-v2-resource-resources.universal.js +587 -0
  27. package/build/cjs/src/bookings-resources-v2-resource-resources.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/bookings-resources-v2-resource-resources.context.d.ts +29 -0
  39. package/build/es/src/bookings-resources-v2-resource-resources.context.js +29 -0
  40. package/build/es/src/bookings-resources-v2-resource-resources.context.js.map +1 -0
  41. package/build/es/src/bookings-resources-v2-resource-resources.http.d.ts +96 -0
  42. package/build/es/src/bookings-resources-v2-resource-resources.http.js +434 -0
  43. package/build/es/src/bookings-resources-v2-resource-resources.http.js.map +1 -0
  44. package/build/es/src/bookings-resources-v2-resource-resources.meta.d.ts +27 -0
  45. package/build/es/src/bookings-resources-v2-resource-resources.meta.js +164 -0
  46. package/build/es/src/bookings-resources-v2-resource-resources.meta.js.map +1 -0
  47. package/build/{index.d.ts → es/src/bookings-resources-v2-resource-resources.public.d.ts} +18 -38
  48. package/build/es/src/bookings-resources-v2-resource-resources.public.js +83 -0
  49. package/build/es/src/bookings-resources-v2-resource-resources.public.js.map +1 -0
  50. package/build/{internal/meta.d.ts → es/src/bookings-resources-v2-resource-resources.types.d.ts} +351 -114
  51. package/build/es/src/bookings-resources-v2-resource-resources.types.js +101 -0
  52. package/build/es/src/bookings-resources-v2-resource-resources.types.js.map +1 -0
  53. package/build/{bookings-resources-v2-resource-resources.universal-hYjNdpWu.d.ts → es/src/bookings-resources-v2-resource-resources.universal.d.ts} +387 -127
  54. package/build/es/src/bookings-resources-v2-resource-resources.universal.js +552 -0
  55. package/build/es/src/bookings-resources-v2-resource-resources.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.context.d.ts +29 -0
  66. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.context.js +43 -0
  67. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.context.js.map +1 -0
  68. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.http.d.ts +96 -0
  69. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.http.js +446 -0
  70. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.http.js.map +1 -0
  71. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.meta.d.ts +27 -0
  72. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.meta.js +199 -0
  73. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.meta.js.map +1 -0
  74. package/build/internal/{index.d.mts → cjs/src/bookings-resources-v2-resource-resources.public.d.ts} +18 -38
  75. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.public.js +106 -0
  76. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.public.js.map +1 -0
  77. package/build/{meta.d.mts → internal/cjs/src/bookings-resources-v2-resource-resources.types.d.ts} +351 -114
  78. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.types.js +104 -0
  79. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.types.js.map +1 -0
  80. package/build/internal/{bookings-resources-v2-resource-resources.universal-hYjNdpWu.d.mts → cjs/src/bookings-resources-v2-resource-resources.universal.d.ts} +387 -127
  81. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.universal.js +587 -0
  82. package/build/internal/cjs/src/bookings-resources-v2-resource-resources.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/bookings-resources-v2-resource-resources.context.d.ts +29 -0
  93. package/build/internal/es/src/bookings-resources-v2-resource-resources.context.js +29 -0
  94. package/build/internal/es/src/bookings-resources-v2-resource-resources.context.js.map +1 -0
  95. package/build/internal/es/src/bookings-resources-v2-resource-resources.http.d.ts +96 -0
  96. package/build/internal/es/src/bookings-resources-v2-resource-resources.http.js +434 -0
  97. package/build/internal/es/src/bookings-resources-v2-resource-resources.http.js.map +1 -0
  98. package/build/internal/es/src/bookings-resources-v2-resource-resources.meta.d.ts +27 -0
  99. package/build/internal/es/src/bookings-resources-v2-resource-resources.meta.js +164 -0
  100. package/build/internal/es/src/bookings-resources-v2-resource-resources.meta.js.map +1 -0
  101. package/build/{index.d.mts → internal/es/src/bookings-resources-v2-resource-resources.public.d.ts} +18 -38
  102. package/build/internal/es/src/bookings-resources-v2-resource-resources.public.js +83 -0
  103. package/build/internal/es/src/bookings-resources-v2-resource-resources.public.js.map +1 -0
  104. package/build/{meta.d.ts → internal/es/src/bookings-resources-v2-resource-resources.types.d.ts} +351 -114
  105. package/build/internal/es/src/bookings-resources-v2-resource-resources.types.js +101 -0
  106. package/build/internal/es/src/bookings-resources-v2-resource-resources.types.js.map +1 -0
  107. package/build/internal/{bookings-resources-v2-resource-resources.universal-hYjNdpWu.d.ts → es/src/bookings-resources-v2-resource-resources.universal.d.ts} +387 -127
  108. package/build/internal/es/src/bookings-resources-v2-resource-resources.universal.js +552 -0
  109. package/build/internal/es/src/bookings-resources-v2-resource-resources.universal.js.map +1 -0
  110. package/package.json +11 -12
  111. package/build/index.js +0 -882
  112. package/build/index.js.map +0 -1
  113. package/build/index.mjs +0 -836
  114. package/build/index.mjs.map +0 -1
  115. package/build/internal/index.js +0 -882
  116. package/build/internal/index.js.map +0 -1
  117. package/build/internal/index.mjs +0 -836
  118. package/build/internal/index.mjs.map +0 -1
  119. package/build/internal/meta.js +0 -559
  120. package/build/internal/meta.js.map +0 -1
  121. package/build/internal/meta.mjs +0 -524
  122. package/build/internal/meta.mjs.map +0 -1
  123. package/build/meta.js +0 -559
  124. package/build/meta.js.map +0 -1
  125. package/build/meta.mjs +0 -524
  126. package/build/meta.mjs.map +0 -1
@@ -1,836 +0,0 @@
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 transformPaths2 } 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
- var ManagementType = /* @__PURE__ */ ((ManagementType2) => {
366
- ManagementType2["WIX_USER"] = "WIX_USER";
367
- return ManagementType2;
368
- })(ManagementType || {});
369
- var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
370
- SortOrder2["ASC"] = "ASC";
371
- SortOrder2["DESC"] = "DESC";
372
- return SortOrder2;
373
- })(SortOrder || {});
374
- var SortType = /* @__PURE__ */ ((SortType2) => {
375
- SortType2["COUNT"] = "COUNT";
376
- SortType2["VALUE"] = "VALUE";
377
- return SortType2;
378
- })(SortType || {});
379
- var SortDirection = /* @__PURE__ */ ((SortDirection2) => {
380
- SortDirection2["DESC"] = "DESC";
381
- SortDirection2["ASC"] = "ASC";
382
- return SortDirection2;
383
- })(SortDirection || {});
384
- var MissingValues = /* @__PURE__ */ ((MissingValues2) => {
385
- MissingValues2["EXCLUDE"] = "EXCLUDE";
386
- MissingValues2["INCLUDE"] = "INCLUDE";
387
- return MissingValues2;
388
- })(MissingValues || {});
389
- var ScalarType = /* @__PURE__ */ ((ScalarType2) => {
390
- ScalarType2["UNKNOWN_SCALAR_TYPE"] = "UNKNOWN_SCALAR_TYPE";
391
- ScalarType2["COUNT_DISTINCT"] = "COUNT_DISTINCT";
392
- ScalarType2["MIN"] = "MIN";
393
- ScalarType2["MAX"] = "MAX";
394
- return ScalarType2;
395
- })(ScalarType || {});
396
- var NestedAggregationType = /* @__PURE__ */ ((NestedAggregationType2) => {
397
- NestedAggregationType2["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
398
- NestedAggregationType2["VALUE"] = "VALUE";
399
- NestedAggregationType2["RANGE"] = "RANGE";
400
- NestedAggregationType2["SCALAR"] = "SCALAR";
401
- NestedAggregationType2["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
402
- return NestedAggregationType2;
403
- })(NestedAggregationType || {});
404
- var Interval = /* @__PURE__ */ ((Interval2) => {
405
- Interval2["UNKNOWN_INTERVAL"] = "UNKNOWN_INTERVAL";
406
- Interval2["YEAR"] = "YEAR";
407
- Interval2["MONTH"] = "MONTH";
408
- Interval2["WEEK"] = "WEEK";
409
- Interval2["DAY"] = "DAY";
410
- Interval2["HOUR"] = "HOUR";
411
- Interval2["MINUTE"] = "MINUTE";
412
- Interval2["SECOND"] = "SECOND";
413
- return Interval2;
414
- })(Interval || {});
415
- var AggregationType = /* @__PURE__ */ ((AggregationType2) => {
416
- AggregationType2["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
417
- AggregationType2["VALUE"] = "VALUE";
418
- AggregationType2["RANGE"] = "RANGE";
419
- AggregationType2["SCALAR"] = "SCALAR";
420
- AggregationType2["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
421
- AggregationType2["NESTED"] = "NESTED";
422
- return AggregationType2;
423
- })(AggregationType || {});
424
- var Mode = /* @__PURE__ */ ((Mode2) => {
425
- Mode2["OR"] = "OR";
426
- Mode2["AND"] = "AND";
427
- return Mode2;
428
- })(Mode || {});
429
- var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
430
- WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
431
- WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
432
- WebhookIdentityType2["MEMBER"] = "MEMBER";
433
- WebhookIdentityType2["WIX_USER"] = "WIX_USER";
434
- WebhookIdentityType2["APP"] = "APP";
435
- return WebhookIdentityType2;
436
- })(WebhookIdentityType || {});
437
- async function createResource2(resource) {
438
- const { httpClient, sideEffects } = arguments[1];
439
- const payload = renameKeysFromSDKRequestToRESTRequest({ resource });
440
- const reqOpts = createResource(payload);
441
- sideEffects?.onSiteCall?.();
442
- try {
443
- const result = await httpClient.request(reqOpts);
444
- sideEffects?.onSuccess?.(result);
445
- return renameKeysFromRESTResponseToSDKResponse(result.data)?.resource;
446
- } catch (err) {
447
- const transformedError = sdkTransformError(
448
- err,
449
- {
450
- spreadPathsToArguments: {},
451
- explicitPathsToArguments: { resource: "$[0]" },
452
- singleArgumentUnchanged: false
453
- },
454
- ["resource"]
455
- );
456
- sideEffects?.onError?.(err);
457
- throw transformedError;
458
- }
459
- }
460
- async function bulkCreateResources2(resources, options) {
461
- const { httpClient, sideEffects } = arguments[2];
462
- const payload = renameKeysFromSDKRequestToRESTRequest({
463
- resources,
464
- returnEntity: options?.returnEntity
465
- });
466
- const reqOpts = bulkCreateResources(payload);
467
- sideEffects?.onSiteCall?.();
468
- try {
469
- const result = await httpClient.request(reqOpts);
470
- sideEffects?.onSuccess?.(result);
471
- return renameKeysFromRESTResponseToSDKResponse(result.data);
472
- } catch (err) {
473
- const transformedError = sdkTransformError(
474
- err,
475
- {
476
- spreadPathsToArguments: {},
477
- explicitPathsToArguments: {
478
- resources: "$[0]",
479
- returnEntity: "$[1].returnEntity"
480
- },
481
- singleArgumentUnchanged: false
482
- },
483
- ["resources", "options"]
484
- );
485
- sideEffects?.onError?.(err);
486
- throw transformedError;
487
- }
488
- }
489
- async function getResource2(resourceId) {
490
- const { httpClient, sideEffects } = arguments[1];
491
- const payload = renameKeysFromSDKRequestToRESTRequest({
492
- resourceId
493
- });
494
- const reqOpts = getResource(payload);
495
- sideEffects?.onSiteCall?.();
496
- try {
497
- const result = await httpClient.request(reqOpts);
498
- sideEffects?.onSuccess?.(result);
499
- return renameKeysFromRESTResponseToSDKResponse(result.data)?.resource;
500
- } catch (err) {
501
- const transformedError = sdkTransformError(
502
- err,
503
- {
504
- spreadPathsToArguments: {},
505
- explicitPathsToArguments: { resourceId: "$[0]" },
506
- singleArgumentUnchanged: false
507
- },
508
- ["resourceId"]
509
- );
510
- sideEffects?.onError?.(err);
511
- throw transformedError;
512
- }
513
- }
514
- async function updateResource2(_id, resource) {
515
- const { httpClient, sideEffects } = arguments[2];
516
- const payload = renameKeysFromSDKRequestToRESTRequest({
517
- resource: { ...resource, id: _id }
518
- });
519
- const reqOpts = updateResource(payload);
520
- sideEffects?.onSiteCall?.();
521
- try {
522
- const result = await httpClient.request(reqOpts);
523
- sideEffects?.onSuccess?.(result);
524
- return renameKeysFromRESTResponseToSDKResponse(result.data)?.resource;
525
- } catch (err) {
526
- const transformedError = sdkTransformError(
527
- err,
528
- {
529
- spreadPathsToArguments: { resource: "$[1]" },
530
- explicitPathsToArguments: { "resource.id": "$[0]" },
531
- singleArgumentUnchanged: false
532
- },
533
- ["_id", "resource"]
534
- );
535
- sideEffects?.onError?.(err);
536
- throw transformedError;
537
- }
538
- }
539
- async function deleteResource2(resourceId) {
540
- const { httpClient, sideEffects } = arguments[1];
541
- const payload = renameKeysFromSDKRequestToRESTRequest({
542
- resourceId
543
- });
544
- const reqOpts = deleteResource(payload);
545
- sideEffects?.onSiteCall?.();
546
- try {
547
- const result = await httpClient.request(reqOpts);
548
- sideEffects?.onSuccess?.(result);
549
- } catch (err) {
550
- const transformedError = sdkTransformError(
551
- err,
552
- {
553
- spreadPathsToArguments: {},
554
- explicitPathsToArguments: { resourceId: "$[0]" },
555
- singleArgumentUnchanged: false
556
- },
557
- ["resourceId"]
558
- );
559
- sideEffects?.onError?.(err);
560
- throw transformedError;
561
- }
562
- }
563
- async function bulkDeleteResources2(ids) {
564
- const { httpClient, sideEffects } = arguments[1];
565
- const payload = renameKeysFromSDKRequestToRESTRequest({ ids });
566
- const reqOpts = bulkDeleteResources(payload);
567
- sideEffects?.onSiteCall?.();
568
- try {
569
- const result = await httpClient.request(reqOpts);
570
- sideEffects?.onSuccess?.(result);
571
- return renameKeysFromRESTResponseToSDKResponse(result.data);
572
- } catch (err) {
573
- const transformedError = sdkTransformError(
574
- err,
575
- {
576
- spreadPathsToArguments: {},
577
- explicitPathsToArguments: { ids: "$[0]" },
578
- singleArgumentUnchanged: false
579
- },
580
- ["ids"]
581
- );
582
- sideEffects?.onError?.(err);
583
- throw transformedError;
584
- }
585
- }
586
- async function searchResources2(options) {
587
- const { httpClient, sideEffects } = arguments[1];
588
- const payload = renameKeysFromSDKRequestToRESTRequest({
589
- search: options?.search
590
- });
591
- const reqOpts = searchResources(payload);
592
- sideEffects?.onSiteCall?.();
593
- try {
594
- const result = await httpClient.request(reqOpts);
595
- sideEffects?.onSuccess?.(result);
596
- return renameKeysFromRESTResponseToSDKResponse(result.data);
597
- } catch (err) {
598
- const transformedError = sdkTransformError(
599
- err,
600
- {
601
- spreadPathsToArguments: {},
602
- explicitPathsToArguments: { search: "$[0].search" },
603
- singleArgumentUnchanged: false
604
- },
605
- ["options"]
606
- );
607
- sideEffects?.onError?.(err);
608
- throw transformedError;
609
- }
610
- }
611
- function queryResources2() {
612
- const { httpClient, sideEffects } = arguments[0];
613
- return queryBuilder({
614
- func: async (payload) => {
615
- const reqOpts = queryResources(payload);
616
- sideEffects?.onSiteCall?.();
617
- try {
618
- const result = await httpClient.request(reqOpts);
619
- sideEffects?.onSuccess?.(result);
620
- return result;
621
- } catch (err) {
622
- sideEffects?.onError?.(err);
623
- throw err;
624
- }
625
- },
626
- requestTransformer: (query) => {
627
- const args = [query, {}];
628
- return renameKeysFromSDKRequestToRESTRequest({
629
- ...args?.[1],
630
- query: args?.[0]
631
- });
632
- },
633
- responseTransformer: ({ data }) => {
634
- const transformedData = renameKeysFromRESTResponseToSDKResponse(data);
635
- return {
636
- items: transformedData?.resources,
637
- pagingMetadata: transformedData?.pagingMetadata
638
- };
639
- },
640
- errorTransformer: (err) => {
641
- const transformedError = sdkTransformError(err, {
642
- spreadPathsToArguments: {},
643
- explicitPathsToArguments: { query: "$[0]" },
644
- singleArgumentUnchanged: false
645
- });
646
- throw transformedError;
647
- },
648
- pagingMethod: "CURSOR",
649
- transformationPaths: {}
650
- });
651
- }
652
- async function countResources2(options) {
653
- const { httpClient, sideEffects } = arguments[1];
654
- const payload = renameKeysFromSDKRequestToRESTRequest({
655
- filter: options?.filter,
656
- search: options?.search
657
- });
658
- const reqOpts = countResources(payload);
659
- sideEffects?.onSiteCall?.();
660
- try {
661
- const result = await httpClient.request(reqOpts);
662
- sideEffects?.onSuccess?.(result);
663
- return renameKeysFromRESTResponseToSDKResponse(result.data);
664
- } catch (err) {
665
- const transformedError = sdkTransformError(
666
- err,
667
- {
668
- spreadPathsToArguments: {},
669
- explicitPathsToArguments: {
670
- filter: "$[0].filter",
671
- search: "$[0].search"
672
- },
673
- singleArgumentUnchanged: false
674
- },
675
- ["options"]
676
- );
677
- sideEffects?.onError?.(err);
678
- throw transformedError;
679
- }
680
- }
681
-
682
- // src/bookings-resources-v2-resource-resources.public.ts
683
- function createResource3(httpClient) {
684
- return (resource) => createResource2(
685
- resource,
686
- // @ts-ignore
687
- { httpClient }
688
- );
689
- }
690
- function bulkCreateResources3(httpClient) {
691
- return (resources, options) => bulkCreateResources2(
692
- resources,
693
- options,
694
- // @ts-ignore
695
- { httpClient }
696
- );
697
- }
698
- function getResource3(httpClient) {
699
- return (resourceId) => getResource2(
700
- resourceId,
701
- // @ts-ignore
702
- { httpClient }
703
- );
704
- }
705
- function updateResource3(httpClient) {
706
- return (_id, resource) => updateResource2(
707
- _id,
708
- resource,
709
- // @ts-ignore
710
- { httpClient }
711
- );
712
- }
713
- function deleteResource3(httpClient) {
714
- return (resourceId) => deleteResource2(
715
- resourceId,
716
- // @ts-ignore
717
- { httpClient }
718
- );
719
- }
720
- function bulkDeleteResources3(httpClient) {
721
- return (ids) => bulkDeleteResources2(
722
- ids,
723
- // @ts-ignore
724
- { httpClient }
725
- );
726
- }
727
- function searchResources3(httpClient) {
728
- return (options) => searchResources2(
729
- options,
730
- // @ts-ignore
731
- { httpClient }
732
- );
733
- }
734
- function queryResources3(httpClient) {
735
- return () => queryResources2(
736
- // @ts-ignore
737
- { httpClient }
738
- );
739
- }
740
- function countResources3(httpClient) {
741
- return (options) => countResources2(
742
- options,
743
- // @ts-ignore
744
- { httpClient }
745
- );
746
- }
747
- var onResourceCreated = EventDefinition(
748
- "wix.bookings.resources.v2.resource_created",
749
- true,
750
- (event) => renameKeysFromRESTResponseToSDKResponse2(
751
- transformPaths2(event, [
752
- {
753
- transformFn: transformRESTTimestampToSDKTimestamp2,
754
- paths: [
755
- { path: "entity.createdDate" },
756
- { path: "entity.updatedDate" },
757
- { path: "metadata.eventTime" }
758
- ]
759
- }
760
- ])
761
- )
762
- )();
763
- var onResourceDeleted = EventDefinition(
764
- "wix.bookings.resources.v2.resource_deleted",
765
- true,
766
- (event) => renameKeysFromRESTResponseToSDKResponse2(
767
- transformPaths2(event, [
768
- {
769
- transformFn: transformRESTTimestampToSDKTimestamp2,
770
- paths: [
771
- { path: "undefined.createdDate" },
772
- { path: "undefined.updatedDate" },
773
- { path: "metadata.eventTime" }
774
- ]
775
- }
776
- ])
777
- )
778
- )();
779
- var onResourceUpdated = EventDefinition(
780
- "wix.bookings.resources.v2.resource_updated",
781
- true,
782
- (event) => renameKeysFromRESTResponseToSDKResponse2(
783
- transformPaths2(event, [
784
- {
785
- transformFn: transformRESTTimestampToSDKTimestamp2,
786
- paths: [
787
- { path: "entity.createdDate" },
788
- { path: "entity.updatedDate" },
789
- { path: "metadata.eventTime" }
790
- ]
791
- }
792
- ])
793
- )
794
- )();
795
-
796
- // src/bookings-resources-v2-resource-resources.context.ts
797
- import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
798
- import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
799
- var createResource4 = /* @__PURE__ */ createRESTModule(createResource3);
800
- var bulkCreateResources4 = /* @__PURE__ */ createRESTModule(bulkCreateResources3);
801
- var getResource4 = /* @__PURE__ */ createRESTModule(getResource3);
802
- var updateResource4 = /* @__PURE__ */ createRESTModule(updateResource3);
803
- var deleteResource4 = /* @__PURE__ */ createRESTModule(deleteResource3);
804
- var bulkDeleteResources4 = /* @__PURE__ */ createRESTModule(bulkDeleteResources3);
805
- var searchResources4 = /* @__PURE__ */ createRESTModule(searchResources3);
806
- var queryResources4 = /* @__PURE__ */ createRESTModule(queryResources3);
807
- var countResources4 = /* @__PURE__ */ createRESTModule(countResources3);
808
- var onResourceCreated2 = createEventModule(onResourceCreated);
809
- var onResourceDeleted2 = createEventModule(onResourceDeleted);
810
- var onResourceUpdated2 = createEventModule(onResourceUpdated);
811
- export {
812
- AggregationType,
813
- Interval,
814
- ManagementType,
815
- MissingValues,
816
- Mode,
817
- NestedAggregationType,
818
- ScalarType,
819
- SortDirection,
820
- SortOrder,
821
- SortType,
822
- WebhookIdentityType,
823
- bulkCreateResources4 as bulkCreateResources,
824
- bulkDeleteResources4 as bulkDeleteResources,
825
- countResources4 as countResources,
826
- createResource4 as createResource,
827
- deleteResource4 as deleteResource,
828
- getResource4 as getResource,
829
- onResourceCreated2 as onResourceCreated,
830
- onResourceDeleted2 as onResourceDeleted,
831
- onResourceUpdated2 as onResourceUpdated,
832
- queryResources4 as queryResources,
833
- searchResources4 as searchResources,
834
- updateResource4 as updateResource
835
- };
836
- //# sourceMappingURL=index.mjs.map