@wix/auto_sdk_bookings_resources 1.0.33 → 1.0.34
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/{bookings-resources-v2-resource-resources.universal-RnzqwcCV.d.ts → bookings-resources-v2-resource-resources.universal-BmmDoUqF.d.ts} +286 -2
- package/build/cjs/index.d.ts +14 -6
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +24 -0
- package/build/cjs/index.typings.js +812 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -1
- package/build/es/{bookings-resources-v2-resource-resources.universal-RnzqwcCV.d.mts → bookings-resources-v2-resource-resources.universal-BmmDoUqF.d.mts} +286 -2
- package/build/es/index.d.mts +14 -6
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +24 -0
- package/build/es/index.typings.mjs +768 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +1 -1
- package/build/internal/cjs/{bookings-resources-v2-resource-resources.universal-RnzqwcCV.d.ts → bookings-resources-v2-resource-resources.universal-BmmDoUqF.d.ts} +286 -2
- package/build/internal/cjs/index.d.ts +14 -6
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +24 -0
- package/build/internal/cjs/index.typings.js +812 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -1
- package/build/internal/es/{bookings-resources-v2-resource-resources.universal-RnzqwcCV.d.mts → bookings-resources-v2-resource-resources.universal-BmmDoUqF.d.mts} +286 -2
- package/build/internal/es/index.d.mts +14 -6
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +24 -0
- package/build/internal/es/index.typings.mjs +768 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SearchSpec, Search } from '@wix/sdk-types';
|
|
1
|
+
import { SearchSpec, Search, NonNullablePaths } from '@wix/sdk-types';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A resource represents an entity, such as a room or a staff member, that can be
|
|
@@ -196,6 +196,8 @@ declare enum ManagementType {
|
|
|
196
196
|
/** The resource is managed by a Wix user. */
|
|
197
197
|
WIX_USER = "WIX_USER"
|
|
198
198
|
}
|
|
199
|
+
/** @enumType */
|
|
200
|
+
type ManagementTypeWithLiterals = ManagementType | 'WIX_USER';
|
|
199
201
|
interface ExtendedFields {
|
|
200
202
|
/**
|
|
201
203
|
* Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
|
|
@@ -1215,6 +1217,56 @@ declare enum WebhookIdentityType {
|
|
|
1215
1217
|
}
|
|
1216
1218
|
/** @enumType */
|
|
1217
1219
|
type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
1220
|
+
type CreateResourceValidationErrors = {
|
|
1221
|
+
ruleName?: 'RESOURCE_LOCATION_ID_IS_REQUIRED';
|
|
1222
|
+
} | {
|
|
1223
|
+
ruleName?: 'RESOURCE_SPECIFIC_LOCATION_OPTIONS_NOT_ALLOWED';
|
|
1224
|
+
} | {
|
|
1225
|
+
ruleName?: 'RESOURCE_SPECIFIC_LOCATION_OPTIONS_MUST_BE_SET';
|
|
1226
|
+
} | {
|
|
1227
|
+
ruleName?: 'RESOURCE_AVAILABLE_IN_BUSINESS_LOCATION_MUST_BE_TRUE';
|
|
1228
|
+
};
|
|
1229
|
+
type BulkCreateResourcesValidationErrors = {
|
|
1230
|
+
ruleName?: 'RESOURCE_LOCATION_ID_IS_REQUIRED';
|
|
1231
|
+
} | {
|
|
1232
|
+
ruleName?: 'RESOURCE_SPECIFIC_LOCATION_OPTIONS_NOT_ALLOWED';
|
|
1233
|
+
} | {
|
|
1234
|
+
ruleName?: 'RESOURCE_SPECIFIC_LOCATION_OPTIONS_MUST_BE_SET';
|
|
1235
|
+
} | {
|
|
1236
|
+
ruleName?: 'RESOURCE_AVAILABLE_IN_BUSINESS_LOCATION_MUST_BE_TRUE';
|
|
1237
|
+
} | {
|
|
1238
|
+
ruleName?: 'RESOURCE_WORKING_HOURS_NOT_SUPPORTED_IN_BULK_REQUEST';
|
|
1239
|
+
};
|
|
1240
|
+
type UpdateResourceValidationErrors = {
|
|
1241
|
+
ruleName?: 'RESOURCE_NAME_IS_REQUIRED';
|
|
1242
|
+
} | {
|
|
1243
|
+
ruleName?: 'RESOURCE_LOCATION_ID_IS_REQUIRED';
|
|
1244
|
+
} | {
|
|
1245
|
+
ruleName?: 'RESOURCE_SPECIFIC_LOCATION_OPTIONS_NOT_ALLOWED';
|
|
1246
|
+
} | {
|
|
1247
|
+
ruleName?: 'RESOURCE_SPECIFIC_LOCATION_OPTIONS_MUST_BE_SET';
|
|
1248
|
+
} | {
|
|
1249
|
+
ruleName?: 'RESOURCE_AVAILABLE_IN_BUSINESS_LOCATION_MUST_BE_TRUE';
|
|
1250
|
+
} | {
|
|
1251
|
+
ruleName?: 'RESOURCE_WORKING_HOURS_SCHEDULE_ID_IS_REQUIRED';
|
|
1252
|
+
} | {
|
|
1253
|
+
ruleName?: 'RESOURCE_WORKING_HOURS_SHARED_IS_REQUIRED';
|
|
1254
|
+
};
|
|
1255
|
+
type BulkUpdateResourcesValidationErrors = {
|
|
1256
|
+
ruleName?: 'RESOURCE_NAME_IS_REQUIRED';
|
|
1257
|
+
} | {
|
|
1258
|
+
ruleName?: 'RESOURCE_LOCATION_ID_IS_REQUIRED';
|
|
1259
|
+
} | {
|
|
1260
|
+
ruleName?: 'RESOURCE_SPECIFIC_LOCATION_OPTIONS_NOT_ALLOWED';
|
|
1261
|
+
} | {
|
|
1262
|
+
ruleName?: 'RESOURCE_SPECIFIC_LOCATION_OPTIONS_MUST_BE_SET';
|
|
1263
|
+
} | {
|
|
1264
|
+
ruleName?: 'RESOURCE_AVAILABLE_IN_BUSINESS_LOCATION_MUST_BE_TRUE';
|
|
1265
|
+
} | {
|
|
1266
|
+
ruleName?: 'RESOURCE_WORKING_HOURS_SCHEDULE_ID_IS_REQUIRED';
|
|
1267
|
+
} | {
|
|
1268
|
+
ruleName?: 'RESOURCE_WORKING_HOURS_SHARED_IS_REQUIRED';
|
|
1269
|
+
};
|
|
1218
1270
|
interface BaseEventMetadata {
|
|
1219
1271
|
/**
|
|
1220
1272
|
* App instance ID.
|
|
@@ -1263,13 +1315,120 @@ interface ResourceCreatedEnvelope {
|
|
|
1263
1315
|
entity: Resource;
|
|
1264
1316
|
metadata: EventMetadata;
|
|
1265
1317
|
}
|
|
1318
|
+
/**
|
|
1319
|
+
* Triggered when a resource is created.
|
|
1320
|
+
* @permissionScope Read Bookings - Public Data
|
|
1321
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
|
|
1322
|
+
* @permissionScope Manage Bookings
|
|
1323
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
1324
|
+
* @permissionScope Read Bookings - Including Participants
|
|
1325
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
|
|
1326
|
+
* @permissionScope Read Bookings - all read permissions
|
|
1327
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
|
|
1328
|
+
* @permissionScope Manage Bookings - all permissions
|
|
1329
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
1330
|
+
* @permissionId BOOKINGS.RESOURCE_READ
|
|
1331
|
+
* @webhook
|
|
1332
|
+
* @eventType wix.bookings.resources.v2.resource_created
|
|
1333
|
+
* @serviceIdentifier wix.bookings.resources.v2.ResourcesService
|
|
1334
|
+
* @slug created
|
|
1335
|
+
*/
|
|
1336
|
+
declare function onResourceCreated(handler: (event: ResourceCreatedEnvelope) => void | Promise<void>): void;
|
|
1266
1337
|
interface ResourceDeletedEnvelope {
|
|
1267
1338
|
metadata: EventMetadata;
|
|
1268
1339
|
}
|
|
1340
|
+
/**
|
|
1341
|
+
* Triggered when a resource is deleted.
|
|
1342
|
+
* @permissionScope Read Bookings - Public Data
|
|
1343
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
|
|
1344
|
+
* @permissionScope Manage Bookings
|
|
1345
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
1346
|
+
* @permissionScope Read Bookings - Including Participants
|
|
1347
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
|
|
1348
|
+
* @permissionScope Read Bookings - all read permissions
|
|
1349
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
|
|
1350
|
+
* @permissionScope Manage Bookings - all permissions
|
|
1351
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
1352
|
+
* @permissionId BOOKINGS.RESOURCE_READ
|
|
1353
|
+
* @webhook
|
|
1354
|
+
* @eventType wix.bookings.resources.v2.resource_deleted
|
|
1355
|
+
* @serviceIdentifier wix.bookings.resources.v2.ResourcesService
|
|
1356
|
+
* @slug deleted
|
|
1357
|
+
*/
|
|
1358
|
+
declare function onResourceDeleted(handler: (event: ResourceDeletedEnvelope) => void | Promise<void>): void;
|
|
1269
1359
|
interface ResourceUpdatedEnvelope {
|
|
1270
1360
|
entity: Resource;
|
|
1271
1361
|
metadata: EventMetadata;
|
|
1272
1362
|
}
|
|
1363
|
+
/**
|
|
1364
|
+
* Triggered when an resource is updated.
|
|
1365
|
+
* @permissionScope Read Bookings - Public Data
|
|
1366
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC
|
|
1367
|
+
* @permissionScope Manage Bookings
|
|
1368
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
1369
|
+
* @permissionScope Read Bookings - Including Participants
|
|
1370
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
|
|
1371
|
+
* @permissionScope Read Bookings - all read permissions
|
|
1372
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
|
|
1373
|
+
* @permissionScope Manage Bookings - all permissions
|
|
1374
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
1375
|
+
* @permissionId BOOKINGS.RESOURCE_READ
|
|
1376
|
+
* @webhook
|
|
1377
|
+
* @eventType wix.bookings.resources.v2.resource_updated
|
|
1378
|
+
* @slug updated
|
|
1379
|
+
*/
|
|
1380
|
+
declare function onResourceUpdated(handler: (event: ResourceUpdatedEnvelope) => void | Promise<void>): void;
|
|
1381
|
+
type ResourceNonNullablePaths = `workingHoursSchedules.values` | `locationOptions.specificLocationOptions.businessLocations`;
|
|
1382
|
+
/**
|
|
1383
|
+
* Creates a new resource.
|
|
1384
|
+
*
|
|
1385
|
+
*
|
|
1386
|
+
* ## Connected schedules
|
|
1387
|
+
*
|
|
1388
|
+
* A new event *schedule*
|
|
1389
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/wix-bookings-integration) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/wix-bookings-integration))
|
|
1390
|
+
* is automatically created for the resource.
|
|
1391
|
+
*
|
|
1392
|
+
* ## Locations
|
|
1393
|
+
*
|
|
1394
|
+
* If you don't specify `locationOptions`, Wix Bookings automatically sets
|
|
1395
|
+
* `locationOptions.availableInAllLocations` to `true`.
|
|
1396
|
+
*
|
|
1397
|
+
* If you specify 1 business location ID in `locationOptions.specificLocationOptions.businessLocations`,
|
|
1398
|
+
* you must specify `locationOptions.specificLocationOptions.availableInBusinessLocations`
|
|
1399
|
+
* as `true`. Currently, you can specify only a single business location.
|
|
1400
|
+
* @param resource - Resource to create.
|
|
1401
|
+
* @public
|
|
1402
|
+
* @requiredField resource
|
|
1403
|
+
* @requiredField resource.name
|
|
1404
|
+
* @permissionId BOOKINGS.RESOURCE_CREATE
|
|
1405
|
+
* @applicableIdentity APP
|
|
1406
|
+
* @returns Created resource.
|
|
1407
|
+
* @fqn wix.bookings.resources.v2.ResourcesService.CreateResource
|
|
1408
|
+
*/
|
|
1409
|
+
declare function createResource(resource: NonNullablePaths<Resource, `name`>): Promise<NonNullablePaths<Resource, ResourceNonNullablePaths> & {
|
|
1410
|
+
__validationErrorsType?: CreateResourceValidationErrors;
|
|
1411
|
+
}>;
|
|
1412
|
+
/**
|
|
1413
|
+
* Creates up to 50 resources.
|
|
1414
|
+
*
|
|
1415
|
+
*
|
|
1416
|
+
* Refer to *Create Resource*
|
|
1417
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/create-resource) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/create-resource))
|
|
1418
|
+
* for more details.
|
|
1419
|
+
* @param resources - Resources to create.
|
|
1420
|
+
* @public
|
|
1421
|
+
* @requiredField resources
|
|
1422
|
+
* @requiredField resources.name
|
|
1423
|
+
* @permissionId BOOKINGS.RESOURCE_CREATE
|
|
1424
|
+
* @applicableIdentity APP
|
|
1425
|
+
* @fqn wix.bookings.resources.v2.ResourcesService.BulkCreateResources
|
|
1426
|
+
*/
|
|
1427
|
+
declare function bulkCreateResources(resources: NonNullablePaths<Resource, `name`>[], options?: BulkCreateResourcesOptions): Promise<NonNullablePaths<BulkCreateResourcesResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | {
|
|
1428
|
+
[P in ResourceNonNullablePaths]: `results.${number}.item.${P}`;
|
|
1429
|
+
}[ResourceNonNullablePaths] | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`> & {
|
|
1430
|
+
__validationErrorsType?: BulkCreateResourcesValidationErrors;
|
|
1431
|
+
}>;
|
|
1273
1432
|
interface BulkCreateResourcesOptions {
|
|
1274
1433
|
/**
|
|
1275
1434
|
* Whether to include the created resources in the response.
|
|
@@ -1278,6 +1437,37 @@ interface BulkCreateResourcesOptions {
|
|
|
1278
1437
|
*/
|
|
1279
1438
|
returnEntity?: boolean;
|
|
1280
1439
|
}
|
|
1440
|
+
/**
|
|
1441
|
+
* Retrieves a resource.
|
|
1442
|
+
* @param resourceId - ID of the resource to retrieve.
|
|
1443
|
+
* @public
|
|
1444
|
+
* @requiredField resourceId
|
|
1445
|
+
* @permissionId BOOKINGS.RESOURCE_READ
|
|
1446
|
+
* @applicableIdentity APP
|
|
1447
|
+
* @applicableIdentity VISITOR
|
|
1448
|
+
* @returns Retrieved resource.
|
|
1449
|
+
* @fqn wix.bookings.resources.v2.ResourcesService.GetResource
|
|
1450
|
+
*/
|
|
1451
|
+
declare function getResource(resourceId: string): Promise<NonNullablePaths<Resource, ResourceNonNullablePaths>>;
|
|
1452
|
+
/**
|
|
1453
|
+
* Updates a resource.
|
|
1454
|
+
*
|
|
1455
|
+
*
|
|
1456
|
+
* Each time the resource is updated, `revision` increments by 1. You must include the current revision of the resource when updating it.
|
|
1457
|
+
* This ensures you're working with the latest service information and prevents unintended overwrites.
|
|
1458
|
+
* @param _id - Resource ID.
|
|
1459
|
+
* @public
|
|
1460
|
+
* @requiredField _id
|
|
1461
|
+
* @requiredField resource
|
|
1462
|
+
* @requiredField resource.revision
|
|
1463
|
+
* @permissionId BOOKINGS.RESOURCE_UPDATE
|
|
1464
|
+
* @applicableIdentity APP
|
|
1465
|
+
* @returns Updated resource.
|
|
1466
|
+
* @fqn wix.bookings.resources.v2.ResourcesService.UpdateResource
|
|
1467
|
+
*/
|
|
1468
|
+
declare function updateResource(_id: string, resource: NonNullablePaths<UpdateResource, `revision`>): Promise<NonNullablePaths<Resource, ResourceNonNullablePaths> & {
|
|
1469
|
+
__validationErrorsType?: UpdateResourceValidationErrors;
|
|
1470
|
+
}>;
|
|
1281
1471
|
interface UpdateResource {
|
|
1282
1472
|
/**
|
|
1283
1473
|
* Resource ID.
|
|
@@ -1341,6 +1531,28 @@ interface UpdateResource {
|
|
|
1341
1531
|
/** Extensions enabling users to save custom data related to the resource. */
|
|
1342
1532
|
extendedFields?: ExtendedFields;
|
|
1343
1533
|
}
|
|
1534
|
+
/**
|
|
1535
|
+
* Updates multiple resources.
|
|
1536
|
+
*
|
|
1537
|
+
*
|
|
1538
|
+
* Refer to *Update Resource*
|
|
1539
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/update-resource) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/update-resource))
|
|
1540
|
+
* for more details.
|
|
1541
|
+
* @param resources - Resources to update.
|
|
1542
|
+
* @public
|
|
1543
|
+
* @documentationMaturity preview
|
|
1544
|
+
* @requiredField resources
|
|
1545
|
+
* @requiredField resources.resource._id
|
|
1546
|
+
* @requiredField resources.resource.revision
|
|
1547
|
+
* @permissionId BOOKINGS.RESOURCE_UPDATE
|
|
1548
|
+
* @applicableIdentity APP
|
|
1549
|
+
* @fqn wix.bookings.resources.v2.ResourcesService.BulkUpdateResources
|
|
1550
|
+
*/
|
|
1551
|
+
declare function bulkUpdateResources(resources: NonNullablePaths<MaskedResource, `resource._id` | `resource.revision`>[], options?: BulkUpdateResourcesOptions): Promise<NonNullablePaths<BulkUpdateResourcesResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | {
|
|
1552
|
+
[P in ResourceNonNullablePaths]: `results.${number}.item.${P}`;
|
|
1553
|
+
}[ResourceNonNullablePaths] | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`> & {
|
|
1554
|
+
__validationErrorsType?: BulkUpdateResourcesValidationErrors;
|
|
1555
|
+
}>;
|
|
1344
1556
|
interface BulkUpdateResourcesOptions {
|
|
1345
1557
|
/**
|
|
1346
1558
|
* Whether to include the updated resources in the response.
|
|
@@ -1349,6 +1561,39 @@ interface BulkUpdateResourcesOptions {
|
|
|
1349
1561
|
*/
|
|
1350
1562
|
returnEntity?: boolean;
|
|
1351
1563
|
}
|
|
1564
|
+
/**
|
|
1565
|
+
* Deletes a resource.
|
|
1566
|
+
*
|
|
1567
|
+
*
|
|
1568
|
+
* Deleting a resource cancels its event schedule and all its working hour
|
|
1569
|
+
* schedules that aren't shared with another resource. Learn more about
|
|
1570
|
+
* _how Bookings uses the Calendar APIs_
|
|
1571
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/wix-bookings-integration) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/wix-bookings-integration)).
|
|
1572
|
+
* @param resourceId - ID of the resource to delete.
|
|
1573
|
+
* @public
|
|
1574
|
+
* @requiredField resourceId
|
|
1575
|
+
* @permissionId BOOKINGS.RESOURCE_DELETE
|
|
1576
|
+
* @applicableIdentity APP
|
|
1577
|
+
* @fqn wix.bookings.resources.v2.ResourcesService.DeleteResource
|
|
1578
|
+
*/
|
|
1579
|
+
declare function deleteResource(resourceId: string): Promise<void>;
|
|
1580
|
+
/**
|
|
1581
|
+
* Deletes multiple resources.
|
|
1582
|
+
*
|
|
1583
|
+
*
|
|
1584
|
+
* Refer to *Delete Resource*
|
|
1585
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/delete-resource) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/delete-resource))
|
|
1586
|
+
* for more details.
|
|
1587
|
+
* @param ids - IDs of the resources to delete.
|
|
1588
|
+
* @public
|
|
1589
|
+
* @requiredField ids
|
|
1590
|
+
* @permissionId BOOKINGS.RESOURCE_DELETE
|
|
1591
|
+
* @applicableIdentity APP
|
|
1592
|
+
* @fqn wix.bookings.resources.v2.ResourcesService.BulkDeleteResources
|
|
1593
|
+
*/
|
|
1594
|
+
declare function bulkDeleteResources(ids: string[]): Promise<NonNullablePaths<BulkDeleteResourcesResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | {
|
|
1595
|
+
[P in ResourceNonNullablePaths]: `results.${number}.item.${P}`;
|
|
1596
|
+
}[ResourceNonNullablePaths] | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`>>;
|
|
1352
1597
|
interface ResourceSearchSpec extends SearchSpec {
|
|
1353
1598
|
aggregatable: [
|
|
1354
1599
|
'_createdDate',
|
|
@@ -1515,6 +1760,30 @@ type ResourceSearch = {
|
|
|
1515
1760
|
*/
|
|
1516
1761
|
timeZone?: CommonSearchWithEntityContext['timeZone'] | null;
|
|
1517
1762
|
};
|
|
1763
|
+
/**
|
|
1764
|
+
* Creates a query to retrieve a list of resources.
|
|
1765
|
+
*
|
|
1766
|
+
* The `queryResources()` function builds a query to retrieve a list of resources and returns a `ResourcesQueryBuilder` object.
|
|
1767
|
+
*
|
|
1768
|
+
* The returned object contains the query definition, which is typically used to run the query using the [find()](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/resources-query-builder/find) function.
|
|
1769
|
+
*
|
|
1770
|
+
* You can refine the query by chaining `ResourcesQueryBuilder` functions onto the query. `ResourcesQueryBuilder` functions enable you to sort, filter, and control the results that `queryResources()` returns.
|
|
1771
|
+
*
|
|
1772
|
+
* `queryResources()` runs with the following `ResourcesQueryBuilder` default that you can override:
|
|
1773
|
+
*
|
|
1774
|
+
* + `limit` is `50`.
|
|
1775
|
+
* + Sorted by `id` in ascending order.
|
|
1776
|
+
*
|
|
1777
|
+
* The functions that are chained to `queryResources()` are applied in the order they are called. For example, if you apply `ascending("typeId")` and then `ascending("name")`, the results are sorted first by the `"typeId"`, and then, if there are multiple results with the same `"typeId"`, the items are sorted by `"name"`.
|
|
1778
|
+
*
|
|
1779
|
+
* The following `ResourcesQueryBuilder` functions are supported for the `queryResources()` function. For a full description of the resource object, see the object returned for the [items](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/resources-query-result/items) property in `ResourcesQueryResult`.
|
|
1780
|
+
* @public
|
|
1781
|
+
* @permissionId BOOKINGS.RESOURCE_READ
|
|
1782
|
+
* @applicableIdentity APP
|
|
1783
|
+
* @applicableIdentity VISITOR
|
|
1784
|
+
* @fqn wix.bookings.resources.v2.ResourcesService.QueryResources
|
|
1785
|
+
*/
|
|
1786
|
+
declare function queryResources(): ResourcesQueryBuilder;
|
|
1518
1787
|
interface QueryCursorResult {
|
|
1519
1788
|
cursors: Cursors;
|
|
1520
1789
|
hasNext: () => boolean;
|
|
@@ -1573,6 +1842,21 @@ interface ResourcesQueryBuilder {
|
|
|
1573
1842
|
skipTo: (cursor: string) => ResourcesQueryBuilder;
|
|
1574
1843
|
find: () => Promise<ResourcesQueryResult>;
|
|
1575
1844
|
}
|
|
1845
|
+
/**
|
|
1846
|
+
* Counts resources according to given criteria.
|
|
1847
|
+
*
|
|
1848
|
+
*
|
|
1849
|
+
* Refer to the *supported filters article*
|
|
1850
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/supported-filters) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/filtering-and-sorting))
|
|
1851
|
+
* for a complete list of supported filters and sorting options.
|
|
1852
|
+
* @public
|
|
1853
|
+
* @param options - Filter to base the count on. See *the supported filters article* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/supported-filters) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/filtering-and-sorting)) for a complete list of filtering options.
|
|
1854
|
+
* @permissionId BOOKINGS.RESOURCE_READ
|
|
1855
|
+
* @applicableIdentity APP
|
|
1856
|
+
* @applicableIdentity VISITOR
|
|
1857
|
+
* @fqn wix.bookings.resources.v2.ResourcesService.CountResources
|
|
1858
|
+
*/
|
|
1859
|
+
declare function countResources(options?: CountResourcesOptions): Promise<NonNullablePaths<CountResourcesResponse, `count`>>;
|
|
1576
1860
|
interface CountResourcesOptions {
|
|
1577
1861
|
/**
|
|
1578
1862
|
* Filter to base the count on. Refer to the *supported filters article*
|
|
@@ -1588,4 +1872,4 @@ interface CountResourcesOptions {
|
|
|
1588
1872
|
search?: SearchDetails;
|
|
1589
1873
|
}
|
|
1590
1874
|
|
|
1591
|
-
export { type
|
|
1875
|
+
export { type ListDeletedResourcesRequest as $, AggregationType as A, type BulkCreateResourcesOptions as B, type CreateResourceValidationErrors as C, type BusinessLocation as D, type WorkingHoursSchedules as E, type EventsSchedule as F, type ExtendedFields as G, type CreateResourceRequest as H, Interval as I, type CreateResourceResponse as J, type BulkCreateResourcesRequest as K, type LocationOptions as L, type MaskedResource as M, NestedAggregationType as N, type BulkResourceResult as O, type ItemMetadata as P, type ApplicationError as Q, type Resource as R, type SearchResourcesResponse as S, type BulkActionMetadata as T, type UpdateResource as U, type V2WorkingHoursSchedules as V, WebhookIdentityType as W, type GetResourceRequest as X, type GetResourceResponse as Y, type GetDeletedResourceRequest as Z, type GetDeletedResourceResponse as _, type BulkCreateResourcesResponse as a, type DomainEvent as a$, type CursorPaging as a0, type ListDeletedResourcesResponse as a1, type CursorPagingMetadata as a2, type Cursors as a3, type RemoveResourceFromTrashBinRequest as a4, type RemoveResourceFromTrashBinResponse as a5, type RestoreResourceFromTrashBinRequest as a6, type RestoreResourceFromTrashBinResponse as a7, type UpdateResourceRequest as a8, type UpdateResourceResponse as a9, type NestedAggregationResults as aA, type NestedAggregationResultsResultOneOf as aB, type ValueResults as aC, type RangeResults as aD, type AggregationResultsScalarResult as aE, type NestedValueAggregationResult as aF, type ValueResult as aG, type RangeResult as aH, type ScalarResult as aI, type NestedResultValue as aJ, type NestedResultValueResultOneOf as aK, type Results as aL, type DateHistogramResult as aM, type GroupByValueResults as aN, type DateHistogramResults as aO, type NestedResults as aP, type AggregationResults as aQ, type AggregationResultsResultOneOf as aR, type QueryResourcesRequest as aS, type CursorQuery as aT, type CursorQueryPagingMethodOneOf as aU, type QueryResourcesResponse as aV, type CountResourcesRequest as aW, type FixResourceSchedulesRequest as aX, type FixResourceSchedulesResponse as aY, type ReindexTenantRequest as aZ, type ReindexTenantResponse as a_, type BulkUpdateResourcesRequest as aa, type DeleteResourceRequest as ab, type DeleteResourceResponse as ac, type BulkDeleteResourcesRequest as ad, type SearchResourcesRequest as ae, type CursorSearch as af, type CursorSearchPagingMethodOneOf as ag, type Sorting as ah, type Aggregation as ai, type AggregationKindOneOf as aj, type RangeBucket as ak, type IncludeMissingValuesOptions as al, type ValueAggregation as am, type ValueAggregationOptionsOneOf as an, type RangeAggregation as ao, type ScalarAggregation as ap, type DateHistogramAggregation as aq, type NestedAggregationItem as ar, type NestedAggregationItemKindOneOf as as, type NestedAggregation as at, type GroupByAggregation as au, type GroupByAggregationKindOneOf as av, type SearchDetails as aw, type AggregationData as ax, type ValueAggregationResult as ay, type RangeAggregationResult as az, type BulkCreateResourcesValidationErrors as b, type DomainEventBodyOneOf as b0, type EntityCreatedEvent as b1, type RestoreInfo as b2, type EntityUpdatedEvent as b3, type EntityDeletedEvent as b4, type ActionEvent as b5, type Empty as b6, type MessageEnvelope as b7, type IdentificationData as b8, type IdentificationDataIdOneOf as b9, queryResources as bA, countResources as bB, type BaseEventMetadata as ba, type EventMetadata as bb, type ResourceSearchSpec as bc, type ResourcesQueryResult as bd, type ManagementTypeWithLiterals as be, type SortOrderWithLiterals as bf, type SortTypeWithLiterals as bg, type SortDirectionWithLiterals as bh, type MissingValuesWithLiterals as bi, type ScalarTypeWithLiterals as bj, type NestedAggregationTypeWithLiterals as bk, type IntervalWithLiterals as bl, type AggregationTypeWithLiterals as bm, type ModeWithLiterals as bn, type WebhookIdentityTypeWithLiterals as bo, onResourceCreated as bp, onResourceDeleted as bq, onResourceUpdated as br, createResource as bs, bulkCreateResources as bt, getResource as bu, updateResource as bv, bulkUpdateResources as bw, deleteResource as bx, bulkDeleteResources as by, type CommonSearchWithEntityContext as bz, type UpdateResourceValidationErrors as c, type BulkUpdateResourcesOptions as d, type BulkUpdateResourcesResponse as e, type BulkUpdateResourcesValidationErrors as f, type BulkDeleteResourcesResponse as g, type ResourceSearch as h, type ResourcesQueryBuilder as i, type CountResourcesOptions as j, type CountResourcesResponse as k, type ResourceCreatedEnvelope as l, type ResourceDeletedEnvelope as m, type ResourceUpdatedEnvelope as n, ManagementType as o, SortOrder as p, SortType as q, SortDirection as r, MissingValues as s, ScalarType as t, Mode as u, type ResourceCompositionDetailsOneOf as v, type WorkingHoursSchedule as w, type SingleResource as x, type Schedule as y, type SpecificLocation as z };
|
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 { R as Resource, B as BulkCreateResourcesOptions, a as BulkCreateResourcesResponse, U as UpdateResource, M as MaskedResource,
|
|
3
|
-
export {
|
|
2
|
+
import { R as Resource, C as CreateResourceValidationErrors, B as BulkCreateResourcesOptions, a as BulkCreateResourcesResponse, b as BulkCreateResourcesValidationErrors, U as UpdateResource, c as UpdateResourceValidationErrors, M as MaskedResource, d as BulkUpdateResourcesOptions, e as BulkUpdateResourcesResponse, f as BulkUpdateResourcesValidationErrors, g as BulkDeleteResourcesResponse, h as ResourceSearch, S as SearchResourcesResponse, i as ResourcesQueryBuilder, j as CountResourcesOptions, k as CountResourcesResponse, l as ResourceCreatedEnvelope, m as ResourceDeletedEnvelope, n as ResourceUpdatedEnvelope } from './bookings-resources-v2-resource-resources.universal-BmmDoUqF.js';
|
|
3
|
+
export { b5 as ActionEvent, ai as Aggregation, ax as AggregationData, aj as AggregationKindOneOf, aQ as AggregationResults, aR as AggregationResultsResultOneOf, aE as AggregationResultsScalarResult, A as AggregationType, Q as ApplicationError, ba as BaseEventMetadata, T as BulkActionMetadata, K as BulkCreateResourcesRequest, ad as BulkDeleteResourcesRequest, O as BulkResourceResult, aa as BulkUpdateResourcesRequest, D as BusinessLocation, aW as CountResourcesRequest, H as CreateResourceRequest, J as CreateResourceResponse, a0 as CursorPaging, a2 as CursorPagingMetadata, aT as CursorQuery, aU as CursorQueryPagingMethodOneOf, af as CursorSearch, ag as CursorSearchPagingMethodOneOf, a3 as Cursors, aq as DateHistogramAggregation, aM as DateHistogramResult, aO as DateHistogramResults, ab as DeleteResourceRequest, ac as DeleteResourceResponse, a$ as DomainEvent, b0 as DomainEventBodyOneOf, b6 as Empty, b1 as EntityCreatedEvent, b4 as EntityDeletedEvent, b3 as EntityUpdatedEvent, bb as EventMetadata, F as EventsSchedule, G as ExtendedFields, aX as FixResourceSchedulesRequest, aY as FixResourceSchedulesResponse, Z as GetDeletedResourceRequest, _ as GetDeletedResourceResponse, X as GetResourceRequest, Y as GetResourceResponse, au as GroupByAggregation, av as GroupByAggregationKindOneOf, aN as GroupByValueResults, b8 as IdentificationData, b9 as IdentificationDataIdOneOf, al as IncludeMissingValuesOptions, I as Interval, P as ItemMetadata, $ as ListDeletedResourcesRequest, a1 as ListDeletedResourcesResponse, L as LocationOptions, o as ManagementType, b7 as MessageEnvelope, s as MissingValues, u as Mode, at as NestedAggregation, ar as NestedAggregationItem, as as NestedAggregationItemKindOneOf, aA as NestedAggregationResults, aB as NestedAggregationResultsResultOneOf, N as NestedAggregationType, aJ as NestedResultValue, aK as NestedResultValueResultOneOf, aP as NestedResults, aF as NestedValueAggregationResult, aS as QueryResourcesRequest, aV as QueryResourcesResponse, ao as RangeAggregation, az as RangeAggregationResult, ak as RangeBucket, aH as RangeResult, aD as RangeResults, aZ as ReindexTenantRequest, a_ as ReindexTenantResponse, a4 as RemoveResourceFromTrashBinRequest, a5 as RemoveResourceFromTrashBinResponse, v as ResourceCompositionDetailsOneOf, bc as ResourceSearchSpec, bd as ResourcesQueryResult, b2 as RestoreInfo, a6 as RestoreResourceFromTrashBinRequest, a7 as RestoreResourceFromTrashBinResponse, aL as Results, ap as ScalarAggregation, aI as ScalarResult, t as ScalarType, y as Schedule, aw as SearchDetails, ae as SearchResourcesRequest, x as SingleResource, r as SortDirection, p as SortOrder, q as SortType, ah as Sorting, z as SpecificLocation, a8 as UpdateResourceRequest, a9 as UpdateResourceResponse, V as V2WorkingHoursSchedules, am as ValueAggregation, an as ValueAggregationOptionsOneOf, ay as ValueAggregationResult, aG as ValueResult, aC as ValueResults, W as WebhookIdentityType, w as WorkingHoursSchedule, E as WorkingHoursSchedules } from './bookings-resources-v2-resource-resources.universal-BmmDoUqF.js';
|
|
4
4
|
|
|
5
5
|
declare function createResource$1(httpClient: HttpClient): CreateResourceSignature;
|
|
6
6
|
interface CreateResourceSignature {
|
|
@@ -25,7 +25,9 @@ interface CreateResourceSignature {
|
|
|
25
25
|
* @param - Resource to create.
|
|
26
26
|
* @returns Created resource.
|
|
27
27
|
*/
|
|
28
|
-
(resource: Resource): Promise<Resource
|
|
28
|
+
(resource: Resource): Promise<Resource & {
|
|
29
|
+
__validationErrorsType?: CreateResourceValidationErrors | undefined;
|
|
30
|
+
}>;
|
|
29
31
|
}
|
|
30
32
|
declare function bulkCreateResources$1(httpClient: HttpClient): BulkCreateResourcesSignature;
|
|
31
33
|
interface BulkCreateResourcesSignature {
|
|
@@ -38,7 +40,9 @@ interface BulkCreateResourcesSignature {
|
|
|
38
40
|
* for more details.
|
|
39
41
|
* @param - Resources to create.
|
|
40
42
|
*/
|
|
41
|
-
(resources: Resource[], options?: BulkCreateResourcesOptions | undefined): Promise<BulkCreateResourcesResponse
|
|
43
|
+
(resources: Resource[], options?: BulkCreateResourcesOptions | undefined): Promise<BulkCreateResourcesResponse & {
|
|
44
|
+
__validationErrorsType?: BulkCreateResourcesValidationErrors | undefined;
|
|
45
|
+
}>;
|
|
42
46
|
}
|
|
43
47
|
declare function getResource$1(httpClient: HttpClient): GetResourceSignature;
|
|
44
48
|
interface GetResourceSignature {
|
|
@@ -60,7 +64,9 @@ interface UpdateResourceSignature {
|
|
|
60
64
|
* @param - Resource ID.
|
|
61
65
|
* @returns Updated resource.
|
|
62
66
|
*/
|
|
63
|
-
(_id: string, resource: UpdateResource): Promise<Resource
|
|
67
|
+
(_id: string, resource: UpdateResource): Promise<Resource & {
|
|
68
|
+
__validationErrorsType?: UpdateResourceValidationErrors | undefined;
|
|
69
|
+
}>;
|
|
64
70
|
}
|
|
65
71
|
declare function bulkUpdateResources$1(httpClient: HttpClient): BulkUpdateResourcesSignature;
|
|
66
72
|
interface BulkUpdateResourcesSignature {
|
|
@@ -73,7 +79,9 @@ interface BulkUpdateResourcesSignature {
|
|
|
73
79
|
* for more details.
|
|
74
80
|
* @param - Resources to update.
|
|
75
81
|
*/
|
|
76
|
-
(resources: MaskedResource[], options?: BulkUpdateResourcesOptions | undefined): Promise<BulkUpdateResourcesResponse
|
|
82
|
+
(resources: MaskedResource[], options?: BulkUpdateResourcesOptions | undefined): Promise<BulkUpdateResourcesResponse & {
|
|
83
|
+
__validationErrorsType?: BulkUpdateResourcesValidationErrors | undefined;
|
|
84
|
+
}>;
|
|
77
85
|
}
|
|
78
86
|
declare function deleteResource$1(httpClient: HttpClient): DeleteResourceSignature;
|
|
79
87
|
interface DeleteResourceSignature {
|