@wix/events_schedule-bookmarks
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -6,3 +6,2 @@ "use strict"; | ||
const listBookmarks = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -19,3 +18,3 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(events_schedule_v1_schedule_item_schedule_bookmarks_public_1.listBookmarks, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(events_schedule_v1_schedule_item_schedule_bookmarks_public_1.listBookmarks, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
@@ -25,3 +24,2 @@ }; | ||
const createBookmark = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -38,3 +36,3 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(events_schedule_v1_schedule_item_schedule_bookmarks_public_1.createBookmark, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(events_schedule_v1_schedule_item_schedule_bookmarks_public_1.createBookmark, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
@@ -44,3 +42,2 @@ }; | ||
const deleteBookmark = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -57,3 +54,3 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(events_schedule_v1_schedule_item_schedule_bookmarks_public_1.deleteBookmark, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(events_schedule_v1_schedule_item_schedule_bookmarks_public_1.deleteBookmark, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
@@ -60,0 +57,0 @@ }; |
import { RequestOptionsFactory } from '@wix/sdk-types'; | ||
/** Retrieves a list of up to 100 schedule items */ | ||
/** Retrieves a list of up to 100 schedule items, with basic filter support. */ | ||
export declare function listScheduleItems(payload: object): RequestOptionsFactory<any>; | ||
/** | ||
* Creates a query to retrieve a list of schedule items. | ||
* Retrieves a list of up to 100 schedule items, given the provided [paging](https://dev.wix.com/api/rest/getting-started/pagination), [filtering](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-schedule-items). | ||
* | ||
* The `queryScheduleItems( )` function builds a query to retrieve a list of schedule items and returns a [`ItemsQueryBuilder`](https://www.wix.com/velo/reference/wix-events-v2/schedule/itemsquerybuilder) object. | ||
* * Important **: | ||
* - All results are for one specific business, resolved from the request context. | ||
* | ||
* The returned object contains the query definition, which is typically used to run the query using the [`find()`](https://www.wix.com/velo/reference/wix-events-v2/schedule/itemsquerybuilder/find) function. | ||
* Query object support: | ||
* - `filter` - supported, see [filtering and sorting](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-schedule-items). | ||
* - `sort` - supported, see [filtering and sorting](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-schedule-items). | ||
* - `paging` - supported, see [paging](https://dev.wix.com/api/rest/getting-started/pagination). | ||
* - `fields` - not supported. | ||
* - `fieldsets` - not supported. | ||
* - `cursorPaging` - not supported, use offset pagination instead. | ||
* | ||
* You can refine the query by chaining `ItemsQueryBuilder` functions onto the query. `ItemsQueryBuilder` functions enable you to sort, filter, and control the results `queryScheduleItems( )` returns. | ||
* | ||
* `queryScheduleItems( )` runs with these `ItemsQueryBuilder` defaults, which you can override: | ||
* | ||
* - [`limit(50)`](https://www.wix.com/velo/reference/wix-events-v2/schedule/itemsquerybuilder/limit) | ||
* - [`descending("_createdDate")`](https://www.wix.com/velo/reference/wix-events-v2/schedule/itemsquerybuilder/descending) | ||
* | ||
* The functions that are chained to `queryScheduleItems( )` are applied in the order they're called. For example, if you apply `ascending('name')` and then `descending('stageName')`, the results are sorted first by the `name`, and then, if there are multiple results with the same `name`, the items are sorted by `stageName`. | ||
* Defaults: | ||
* - When filter is not specified, returns all schedule items that caller is authorized to read. | ||
* - When sorting is not specified, defaults to `time_slot.start` and `time_slot.end` in `ASC` order. | ||
*/ | ||
@@ -23,13 +25,16 @@ export declare function queryScheduleItems(payload: object): RequestOptionsFactory<any>; | ||
export declare function getScheduleItem(payload: object): RequestOptionsFactory<any>; | ||
/** Adds a schedule item to the draft schedule. */ | ||
/** Adds schedule item to the draft schedule. Draft items are not publicly available unless published. */ | ||
export declare function addScheduleItem(payload: object): RequestOptionsFactory<any>; | ||
/** Updates a schedule item in a draft schedule. */ | ||
/** | ||
* Updates existing schedule item. | ||
* All modifications are performed on a draft schedule, even if schedule item has already been published. | ||
*/ | ||
export declare function updateScheduleItem(payload: object): RequestOptionsFactory<any>; | ||
/** Deletes schedule items from the draft schedule. */ | ||
/** Deletes schedule item from draft schedule. */ | ||
export declare function deleteScheduleItem(payload: object): RequestOptionsFactory<any>; | ||
/** Clears all changes to the draft schedule. */ | ||
/** Clears all changes to the draft schedule. (Does not affect the published schedule.) */ | ||
export declare function discardDraft(payload: object): RequestOptionsFactory<any>; | ||
/** Publishes the draft schedule. */ | ||
export declare function publishDraft(payload: object): RequestOptionsFactory<any>; | ||
/** Adjusts the time of all draft schedule items at once per event. */ | ||
/** Adjusts time of all draft schedule items (per event). */ | ||
export declare function rescheduleDraft(payload: object): RequestOptionsFactory<any>; | ||
@@ -36,0 +41,0 @@ /** Retrieves a list of bookmarked schedule items for a currently logged-in member. */ |
@@ -153,3 +153,3 @@ "use strict"; | ||
} | ||
/** Retrieves a list of up to 100 schedule items */ | ||
/** Retrieves a list of up to 100 schedule items, with basic filter support. */ | ||
function listScheduleItems(payload) { | ||
@@ -191,16 +191,18 @@ function __listScheduleItems({ host }) { | ||
/** | ||
* Creates a query to retrieve a list of schedule items. | ||
* Retrieves a list of up to 100 schedule items, given the provided [paging](https://dev.wix.com/api/rest/getting-started/pagination), [filtering](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-schedule-items). | ||
* | ||
* The `queryScheduleItems( )` function builds a query to retrieve a list of schedule items and returns a [`ItemsQueryBuilder`](https://www.wix.com/velo/reference/wix-events-v2/schedule/itemsquerybuilder) object. | ||
* * Important **: | ||
* - All results are for one specific business, resolved from the request context. | ||
* | ||
* The returned object contains the query definition, which is typically used to run the query using the [`find()`](https://www.wix.com/velo/reference/wix-events-v2/schedule/itemsquerybuilder/find) function. | ||
* Query object support: | ||
* - `filter` - supported, see [filtering and sorting](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-schedule-items). | ||
* - `sort` - supported, see [filtering and sorting](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-schedule-items). | ||
* - `paging` - supported, see [paging](https://dev.wix.com/api/rest/getting-started/pagination). | ||
* - `fields` - not supported. | ||
* - `fieldsets` - not supported. | ||
* - `cursorPaging` - not supported, use offset pagination instead. | ||
* | ||
* You can refine the query by chaining `ItemsQueryBuilder` functions onto the query. `ItemsQueryBuilder` functions enable you to sort, filter, and control the results `queryScheduleItems( )` returns. | ||
* | ||
* `queryScheduleItems( )` runs with these `ItemsQueryBuilder` defaults, which you can override: | ||
* | ||
* - [`limit(50)`](https://www.wix.com/velo/reference/wix-events-v2/schedule/itemsquerybuilder/limit) | ||
* - [`descending("_createdDate")`](https://www.wix.com/velo/reference/wix-events-v2/schedule/itemsquerybuilder/descending) | ||
* | ||
* The functions that are chained to `queryScheduleItems( )` are applied in the order they're called. For example, if you apply `ascending('name')` and then `descending('stageName')`, the results are sorted first by the `name`, and then, if there are multiple results with the same `name`, the items are sorted by `stageName`. | ||
* Defaults: | ||
* - When filter is not specified, returns all schedule items that caller is authorized to read. | ||
* - When sorting is not specified, defaults to `time_slot.start` and `time_slot.end` in `ASC` order. | ||
*/ | ||
@@ -270,3 +272,3 @@ function queryScheduleItems(payload) { | ||
exports.getScheduleItem = getScheduleItem; | ||
/** Adds a schedule item to the draft schedule. */ | ||
/** Adds schedule item to the draft schedule. Draft items are not publicly available unless published. */ | ||
function addScheduleItem(payload) { | ||
@@ -307,3 +309,6 @@ function __addScheduleItem({ host }) { | ||
exports.addScheduleItem = addScheduleItem; | ||
/** Updates a schedule item in a draft schedule. */ | ||
/** | ||
* Updates existing schedule item. | ||
* All modifications are performed on a draft schedule, even if schedule item has already been published. | ||
*/ | ||
function updateScheduleItem(payload) { | ||
@@ -348,3 +353,3 @@ function __updateScheduleItem({ host }) { | ||
exports.updateScheduleItem = updateScheduleItem; | ||
/** Deletes schedule items from the draft schedule. */ | ||
/** Deletes schedule item from draft schedule. */ | ||
function deleteScheduleItem(payload) { | ||
@@ -368,3 +373,3 @@ function __deleteScheduleItem({ host }) { | ||
exports.deleteScheduleItem = deleteScheduleItem; | ||
/** Clears all changes to the draft schedule. */ | ||
/** Clears all changes to the draft schedule. (Does not affect the published schedule.) */ | ||
function discardDraft(payload) { | ||
@@ -407,3 +412,3 @@ function __discardDraft({ host }) { | ||
exports.publishDraft = publishDraft; | ||
/** Adjusts the time of all draft schedule items at once per event. */ | ||
/** Adjusts time of all draft schedule items (per event). */ | ||
function rescheduleDraft(payload) { | ||
@@ -410,0 +415,0 @@ function __rescheduleDraft({ host }) { |
@@ -431,2 +431,3 @@ /** Schedule item describes the schedule within an event. Each event may contain multiple schedule items. */ | ||
* @param eventId - Event ID to which the schedule belongs. | ||
* @applicableIdentity MEMBER | ||
*/ | ||
@@ -441,2 +442,3 @@ export declare function listBookmarks(eventId: string): Promise<ListBookmarksResponse & ListBookmarksResponseNonNullableFields>; | ||
* @param eventId - Event ID to which the schedule belongs. | ||
* @applicableIdentity MEMBER | ||
*/ | ||
@@ -451,4 +453,5 @@ export declare function createBookmark(itemId: string, eventId: string): Promise<void>; | ||
* @param eventId - Event ID to which the schedule belongs. | ||
* @applicableIdentity MEMBER | ||
*/ | ||
export declare function deleteBookmark(itemId: string, eventId: string): Promise<void>; | ||
export {}; |
@@ -25,11 +25,2 @@ "use strict"; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -68,27 +59,24 @@ exports.deleteBookmark = exports.createBookmark = exports.listBookmarks = exports.SortOrder = exports.StateFilter = exports.ScheduleStatus = void 0; | ||
* @param eventId - Event ID to which the schedule belongs. | ||
* @applicableIdentity MEMBER | ||
*/ | ||
function listBookmarks(eventId) { | ||
var arguments_1 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_1[1]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ eventId: eventId }); | ||
const reqOpts = ambassadorWixEventsScheduleV1ScheduleItem.listBookmarks(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { eventId: '$[0]' }, | ||
singleArgumentUnchanged: false, | ||
}, ['eventId']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
}); | ||
async function listBookmarks(eventId) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ eventId: eventId }); | ||
const reqOpts = ambassadorWixEventsScheduleV1ScheduleItem.listBookmarks(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { eventId: '$[0]' }, | ||
singleArgumentUnchanged: false, | ||
}, ['eventId']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -103,29 +91,26 @@ exports.listBookmarks = listBookmarks; | ||
* @param eventId - Event ID to which the schedule belongs. | ||
* @applicableIdentity MEMBER | ||
*/ | ||
function createBookmark(itemId, eventId) { | ||
var arguments_2 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_2[2]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
itemId: itemId, | ||
eventId: eventId, | ||
}); | ||
const reqOpts = ambassadorWixEventsScheduleV1ScheduleItem.createBookmark(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { itemId: '$[0]', eventId: '$[1]' }, | ||
singleArgumentUnchanged: false, | ||
}, ['itemId', 'eventId']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
async function createBookmark(itemId, eventId) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
itemId: itemId, | ||
eventId: eventId, | ||
}); | ||
const reqOpts = ambassadorWixEventsScheduleV1ScheduleItem.createBookmark(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { itemId: '$[0]', eventId: '$[1]' }, | ||
singleArgumentUnchanged: false, | ||
}, ['itemId', 'eventId']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -140,31 +125,28 @@ exports.createBookmark = createBookmark; | ||
* @param eventId - Event ID to which the schedule belongs. | ||
* @applicableIdentity MEMBER | ||
*/ | ||
function deleteBookmark(itemId, eventId) { | ||
var arguments_3 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_3[2]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
itemId: itemId, | ||
eventId: eventId, | ||
}); | ||
const reqOpts = ambassadorWixEventsScheduleV1ScheduleItem.deleteBookmark(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { itemId: '$[0]', eventId: '$[1]' }, | ||
singleArgumentUnchanged: false, | ||
}, ['itemId', 'eventId']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
async function deleteBookmark(itemId, eventId) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
itemId: itemId, | ||
eventId: eventId, | ||
}); | ||
const reqOpts = ambassadorWixEventsScheduleV1ScheduleItem.deleteBookmark(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { itemId: '$[0]', eventId: '$[1]' }, | ||
singleArgumentUnchanged: false, | ||
}, ['itemId', 'eventId']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
exports.deleteBookmark = deleteBookmark; | ||
//# sourceMappingURL=events-schedule-v1-schedule-item-schedule-bookmarks.universal.js.map |
import { listBookmarks as publicListBookmarks, createBookmark as publicCreateBookmark, deleteBookmark as publicDeleteBookmark, } from './events-schedule-v1-schedule-item-schedule-bookmarks.public'; | ||
export const listBookmarks = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -15,7 +14,6 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(publicListBookmarks, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(publicListBookmarks, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
export const createBookmark = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -32,7 +30,6 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(publicCreateBookmark, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(publicCreateBookmark, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
export const deleteBookmark = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -49,5 +46,5 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(publicDeleteBookmark, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(publicDeleteBookmark, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
//# sourceMappingURL=events-schedule-v1-schedule-item-schedule-bookmarks.context.js.map |
import { RequestOptionsFactory } from '@wix/sdk-types'; | ||
/** Retrieves a list of up to 100 schedule items */ | ||
/** Retrieves a list of up to 100 schedule items, with basic filter support. */ | ||
export declare function listScheduleItems(payload: object): RequestOptionsFactory<any>; | ||
/** | ||
* Creates a query to retrieve a list of schedule items. | ||
* Retrieves a list of up to 100 schedule items, given the provided [paging](https://dev.wix.com/api/rest/getting-started/pagination), [filtering](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-schedule-items). | ||
* | ||
* The `queryScheduleItems( )` function builds a query to retrieve a list of schedule items and returns a [`ItemsQueryBuilder`](https://www.wix.com/velo/reference/wix-events-v2/schedule/itemsquerybuilder) object. | ||
* * Important **: | ||
* - All results are for one specific business, resolved from the request context. | ||
* | ||
* The returned object contains the query definition, which is typically used to run the query using the [`find()`](https://www.wix.com/velo/reference/wix-events-v2/schedule/itemsquerybuilder/find) function. | ||
* Query object support: | ||
* - `filter` - supported, see [filtering and sorting](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-schedule-items). | ||
* - `sort` - supported, see [filtering and sorting](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-schedule-items). | ||
* - `paging` - supported, see [paging](https://dev.wix.com/api/rest/getting-started/pagination). | ||
* - `fields` - not supported. | ||
* - `fieldsets` - not supported. | ||
* - `cursorPaging` - not supported, use offset pagination instead. | ||
* | ||
* You can refine the query by chaining `ItemsQueryBuilder` functions onto the query. `ItemsQueryBuilder` functions enable you to sort, filter, and control the results `queryScheduleItems( )` returns. | ||
* | ||
* `queryScheduleItems( )` runs with these `ItemsQueryBuilder` defaults, which you can override: | ||
* | ||
* - [`limit(50)`](https://www.wix.com/velo/reference/wix-events-v2/schedule/itemsquerybuilder/limit) | ||
* - [`descending("_createdDate")`](https://www.wix.com/velo/reference/wix-events-v2/schedule/itemsquerybuilder/descending) | ||
* | ||
* The functions that are chained to `queryScheduleItems( )` are applied in the order they're called. For example, if you apply `ascending('name')` and then `descending('stageName')`, the results are sorted first by the `name`, and then, if there are multiple results with the same `name`, the items are sorted by `stageName`. | ||
* Defaults: | ||
* - When filter is not specified, returns all schedule items that caller is authorized to read. | ||
* - When sorting is not specified, defaults to `time_slot.start` and `time_slot.end` in `ASC` order. | ||
*/ | ||
@@ -23,13 +25,16 @@ export declare function queryScheduleItems(payload: object): RequestOptionsFactory<any>; | ||
export declare function getScheduleItem(payload: object): RequestOptionsFactory<any>; | ||
/** Adds a schedule item to the draft schedule. */ | ||
/** Adds schedule item to the draft schedule. Draft items are not publicly available unless published. */ | ||
export declare function addScheduleItem(payload: object): RequestOptionsFactory<any>; | ||
/** Updates a schedule item in a draft schedule. */ | ||
/** | ||
* Updates existing schedule item. | ||
* All modifications are performed on a draft schedule, even if schedule item has already been published. | ||
*/ | ||
export declare function updateScheduleItem(payload: object): RequestOptionsFactory<any>; | ||
/** Deletes schedule items from the draft schedule. */ | ||
/** Deletes schedule item from draft schedule. */ | ||
export declare function deleteScheduleItem(payload: object): RequestOptionsFactory<any>; | ||
/** Clears all changes to the draft schedule. */ | ||
/** Clears all changes to the draft schedule. (Does not affect the published schedule.) */ | ||
export declare function discardDraft(payload: object): RequestOptionsFactory<any>; | ||
/** Publishes the draft schedule. */ | ||
export declare function publishDraft(payload: object): RequestOptionsFactory<any>; | ||
/** Adjusts the time of all draft schedule items at once per event. */ | ||
/** Adjusts time of all draft schedule items (per event). */ | ||
export declare function rescheduleDraft(payload: object): RequestOptionsFactory<any>; | ||
@@ -36,0 +41,0 @@ /** Retrieves a list of bookmarked schedule items for a currently logged-in member. */ |
@@ -150,3 +150,3 @@ import { toURLSearchParams } from '@wix/metro-runtime'; | ||
} | ||
/** Retrieves a list of up to 100 schedule items */ | ||
/** Retrieves a list of up to 100 schedule items, with basic filter support. */ | ||
export function listScheduleItems(payload) { | ||
@@ -187,16 +187,18 @@ function __listScheduleItems({ host }) { | ||
/** | ||
* Creates a query to retrieve a list of schedule items. | ||
* Retrieves a list of up to 100 schedule items, given the provided [paging](https://dev.wix.com/api/rest/getting-started/pagination), [filtering](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-schedule-items). | ||
* | ||
* The `queryScheduleItems( )` function builds a query to retrieve a list of schedule items and returns a [`ItemsQueryBuilder`](https://www.wix.com/velo/reference/wix-events-v2/schedule/itemsquerybuilder) object. | ||
* * Important **: | ||
* - All results are for one specific business, resolved from the request context. | ||
* | ||
* The returned object contains the query definition, which is typically used to run the query using the [`find()`](https://www.wix.com/velo/reference/wix-events-v2/schedule/itemsquerybuilder/find) function. | ||
* Query object support: | ||
* - `filter` - supported, see [filtering and sorting](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-schedule-items). | ||
* - `sort` - supported, see [filtering and sorting](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-schedule-items). | ||
* - `paging` - supported, see [paging](https://dev.wix.com/api/rest/getting-started/pagination). | ||
* - `fields` - not supported. | ||
* - `fieldsets` - not supported. | ||
* - `cursorPaging` - not supported, use offset pagination instead. | ||
* | ||
* You can refine the query by chaining `ItemsQueryBuilder` functions onto the query. `ItemsQueryBuilder` functions enable you to sort, filter, and control the results `queryScheduleItems( )` returns. | ||
* | ||
* `queryScheduleItems( )` runs with these `ItemsQueryBuilder` defaults, which you can override: | ||
* | ||
* - [`limit(50)`](https://www.wix.com/velo/reference/wix-events-v2/schedule/itemsquerybuilder/limit) | ||
* - [`descending("_createdDate")`](https://www.wix.com/velo/reference/wix-events-v2/schedule/itemsquerybuilder/descending) | ||
* | ||
* The functions that are chained to `queryScheduleItems( )` are applied in the order they're called. For example, if you apply `ascending('name')` and then `descending('stageName')`, the results are sorted first by the `name`, and then, if there are multiple results with the same `name`, the items are sorted by `stageName`. | ||
* Defaults: | ||
* - When filter is not specified, returns all schedule items that caller is authorized to read. | ||
* - When sorting is not specified, defaults to `time_slot.start` and `time_slot.end` in `ASC` order. | ||
*/ | ||
@@ -264,3 +266,3 @@ export function queryScheduleItems(payload) { | ||
} | ||
/** Adds a schedule item to the draft schedule. */ | ||
/** Adds schedule item to the draft schedule. Draft items are not publicly available unless published. */ | ||
export function addScheduleItem(payload) { | ||
@@ -300,3 +302,6 @@ function __addScheduleItem({ host }) { | ||
} | ||
/** Updates a schedule item in a draft schedule. */ | ||
/** | ||
* Updates existing schedule item. | ||
* All modifications are performed on a draft schedule, even if schedule item has already been published. | ||
*/ | ||
export function updateScheduleItem(payload) { | ||
@@ -340,3 +345,3 @@ function __updateScheduleItem({ host }) { | ||
} | ||
/** Deletes schedule items from the draft schedule. */ | ||
/** Deletes schedule item from draft schedule. */ | ||
export function deleteScheduleItem(payload) { | ||
@@ -359,3 +364,3 @@ function __deleteScheduleItem({ host }) { | ||
} | ||
/** Clears all changes to the draft schedule. */ | ||
/** Clears all changes to the draft schedule. (Does not affect the published schedule.) */ | ||
export function discardDraft(payload) { | ||
@@ -396,3 +401,3 @@ function __discardDraft({ host }) { | ||
} | ||
/** Adjusts the time of all draft schedule items at once per event. */ | ||
/** Adjusts time of all draft schedule items (per event). */ | ||
export function rescheduleDraft(payload) { | ||
@@ -399,0 +404,0 @@ function __rescheduleDraft({ host }) { |
@@ -431,2 +431,3 @@ /** Schedule item describes the schedule within an event. Each event may contain multiple schedule items. */ | ||
* @param eventId - Event ID to which the schedule belongs. | ||
* @applicableIdentity MEMBER | ||
*/ | ||
@@ -441,2 +442,3 @@ export declare function listBookmarks(eventId: string): Promise<ListBookmarksResponse & ListBookmarksResponseNonNullableFields>; | ||
* @param eventId - Event ID to which the schedule belongs. | ||
* @applicableIdentity MEMBER | ||
*/ | ||
@@ -451,4 +453,5 @@ export declare function createBookmark(itemId: string, eventId: string): Promise<void>; | ||
* @param eventId - Event ID to which the schedule belongs. | ||
* @applicableIdentity MEMBER | ||
*/ | ||
export declare function deleteBookmark(itemId: string, eventId: string): Promise<void>; | ||
export {}; |
@@ -1,10 +0,1 @@ | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error'; | ||
@@ -41,27 +32,24 @@ import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys'; | ||
* @param eventId - Event ID to which the schedule belongs. | ||
* @applicableIdentity MEMBER | ||
*/ | ||
export function listBookmarks(eventId) { | ||
var arguments_1 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_1[1]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ eventId: eventId }); | ||
const reqOpts = ambassadorWixEventsScheduleV1ScheduleItem.listBookmarks(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return renameKeysFromRESTResponseToSDKResponse(result.data); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { eventId: '$[0]' }, | ||
singleArgumentUnchanged: false, | ||
}, ['eventId']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
}); | ||
export async function listBookmarks(eventId) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ eventId: eventId }); | ||
const reqOpts = ambassadorWixEventsScheduleV1ScheduleItem.listBookmarks(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return renameKeysFromRESTResponseToSDKResponse(result.data); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { eventId: '$[0]' }, | ||
singleArgumentUnchanged: false, | ||
}, ['eventId']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -75,29 +63,26 @@ /** | ||
* @param eventId - Event ID to which the schedule belongs. | ||
* @applicableIdentity MEMBER | ||
*/ | ||
export function createBookmark(itemId, eventId) { | ||
var arguments_2 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_2[2]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ | ||
itemId: itemId, | ||
eventId: eventId, | ||
}); | ||
const reqOpts = ambassadorWixEventsScheduleV1ScheduleItem.createBookmark(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { itemId: '$[0]', eventId: '$[1]' }, | ||
singleArgumentUnchanged: false, | ||
}, ['itemId', 'eventId']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
export async function createBookmark(itemId, eventId) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ | ||
itemId: itemId, | ||
eventId: eventId, | ||
}); | ||
const reqOpts = ambassadorWixEventsScheduleV1ScheduleItem.createBookmark(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { itemId: '$[0]', eventId: '$[1]' }, | ||
singleArgumentUnchanged: false, | ||
}, ['itemId', 'eventId']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -111,30 +96,27 @@ /** | ||
* @param eventId - Event ID to which the schedule belongs. | ||
* @applicableIdentity MEMBER | ||
*/ | ||
export function deleteBookmark(itemId, eventId) { | ||
var arguments_3 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_3[2]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ | ||
itemId: itemId, | ||
eventId: eventId, | ||
}); | ||
const reqOpts = ambassadorWixEventsScheduleV1ScheduleItem.deleteBookmark(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { itemId: '$[0]', eventId: '$[1]' }, | ||
singleArgumentUnchanged: false, | ||
}, ['itemId', 'eventId']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
export async function deleteBookmark(itemId, eventId) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ | ||
itemId: itemId, | ||
eventId: eventId, | ||
}); | ||
const reqOpts = ambassadorWixEventsScheduleV1ScheduleItem.deleteBookmark(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { itemId: '$[0]', eventId: '$[1]' }, | ||
singleArgumentUnchanged: false, | ||
}, ['itemId', 'eventId']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
//# sourceMappingURL=events-schedule-v1-schedule-item-schedule-bookmarks.universal.js.map |
{ | ||
"name": "@wix/events_schedule-bookmarks", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"publishConfig": { | ||
@@ -42,3 +42,3 @@ "registry": "https://registry.npmjs.org/", | ||
}, | ||
"falconPackageHash": "f6141301a17448f3e56831c178164953ab04baae62d2abceefc83dab" | ||
"falconPackageHash": "9bb7b9f987627a08bc10386a750834babbc4e802bb6fa205bd847de7" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
172459
3562