@wix/auto_sdk_bookings_categories 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-v1-category-categories.context.d.ts +12 -0
- package/build/cjs/src/bookings-v1-category-categories.context.js +18 -0
- package/build/cjs/src/bookings-v1-category-categories.context.js.map +1 -0
- package/build/cjs/src/bookings-v1-category-categories.http.d.ts +12 -0
- package/build/cjs/src/bookings-v1-category-categories.http.js +177 -0
- package/build/cjs/src/bookings-v1-category-categories.http.js.map +1 -0
- package/build/cjs/src/bookings-v1-category-categories.meta.d.ts +20 -0
- package/build/cjs/src/bookings-v1-category-categories.meta.js +104 -0
- package/build/cjs/src/bookings-v1-category-categories.meta.js.map +1 -0
- package/build/cjs/src/bookings-v1-category-categories.public.d.ts +40 -0
- package/build/cjs/src/bookings-v1-category-categories.public.js +37 -0
- package/build/cjs/src/bookings-v1-category-categories.public.js.map +1 -0
- package/build/cjs/src/bookings-v1-category-categories.types.d.ts +149 -0
- package/build/cjs/src/bookings-v1-category-categories.types.js +25 -0
- package/build/cjs/src/bookings-v1-category-categories.types.js.map +1 -0
- package/build/cjs/src/bookings-v1-category-categories.universal.d.ts +252 -0
- package/build/cjs/src/bookings-v1-category-categories.universal.js +221 -0
- package/build/cjs/src/bookings-v1-category-categories.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-v1-category-categories.context.d.ts +12 -0
- package/build/es/src/bookings-v1-category-categories.context.js +12 -0
- package/build/es/src/bookings-v1-category-categories.context.js.map +1 -0
- package/build/es/src/bookings-v1-category-categories.http.d.ts +12 -0
- package/build/es/src/bookings-v1-category-categories.http.js +170 -0
- package/build/es/src/bookings-v1-category-categories.http.js.map +1 -0
- package/build/es/src/bookings-v1-category-categories.meta.d.ts +20 -0
- package/build/es/src/bookings-v1-category-categories.meta.js +74 -0
- package/build/es/src/bookings-v1-category-categories.meta.js.map +1 -0
- package/build/es/src/bookings-v1-category-categories.public.d.ts +40 -0
- package/build/es/src/bookings-v1-category-categories.public.js +27 -0
- package/build/es/src/bookings-v1-category-categories.public.js.map +1 -0
- package/build/es/src/bookings-v1-category-categories.types.d.ts +149 -0
- package/build/es/src/bookings-v1-category-categories.types.js +22 -0
- package/build/es/src/bookings-v1-category-categories.types.js.map +1 -0
- package/build/es/src/bookings-v1-category-categories.universal.d.ts +252 -0
- package/build/es/src/bookings-v1-category-categories.universal.js +191 -0
- package/build/es/src/bookings-v1-category-categories.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-v1-category-categories.context.d.ts +12 -0
- package/build/internal/cjs/src/bookings-v1-category-categories.context.js +18 -0
- package/build/internal/cjs/src/bookings-v1-category-categories.context.js.map +1 -0
- package/build/internal/cjs/src/bookings-v1-category-categories.http.d.ts +12 -0
- package/build/internal/cjs/src/bookings-v1-category-categories.http.js +177 -0
- package/build/internal/cjs/src/bookings-v1-category-categories.http.js.map +1 -0
- package/build/internal/cjs/src/bookings-v1-category-categories.meta.d.ts +20 -0
- package/build/internal/cjs/src/bookings-v1-category-categories.meta.js +104 -0
- package/build/internal/cjs/src/bookings-v1-category-categories.meta.js.map +1 -0
- package/build/internal/cjs/src/bookings-v1-category-categories.public.d.ts +40 -0
- package/build/internal/cjs/src/bookings-v1-category-categories.public.js +37 -0
- package/build/internal/cjs/src/bookings-v1-category-categories.public.js.map +1 -0
- package/build/internal/cjs/src/bookings-v1-category-categories.types.d.ts +149 -0
- package/build/internal/cjs/src/bookings-v1-category-categories.types.js +25 -0
- package/build/internal/cjs/src/bookings-v1-category-categories.types.js.map +1 -0
- package/build/internal/cjs/src/bookings-v1-category-categories.universal.d.ts +275 -0
- package/build/internal/cjs/src/bookings-v1-category-categories.universal.js +221 -0
- package/build/internal/cjs/src/bookings-v1-category-categories.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-v1-category-categories.context.d.ts +12 -0
- package/build/internal/es/src/bookings-v1-category-categories.context.js +12 -0
- package/build/internal/es/src/bookings-v1-category-categories.context.js.map +1 -0
- package/build/internal/es/src/bookings-v1-category-categories.http.d.ts +12 -0
- package/build/internal/es/src/bookings-v1-category-categories.http.js +170 -0
- package/build/internal/es/src/bookings-v1-category-categories.http.js.map +1 -0
- package/build/internal/es/src/bookings-v1-category-categories.meta.d.ts +20 -0
- package/build/internal/es/src/bookings-v1-category-categories.meta.js +74 -0
- package/build/internal/es/src/bookings-v1-category-categories.meta.js.map +1 -0
- package/build/internal/es/src/bookings-v1-category-categories.public.d.ts +40 -0
- package/build/internal/es/src/bookings-v1-category-categories.public.js +27 -0
- package/build/internal/es/src/bookings-v1-category-categories.public.js.map +1 -0
- package/build/internal/es/src/bookings-v1-category-categories.types.d.ts +149 -0
- package/build/internal/es/src/bookings-v1-category-categories.types.js +22 -0
- package/build/internal/es/src/bookings-v1-category-categories.types.js.map +1 -0
- package/build/internal/es/src/bookings-v1-category-categories.universal.d.ts +275 -0
- package/build/internal/es/src/bookings-v1-category-categories.universal.js +191 -0
- package/build/internal/es/src/bookings-v1-category-categories.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/** Categories are used to group multiple services together. A service must be associated with a category in order to be exposed in the Wix Bookings UI. */
|
|
2
|
+
export interface Category {
|
|
3
|
+
/**
|
|
4
|
+
* Category ID.
|
|
5
|
+
* @readonly
|
|
6
|
+
*/
|
|
7
|
+
_id?: string | null;
|
|
8
|
+
/** Category name. */
|
|
9
|
+
name?: string | null;
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
* @internal
|
|
13
|
+
* @readonly
|
|
14
|
+
*/
|
|
15
|
+
status?: Status;
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
* @internal */
|
|
19
|
+
sortOrder?: number | null;
|
|
20
|
+
}
|
|
21
|
+
export declare enum Status {
|
|
22
|
+
/** The category was created. */
|
|
23
|
+
CREATED = "CREATED",
|
|
24
|
+
/** The category was deleted. */
|
|
25
|
+
DELETED = "DELETED"
|
|
26
|
+
}
|
|
27
|
+
export interface ListCategoryRequest {
|
|
28
|
+
/** Category IDs. */
|
|
29
|
+
categoryIds?: string[];
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
* @internal */
|
|
33
|
+
includeDeleted?: boolean | null;
|
|
34
|
+
}
|
|
35
|
+
export interface ListCategoryResponse {
|
|
36
|
+
/** Category information. */
|
|
37
|
+
categories?: Category[];
|
|
38
|
+
}
|
|
39
|
+
/** An event sent every time a category entity is changed. */
|
|
40
|
+
export interface CategoryNotification {
|
|
41
|
+
category?: Category;
|
|
42
|
+
event?: Event;
|
|
43
|
+
}
|
|
44
|
+
export declare enum Event {
|
|
45
|
+
Updated = "Updated",
|
|
46
|
+
Deleted = "Deleted",
|
|
47
|
+
Created = "Created"
|
|
48
|
+
}
|
|
49
|
+
export interface CreateCategoryRequest {
|
|
50
|
+
/** Category information. */
|
|
51
|
+
category: Category;
|
|
52
|
+
}
|
|
53
|
+
export interface CreateCategoryResponse {
|
|
54
|
+
/** Category information. */
|
|
55
|
+
category?: Category;
|
|
56
|
+
}
|
|
57
|
+
export interface BatchCreateCategoryRequest {
|
|
58
|
+
/** Category information. */
|
|
59
|
+
categories?: Category[];
|
|
60
|
+
}
|
|
61
|
+
export interface BatchCreateCategoryResponse {
|
|
62
|
+
/** Category information. */
|
|
63
|
+
categories?: Category[];
|
|
64
|
+
}
|
|
65
|
+
export interface UpdateCategoryRequest {
|
|
66
|
+
category: Category;
|
|
67
|
+
}
|
|
68
|
+
export interface UpdateCategoryResponse {
|
|
69
|
+
/** The updated category. */
|
|
70
|
+
category?: Category;
|
|
71
|
+
}
|
|
72
|
+
export interface DeleteCategoryRequest {
|
|
73
|
+
/** Category ID. */
|
|
74
|
+
_id: string | null;
|
|
75
|
+
/** Cascade delete all the services in this category. Defaults to false (when false, the services will still exist but will not be accessible in the dashboard). */
|
|
76
|
+
deleteServices?: boolean | null;
|
|
77
|
+
}
|
|
78
|
+
export interface DeleteCategoryResponse {
|
|
79
|
+
/** Deleted Category ID. */
|
|
80
|
+
_id?: string | null;
|
|
81
|
+
}
|
|
82
|
+
export interface BatchDeleteCategoryRequest {
|
|
83
|
+
/** Category ID. */
|
|
84
|
+
ids?: string[] | null;
|
|
85
|
+
}
|
|
86
|
+
export interface BatchDeleteCategoryResponse {
|
|
87
|
+
}
|
|
88
|
+
export interface BatchUpdateCategoryRequest {
|
|
89
|
+
/** List of categories to be updated. */
|
|
90
|
+
categories?: Category[];
|
|
91
|
+
/** Field mask of fields to update. */
|
|
92
|
+
fieldMask?: string[];
|
|
93
|
+
}
|
|
94
|
+
export interface BatchUpdateCategoryResponse {
|
|
95
|
+
}
|
|
96
|
+
export interface MessageEnvelope {
|
|
97
|
+
/** App instance ID. */
|
|
98
|
+
instanceId?: string | null;
|
|
99
|
+
/** Event type. */
|
|
100
|
+
eventType?: string;
|
|
101
|
+
/** The identification type and identity data. */
|
|
102
|
+
identity?: IdentificationData;
|
|
103
|
+
/** Stringify payload. */
|
|
104
|
+
data?: string;
|
|
105
|
+
}
|
|
106
|
+
export interface IdentificationData extends IdentificationDataIdOneOf {
|
|
107
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
108
|
+
anonymousVisitorId?: string;
|
|
109
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
110
|
+
memberId?: string;
|
|
111
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
112
|
+
wixUserId?: string;
|
|
113
|
+
/** ID of an app. */
|
|
114
|
+
appId?: string;
|
|
115
|
+
/** @readonly */
|
|
116
|
+
identityType?: WebhookIdentityType;
|
|
117
|
+
}
|
|
118
|
+
/** @oneof */
|
|
119
|
+
export interface IdentificationDataIdOneOf {
|
|
120
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
121
|
+
anonymousVisitorId?: string;
|
|
122
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
123
|
+
memberId?: string;
|
|
124
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
125
|
+
wixUserId?: string;
|
|
126
|
+
/** ID of an app. */
|
|
127
|
+
appId?: string;
|
|
128
|
+
}
|
|
129
|
+
export declare enum WebhookIdentityType {
|
|
130
|
+
UNKNOWN = "UNKNOWN",
|
|
131
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
132
|
+
MEMBER = "MEMBER",
|
|
133
|
+
WIX_USER = "WIX_USER",
|
|
134
|
+
APP = "APP"
|
|
135
|
+
}
|
|
136
|
+
export interface CategoryNonNullableFields {
|
|
137
|
+
status: Status;
|
|
138
|
+
}
|
|
139
|
+
export interface ListCategoryResponseNonNullableFields {
|
|
140
|
+
categories: CategoryNonNullableFields[];
|
|
141
|
+
}
|
|
142
|
+
export interface CreateCategoryResponseNonNullableFields {
|
|
143
|
+
category?: CategoryNonNullableFields;
|
|
144
|
+
}
|
|
145
|
+
export interface UpdateCategoryResponseNonNullableFields {
|
|
146
|
+
category?: CategoryNonNullableFields;
|
|
147
|
+
}
|
|
148
|
+
export interface BaseEventMetadata {
|
|
149
|
+
/** App instance ID. */
|
|
150
|
+
instanceId?: string | null;
|
|
151
|
+
/** Event type. */
|
|
152
|
+
eventType?: string;
|
|
153
|
+
/** The identification type and identity data. */
|
|
154
|
+
identity?: IdentificationData;
|
|
155
|
+
}
|
|
156
|
+
export interface CategoryNotificationEnvelope {
|
|
157
|
+
data: CategoryNotification;
|
|
158
|
+
metadata: BaseEventMetadata;
|
|
159
|
+
}
|
|
160
|
+
/** @permissionScope Read Bookings - Public Data
|
|
161
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
|
|
162
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
163
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
164
|
+
* @permissionScope Manage Bookings
|
|
165
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
166
|
+
* @permissionScope Read Bookings - Including Participants
|
|
167
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
|
|
168
|
+
* @permissionScope Read Bookings - all read permissions
|
|
169
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
|
|
170
|
+
* @permissionScope Manage Bookings - all permissions
|
|
171
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
172
|
+
* @permissionId BOOKINGS.CATEGORIES_READ
|
|
173
|
+
* @webhook
|
|
174
|
+
* @eventType com.wixpress.bookings.services.api.v1.CategoryNotification
|
|
175
|
+
* @documentationMaturity preview
|
|
176
|
+
*/
|
|
177
|
+
export declare function onCategoryNotification(handler: (event: CategoryNotificationEnvelope) => void | Promise<void>): void;
|
|
178
|
+
/**
|
|
179
|
+
* Lists all categories.
|
|
180
|
+
* @public
|
|
181
|
+
* @documentationMaturity preview
|
|
182
|
+
* @permissionId BOOKINGS.CATEGORIES_READ
|
|
183
|
+
* @permissionScope Read Bookings - Public Data
|
|
184
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
|
|
185
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
186
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
187
|
+
* @permissionScope Manage Bookings
|
|
188
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
189
|
+
* @permissionScope Read Bookings - Including Participants
|
|
190
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
|
|
191
|
+
* @permissionScope Read Bookings - all read permissions
|
|
192
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
|
|
193
|
+
* @permissionScope Manage Bookings - all permissions
|
|
194
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
195
|
+
* @applicableIdentity APP
|
|
196
|
+
* @applicableIdentity VISITOR
|
|
197
|
+
* @fqn com.wixpress.bookings.services.api.v1.CategoriesService.List
|
|
198
|
+
*/
|
|
199
|
+
export declare function listCategories(options?: ListCategoriesOptions): Promise<ListCategoryResponse & ListCategoryResponseNonNullableFields>;
|
|
200
|
+
export interface ListCategoriesOptions {
|
|
201
|
+
/** Category IDs. */
|
|
202
|
+
categoryIds?: string[];
|
|
203
|
+
/** @internal */
|
|
204
|
+
includeDeleted?: boolean | null;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Creates a new category.
|
|
208
|
+
* @param category - Category information.
|
|
209
|
+
* @public
|
|
210
|
+
* @documentationMaturity preview
|
|
211
|
+
* @requiredField category
|
|
212
|
+
* @requiredField category.name
|
|
213
|
+
* @permissionId BOOKINGS.MANAGE_CATEGORIES
|
|
214
|
+
* @permissionScope Manage Bookings
|
|
215
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
216
|
+
* @permissionScope Manage Bookings - all permissions
|
|
217
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
218
|
+
* @applicableIdentity APP
|
|
219
|
+
* @returns Category information.
|
|
220
|
+
* @fqn com.wixpress.bookings.services.api.v1.CategoriesService.Create
|
|
221
|
+
*/
|
|
222
|
+
export declare function createCategory(category: Category): Promise<Category & CategoryNonNullableFields>;
|
|
223
|
+
/**
|
|
224
|
+
* Updates an existing category.
|
|
225
|
+
* @param _id - Category ID.
|
|
226
|
+
* @public
|
|
227
|
+
* @documentationMaturity preview
|
|
228
|
+
* @requiredField _id
|
|
229
|
+
* @requiredField category
|
|
230
|
+
* @requiredField category.name
|
|
231
|
+
* @permissionId BOOKINGS.MANAGE_CATEGORIES
|
|
232
|
+
* @permissionScope Manage Bookings
|
|
233
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
234
|
+
* @permissionScope Manage Bookings - all permissions
|
|
235
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
236
|
+
* @applicableIdentity APP
|
|
237
|
+
* @fqn com.wixpress.bookings.services.api.v1.CategoriesService.Update
|
|
238
|
+
*/
|
|
239
|
+
export declare function updateCategory(_id: string | null, category: UpdateCategory): Promise<UpdateCategoryResponse & UpdateCategoryResponseNonNullableFields>;
|
|
240
|
+
export interface UpdateCategory {
|
|
241
|
+
/**
|
|
242
|
+
* Category ID.
|
|
243
|
+
* @readonly
|
|
244
|
+
*/
|
|
245
|
+
_id?: string | null;
|
|
246
|
+
/** Category name. */
|
|
247
|
+
name?: string | null;
|
|
248
|
+
/**
|
|
249
|
+
* @internal
|
|
250
|
+
* @readonly
|
|
251
|
+
*/
|
|
252
|
+
status?: Status;
|
|
253
|
+
/** @internal */
|
|
254
|
+
sortOrder?: number | null;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Deletes a category.
|
|
258
|
+
* When deleting a category, you have the option to delete all the associated services within this category using the `deleteServices` field in the request.
|
|
259
|
+
* @param _id - Category ID.
|
|
260
|
+
* @public
|
|
261
|
+
* @documentationMaturity preview
|
|
262
|
+
* @requiredField _id
|
|
263
|
+
* @permissionId BOOKINGS.MANAGE_CATEGORIES
|
|
264
|
+
* @permissionScope Manage Bookings
|
|
265
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
266
|
+
* @permissionScope Manage Bookings - all permissions
|
|
267
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
268
|
+
* @applicableIdentity APP
|
|
269
|
+
* @fqn com.wixpress.bookings.services.api.v1.CategoriesService._delete
|
|
270
|
+
*/
|
|
271
|
+
export declare function deleteCategory(_id: string | null, options?: DeleteCategoryOptions): Promise<DeleteCategoryResponse>;
|
|
272
|
+
export interface DeleteCategoryOptions {
|
|
273
|
+
/** Cascade delete all the services in this category. Defaults to false (when false, the services will still exist but will not be accessible in the dashboard). */
|
|
274
|
+
deleteServices?: boolean | null;
|
|
275
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
|
|
2
|
+
import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
|
|
3
|
+
import * as ambassadorWixBookingsV1Category from './bookings-v1-category-categories.http.js';
|
|
4
|
+
export var Status;
|
|
5
|
+
(function (Status) {
|
|
6
|
+
/** The category was created. */
|
|
7
|
+
Status["CREATED"] = "CREATED";
|
|
8
|
+
/** The category was deleted. */
|
|
9
|
+
Status["DELETED"] = "DELETED";
|
|
10
|
+
})(Status || (Status = {}));
|
|
11
|
+
export var Event;
|
|
12
|
+
(function (Event) {
|
|
13
|
+
Event["Updated"] = "Updated";
|
|
14
|
+
Event["Deleted"] = "Deleted";
|
|
15
|
+
Event["Created"] = "Created";
|
|
16
|
+
})(Event || (Event = {}));
|
|
17
|
+
export var WebhookIdentityType;
|
|
18
|
+
(function (WebhookIdentityType) {
|
|
19
|
+
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
|
20
|
+
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
21
|
+
WebhookIdentityType["MEMBER"] = "MEMBER";
|
|
22
|
+
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
|
23
|
+
WebhookIdentityType["APP"] = "APP";
|
|
24
|
+
})(WebhookIdentityType || (WebhookIdentityType = {}));
|
|
25
|
+
/**
|
|
26
|
+
* Lists all categories.
|
|
27
|
+
* @public
|
|
28
|
+
* @documentationMaturity preview
|
|
29
|
+
* @permissionId BOOKINGS.CATEGORIES_READ
|
|
30
|
+
* @permissionScope Read Bookings - Public Data
|
|
31
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
|
|
32
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
33
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
34
|
+
* @permissionScope Manage Bookings
|
|
35
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
36
|
+
* @permissionScope Read Bookings - Including Participants
|
|
37
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
|
|
38
|
+
* @permissionScope Read Bookings - all read permissions
|
|
39
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
|
|
40
|
+
* @permissionScope Manage Bookings - all permissions
|
|
41
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
42
|
+
* @applicableIdentity APP
|
|
43
|
+
* @applicableIdentity VISITOR
|
|
44
|
+
* @fqn com.wixpress.bookings.services.api.v1.CategoriesService.List
|
|
45
|
+
*/
|
|
46
|
+
export async function listCategories(options) {
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
49
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
50
|
+
categoryIds: options?.categoryIds,
|
|
51
|
+
includeDeleted: options?.includeDeleted,
|
|
52
|
+
});
|
|
53
|
+
const reqOpts = ambassadorWixBookingsV1Category.list(payload);
|
|
54
|
+
sideEffects?.onSiteCall?.();
|
|
55
|
+
try {
|
|
56
|
+
const result = await httpClient.request(reqOpts);
|
|
57
|
+
sideEffects?.onSuccess?.(result);
|
|
58
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
const transformedError = sdkTransformError(err, {
|
|
62
|
+
spreadPathsToArguments: {},
|
|
63
|
+
explicitPathsToArguments: {
|
|
64
|
+
categoryIds: '$[0].categoryIds',
|
|
65
|
+
includeDeleted: '$[0].includeDeleted',
|
|
66
|
+
},
|
|
67
|
+
singleArgumentUnchanged: false,
|
|
68
|
+
}, ['options']);
|
|
69
|
+
sideEffects?.onError?.(err);
|
|
70
|
+
throw transformedError;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Creates a new category.
|
|
75
|
+
* @param category - Category information.
|
|
76
|
+
* @public
|
|
77
|
+
* @documentationMaturity preview
|
|
78
|
+
* @requiredField category
|
|
79
|
+
* @requiredField category.name
|
|
80
|
+
* @permissionId BOOKINGS.MANAGE_CATEGORIES
|
|
81
|
+
* @permissionScope Manage Bookings
|
|
82
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
83
|
+
* @permissionScope Manage Bookings - all permissions
|
|
84
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
85
|
+
* @applicableIdentity APP
|
|
86
|
+
* @returns Category information.
|
|
87
|
+
* @fqn com.wixpress.bookings.services.api.v1.CategoriesService.Create
|
|
88
|
+
*/
|
|
89
|
+
export async function createCategory(category) {
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
92
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ category: category });
|
|
93
|
+
const reqOpts = ambassadorWixBookingsV1Category.create(payload);
|
|
94
|
+
sideEffects?.onSiteCall?.();
|
|
95
|
+
try {
|
|
96
|
+
const result = await httpClient.request(reqOpts);
|
|
97
|
+
sideEffects?.onSuccess?.(result);
|
|
98
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.category;
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
const transformedError = sdkTransformError(err, {
|
|
102
|
+
spreadPathsToArguments: {},
|
|
103
|
+
explicitPathsToArguments: { category: '$[0]' },
|
|
104
|
+
singleArgumentUnchanged: false,
|
|
105
|
+
}, ['category']);
|
|
106
|
+
sideEffects?.onError?.(err);
|
|
107
|
+
throw transformedError;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Updates an existing category.
|
|
112
|
+
* @param _id - Category ID.
|
|
113
|
+
* @public
|
|
114
|
+
* @documentationMaturity preview
|
|
115
|
+
* @requiredField _id
|
|
116
|
+
* @requiredField category
|
|
117
|
+
* @requiredField category.name
|
|
118
|
+
* @permissionId BOOKINGS.MANAGE_CATEGORIES
|
|
119
|
+
* @permissionScope Manage Bookings
|
|
120
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
121
|
+
* @permissionScope Manage Bookings - all permissions
|
|
122
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
123
|
+
* @applicableIdentity APP
|
|
124
|
+
* @fqn com.wixpress.bookings.services.api.v1.CategoriesService.Update
|
|
125
|
+
*/
|
|
126
|
+
export async function updateCategory(_id, category) {
|
|
127
|
+
// @ts-ignore
|
|
128
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
129
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
130
|
+
category: { ...category, id: _id },
|
|
131
|
+
});
|
|
132
|
+
const reqOpts = ambassadorWixBookingsV1Category.update(payload);
|
|
133
|
+
sideEffects?.onSiteCall?.();
|
|
134
|
+
try {
|
|
135
|
+
const result = await httpClient.request(reqOpts);
|
|
136
|
+
sideEffects?.onSuccess?.(result);
|
|
137
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
138
|
+
}
|
|
139
|
+
catch (err) {
|
|
140
|
+
const transformedError = sdkTransformError(err, {
|
|
141
|
+
spreadPathsToArguments: { category: '$[1]' },
|
|
142
|
+
explicitPathsToArguments: { 'category.id': '$[0]' },
|
|
143
|
+
singleArgumentUnchanged: false,
|
|
144
|
+
}, ['_id', 'category']);
|
|
145
|
+
sideEffects?.onError?.(err);
|
|
146
|
+
throw transformedError;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Deletes a category.
|
|
151
|
+
* When deleting a category, you have the option to delete all the associated services within this category using the `deleteServices` field in the request.
|
|
152
|
+
* @param _id - Category ID.
|
|
153
|
+
* @public
|
|
154
|
+
* @documentationMaturity preview
|
|
155
|
+
* @requiredField _id
|
|
156
|
+
* @permissionId BOOKINGS.MANAGE_CATEGORIES
|
|
157
|
+
* @permissionScope Manage Bookings
|
|
158
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
159
|
+
* @permissionScope Manage Bookings - all permissions
|
|
160
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
161
|
+
* @applicableIdentity APP
|
|
162
|
+
* @fqn com.wixpress.bookings.services.api.v1.CategoriesService._delete
|
|
163
|
+
*/
|
|
164
|
+
export async function deleteCategory(_id, options) {
|
|
165
|
+
// @ts-ignore
|
|
166
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
167
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
168
|
+
id: _id,
|
|
169
|
+
deleteServices: options?.deleteServices,
|
|
170
|
+
});
|
|
171
|
+
const reqOpts = ambassadorWixBookingsV1Category._delete(payload);
|
|
172
|
+
sideEffects?.onSiteCall?.();
|
|
173
|
+
try {
|
|
174
|
+
const result = await httpClient.request(reqOpts);
|
|
175
|
+
sideEffects?.onSuccess?.(result);
|
|
176
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
177
|
+
}
|
|
178
|
+
catch (err) {
|
|
179
|
+
const transformedError = sdkTransformError(err, {
|
|
180
|
+
spreadPathsToArguments: {},
|
|
181
|
+
explicitPathsToArguments: {
|
|
182
|
+
id: '$[0]',
|
|
183
|
+
deleteServices: '$[1].deleteServices',
|
|
184
|
+
},
|
|
185
|
+
singleArgumentUnchanged: false,
|
|
186
|
+
}, ['_id', 'options']);
|
|
187
|
+
sideEffects?.onError?.(err);
|
|
188
|
+
throw transformedError;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=bookings-v1-category-categories.universal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookings-v1-category-categories.universal.js","sourceRoot":"","sources":["../../../../src/bookings-v1-category-categories.universal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EACL,qCAAqC,EACrC,uCAAuC,GACxC,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,+B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E,GAAG;QACP,cAAc,EAAE,OAAO,EAAE,cAAc;KACxC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,+BAA+B,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAEjE,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,uCAAuC,CAAC,MAAM,CAAC,IAAI,CAAE,CAAC;IAC/D,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,gBAAgB,GAAG,iBAAiB,CACxC,GAAG,EACH;YACE,sBAAsB,EAAE,EAAE;YAC1B,wBAAwB,EAAE;gBACxB,EAAE,EAAE,MAAM;gBACV,cAAc,EAAE,qBAAqB;aACtC;YACD,uBAAuB,EAAE,KAAK;SAC/B,EACD,CAAC,KAAK,EAAE,SAAS,CAAC,CACnB,CAAC;QACF,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,gBAAgB,CAAC;IACzB,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wix/auto_sdk_bookings_categories",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"registry": "https://registry.npmjs.org/",
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"keywords": [],
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"main": "./build/cjs/index.js",
|
|
11
|
+
"types": "./build/es/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./build/es/index.js",
|
|
15
|
+
"require": "./build/cjs/index.js",
|
|
16
|
+
"types": "./build/es/index.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./package.json": "./package.json",
|
|
19
|
+
"./meta": {
|
|
20
|
+
"import": "./build/es/meta.js",
|
|
21
|
+
"require": "./build/cjs/meta.js",
|
|
22
|
+
"types": "./build/es/meta.d.ts"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"build",
|
|
27
|
+
"meta",
|
|
28
|
+
"service-plugins"
|
|
29
|
+
],
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@wix/sdk-runtime": "^0.3.35",
|
|
32
|
+
"@wix/sdk-types": "^1.12.4"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"typescript": "^5.3.2"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc -b tsconfig.json tsconfig.esm.json tsconfig.internal.json tsconfig.internal.esm.json",
|
|
39
|
+
"test": ":"
|
|
40
|
+
},
|
|
41
|
+
"wix": {
|
|
42
|
+
"artifact": {
|
|
43
|
+
"artifactId": "auto-sdk-bookings-categories",
|
|
44
|
+
"groupId": "com.wixpress.public-sdk-dependencies"
|
|
45
|
+
},
|
|
46
|
+
"sdkDependency": {
|
|
47
|
+
"fqdnNamespace": "categories",
|
|
48
|
+
"fqdn": "wix.bookings.v1.category"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"falconPackageHash": "0aa8fc4b8cc783d16b4624fd5808a55c46b3f0f71003ac9b9ad5b1f0"
|
|
52
|
+
}
|