@wix/auto_sdk_bookings_categories 1.0.22 → 1.0.23
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 +5 -3
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/{bookings-v1-category-categories.universal-DrWLnqJ6.d.ts → index.typings.d.ts} +103 -1
- package/build/cjs/index.typings.js +337 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +2 -1
- package/build/es/index.d.mts +5 -3
- package/build/es/index.mjs.map +1 -1
- package/build/es/{bookings-v1-category-categories.universal-DrWLnqJ6.d.mts → index.typings.d.mts} +103 -1
- package/build/es/index.typings.mjs +307 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +2 -1
- package/build/internal/cjs/index.d.ts +5 -3
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/{bookings-v1-category-categories.universal-DY7XN7m0.d.ts → index.typings.d.ts} +101 -1
- package/build/internal/cjs/index.typings.js +337 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +2 -1
- package/build/internal/es/index.d.mts +5 -3
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/{bookings-v1-category-categories.universal-DY7XN7m0.d.mts → index.typings.d.mts} +101 -1
- package/build/internal/es/index.typings.mjs +307 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +2 -1
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { ListCategoriesOptions, ListCategoryResponse, Category, UpdateCategory, UpdateCategoryResponse, UpdateCategoryApplicationErrors, DeleteCategoryOptions, DeleteCategoryResponse, CategoryNotificationEnvelope } from './index.typings.js';
|
|
3
|
+
export { BaseEventMetadata, BatchCreateCategoryRequest, BatchCreateCategoryResponse, BatchDeleteCategoryRequest, BatchDeleteCategoryResponse, BatchUpdateCategoryRequest, BatchUpdateCategoryResponse, CategoryNotification, CreateCategoryRequest, CreateCategoryResponse, DeleteCategoryRequest, Event, IdentificationData, IdentificationDataIdOneOf, ListCategoryRequest, MessageEnvelope, Status, UpdateCategoryRequest, WebhookIdentityType } from './index.typings.js';
|
|
4
4
|
|
|
5
5
|
declare function listCategories$1(httpClient: HttpClient): ListCategoriesSignature;
|
|
6
6
|
interface ListCategoriesSignature {
|
|
@@ -34,7 +34,9 @@ interface UpdateCategorySignature {
|
|
|
34
34
|
* @param - Category ID.
|
|
35
35
|
* @deprecated
|
|
36
36
|
*/
|
|
37
|
-
(_id: string, category: UpdateCategory): Promise<UpdateCategoryResponse
|
|
37
|
+
(_id: string, category: UpdateCategory): Promise<UpdateCategoryResponse & {
|
|
38
|
+
__applicationErrorsType?: UpdateCategoryApplicationErrors | undefined;
|
|
39
|
+
}>;
|
|
38
40
|
}
|
|
39
41
|
declare function deleteCategory$1(httpClient: HttpClient): DeleteCategorySignature;
|
|
40
42
|
interface DeleteCategorySignature {
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../src/bookings-v1-category-categories.public.ts","../../src/bookings-v1-category-categories.universal.ts","../../src/bookings-v1-category-categories.http.ts","../../src/bookings-v1-category-categories.context.ts"],"sourcesContent":["export * from './src/bookings-v1-category-categories.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Category,\n CategoryNotificationEnvelope,\n DeleteCategoryOptions,\n DeleteCategoryResponse,\n ListCategoriesOptions,\n ListCategoryResponse,\n UpdateCategory,\n UpdateCategoryResponse,\n createCategory as universalCreateCategory,\n deleteCategory as universalDeleteCategory,\n listCategories as universalListCategories,\n updateCategory as universalUpdateCategory,\n} from './bookings-v1-category-categories.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/bookings' };\n\nexport function listCategories(\n httpClient: HttpClient\n): ListCategoriesSignature {\n return (options?: ListCategoriesOptions) =>\n universalListCategories(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListCategoriesSignature {\n /**\n * Retrieves all categories.\n * @param - Options to use when listing categories.\n * @deprecated\n */\n (options?: ListCategoriesOptions | undefined): Promise<ListCategoryResponse>;\n}\n\nexport function createCategory(\n httpClient: HttpClient\n): CreateCategorySignature {\n return (category: NonNullablePaths<Category, `name`>) =>\n universalCreateCategory(\n category,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateCategorySignature {\n /**\n * Creates a category.\n * @param - Category to create.\n * @returns Created category.\n * @deprecated\n */\n (category: Category): Promise<Category>;\n}\n\nexport function updateCategory(\n httpClient: HttpClient\n): UpdateCategorySignature {\n return (_id: string, category: NonNullablePaths<UpdateCategory, `name`>) =>\n universalUpdateCategory(\n _id,\n category,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateCategorySignature {\n /**\n * Updates a category.\n *\n *\n * Each time the category is updated, revision increments by 1. You must include\n * the number of the existing revision when updating the category. This ensures\n * you're working with the latest service information and prevents unintended\n * overwrites.\n * @param - Category ID.\n * @deprecated\n */\n (_id: string, category: UpdateCategory): Promise<UpdateCategoryResponse>;\n}\n\nexport function deleteCategory(\n httpClient: HttpClient\n): DeleteCategorySignature {\n return (_id: string, options?: DeleteCategoryOptions) =>\n universalDeleteCategory(\n _id,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteCategorySignature {\n /**\n * Deletes a category.\n *\n *\n * You can specify `{\"deleteServices\": true}` to also delete all associated\n * services. Learn more about *deleting a service*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/delete-service) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/delete-service)).\n * @param - ID of the category to delete.\n * @deprecated\n */\n (\n _id: string,\n options?: DeleteCategoryOptions | undefined\n ): Promise<DeleteCategoryResponse>;\n}\n\nexport const onCategoryNotification = EventDefinition(\n 'com.wixpress.bookings.services.api.v1.CategoryNotification',\n false,\n (event: CategoryNotificationEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(event)\n)<CategoryNotificationEnvelope>();\n\nexport {\n BaseEventMetadata,\n BatchCreateCategoryRequest,\n BatchCreateCategoryResponse,\n BatchDeleteCategoryRequest,\n BatchDeleteCategoryResponse,\n BatchUpdateCategoryRequest,\n BatchUpdateCategoryResponse,\n Category,\n CategoryNotification,\n CategoryNotificationEnvelope,\n CreateCategoryRequest,\n CreateCategoryResponse,\n DeleteCategoryOptions,\n DeleteCategoryRequest,\n DeleteCategoryResponse,\n Event,\n IdentificationData,\n IdentificationDataIdOneOf,\n ListCategoriesOptions,\n ListCategoryRequest,\n ListCategoryResponse,\n MessageEnvelope,\n Status,\n UpdateCategory,\n UpdateCategoryRequest,\n UpdateCategoryResponse,\n WebhookIdentityType,\n} from './bookings-v1-category-categories.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBookingsV1Category from './bookings-v1-category-categories.http.js';\n\n/** 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. */\nexport interface Category {\n /**\n * Category ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Category name.\n * @maxLength 500\n */\n name?: string | null;\n /**\n * @internal\n * @internal\n * @readonly\n */\n status?: StatusWithLiterals;\n /**\n * @internal\n * @internal */\n sortOrder?: number | null;\n}\n\nexport enum Status {\n /** The category was created. */\n CREATED = 'CREATED',\n /** The category was deleted. */\n DELETED = 'DELETED',\n}\n\n/** @enumType */\nexport type StatusWithLiterals = Status | 'CREATED' | 'DELETED';\n\nexport interface ListCategoryRequest {\n /**\n * IDs of the categories to retrieve.\n *\n * Default: All categories are retrieved.\n * @format GUID\n */\n categoryIds?: string[];\n /**\n * @internal\n * @internal */\n includeDeleted?: boolean | null;\n}\n\nexport interface ListCategoryResponse {\n /** Retrieved categories. */\n categories?: Category[];\n}\n\n/** An event sent every time a category entity is changed. */\nexport interface CategoryNotification {\n category?: Category;\n event?: EventWithLiterals;\n}\n\nexport enum Event {\n /** Category was updated. */\n Updated = 'Updated',\n /** Category was deleted. */\n Deleted = 'Deleted',\n /** Category was created. */\n Created = 'Created',\n}\n\n/** @enumType */\nexport type EventWithLiterals = Event | 'Updated' | 'Deleted' | 'Created';\n\nexport interface CreateCategoryRequest {\n /** Category to create. */\n category: Category;\n}\n\nexport interface CreateCategoryResponse {\n /** Created category. */\n category?: Category;\n}\n\nexport interface BatchCreateCategoryRequest {\n /** Categories to create. */\n categories?: Category[];\n}\n\nexport interface BatchCreateCategoryResponse {\n /** Created categories. */\n categories?: Category[];\n}\n\nexport interface UpdateCategoryRequest {\n /** Category to update. */\n category: Category;\n}\n\nexport interface UpdateCategoryResponse {\n /** Updated category. */\n category?: Category;\n}\n\nexport interface DeleteCategoryRequest {\n /**\n * ID of the category to delete.\n * @format GUID\n */\n _id: string | null;\n /**\n * Whether to delete all the services associated with the category.\n *\n * Default: `false`\n */\n deleteServices?: boolean | null;\n}\n\nexport interface DeleteCategoryResponse {\n /**\n * ID of the deleted category.\n * @format GUID\n */\n _id?: string | null;\n}\n\nexport interface BatchDeleteCategoryRequest {\n /**\n * IDs of the categories to delete.\n * @format GUID\n */\n ids?: string[] | null;\n}\n\nexport interface BatchDeleteCategoryResponse {}\n\nexport interface BatchUpdateCategoryRequest {\n /** List of categories to be updated. */\n categories?: Category[];\n /** Field mask of fields to update. */\n fieldMask?: string[];\n}\n\nexport interface BatchUpdateCategoryResponse {}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n}\n\nexport interface CategoryNotificationEnvelope {\n data: CategoryNotification;\n metadata: BaseEventMetadata;\n}\n\n/** @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Read Bookings - Public Data\n * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC\n * @permissionScope Manage Bookings Services and Settings\n * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION\n * @permissionScope Manage Bookings\n * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS\n * @permissionScope Read Bookings - Including Participants\n * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE\n * @permissionScope Read Bookings - all read permissions\n * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS\n * @permissionScope Manage Bookings - all permissions\n * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS\n * @permissionId BOOKINGS.CATEGORIES_READ\n * @webhook\n * @eventType com.wixpress.bookings.services.api.v1.CategoryNotification\n * @serviceIdentifier com.wixpress.bookings.services.api.v1.CategoriesService\n * @slug category_notification\n * @documentationMaturity preview\n * @deprecated\n */\nexport declare function onCategoryNotification(\n handler: (event: CategoryNotificationEnvelope) => void | Promise<void>\n): void;\n\ntype CategoryNonNullablePaths = `status`;\n\n/**\n * Retrieves all categories.\n * @public\n * @documentationMaturity preview\n * @param options - Options to use when listing categories.\n * @permissionId BOOKINGS.CATEGORIES_READ\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.bookings.services.api.v1.CategoriesService.List\n * @deprecated\n */\nexport async function listCategories(\n options?: ListCategoriesOptions\n): Promise<\n NonNullablePaths<\n ListCategoryResponse,\n {\n [P in CategoryNonNullablePaths]: `categories.${number}.${P}`;\n }[CategoryNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n categoryIds: options?.categoryIds,\n includeDeleted: options?.includeDeleted,\n });\n\n const reqOpts = ambassadorWixBookingsV1Category.list(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n categoryIds: '$[0].categoryIds',\n includeDeleted: '$[0].includeDeleted',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListCategoriesOptions {\n /**\n * IDs of the categories to retrieve.\n *\n * Default: All categories are retrieved.\n * @format GUID\n */\n categoryIds?: string[];\n /** @internal */\n includeDeleted?: boolean | null;\n}\n\n/**\n * Creates a category.\n * @param category - Category to create.\n * @public\n * @documentationMaturity preview\n * @requiredField category\n * @requiredField category.name\n * @permissionId BOOKINGS.MANAGE_CATEGORIES\n * @applicableIdentity APP\n * @returns Created category.\n * @fqn com.wixpress.bookings.services.api.v1.CategoriesService.Create\n * @deprecated\n */\nexport async function createCategory(\n category: NonNullablePaths<Category, `name`>\n): Promise<NonNullablePaths<Category, CategoryNonNullablePaths>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ category: category });\n\n const reqOpts = ambassadorWixBookingsV1Category.create(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.category!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { category: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['category']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a category.\n *\n *\n * Each time the category is updated, revision increments by 1. You must include\n * the number of the existing revision when updating the category. This ensures\n * you're working with the latest service information and prevents unintended\n * overwrites.\n * @param _id - Category ID.\n * @public\n * @documentationMaturity preview\n * @requiredField _id\n * @requiredField category\n * @requiredField category.name\n * @permissionId BOOKINGS.MANAGE_CATEGORIES\n * @applicableIdentity APP\n * @fqn com.wixpress.bookings.services.api.v1.CategoriesService.Update\n * @deprecated\n */\nexport async function updateCategory(\n _id: string,\n category: NonNullablePaths<UpdateCategory, `name`>\n): Promise<\n NonNullablePaths<\n UpdateCategoryResponse,\n {\n [P in CategoryNonNullablePaths]: `category.${P}`;\n }[CategoryNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n category: { ...category, id: _id },\n });\n\n const reqOpts = ambassadorWixBookingsV1Category.update(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { category: '$[1]' },\n explicitPathsToArguments: { 'category.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'category']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateCategory {\n /**\n * Category ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Category name.\n * @maxLength 500\n */\n name?: string | null;\n /**\n * @internal\n * @readonly\n */\n status?: StatusWithLiterals;\n /** @internal */\n sortOrder?: number | null;\n}\n\n/**\n * Deletes a category.\n *\n *\n * You can specify `{\"deleteServices\": true}` to also delete all associated\n * services. Learn more about *deleting a service*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/delete-service) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/delete-service)).\n * @param _id - ID of the category to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField _id\n * @permissionId BOOKINGS.MANAGE_CATEGORIES\n * @applicableIdentity APP\n * @fqn com.wixpress.bookings.services.api.v1.CategoriesService._delete\n * @deprecated\n */\nexport async function deleteCategory(\n _id: string,\n options?: DeleteCategoryOptions\n): Promise<DeleteCategoryResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n id: _id,\n deleteServices: options?.deleteServices,\n });\n\n const reqOpts = ambassadorWixBookingsV1Category._delete(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n id: '$[0]',\n deleteServices: '$[1].deleteServices',\n },\n singleArgumentUnchanged: false,\n },\n ['_id', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface DeleteCategoryOptions {\n /**\n * Whether to delete all the services associated with the category.\n *\n * Default: `false`\n */\n deleteServices?: boolean | null;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressBookingsServicesApiV1CategoriesServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/bookings/v1/categories',\n destPath: '/v1/categories',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/bookings/v1/categories',\n destPath: '/v1/categories',\n },\n {\n srcPath: '/_api/services-server/v1/categories',\n destPath: '/v1/categories',\n },\n {\n srcPath: '/_api/services-server/v1/batch/categories',\n destPath: '/v1/batch/categories',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/bookings/v1/categories',\n destPath: '/v1/categories',\n },\n {\n srcPath: '/_api/bookings/v1/batch/categories',\n destPath: '/v1/batch/categories',\n },\n {\n srcPath: '/_api/services-server/v1/categories',\n destPath: '/v1/categories',\n },\n {\n srcPath: '/_api/services-server/v1/batch/categories',\n destPath: '/v1/batch/categories',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/bookings/v1/categories',\n destPath: '/v1/categories',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/bookings/v1/categories',\n destPath: '/v1/categories',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/bookings/v1/categories',\n destPath: '/v1/categories',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/categories-proxy',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/services-server/v1/categories',\n destPath: '/v1/categories',\n },\n {\n srcPath: '/_api/services-server/v1/batch/categories',\n destPath: '/v1/batch/categories',\n },\n ],\n 'bookings._base_domain_': [\n {\n srcPath: '/_api/services-server/v1/categories',\n destPath: '/v1/categories',\n },\n {\n srcPath: '/_api/services-server/v1/batch/categories',\n destPath: '/v1/batch/categories',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_bookings_categories';\n\n/**\n * Retrieves all categories.\n * @deprecated\n */\nexport function list(payload: object): RequestOptionsFactory<any> {\n function __list({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bookings.v1.category',\n method: 'GET' as any,\n methodFqn: 'com.wixpress.bookings.services.api.v1.CategoriesService.List',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressBookingsServicesApiV1CategoriesServiceUrl({\n protoPath: '/v1/categories',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __list;\n}\n\n/**\n * Creates a category.\n * @deprecated\n */\nexport function create(payload: object): RequestOptionsFactory<any> {\n function __create({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bookings.v1.category',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.bookings.services.api.v1.CategoriesService.Create',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressBookingsServicesApiV1CategoriesServiceUrl({\n protoPath: '/v1/categories',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __create;\n}\n\n/**\n * Updates a category.\n *\n *\n * Each time the category is updated, revision increments by 1. You must include\n * the number of the existing revision when updating the category. This ensures\n * you're working with the latest service information and prevents unintended\n * overwrites.\n * @deprecated\n */\nexport function update(payload: object): RequestOptionsFactory<any> {\n function __update({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bookings.v1.category',\n method: 'PUT' as any,\n methodFqn:\n 'com.wixpress.bookings.services.api.v1.CategoriesService.Update',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressBookingsServicesApiV1CategoriesServiceUrl({\n protoPath: '/v1/categories/{category.id}',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __update;\n}\n\n/**\n * Deletes a category.\n *\n *\n * You can specify `{\"deleteServices\": true}` to also delete all associated\n * services. Learn more about *deleting a service*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/delete-service) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/delete-service)).\n * @deprecated\n */\nexport function _delete(payload: object): RequestOptionsFactory<any> {\n function ___delete({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bookings.v1.category',\n method: 'DELETE' as any,\n methodFqn:\n 'com.wixpress.bookings.services.api.v1.CategoriesService._delete',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressBookingsServicesApiV1CategoriesServiceUrl({\n protoPath: '/v1/categories/{id}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return ___delete;\n}\n","import {\n listCategories as publicListCategories,\n createCategory as publicCreateCategory,\n updateCategory as publicUpdateCategory,\n deleteCategory as publicDeleteCategory,\n} from './bookings-v1-category-categories.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onCategoryNotification as publicOnCategoryNotification } from './bookings-v1-category-categories.public.js';\n\nexport const listCategories: MaybeContext<\n BuildRESTFunction<typeof publicListCategories> & typeof publicListCategories\n> = /*#__PURE__*/ createRESTModule(publicListCategories);\nexport const createCategory: MaybeContext<\n BuildRESTFunction<typeof publicCreateCategory> & typeof publicCreateCategory\n> = /*#__PURE__*/ createRESTModule(publicCreateCategory);\nexport const updateCategory: MaybeContext<\n BuildRESTFunction<typeof publicUpdateCategory> & typeof publicUpdateCategory\n> = /*#__PURE__*/ createRESTModule(publicUpdateCategory);\nexport const deleteCategory: MaybeContext<\n BuildRESTFunction<typeof publicDeleteCategory> & typeof publicDeleteCategory\n> = /*#__PURE__*/ createRESTModule(publicDeleteCategory);\n/** @deprecated */\nexport const onCategoryNotification: BuildEventDefinition<\n typeof publicOnCategoryNotification\n> = createEventModule(publicOnCategoryNotification);\n\nexport {\n Status,\n Event,\n WebhookIdentityType,\n} from './bookings-v1-category-categories.universal.js';\nexport {\n Category,\n ListCategoryRequest,\n ListCategoryResponse,\n CategoryNotification,\n CreateCategoryRequest,\n CreateCategoryResponse,\n BatchCreateCategoryRequest,\n BatchCreateCategoryResponse,\n UpdateCategoryRequest,\n UpdateCategoryResponse,\n DeleteCategoryRequest,\n DeleteCategoryResponse,\n BatchDeleteCategoryRequest,\n BatchDeleteCategoryResponse,\n BatchUpdateCategoryRequest,\n BatchUpdateCategoryResponse,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n BaseEventMetadata,\n CategoryNotificationEnvelope,\n ListCategoriesOptions,\n UpdateCategory,\n DeleteCategoryOptions,\n} from './bookings-v1-category-categories.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAAA;AAAA,EAAA,sBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,8BAAAC;AAAA,EAAA,sBAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,uBAA8D;;;ACD9D,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,4DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,yBAAyB;AAAA,MACv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;AAiBO,SAASC,gBACd,YACyB;AACzB,SAAO,CAAC,KAAa,YACnB;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAmBO,IAAM,6BAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA,CAAC,cACC,wEAAwC,KAAK;AACjD,EAAgC;;;AGnHhC,IAAAC,uBAAiC;AACjC,sCAAkC;AAQ3B,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAEhD,IAAMC,8BAET,mDAAkB,sBAA4B;","names":["createCategory","deleteCategory","listCategories","onCategoryNotification","updateCategory","import_rename_all_nested_keys","import_rest_modules","Status","Event","WebhookIdentityType","sdkTransformError","listCategories","createCategory","updateCategory","deleteCategory","import_rest_modules","listCategories","createCategory","updateCategory","deleteCategory","onCategoryNotification"]}
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/bookings-v1-category-categories.public.ts","../../src/bookings-v1-category-categories.universal.ts","../../src/bookings-v1-category-categories.http.ts","../../src/bookings-v1-category-categories.context.ts"],"sourcesContent":["export * from './src/bookings-v1-category-categories.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Category,\n CategoryNotificationEnvelope,\n DeleteCategoryOptions,\n DeleteCategoryResponse,\n ListCategoriesOptions,\n ListCategoryResponse,\n UpdateCategory,\n UpdateCategoryApplicationErrors,\n UpdateCategoryResponse,\n createCategory as universalCreateCategory,\n deleteCategory as universalDeleteCategory,\n listCategories as universalListCategories,\n updateCategory as universalUpdateCategory,\n} from './bookings-v1-category-categories.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/bookings' };\n\nexport function listCategories(\n httpClient: HttpClient\n): ListCategoriesSignature {\n return (options?: ListCategoriesOptions) =>\n universalListCategories(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListCategoriesSignature {\n /**\n * Retrieves all categories.\n * @param - Options to use when listing categories.\n * @deprecated\n */\n (options?: ListCategoriesOptions | undefined): Promise<ListCategoryResponse>;\n}\n\nexport function createCategory(\n httpClient: HttpClient\n): CreateCategorySignature {\n return (category: NonNullablePaths<Category, `name`>) =>\n universalCreateCategory(\n category,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateCategorySignature {\n /**\n * Creates a category.\n * @param - Category to create.\n * @returns Created category.\n * @deprecated\n */\n (category: Category): Promise<Category>;\n}\n\nexport function updateCategory(\n httpClient: HttpClient\n): UpdateCategorySignature {\n return (_id: string, category: NonNullablePaths<UpdateCategory, `name`>) =>\n universalUpdateCategory(\n _id,\n category,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateCategorySignature {\n /**\n * Updates a category.\n *\n *\n * Each time the category is updated, revision increments by 1. You must include\n * the number of the existing revision when updating the category. This ensures\n * you're working with the latest service information and prevents unintended\n * overwrites.\n * @param - Category ID.\n * @deprecated\n */\n (_id: string, category: UpdateCategory): Promise<\n UpdateCategoryResponse & {\n __applicationErrorsType?: UpdateCategoryApplicationErrors | undefined;\n }\n >;\n}\n\nexport function deleteCategory(\n httpClient: HttpClient\n): DeleteCategorySignature {\n return (_id: string, options?: DeleteCategoryOptions) =>\n universalDeleteCategory(\n _id,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteCategorySignature {\n /**\n * Deletes a category.\n *\n *\n * You can specify `{\"deleteServices\": true}` to also delete all associated\n * services. Learn more about *deleting a service*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/delete-service) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/delete-service)).\n * @param - ID of the category to delete.\n * @deprecated\n */\n (\n _id: string,\n options?: DeleteCategoryOptions | undefined\n ): Promise<DeleteCategoryResponse>;\n}\n\nexport const onCategoryNotification = EventDefinition(\n 'com.wixpress.bookings.services.api.v1.CategoryNotification',\n false,\n (event: CategoryNotificationEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(event)\n)<CategoryNotificationEnvelope>();\n\nexport {\n BaseEventMetadata,\n BatchCreateCategoryRequest,\n BatchCreateCategoryResponse,\n BatchDeleteCategoryRequest,\n BatchDeleteCategoryResponse,\n BatchUpdateCategoryRequest,\n BatchUpdateCategoryResponse,\n Category,\n CategoryNotification,\n CategoryNotificationEnvelope,\n CreateCategoryRequest,\n CreateCategoryResponse,\n DeleteCategoryOptions,\n DeleteCategoryRequest,\n DeleteCategoryResponse,\n Event,\n IdentificationData,\n IdentificationDataIdOneOf,\n ListCategoriesOptions,\n ListCategoryRequest,\n ListCategoryResponse,\n MessageEnvelope,\n Status,\n UpdateCategory,\n UpdateCategoryRequest,\n UpdateCategoryResponse,\n WebhookIdentityType,\n} from './bookings-v1-category-categories.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBookingsV1Category from './bookings-v1-category-categories.http.js';\n\n/** 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. */\nexport interface Category {\n /**\n * Category ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Category name.\n * @maxLength 500\n */\n name?: string | null;\n /**\n * @internal\n * @internal\n * @readonly\n */\n status?: StatusWithLiterals;\n /**\n * @internal\n * @internal */\n sortOrder?: number | null;\n}\n\nexport enum Status {\n /** The category was created. */\n CREATED = 'CREATED',\n /** The category was deleted. */\n DELETED = 'DELETED',\n}\n\n/** @enumType */\nexport type StatusWithLiterals = Status | 'CREATED' | 'DELETED';\n\nexport interface ListCategoryRequest {\n /**\n * IDs of the categories to retrieve.\n *\n * Default: All categories are retrieved.\n * @format GUID\n */\n categoryIds?: string[];\n /**\n * @internal\n * @internal */\n includeDeleted?: boolean | null;\n}\n\nexport interface ListCategoryResponse {\n /** Retrieved categories. */\n categories?: Category[];\n}\n\n/** An event sent every time a category entity is changed. */\nexport interface CategoryNotification {\n category?: Category;\n event?: EventWithLiterals;\n}\n\nexport enum Event {\n /** Category was updated. */\n Updated = 'Updated',\n /** Category was deleted. */\n Deleted = 'Deleted',\n /** Category was created. */\n Created = 'Created',\n}\n\n/** @enumType */\nexport type EventWithLiterals = Event | 'Updated' | 'Deleted' | 'Created';\n\nexport interface CreateCategoryRequest {\n /** Category to create. */\n category: Category;\n}\n\nexport interface CreateCategoryResponse {\n /** Created category. */\n category?: Category;\n}\n\nexport interface BatchCreateCategoryRequest {\n /** Categories to create. */\n categories?: Category[];\n}\n\nexport interface BatchCreateCategoryResponse {\n /** Created categories. */\n categories?: Category[];\n}\n\nexport interface UpdateCategoryRequest {\n /** Category to update. */\n category: Category;\n}\n\nexport interface UpdateCategoryResponse {\n /** Updated category. */\n category?: Category;\n}\n\nexport interface DeleteCategoryRequest {\n /**\n * ID of the category to delete.\n * @format GUID\n */\n _id: string | null;\n /**\n * Whether to delete all the services associated with the category.\n *\n * Default: `false`\n */\n deleteServices?: boolean | null;\n}\n\nexport interface DeleteCategoryResponse {\n /**\n * ID of the deleted category.\n * @format GUID\n */\n _id?: string | null;\n}\n\nexport interface BatchDeleteCategoryRequest {\n /**\n * IDs of the categories to delete.\n * @format GUID\n */\n ids?: string[] | null;\n}\n\nexport interface BatchDeleteCategoryResponse {}\n\nexport interface BatchUpdateCategoryRequest {\n /** List of categories to be updated. */\n categories?: Category[];\n /** Field mask of fields to update. */\n fieldMask?: string[];\n}\n\nexport interface BatchUpdateCategoryResponse {}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\nexport type UpdateCategoryApplicationErrors = {\n code?: 'NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n}\n\nexport interface CategoryNotificationEnvelope {\n data: CategoryNotification;\n metadata: BaseEventMetadata;\n}\n\n/** @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Read Bookings - Public Data\n * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC\n * @permissionScope Manage Bookings Services and Settings\n * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION\n * @permissionScope Manage Bookings\n * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS\n * @permissionScope Read Bookings - Including Participants\n * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE\n * @permissionScope Read Bookings - all read permissions\n * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS\n * @permissionScope Manage Bookings - all permissions\n * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS\n * @permissionId BOOKINGS.CATEGORIES_READ\n * @webhook\n * @eventType com.wixpress.bookings.services.api.v1.CategoryNotification\n * @serviceIdentifier com.wixpress.bookings.services.api.v1.CategoriesService\n * @slug category_notification\n * @documentationMaturity preview\n * @deprecated\n */\nexport declare function onCategoryNotification(\n handler: (event: CategoryNotificationEnvelope) => void | Promise<void>\n): void;\n\ntype CategoryNonNullablePaths = `status`;\n\n/**\n * Retrieves all categories.\n * @public\n * @documentationMaturity preview\n * @param options - Options to use when listing categories.\n * @permissionId BOOKINGS.CATEGORIES_READ\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.bookings.services.api.v1.CategoriesService.List\n * @deprecated\n */\nexport async function listCategories(\n options?: ListCategoriesOptions\n): Promise<\n NonNullablePaths<\n ListCategoryResponse,\n {\n [P in CategoryNonNullablePaths]: `categories.${number}.${P}`;\n }[CategoryNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n categoryIds: options?.categoryIds,\n includeDeleted: options?.includeDeleted,\n });\n\n const reqOpts = ambassadorWixBookingsV1Category.list(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n categoryIds: '$[0].categoryIds',\n includeDeleted: '$[0].includeDeleted',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListCategoriesOptions {\n /**\n * IDs of the categories to retrieve.\n *\n * Default: All categories are retrieved.\n * @format GUID\n */\n categoryIds?: string[];\n /** @internal */\n includeDeleted?: boolean | null;\n}\n\n/**\n * Creates a category.\n * @param category - Category to create.\n * @public\n * @documentationMaturity preview\n * @requiredField category\n * @requiredField category.name\n * @permissionId BOOKINGS.MANAGE_CATEGORIES\n * @applicableIdentity APP\n * @returns Created category.\n * @fqn com.wixpress.bookings.services.api.v1.CategoriesService.Create\n * @deprecated\n */\nexport async function createCategory(\n category: NonNullablePaths<Category, `name`>\n): Promise<NonNullablePaths<Category, CategoryNonNullablePaths>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ category: category });\n\n const reqOpts = ambassadorWixBookingsV1Category.create(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.category!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { category: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['category']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a category.\n *\n *\n * Each time the category is updated, revision increments by 1. You must include\n * the number of the existing revision when updating the category. This ensures\n * you're working with the latest service information and prevents unintended\n * overwrites.\n * @param _id - Category ID.\n * @public\n * @documentationMaturity preview\n * @requiredField _id\n * @requiredField category\n * @requiredField category.name\n * @permissionId BOOKINGS.MANAGE_CATEGORIES\n * @applicableIdentity APP\n * @fqn com.wixpress.bookings.services.api.v1.CategoriesService.Update\n * @deprecated\n */\nexport async function updateCategory(\n _id: string,\n category: NonNullablePaths<UpdateCategory, `name`>\n): Promise<\n NonNullablePaths<\n UpdateCategoryResponse,\n {\n [P in CategoryNonNullablePaths]: `category.${P}`;\n }[CategoryNonNullablePaths]\n > & {\n __applicationErrorsType?: UpdateCategoryApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n category: { ...category, id: _id },\n });\n\n const reqOpts = ambassadorWixBookingsV1Category.update(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { category: '$[1]' },\n explicitPathsToArguments: { 'category.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'category']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateCategory {\n /**\n * Category ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Category name.\n * @maxLength 500\n */\n name?: string | null;\n /**\n * @internal\n * @readonly\n */\n status?: StatusWithLiterals;\n /** @internal */\n sortOrder?: number | null;\n}\n\n/**\n * Deletes a category.\n *\n *\n * You can specify `{\"deleteServices\": true}` to also delete all associated\n * services. Learn more about *deleting a service*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/delete-service) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/delete-service)).\n * @param _id - ID of the category to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField _id\n * @permissionId BOOKINGS.MANAGE_CATEGORIES\n * @applicableIdentity APP\n * @fqn com.wixpress.bookings.services.api.v1.CategoriesService._delete\n * @deprecated\n */\nexport async function deleteCategory(\n _id: string,\n options?: DeleteCategoryOptions\n): Promise<DeleteCategoryResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n id: _id,\n deleteServices: options?.deleteServices,\n });\n\n const reqOpts = ambassadorWixBookingsV1Category._delete(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n id: '$[0]',\n deleteServices: '$[1].deleteServices',\n },\n singleArgumentUnchanged: false,\n },\n ['_id', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface DeleteCategoryOptions {\n /**\n * Whether to delete all the services associated with the category.\n *\n * Default: `false`\n */\n deleteServices?: boolean | null;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressBookingsServicesApiV1CategoriesServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/bookings/v1/categories',\n destPath: '/v1/categories',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/bookings/v1/categories',\n destPath: '/v1/categories',\n },\n {\n srcPath: '/_api/services-server/v1/categories',\n destPath: '/v1/categories',\n },\n {\n srcPath: '/_api/services-server/v1/batch/categories',\n destPath: '/v1/batch/categories',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/bookings/v1/categories',\n destPath: '/v1/categories',\n },\n {\n srcPath: '/_api/bookings/v1/batch/categories',\n destPath: '/v1/batch/categories',\n },\n {\n srcPath: '/_api/services-server/v1/categories',\n destPath: '/v1/categories',\n },\n {\n srcPath: '/_api/services-server/v1/batch/categories',\n destPath: '/v1/batch/categories',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/bookings/v1/categories',\n destPath: '/v1/categories',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/bookings/v1/categories',\n destPath: '/v1/categories',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/bookings/v1/categories',\n destPath: '/v1/categories',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/categories-proxy',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/services-server/v1/categories',\n destPath: '/v1/categories',\n },\n {\n srcPath: '/_api/services-server/v1/batch/categories',\n destPath: '/v1/batch/categories',\n },\n ],\n 'bookings._base_domain_': [\n {\n srcPath: '/_api/services-server/v1/categories',\n destPath: '/v1/categories',\n },\n {\n srcPath: '/_api/services-server/v1/batch/categories',\n destPath: '/v1/batch/categories',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_bookings_categories';\n\n/**\n * Retrieves all categories.\n * @deprecated\n */\nexport function list(payload: object): RequestOptionsFactory<any> {\n function __list({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bookings.v1.category',\n method: 'GET' as any,\n methodFqn: 'com.wixpress.bookings.services.api.v1.CategoriesService.List',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressBookingsServicesApiV1CategoriesServiceUrl({\n protoPath: '/v1/categories',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __list;\n}\n\n/**\n * Creates a category.\n * @deprecated\n */\nexport function create(payload: object): RequestOptionsFactory<any> {\n function __create({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bookings.v1.category',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.bookings.services.api.v1.CategoriesService.Create',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressBookingsServicesApiV1CategoriesServiceUrl({\n protoPath: '/v1/categories',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __create;\n}\n\n/**\n * Updates a category.\n *\n *\n * Each time the category is updated, revision increments by 1. You must include\n * the number of the existing revision when updating the category. This ensures\n * you're working with the latest service information and prevents unintended\n * overwrites.\n * @deprecated\n */\nexport function update(payload: object): RequestOptionsFactory<any> {\n function __update({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bookings.v1.category',\n method: 'PUT' as any,\n methodFqn:\n 'com.wixpress.bookings.services.api.v1.CategoriesService.Update',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressBookingsServicesApiV1CategoriesServiceUrl({\n protoPath: '/v1/categories/{category.id}',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __update;\n}\n\n/**\n * Deletes a category.\n *\n *\n * You can specify `{\"deleteServices\": true}` to also delete all associated\n * services. Learn more about *deleting a service*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/delete-service) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/delete-service)).\n * @deprecated\n */\nexport function _delete(payload: object): RequestOptionsFactory<any> {\n function ___delete({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bookings.v1.category',\n method: 'DELETE' as any,\n methodFqn:\n 'com.wixpress.bookings.services.api.v1.CategoriesService._delete',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressBookingsServicesApiV1CategoriesServiceUrl({\n protoPath: '/v1/categories/{id}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return ___delete;\n}\n","import {\n listCategories as publicListCategories,\n createCategory as publicCreateCategory,\n updateCategory as publicUpdateCategory,\n deleteCategory as publicDeleteCategory,\n} from './bookings-v1-category-categories.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onCategoryNotification as publicOnCategoryNotification } from './bookings-v1-category-categories.public.js';\n\nexport const listCategories: MaybeContext<\n BuildRESTFunction<typeof publicListCategories> & typeof publicListCategories\n> = /*#__PURE__*/ createRESTModule(publicListCategories);\nexport const createCategory: MaybeContext<\n BuildRESTFunction<typeof publicCreateCategory> & typeof publicCreateCategory\n> = /*#__PURE__*/ createRESTModule(publicCreateCategory);\nexport const updateCategory: MaybeContext<\n BuildRESTFunction<typeof publicUpdateCategory> & typeof publicUpdateCategory\n> = /*#__PURE__*/ createRESTModule(publicUpdateCategory);\nexport const deleteCategory: MaybeContext<\n BuildRESTFunction<typeof publicDeleteCategory> & typeof publicDeleteCategory\n> = /*#__PURE__*/ createRESTModule(publicDeleteCategory);\n/** @deprecated */\nexport const onCategoryNotification: BuildEventDefinition<\n typeof publicOnCategoryNotification\n> = createEventModule(publicOnCategoryNotification);\n\nexport {\n Status,\n Event,\n WebhookIdentityType,\n} from './bookings-v1-category-categories.universal.js';\nexport {\n Category,\n ListCategoryRequest,\n ListCategoryResponse,\n CategoryNotification,\n CreateCategoryRequest,\n CreateCategoryResponse,\n BatchCreateCategoryRequest,\n BatchCreateCategoryResponse,\n UpdateCategoryRequest,\n UpdateCategoryResponse,\n DeleteCategoryRequest,\n DeleteCategoryResponse,\n BatchDeleteCategoryRequest,\n BatchDeleteCategoryResponse,\n BatchUpdateCategoryRequest,\n BatchUpdateCategoryResponse,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n BaseEventMetadata,\n CategoryNotificationEnvelope,\n ListCategoriesOptions,\n UpdateCategory,\n DeleteCategoryOptions,\n} from './bookings-v1-category-categories.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAAA;AAAA,EAAA,sBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,8BAAAC;AAAA,EAAA,sBAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,uBAA8D;;;ACD9D,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,4DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,yBAAyB;AA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f;AACJ;AAqBO,SAASC,gBACd,YACyB;AACzB,SAAO,CAAC,KAAa,YACnB;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAmBO,IAAM,6BAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA,CAAC,cACC,wEAAwC,KAAK;AACjD,EAAgC;;;AGxHhC,IAAAC,uBAAiC;AACjC,sCAAkC;AAQ3B,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAEhD,IAAMC,8BAET,mDAAkB,sBAA4B;","names":["createCategory","deleteCategory","listCategories","onCategoryNotification","updateCategory","import_rename_all_nested_keys","import_rest_modules","Status","Event","WebhookIdentityType","sdkTransformError","listCategories","createCategory","updateCategory","deleteCategory","import_rest_modules","listCategories","createCategory","updateCategory","deleteCategory","onCategoryNotification"]}
|
package/build/cjs/{bookings-v1-category-categories.universal-DrWLnqJ6.d.ts → index.typings.d.ts}
RENAMED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
1
3
|
/** 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
4
|
interface Category {
|
|
3
5
|
/**
|
|
@@ -18,6 +20,8 @@ declare enum Status {
|
|
|
18
20
|
/** The category was deleted. */
|
|
19
21
|
DELETED = "DELETED"
|
|
20
22
|
}
|
|
23
|
+
/** @enumType */
|
|
24
|
+
type StatusWithLiterals = Status | 'CREATED' | 'DELETED';
|
|
21
25
|
interface ListCategoryRequest {
|
|
22
26
|
/**
|
|
23
27
|
* IDs of the categories to retrieve.
|
|
@@ -179,6 +183,11 @@ declare enum WebhookIdentityType {
|
|
|
179
183
|
}
|
|
180
184
|
/** @enumType */
|
|
181
185
|
type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
186
|
+
type UpdateCategoryApplicationErrors = {
|
|
187
|
+
code?: 'NOT_FOUND';
|
|
188
|
+
description?: string;
|
|
189
|
+
data?: Record<string, any>;
|
|
190
|
+
};
|
|
182
191
|
interface BaseEventMetadata {
|
|
183
192
|
/**
|
|
184
193
|
* App instance ID.
|
|
@@ -197,6 +206,44 @@ interface CategoryNotificationEnvelope {
|
|
|
197
206
|
data: CategoryNotification;
|
|
198
207
|
metadata: BaseEventMetadata;
|
|
199
208
|
}
|
|
209
|
+
/** @permissionScope Manage Stores
|
|
210
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
211
|
+
* @permissionScope Read Bookings - Public Data
|
|
212
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
|
|
213
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
214
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
215
|
+
* @permissionScope Manage Bookings
|
|
216
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
217
|
+
* @permissionScope Read Bookings - Including Participants
|
|
218
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
|
|
219
|
+
* @permissionScope Read Bookings - all read permissions
|
|
220
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
|
|
221
|
+
* @permissionScope Manage Bookings - all permissions
|
|
222
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
223
|
+
* @permissionId BOOKINGS.CATEGORIES_READ
|
|
224
|
+
* @webhook
|
|
225
|
+
* @eventType com.wixpress.bookings.services.api.v1.CategoryNotification
|
|
226
|
+
* @serviceIdentifier com.wixpress.bookings.services.api.v1.CategoriesService
|
|
227
|
+
* @slug category_notification
|
|
228
|
+
* @documentationMaturity preview
|
|
229
|
+
* @deprecated
|
|
230
|
+
*/
|
|
231
|
+
declare function onCategoryNotification(handler: (event: CategoryNotificationEnvelope) => void | Promise<void>): void;
|
|
232
|
+
type CategoryNonNullablePaths = `status`;
|
|
233
|
+
/**
|
|
234
|
+
* Retrieves all categories.
|
|
235
|
+
* @public
|
|
236
|
+
* @documentationMaturity preview
|
|
237
|
+
* @param options - Options to use when listing categories.
|
|
238
|
+
* @permissionId BOOKINGS.CATEGORIES_READ
|
|
239
|
+
* @applicableIdentity APP
|
|
240
|
+
* @applicableIdentity VISITOR
|
|
241
|
+
* @fqn com.wixpress.bookings.services.api.v1.CategoriesService.List
|
|
242
|
+
* @deprecated
|
|
243
|
+
*/
|
|
244
|
+
declare function listCategories(options?: ListCategoriesOptions): Promise<NonNullablePaths<ListCategoryResponse, {
|
|
245
|
+
[P in CategoryNonNullablePaths]: `categories.${number}.${P}`;
|
|
246
|
+
}[CategoryNonNullablePaths]>>;
|
|
200
247
|
interface ListCategoriesOptions {
|
|
201
248
|
/**
|
|
202
249
|
* IDs of the categories to retrieve.
|
|
@@ -206,6 +253,44 @@ interface ListCategoriesOptions {
|
|
|
206
253
|
*/
|
|
207
254
|
categoryIds?: string[];
|
|
208
255
|
}
|
|
256
|
+
/**
|
|
257
|
+
* Creates a category.
|
|
258
|
+
* @param category - Category to create.
|
|
259
|
+
* @public
|
|
260
|
+
* @documentationMaturity preview
|
|
261
|
+
* @requiredField category
|
|
262
|
+
* @requiredField category.name
|
|
263
|
+
* @permissionId BOOKINGS.MANAGE_CATEGORIES
|
|
264
|
+
* @applicableIdentity APP
|
|
265
|
+
* @returns Created category.
|
|
266
|
+
* @fqn com.wixpress.bookings.services.api.v1.CategoriesService.Create
|
|
267
|
+
* @deprecated
|
|
268
|
+
*/
|
|
269
|
+
declare function createCategory(category: NonNullablePaths<Category, `name`>): Promise<NonNullablePaths<Category, CategoryNonNullablePaths>>;
|
|
270
|
+
/**
|
|
271
|
+
* Updates a category.
|
|
272
|
+
*
|
|
273
|
+
*
|
|
274
|
+
* Each time the category is updated, revision increments by 1. You must include
|
|
275
|
+
* the number of the existing revision when updating the category. This ensures
|
|
276
|
+
* you're working with the latest service information and prevents unintended
|
|
277
|
+
* overwrites.
|
|
278
|
+
* @param _id - Category ID.
|
|
279
|
+
* @public
|
|
280
|
+
* @documentationMaturity preview
|
|
281
|
+
* @requiredField _id
|
|
282
|
+
* @requiredField category
|
|
283
|
+
* @requiredField category.name
|
|
284
|
+
* @permissionId BOOKINGS.MANAGE_CATEGORIES
|
|
285
|
+
* @applicableIdentity APP
|
|
286
|
+
* @fqn com.wixpress.bookings.services.api.v1.CategoriesService.Update
|
|
287
|
+
* @deprecated
|
|
288
|
+
*/
|
|
289
|
+
declare function updateCategory(_id: string, category: NonNullablePaths<UpdateCategory, `name`>): Promise<NonNullablePaths<UpdateCategoryResponse, {
|
|
290
|
+
[P in CategoryNonNullablePaths]: `category.${P}`;
|
|
291
|
+
}[CategoryNonNullablePaths]> & {
|
|
292
|
+
__applicationErrorsType?: UpdateCategoryApplicationErrors;
|
|
293
|
+
}>;
|
|
209
294
|
interface UpdateCategory {
|
|
210
295
|
/**
|
|
211
296
|
* Category ID.
|
|
@@ -219,6 +304,23 @@ interface UpdateCategory {
|
|
|
219
304
|
*/
|
|
220
305
|
name?: string | null;
|
|
221
306
|
}
|
|
307
|
+
/**
|
|
308
|
+
* Deletes a category.
|
|
309
|
+
*
|
|
310
|
+
*
|
|
311
|
+
* You can specify `{"deleteServices": true}` to also delete all associated
|
|
312
|
+
* services. Learn more about *deleting a service*
|
|
313
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/delete-service) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/delete-service)).
|
|
314
|
+
* @param _id - ID of the category to delete.
|
|
315
|
+
* @public
|
|
316
|
+
* @documentationMaturity preview
|
|
317
|
+
* @requiredField _id
|
|
318
|
+
* @permissionId BOOKINGS.MANAGE_CATEGORIES
|
|
319
|
+
* @applicableIdentity APP
|
|
320
|
+
* @fqn com.wixpress.bookings.services.api.v1.CategoriesService._delete
|
|
321
|
+
* @deprecated
|
|
322
|
+
*/
|
|
323
|
+
declare function deleteCategory(_id: string, options?: DeleteCategoryOptions): Promise<DeleteCategoryResponse>;
|
|
222
324
|
interface DeleteCategoryOptions {
|
|
223
325
|
/**
|
|
224
326
|
* Whether to delete all the services associated with the category.
|
|
@@ -228,4 +330,4 @@ interface DeleteCategoryOptions {
|
|
|
228
330
|
deleteServices?: boolean | null;
|
|
229
331
|
}
|
|
230
332
|
|
|
231
|
-
export { type
|
|
333
|
+
export { type BaseEventMetadata, type BatchCreateCategoryRequest, type BatchCreateCategoryResponse, type BatchDeleteCategoryRequest, type BatchDeleteCategoryResponse, type BatchUpdateCategoryRequest, type BatchUpdateCategoryResponse, type Category, type CategoryNotification, type CategoryNotificationEnvelope, type CreateCategoryRequest, type CreateCategoryResponse, type DeleteCategoryOptions, type DeleteCategoryRequest, type DeleteCategoryResponse, Event, type EventWithLiterals, type IdentificationData, type IdentificationDataIdOneOf, type ListCategoriesOptions, type ListCategoryRequest, type ListCategoryResponse, type MessageEnvelope, Status, type StatusWithLiterals, type UpdateCategory, type UpdateCategoryApplicationErrors, type UpdateCategoryRequest, type UpdateCategoryResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createCategory, deleteCategory, listCategories, onCategoryNotification, updateCategory };
|