@wix/auto_sdk_bookings_categories-v-2 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.context.d.ts +27 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.context.js +33 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.context.js.map +1 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.http.d.ts +65 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.http.js +332 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.http.js.map +1 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.meta.d.ts +27 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.meta.js +161 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.meta.js.map +1 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.public.d.ts +106 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.public.js +86 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.public.js.map +1 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.types.d.ts +372 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.types.js +27 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.types.js.map +1 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.universal.d.ts +780 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.universal.js +405 -0
- package/build/cjs/src/bookings-categories-v2-category-categories-v-2.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.context.d.ts +27 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.context.js +27 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.context.js.map +1 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.http.d.ts +65 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.http.js +322 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.http.js.map +1 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.meta.d.ts +27 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.meta.js +128 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.meta.js.map +1 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.public.d.ts +106 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.public.js +73 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.public.js.map +1 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.types.d.ts +372 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.types.js +24 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.types.js.map +1 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.universal.d.ts +780 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.universal.js +372 -0
- package/build/es/src/bookings-categories-v2-category-categories-v-2.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.context.d.ts +27 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.context.js +33 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.context.js.map +1 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.http.d.ts +65 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.http.js +332 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.http.js.map +1 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.meta.d.ts +27 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.meta.js +161 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.meta.js.map +1 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.public.d.ts +106 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.public.js +86 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.public.js.map +1 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.types.d.ts +372 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.types.js +27 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.types.js.map +1 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.universal.d.ts +780 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.universal.js +405 -0
- package/build/internal/cjs/src/bookings-categories-v2-category-categories-v-2.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.context.d.ts +27 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.context.js +27 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.context.js.map +1 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.http.d.ts +65 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.http.js +322 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.http.js.map +1 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.meta.d.ts +27 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.meta.js +128 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.meta.js.map +1 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.public.d.ts +106 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.public.js +73 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.public.js.map +1 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.types.d.ts +372 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.types.js +24 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.types.js.map +1 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.universal.d.ts +780 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.universal.js +372 -0
- package/build/internal/es/src/bookings-categories-v2-category-categories-v-2.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.moveCategory = exports.countCategories = exports.queryCategories = exports.deleteCategory = exports.updateCategory = exports.getCategory = exports.createCategory = exports.WebhookIdentityType = exports.Position = exports.SortOrder = void 0;
|
|
27
|
+
const transform_error_1 = require("@wix/sdk-runtime/transform-error");
|
|
28
|
+
const query_builder_1 = require("@wix/sdk-runtime/query-builder");
|
|
29
|
+
const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
30
|
+
const ambassadorWixBookingsCategoriesV2Category = __importStar(require("./bookings-categories-v2-category-categories-v-2.http.js"));
|
|
31
|
+
var SortOrder;
|
|
32
|
+
(function (SortOrder) {
|
|
33
|
+
SortOrder["ASC"] = "ASC";
|
|
34
|
+
SortOrder["DESC"] = "DESC";
|
|
35
|
+
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
36
|
+
var Position;
|
|
37
|
+
(function (Position) {
|
|
38
|
+
Position["UNKNOWN_POSITION"] = "UNKNOWN_POSITION";
|
|
39
|
+
/** Place the category at the end of the list. */
|
|
40
|
+
Position["LAST"] = "LAST";
|
|
41
|
+
/** Place the category at the beginning of the list. */
|
|
42
|
+
Position["FIRST"] = "FIRST";
|
|
43
|
+
/** Place the category immediately after a specific category. */
|
|
44
|
+
Position["AFTER_CATEGORY"] = "AFTER_CATEGORY";
|
|
45
|
+
})(Position || (exports.Position = Position = {}));
|
|
46
|
+
var WebhookIdentityType;
|
|
47
|
+
(function (WebhookIdentityType) {
|
|
48
|
+
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
|
49
|
+
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
50
|
+
WebhookIdentityType["MEMBER"] = "MEMBER";
|
|
51
|
+
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
|
52
|
+
WebhookIdentityType["APP"] = "APP";
|
|
53
|
+
})(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
|
|
54
|
+
/**
|
|
55
|
+
* Creates a category.
|
|
56
|
+
* @param category - Category to create.
|
|
57
|
+
* @public
|
|
58
|
+
* @requiredField category
|
|
59
|
+
* @requiredField category.name
|
|
60
|
+
* @permissionId BOOKINGS.CATEGORY_CREATE
|
|
61
|
+
* @permissionScope Manage Bookings
|
|
62
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
63
|
+
* @permissionScope Manage Bookings - all permissions
|
|
64
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
65
|
+
* @applicableIdentity APP
|
|
66
|
+
* @returns Created category.
|
|
67
|
+
* @fqn wix.bookings.categories.v2.CategoriesService.CreateCategory
|
|
68
|
+
*/
|
|
69
|
+
async function createCategory(category) {
|
|
70
|
+
// @ts-ignore
|
|
71
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
72
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ category: category });
|
|
73
|
+
const reqOpts = ambassadorWixBookingsCategoriesV2Category.createCategory(payload);
|
|
74
|
+
sideEffects?.onSiteCall?.();
|
|
75
|
+
try {
|
|
76
|
+
const result = await httpClient.request(reqOpts);
|
|
77
|
+
sideEffects?.onSuccess?.(result);
|
|
78
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.category;
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
82
|
+
spreadPathsToArguments: {},
|
|
83
|
+
explicitPathsToArguments: { category: '$[0]' },
|
|
84
|
+
singleArgumentUnchanged: false,
|
|
85
|
+
}, ['category']);
|
|
86
|
+
sideEffects?.onError?.(err);
|
|
87
|
+
throw transformedError;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.createCategory = createCategory;
|
|
91
|
+
/**
|
|
92
|
+
* Retrieves a category.
|
|
93
|
+
* @param categoryId - ID of the category to retrieve.
|
|
94
|
+
* @public
|
|
95
|
+
* @requiredField categoryId
|
|
96
|
+
* @permissionId BOOKINGS.CATEGORY_READ
|
|
97
|
+
* @permissionScope Read Bookings - Public Data
|
|
98
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
|
|
99
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
100
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
101
|
+
* @permissionScope Manage Bookings
|
|
102
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
103
|
+
* @permissionScope Read Bookings - Including Participants
|
|
104
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
|
|
105
|
+
* @permissionScope Read Bookings - all read permissions
|
|
106
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
|
|
107
|
+
* @permissionScope Manage Bookings - all permissions
|
|
108
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
109
|
+
* @applicableIdentity APP
|
|
110
|
+
* @applicableIdentity VISITOR
|
|
111
|
+
* @returns Retrieved category.
|
|
112
|
+
* @fqn wix.bookings.categories.v2.CategoriesService.GetCategory
|
|
113
|
+
*/
|
|
114
|
+
async function getCategory(categoryId) {
|
|
115
|
+
// @ts-ignore
|
|
116
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
117
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
118
|
+
categoryId: categoryId,
|
|
119
|
+
});
|
|
120
|
+
const reqOpts = ambassadorWixBookingsCategoriesV2Category.getCategory(payload);
|
|
121
|
+
sideEffects?.onSiteCall?.();
|
|
122
|
+
try {
|
|
123
|
+
const result = await httpClient.request(reqOpts);
|
|
124
|
+
sideEffects?.onSuccess?.(result);
|
|
125
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.category;
|
|
126
|
+
}
|
|
127
|
+
catch (err) {
|
|
128
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
129
|
+
spreadPathsToArguments: {},
|
|
130
|
+
explicitPathsToArguments: { categoryId: '$[0]' },
|
|
131
|
+
singleArgumentUnchanged: false,
|
|
132
|
+
}, ['categoryId']);
|
|
133
|
+
sideEffects?.onError?.(err);
|
|
134
|
+
throw transformedError;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.getCategory = getCategory;
|
|
138
|
+
/**
|
|
139
|
+
* Updates a category.
|
|
140
|
+
*
|
|
141
|
+
*
|
|
142
|
+
* Each time the category is updated, `revision` increments by 1.
|
|
143
|
+
* You must specify the current `revision` to prevent unintended overwrites.
|
|
144
|
+
*
|
|
145
|
+
* You can't adjust a categories `sortOrder` with this method, call Move Category ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-categories/move-category) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/categories-v2/move-category)) instead.
|
|
146
|
+
* @param _id - Category ID.
|
|
147
|
+
* @public
|
|
148
|
+
* @requiredField _id
|
|
149
|
+
* @requiredField category
|
|
150
|
+
* @requiredField category.revision
|
|
151
|
+
* @permissionId BOOKINGS.CATEGORY_UPDATE
|
|
152
|
+
* @permissionScope Manage Bookings
|
|
153
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
154
|
+
* @permissionScope Manage Bookings - all permissions
|
|
155
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
156
|
+
* @applicableIdentity APP
|
|
157
|
+
* @returns Updated category.
|
|
158
|
+
* @fqn wix.bookings.categories.v2.CategoriesService.UpdateCategory
|
|
159
|
+
*/
|
|
160
|
+
async function updateCategory(_id, category) {
|
|
161
|
+
// @ts-ignore
|
|
162
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
163
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
164
|
+
category: { ...category, id: _id },
|
|
165
|
+
});
|
|
166
|
+
const reqOpts = ambassadorWixBookingsCategoriesV2Category.updateCategory(payload);
|
|
167
|
+
sideEffects?.onSiteCall?.();
|
|
168
|
+
try {
|
|
169
|
+
const result = await httpClient.request(reqOpts);
|
|
170
|
+
sideEffects?.onSuccess?.(result);
|
|
171
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.category;
|
|
172
|
+
}
|
|
173
|
+
catch (err) {
|
|
174
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
175
|
+
spreadPathsToArguments: { category: '$[1]' },
|
|
176
|
+
explicitPathsToArguments: { 'category.id': '$[0]' },
|
|
177
|
+
singleArgumentUnchanged: false,
|
|
178
|
+
}, ['_id', 'category']);
|
|
179
|
+
sideEffects?.onError?.(err);
|
|
180
|
+
throw transformedError;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
exports.updateCategory = updateCategory;
|
|
184
|
+
/**
|
|
185
|
+
* Deletes a category.
|
|
186
|
+
*
|
|
187
|
+
*
|
|
188
|
+
* ## Impact on connected services
|
|
189
|
+
*
|
|
190
|
+
* When you delete a category, any services linked to it remain associated with the now-deleted category. Wix Bookings still displays these services to business owners in the dashboard, but they aren't visible to customers on the live site.
|
|
191
|
+
* Attempting to call Update Service ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/update-service) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/update-service)) for a service that's linked to a deleted category fails, unless you specify a different, existing category ID in `service.category.id`.
|
|
192
|
+
* @param categoryId - ID of the category to delete.
|
|
193
|
+
* @public
|
|
194
|
+
* @requiredField categoryId
|
|
195
|
+
* @permissionId BOOKINGS.CATEGORY_DELETE
|
|
196
|
+
* @permissionScope Manage Bookings
|
|
197
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
198
|
+
* @permissionScope Manage Bookings - all permissions
|
|
199
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
200
|
+
* @applicableIdentity APP
|
|
201
|
+
* @fqn wix.bookings.categories.v2.CategoriesService.DeleteCategory
|
|
202
|
+
*/
|
|
203
|
+
async function deleteCategory(categoryId) {
|
|
204
|
+
// @ts-ignore
|
|
205
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
206
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
207
|
+
categoryId: categoryId,
|
|
208
|
+
});
|
|
209
|
+
const reqOpts = ambassadorWixBookingsCategoriesV2Category.deleteCategory(payload);
|
|
210
|
+
sideEffects?.onSiteCall?.();
|
|
211
|
+
try {
|
|
212
|
+
const result = await httpClient.request(reqOpts);
|
|
213
|
+
sideEffects?.onSuccess?.(result);
|
|
214
|
+
}
|
|
215
|
+
catch (err) {
|
|
216
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
217
|
+
spreadPathsToArguments: {},
|
|
218
|
+
explicitPathsToArguments: { categoryId: '$[0]' },
|
|
219
|
+
singleArgumentUnchanged: false,
|
|
220
|
+
}, ['categoryId']);
|
|
221
|
+
sideEffects?.onError?.(err);
|
|
222
|
+
throw transformedError;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
exports.deleteCategory = deleteCategory;
|
|
226
|
+
/**
|
|
227
|
+
* Retrieves up to 1000 categories, given the specified paging, filtering, and sorting.
|
|
228
|
+
*
|
|
229
|
+
*
|
|
230
|
+
* ## Defaults
|
|
231
|
+
*
|
|
232
|
+
* Query Categories has the following default settings, which you can override:
|
|
233
|
+
*
|
|
234
|
+
* - Most responses are sorted by `id` in ascending order.
|
|
235
|
+
* *Tip**: Always specify a sort order to ensure consistent results.
|
|
236
|
+
* - `cursorPaging.limit` set to `50`.
|
|
237
|
+
*
|
|
238
|
+
* ## Filters
|
|
239
|
+
*
|
|
240
|
+
* Refer to the Supported Filters article ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/categories-v2/filtering-and-sorting)) for a complete list of supported filters and sorting options.
|
|
241
|
+
*
|
|
242
|
+
* ## See also
|
|
243
|
+
*
|
|
244
|
+
* To learn about working with Query methods in general, see:
|
|
245
|
+
*
|
|
246
|
+
* - API Query Language ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)).
|
|
247
|
+
* - Sorting ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language#the-sort-array) | [REST](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging#sort-query-endpoints)).
|
|
248
|
+
* - Paging ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language#the-paging-object) | [REST](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging#paging)).
|
|
249
|
+
* @public
|
|
250
|
+
* @permissionScope Read Bookings - Public Data
|
|
251
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
|
|
252
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
253
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
254
|
+
* @permissionScope Manage Bookings
|
|
255
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
256
|
+
* @permissionScope Read Bookings - Including Participants
|
|
257
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
|
|
258
|
+
* @permissionScope Read Bookings - all read permissions
|
|
259
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
|
|
260
|
+
* @permissionScope Manage Bookings - all permissions
|
|
261
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
262
|
+
* @permissionId BOOKINGS.CATEGORY_READ
|
|
263
|
+
* @applicableIdentity APP
|
|
264
|
+
* @applicableIdentity VISITOR
|
|
265
|
+
* @fqn wix.bookings.categories.v2.CategoriesService.QueryCategories
|
|
266
|
+
*/
|
|
267
|
+
function queryCategories() {
|
|
268
|
+
// @ts-ignore
|
|
269
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
270
|
+
return (0, query_builder_1.queryBuilder)({
|
|
271
|
+
func: async (payload) => {
|
|
272
|
+
const reqOpts = ambassadorWixBookingsCategoriesV2Category.queryCategories(payload);
|
|
273
|
+
sideEffects?.onSiteCall?.();
|
|
274
|
+
try {
|
|
275
|
+
const result = await httpClient.request(reqOpts);
|
|
276
|
+
sideEffects?.onSuccess?.(result);
|
|
277
|
+
return result;
|
|
278
|
+
}
|
|
279
|
+
catch (err) {
|
|
280
|
+
sideEffects?.onError?.(err);
|
|
281
|
+
throw err;
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
requestTransformer: (query) => {
|
|
285
|
+
const args = [query, {}];
|
|
286
|
+
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
287
|
+
...args?.[1],
|
|
288
|
+
query: args?.[0],
|
|
289
|
+
});
|
|
290
|
+
},
|
|
291
|
+
responseTransformer: ({ data }) => {
|
|
292
|
+
const transformedData = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(data);
|
|
293
|
+
return {
|
|
294
|
+
items: transformedData?.categories,
|
|
295
|
+
pagingMetadata: transformedData?.pagingMetadata,
|
|
296
|
+
};
|
|
297
|
+
},
|
|
298
|
+
errorTransformer: (err) => {
|
|
299
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
300
|
+
spreadPathsToArguments: {},
|
|
301
|
+
explicitPathsToArguments: { query: '$[0]' },
|
|
302
|
+
singleArgumentUnchanged: false,
|
|
303
|
+
});
|
|
304
|
+
throw transformedError;
|
|
305
|
+
},
|
|
306
|
+
pagingMethod: 'CURSOR',
|
|
307
|
+
transformationPaths: {},
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
exports.queryCategories = queryCategories;
|
|
311
|
+
/**
|
|
312
|
+
* Counts categories, given the specified filtering.
|
|
313
|
+
*
|
|
314
|
+
*
|
|
315
|
+
* Refer to the Supported Filters article ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/categories-v2/filtering-and-sorting)) for a complete list of supported filters.
|
|
316
|
+
* @public
|
|
317
|
+
* @permissionId BOOKINGS.CATEGORY_READ
|
|
318
|
+
* @permissionScope Read Bookings - Public Data
|
|
319
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
|
|
320
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
321
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
322
|
+
* @permissionScope Manage Bookings
|
|
323
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
324
|
+
* @permissionScope Read Bookings - Including Participants
|
|
325
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
|
|
326
|
+
* @permissionScope Read Bookings - all read permissions
|
|
327
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
|
|
328
|
+
* @permissionScope Manage Bookings - all permissions
|
|
329
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
330
|
+
* @applicableIdentity APP
|
|
331
|
+
* @applicableIdentity VISITOR
|
|
332
|
+
* @fqn wix.bookings.categories.v2.CategoriesService.CountCategories
|
|
333
|
+
*/
|
|
334
|
+
async function countCategories(options) {
|
|
335
|
+
// @ts-ignore
|
|
336
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
337
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
338
|
+
filter: options?.filter,
|
|
339
|
+
});
|
|
340
|
+
const reqOpts = ambassadorWixBookingsCategoriesV2Category.countCategories(payload);
|
|
341
|
+
sideEffects?.onSiteCall?.();
|
|
342
|
+
try {
|
|
343
|
+
const result = await httpClient.request(reqOpts);
|
|
344
|
+
sideEffects?.onSuccess?.(result);
|
|
345
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
346
|
+
}
|
|
347
|
+
catch (err) {
|
|
348
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
349
|
+
spreadPathsToArguments: {},
|
|
350
|
+
explicitPathsToArguments: { filter: '$[0].filter' },
|
|
351
|
+
singleArgumentUnchanged: false,
|
|
352
|
+
}, ['options']);
|
|
353
|
+
sideEffects?.onError?.(err);
|
|
354
|
+
throw transformedError;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
exports.countCategories = countCategories;
|
|
358
|
+
/**
|
|
359
|
+
* Moves a category to the start, the end, or immediately after a specified category in the list.
|
|
360
|
+
*
|
|
361
|
+
*
|
|
362
|
+
* Large initial gaps between `sortOrder` values let Wix Bookings efficiently reorder categories without updating the entire list.
|
|
363
|
+
* If gaps become too small, Wix Bookings automatically restores larger gaps.
|
|
364
|
+
* @param categoryId - ID of the category to move.
|
|
365
|
+
* @public
|
|
366
|
+
* @requiredField categoryId
|
|
367
|
+
* @permissionId BOOKINGS.CATEGORY_MOVE
|
|
368
|
+
* @permissionScope Manage Bookings
|
|
369
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
370
|
+
* @permissionScope Manage Bookings - all permissions
|
|
371
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
372
|
+
* @applicableIdentity APP
|
|
373
|
+
* @fqn wix.bookings.categories.v2.CategoriesService.MoveCategory
|
|
374
|
+
*/
|
|
375
|
+
async function moveCategory(categoryId, options) {
|
|
376
|
+
// @ts-ignore
|
|
377
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
378
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
379
|
+
categoryId: categoryId,
|
|
380
|
+
position: options?.position,
|
|
381
|
+
afterCategoryId: options?.afterCategoryId,
|
|
382
|
+
});
|
|
383
|
+
const reqOpts = ambassadorWixBookingsCategoriesV2Category.moveCategory(payload);
|
|
384
|
+
sideEffects?.onSiteCall?.();
|
|
385
|
+
try {
|
|
386
|
+
const result = await httpClient.request(reqOpts);
|
|
387
|
+
sideEffects?.onSuccess?.(result);
|
|
388
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
389
|
+
}
|
|
390
|
+
catch (err) {
|
|
391
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
392
|
+
spreadPathsToArguments: {},
|
|
393
|
+
explicitPathsToArguments: {
|
|
394
|
+
categoryId: '$[0]',
|
|
395
|
+
position: '$[1].position',
|
|
396
|
+
afterCategoryId: '$[1].afterCategoryId',
|
|
397
|
+
},
|
|
398
|
+
singleArgumentUnchanged: false,
|
|
399
|
+
}, ['categoryId', 'options']);
|
|
400
|
+
sideEffects?.onError?.(err);
|
|
401
|
+
throw transformedError;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
exports.moveCategory = moveCategory;
|
|
405
|
+
//# sourceMappingURL=bookings-categories-v2-category-categories-v-2.universal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookings-categories-v2-category-categories-v-2.universal.js","sourceRoot":"","sources":["../../../src/bookings-categories-v2-category-categories-v-2.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAuF;AACvF,kEAA8D;AAC9D,oFAGiD;AAEjD,oIAAsH;AAkJtH,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AA8ED,IAAY,QAQX;AARD,WAAY,QAAQ;IAClB,iDAAqC,CAAA;IACrC,iDAAiD;IACjD,yBAAa,CAAA;IACb,uDAAuD;IACvD,2BAAe,CAAA;IACf,gEAAgE;IAChE,6CAAiC,CAAA;AACnC,CAAC,EARW,QAAQ,wBAAR,QAAQ,QAQnB;AAqKD,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,8DAAuC,CAAA;IACvC,wCAAiB,CAAA;IACjB,4CAAqB,CAAA;IACrB,kCAAW,CAAA;AACb,CAAC,EANW,mBAAmB,mCAAnB,mBAAmB,QAM9B;AA4ID;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,cAAc,CAClC,QAA4C;IAE5C,aAAa;IACb,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC,CAAC,CAG9C,CAAC;IAEF,MAAM,OAAO,GAAG,IAAA,8DAAqC,EAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IAE9E,MAAM,OA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SAAS,CAAC,CAAC,CAG9C,CAAC;IAEF,MAAM,OAAO,GAAG,IAAA,8DAAqC,EAAC;QACpD,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,OAAO,EAAE,QAAQ;QAC3B,eAAe,EAAE,OAAO,EAAE,eAAe;KAC1C,CAAC,CAAC;IAEH,MAAM,OAAO,GACX,yCAAyC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAElE,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC;IAC5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjD,WAAW,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;QAEjC,OAAO,IAAA,gEAAuC,EAAC,MAAM,CAAC,IAAI,CAAE,CAAC;IAC/D,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,gBAAgB,GAAG,IAAA,gCAAiB,EACxC,GAAG,EACH;YACE,sBAAsB,EAAE,EAAE;YAC1B,wBAAwB,EAAE;gBACxB,UAAU,EAAE,MAAM;gBAClB,QAAQ,EAAE,eAAe;gBACzB,eAAe,EAAE,sBAAsB;aACxC;YACD,uBAAuB,EAAE,KAAK;SAC/B,EACD,CAAC,YAAY,EAAE,SAAS,CAAC,CAC1B,CAAC;QACF,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,gBAAgB,CAAC;IACzB,CAAC;AACH,CAAC;AA3CD,oCA2CC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/bookings-categories-v2-category-categories-v-2.context.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,iEAAiE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/bookings-categories-v2-category-categories-v-2.universal.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":"AAAA,cAAc,mEAAmE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/bookings-categories-v2-category-categories-v-2.meta.js';
|
package/build/es/meta.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":"AAAA,cAAc,8DAA8D,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createCategory as publicCreateCategory, getCategory as publicGetCategory, updateCategory as publicUpdateCategory, deleteCategory as publicDeleteCategory, queryCategories as publicQueryCategories, countCategories as publicCountCategories, moveCategory as publicMoveCategory } from './bookings-categories-v2-category-categories-v-2.public.js';
|
|
2
|
+
import { createEventModule } from '@wix/sdk-runtime/event-definition-modules';
|
|
3
|
+
import { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';
|
|
4
|
+
import { onCategoryCreated as publicOnCategoryCreated } from './bookings-categories-v2-category-categories-v-2.public.js';
|
|
5
|
+
import { onCategoryDeleted as publicOnCategoryDeleted } from './bookings-categories-v2-category-categories-v-2.public.js';
|
|
6
|
+
import { onCategoryUpdated as publicOnCategoryUpdated } from './bookings-categories-v2-category-categories-v-2.public.js';
|
|
7
|
+
export declare const createCategory: MaybeContext<BuildRESTFunction<typeof publicCreateCategory> & typeof publicCreateCategory>;
|
|
8
|
+
export declare const getCategory: MaybeContext<BuildRESTFunction<typeof publicGetCategory> & typeof publicGetCategory>;
|
|
9
|
+
export declare const updateCategory: MaybeContext<BuildRESTFunction<typeof publicUpdateCategory> & typeof publicUpdateCategory>;
|
|
10
|
+
export declare const deleteCategory: MaybeContext<BuildRESTFunction<typeof publicDeleteCategory> & typeof publicDeleteCategory>;
|
|
11
|
+
export declare const queryCategories: MaybeContext<BuildRESTFunction<typeof publicQueryCategories> & typeof publicQueryCategories>;
|
|
12
|
+
export declare const countCategories: MaybeContext<BuildRESTFunction<typeof publicCountCategories> & typeof publicCountCategories>;
|
|
13
|
+
export declare const moveCategory: MaybeContext<BuildRESTFunction<typeof publicMoveCategory> & typeof publicMoveCategory>;
|
|
14
|
+
/**
|
|
15
|
+
* Triggered when a category is created.
|
|
16
|
+
*/
|
|
17
|
+
export declare const onCategoryCreated: ReturnType<typeof createEventModule<typeof publicOnCategoryCreated>>;
|
|
18
|
+
/**
|
|
19
|
+
* Triggered when a category is deleted.
|
|
20
|
+
*/
|
|
21
|
+
export declare const onCategoryDeleted: ReturnType<typeof createEventModule<typeof publicOnCategoryDeleted>>;
|
|
22
|
+
/**
|
|
23
|
+
* Triggered when a category is updated.
|
|
24
|
+
*/
|
|
25
|
+
export declare const onCategoryUpdated: ReturnType<typeof createEventModule<typeof publicOnCategoryUpdated>>;
|
|
26
|
+
export { SortOrder, Position, WebhookIdentityType, } from './bookings-categories-v2-category-categories-v-2.universal.js';
|
|
27
|
+
export { Category, ExtendedFields, CreateCategoryRequest, CreateCategoryResponse, GetCategoryRequest, GetCategoryResponse, UpdateCategoryRequest, UpdateCategoryResponse, DeleteCategoryRequest, DeleteCategoryResponse, QueryCategoriesRequest, CursorQuery, CursorQueryPagingMethodOneOf, Sorting, CursorPaging, QueryCategoriesResponse, CursorPagingMetadata, Cursors, CountCategoriesRequest, CountCategoriesResponse, MoveCategoryRequest, MoveCategoryResponse, ImportCategoriesRequest, ImportCategoriesResponse, PublishCategoriesUpdatedRequest, PublishCategoriesUpdatedResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, RestoreInfo, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, MessageEnvelope, IdentificationData, IdentificationDataIdOneOf, BaseEventMetadata, EventMetadata, CategoryCreatedEnvelope, CategoryDeletedEnvelope, CategoryUpdatedEnvelope, UpdateCategory, CategoriesQueryResult, CategoriesQueryBuilder, CountCategoriesOptions, MoveCategoryOptions, } from './bookings-categories-v2-category-categories-v-2.universal.js';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createCategory as publicCreateCategory, getCategory as publicGetCategory, updateCategory as publicUpdateCategory, deleteCategory as publicDeleteCategory, queryCategories as publicQueryCategories, countCategories as publicCountCategories, moveCategory as publicMoveCategory, } from './bookings-categories-v2-category-categories-v-2.public.js';
|
|
2
|
+
import { createRESTModule } from '@wix/sdk-runtime/rest-modules';
|
|
3
|
+
import { createEventModule } from '@wix/sdk-runtime/event-definition-modules';
|
|
4
|
+
import { onCategoryCreated as publicOnCategoryCreated } from './bookings-categories-v2-category-categories-v-2.public.js';
|
|
5
|
+
import { onCategoryDeleted as publicOnCategoryDeleted } from './bookings-categories-v2-category-categories-v-2.public.js';
|
|
6
|
+
import { onCategoryUpdated as publicOnCategoryUpdated } from './bookings-categories-v2-category-categories-v-2.public.js';
|
|
7
|
+
export const createCategory = /*#__PURE__*/ createRESTModule(publicCreateCategory);
|
|
8
|
+
export const getCategory = /*#__PURE__*/ createRESTModule(publicGetCategory);
|
|
9
|
+
export const updateCategory = /*#__PURE__*/ createRESTModule(publicUpdateCategory);
|
|
10
|
+
export const deleteCategory = /*#__PURE__*/ createRESTModule(publicDeleteCategory);
|
|
11
|
+
export const queryCategories = /*#__PURE__*/ createRESTModule(publicQueryCategories);
|
|
12
|
+
export const countCategories = /*#__PURE__*/ createRESTModule(publicCountCategories);
|
|
13
|
+
export const moveCategory = /*#__PURE__*/ createRESTModule(publicMoveCategory);
|
|
14
|
+
/**
|
|
15
|
+
* Triggered when a category is created.
|
|
16
|
+
*/
|
|
17
|
+
export const onCategoryCreated = createEventModule(publicOnCategoryCreated);
|
|
18
|
+
/**
|
|
19
|
+
* Triggered when a category is deleted.
|
|
20
|
+
*/
|
|
21
|
+
export const onCategoryDeleted = createEventModule(publicOnCategoryDeleted);
|
|
22
|
+
/**
|
|
23
|
+
* Triggered when a category is updated.
|
|
24
|
+
*/
|
|
25
|
+
export const onCategoryUpdated = createEventModule(publicOnCategoryUpdated);
|
|
26
|
+
export { SortOrder, Position, WebhookIdentityType, } from './bookings-categories-v2-category-categories-v-2.universal.js';
|
|
27
|
+
//# sourceMappingURL=bookings-categories-v2-category-categories-v-2.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookings-categories-v2-category-categories-v-2.context.js","sourceRoot":"","sources":["../../../src/bookings-categories-v2-category-categories-v-2.context.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,IAAI,oBAAoB,EACtC,WAAW,IAAI,iBAAiB,EAChC,cAAc,IAAI,oBAAoB,EACtC,cAAc,IAAI,oBAAoB,EACtC,eAAe,IAAI,qBAAqB,EACxC,eAAe,IAAI,qBAAqB,EACxC,YAAY,IAAI,kBAAkB,GACnC,MAAM,4DAA4D,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAE9E,OAAO,EAAE,iBAAiB,IAAI,uBAAuB,EAAE,MAAM,4DAA4D,CAAC;AAC1H,OAAO,EAAE,iBAAiB,IAAI,uBAAuB,EAAE,MAAM,4DAA4D,CAAC;AAC1H,OAAO,EAAE,iBAAiB,IAAI,uBAAuB,EAAE,MAAM,4DAA4D,CAAC;AAE1H,MAAM,CAAC,MAAM,cAAc,GAEvB,aAAa,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAEpB,aAAa,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;AACtD,MAAM,CAAC,MAAM,cAAc,GAEvB,aAAa,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC;AACzD,MAAM,CAAC,MAAM,cAAc,GAEvB,aAAa,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC;AACzD,MAAM,CAAC,MAAM,eAAe,GAExB,aAAa,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;AAC1D,MAAM,CAAC,MAAM,eAAe,GAExB,aAAa,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;AAC1D,MAAM,CAAC,MAAM,YAAY,GAErB,aAAa,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;AACvD;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAE1B,iBAAiB,CAAC,uBAAuB,CAAC,CAAC;AAC/C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAE1B,iBAAiB,CAAC,uBAAuB,CAAC,CAAC;AAC/C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAE1B,iBAAiB,CAAC,uBAAuB,CAAC,CAAC;AAE/C,OAAO,EACL,SAAS,EACT,QAAQ,EACR,mBAAmB,GACpB,MAAM,+DAA+D,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
|
+
/** Creates a category. */
|
|
3
|
+
export declare function createCategory(payload: object): RequestOptionsFactory<any>;
|
|
4
|
+
/** Retrieves a category. */
|
|
5
|
+
export declare function getCategory(payload: object): RequestOptionsFactory<any>;
|
|
6
|
+
/**
|
|
7
|
+
* Updates a category.
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* Each time the category is updated, `revision` increments by 1.
|
|
11
|
+
* You must specify the current `revision` to prevent unintended overwrites.
|
|
12
|
+
*
|
|
13
|
+
* You can't adjust a categories `sortOrder` with this method, call Move Category ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-categories/move-category) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/categories-v2/move-category)) instead.
|
|
14
|
+
*/
|
|
15
|
+
export declare function updateCategory(payload: object): RequestOptionsFactory<any>;
|
|
16
|
+
/**
|
|
17
|
+
* Deletes a category.
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
* ## Impact on connected services
|
|
21
|
+
*
|
|
22
|
+
* When you delete a category, any services linked to it remain associated with the now-deleted category. Wix Bookings still displays these services to business owners in the dashboard, but they aren't visible to customers on the live site.
|
|
23
|
+
* Attempting to call Update Service ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/update-service) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/update-service)) for a service that's linked to a deleted category fails, unless you specify a different, existing category ID in `service.category.id`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function deleteCategory(payload: object): RequestOptionsFactory<any>;
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves up to 1000 categories, given the specified paging, filtering, and sorting.
|
|
28
|
+
*
|
|
29
|
+
*
|
|
30
|
+
* ## Defaults
|
|
31
|
+
*
|
|
32
|
+
* Query Categories has the following default settings, which you can override:
|
|
33
|
+
*
|
|
34
|
+
* - Most responses are sorted by `id` in ascending order.
|
|
35
|
+
* *Tip**: Always specify a sort order to ensure consistent results.
|
|
36
|
+
* - `cursorPaging.limit` set to `50`.
|
|
37
|
+
*
|
|
38
|
+
* ## Filters
|
|
39
|
+
*
|
|
40
|
+
* Refer to the Supported Filters article ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/categories-v2/filtering-and-sorting)) for a complete list of supported filters and sorting options.
|
|
41
|
+
*
|
|
42
|
+
* ## See also
|
|
43
|
+
*
|
|
44
|
+
* To learn about working with Query methods in general, see:
|
|
45
|
+
*
|
|
46
|
+
* - API Query Language ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)).
|
|
47
|
+
* - Sorting ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language#the-sort-array) | [REST](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging#sort-query-endpoints)).
|
|
48
|
+
* - Paging ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language#the-paging-object) | [REST](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging#paging)).
|
|
49
|
+
*/
|
|
50
|
+
export declare function queryCategories(payload: object): RequestOptionsFactory<any>;
|
|
51
|
+
/**
|
|
52
|
+
* Counts categories, given the specified filtering.
|
|
53
|
+
*
|
|
54
|
+
*
|
|
55
|
+
* Refer to the Supported Filters article ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/categories-v2/filtering-and-sorting)) for a complete list of supported filters.
|
|
56
|
+
*/
|
|
57
|
+
export declare function countCategories(payload: object): RequestOptionsFactory<any>;
|
|
58
|
+
/**
|
|
59
|
+
* Moves a category to the start, the end, or immediately after a specified category in the list.
|
|
60
|
+
*
|
|
61
|
+
*
|
|
62
|
+
* Large initial gaps between `sortOrder` values let Wix Bookings efficiently reorder categories without updating the entire list.
|
|
63
|
+
* If gaps become too small, Wix Bookings automatically restores larger gaps.
|
|
64
|
+
*/
|
|
65
|
+
export declare function moveCategory(payload: object): RequestOptionsFactory<any>;
|