@wix/vibe-bookings-plugin 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +338 -25
- package/dist/index.cjs.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -3053,17 +3053,6 @@ function renameKeysFromRESTResponseToSDKResponse(payload, ignorePaths = []) {
|
|
|
3053
3053
|
return renameAllNestedKeys(payload, RESTResponseToSDKResponseRenameMap, ignorePaths);
|
|
3054
3054
|
}
|
|
3055
3055
|
|
|
3056
|
-
// ../../../node_modules/@wix/sdk-types/build/index.mjs
|
|
3057
|
-
function EventDefinition(type, isDomainEvent = false, transformations = (x) => x) {
|
|
3058
|
-
return () => ({
|
|
3059
|
-
__type: "event-definition",
|
|
3060
|
-
type,
|
|
3061
|
-
isDomainEvent,
|
|
3062
|
-
transformations
|
|
3063
|
-
});
|
|
3064
|
-
}
|
|
3065
|
-
var SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
3066
|
-
|
|
3067
3056
|
// ../../../node_modules/@wix/sdk-context/build/index.mjs
|
|
3068
3057
|
var wixContext = {};
|
|
3069
3058
|
|
|
@@ -3326,6 +3315,16 @@ function transformSDKFieldMaskToRESTFieldMask(val) {
|
|
|
3326
3315
|
return val.join(",");
|
|
3327
3316
|
}
|
|
3328
3317
|
|
|
3318
|
+
// ../../../node_modules/@wix/sdk-types/build/index.mjs
|
|
3319
|
+
function EventDefinition(type, isDomainEvent = false, transformations = (x) => x) {
|
|
3320
|
+
return () => ({
|
|
3321
|
+
__type: "event-definition",
|
|
3322
|
+
type,
|
|
3323
|
+
isDomainEvent,
|
|
3324
|
+
transformations
|
|
3325
|
+
});
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3329
3328
|
// ../../../node_modules/@wix/sdk-runtime/build/query-filter.js
|
|
3330
3329
|
function isAndOperator(filter) {
|
|
3331
3330
|
return Object.keys(filter).length === 1 && "$and" in filter && Array.isArray(filter.$and);
|
|
@@ -4041,6 +4040,7 @@ __export(es_exports, {
|
|
|
4041
4040
|
SortType: () => SortType,
|
|
4042
4041
|
SortingMethodType: () => SortingMethodType,
|
|
4043
4042
|
Status: () => Status,
|
|
4043
|
+
TaxableAddressType: () => TaxableAddressType,
|
|
4044
4044
|
V2RequestedFields: () => V2RequestedFields,
|
|
4045
4045
|
WebhookIdentityType: () => WebhookIdentityType,
|
|
4046
4046
|
bulkCreateServices: () => bulkCreateServices4,
|
|
@@ -4079,6 +4079,7 @@ __export(es_exports, {
|
|
|
4079
4079
|
function transformSDKAddressToRESTAddress(payload) {
|
|
4080
4080
|
return payload && removeUndefinedKeys({
|
|
4081
4081
|
city: payload.city,
|
|
4082
|
+
hint: payload.hint,
|
|
4082
4083
|
subdivision: payload.subdivision,
|
|
4083
4084
|
country: payload.country,
|
|
4084
4085
|
postalCode: payload.postalCode,
|
|
@@ -4104,6 +4105,7 @@ function transformRESTAddressToSDKAddress(payload) {
|
|
|
4104
4105
|
number: payload.streetAddress.number,
|
|
4105
4106
|
apt: payload.streetAddress.apt
|
|
4106
4107
|
},
|
|
4108
|
+
hint: payload.hint,
|
|
4107
4109
|
city: payload.city,
|
|
4108
4110
|
subdivision: payload.subdivision,
|
|
4109
4111
|
country: payload.country,
|
|
@@ -4409,6 +4411,9 @@ function createAddOnGroup(payload) {
|
|
|
4409
4411
|
method: "POST",
|
|
4410
4412
|
methodFqn: "wix.bookings.services.v2.AddOnGroupsService.CreateAddOnGroup",
|
|
4411
4413
|
packageName: PACKAGE_NAME,
|
|
4414
|
+
migrationOptions: {
|
|
4415
|
+
optInTransformResponse: true
|
|
4416
|
+
},
|
|
4412
4417
|
url: resolveWixBookingsServicesV2AddOnGroupsServiceUrl({
|
|
4413
4418
|
protoPath: "/v2/services/add-on-groups/create",
|
|
4414
4419
|
data: payload,
|
|
@@ -4427,6 +4432,9 @@ function deleteAddOnGroup(payload) {
|
|
|
4427
4432
|
method: "POST",
|
|
4428
4433
|
methodFqn: "wix.bookings.services.v2.AddOnGroupsService.DeleteAddOnGroup",
|
|
4429
4434
|
packageName: PACKAGE_NAME,
|
|
4435
|
+
migrationOptions: {
|
|
4436
|
+
optInTransformResponse: true
|
|
4437
|
+
},
|
|
4430
4438
|
url: resolveWixBookingsServicesV2AddOnGroupsServiceUrl({
|
|
4431
4439
|
protoPath: "/v2/services/add-on-groups/delete",
|
|
4432
4440
|
data: payload,
|
|
@@ -4451,6 +4459,9 @@ function updateAddOnGroup(payload) {
|
|
|
4451
4459
|
method: "POST",
|
|
4452
4460
|
methodFqn: "wix.bookings.services.v2.AddOnGroupsService.UpdateAddOnGroup",
|
|
4453
4461
|
packageName: PACKAGE_NAME,
|
|
4462
|
+
migrationOptions: {
|
|
4463
|
+
optInTransformResponse: true
|
|
4464
|
+
},
|
|
4454
4465
|
url: resolveWixBookingsServicesV2AddOnGroupsServiceUrl({
|
|
4455
4466
|
protoPath: "/v2/services/add-on-groups/update",
|
|
4456
4467
|
data: serializedData,
|
|
@@ -4469,6 +4480,9 @@ function listAddOnGroupsByServiceId(payload) {
|
|
|
4469
4480
|
method: "POST",
|
|
4470
4481
|
methodFqn: "wix.bookings.services.v2.AddOnGroupsService.ListAddOnGroupsByServiceId",
|
|
4471
4482
|
packageName: PACKAGE_NAME,
|
|
4483
|
+
migrationOptions: {
|
|
4484
|
+
optInTransformResponse: true
|
|
4485
|
+
},
|
|
4472
4486
|
url: resolveWixBookingsServicesV2AddOnGroupsServiceUrl({
|
|
4473
4487
|
protoPath: "/v2/services/add-on-groups/list-add-on-groups-by-service-id",
|
|
4474
4488
|
data: payload,
|
|
@@ -4487,6 +4501,9 @@ function setAddOnsForGroup(payload) {
|
|
|
4487
4501
|
method: "POST",
|
|
4488
4502
|
methodFqn: "wix.bookings.services.v2.AddOnGroupsService.SetAddOnsForGroup",
|
|
4489
4503
|
packageName: PACKAGE_NAME,
|
|
4504
|
+
migrationOptions: {
|
|
4505
|
+
optInTransformResponse: true
|
|
4506
|
+
},
|
|
4490
4507
|
url: resolveWixBookingsServicesV2AddOnGroupsServiceUrl({
|
|
4491
4508
|
protoPath: "/v2/services/add-on-groups/set-add-ons-for-group",
|
|
4492
4509
|
data: payload,
|
|
@@ -4538,6 +4555,9 @@ function createService(payload) {
|
|
|
4538
4555
|
method: "POST",
|
|
4539
4556
|
methodFqn: "wix.bookings.services.v2.ServicesService.CreateService",
|
|
4540
4557
|
packageName: PACKAGE_NAME,
|
|
4558
|
+
migrationOptions: {
|
|
4559
|
+
optInTransformResponse: true
|
|
4560
|
+
},
|
|
4541
4561
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
4542
4562
|
protoPath: "/v2/services",
|
|
4543
4563
|
data: serializedData,
|
|
@@ -4624,6 +4644,9 @@ function bulkCreateServices(payload) {
|
|
|
4624
4644
|
method: "POST",
|
|
4625
4645
|
methodFqn: "wix.bookings.services.v2.ServicesService.BulkCreateServices",
|
|
4626
4646
|
packageName: PACKAGE_NAME,
|
|
4647
|
+
migrationOptions: {
|
|
4648
|
+
optInTransformResponse: true
|
|
4649
|
+
},
|
|
4627
4650
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
4628
4651
|
protoPath: "/v2/bulk/services/create",
|
|
4629
4652
|
data: serializedData,
|
|
@@ -4689,6 +4712,9 @@ function getService(payload) {
|
|
|
4689
4712
|
method: "GET",
|
|
4690
4713
|
methodFqn: "wix.bookings.services.v2.ServicesService.GetService",
|
|
4691
4714
|
packageName: PACKAGE_NAME,
|
|
4715
|
+
migrationOptions: {
|
|
4716
|
+
optInTransformResponse: true
|
|
4717
|
+
},
|
|
4692
4718
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
4693
4719
|
protoPath: "/v2/services/{serviceId}",
|
|
4694
4720
|
data: payload,
|
|
@@ -4779,6 +4805,9 @@ function updateService(payload) {
|
|
|
4779
4805
|
method: "PATCH",
|
|
4780
4806
|
methodFqn: "wix.bookings.services.v2.ServicesService.UpdateService",
|
|
4781
4807
|
packageName: PACKAGE_NAME,
|
|
4808
|
+
migrationOptions: {
|
|
4809
|
+
optInTransformResponse: true
|
|
4810
|
+
},
|
|
4782
4811
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
4783
4812
|
protoPath: "/v2/services/{service.id}",
|
|
4784
4813
|
data: serializedData,
|
|
@@ -4883,6 +4912,9 @@ function bulkUpdateServices(payload) {
|
|
|
4883
4912
|
method: "POST",
|
|
4884
4913
|
methodFqn: "wix.bookings.services.v2.ServicesService.BulkUpdateServices",
|
|
4885
4914
|
packageName: PACKAGE_NAME,
|
|
4915
|
+
migrationOptions: {
|
|
4916
|
+
optInTransformResponse: true
|
|
4917
|
+
},
|
|
4886
4918
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
4887
4919
|
protoPath: "/v2/bulk/services/update",
|
|
4888
4920
|
data: serializedData,
|
|
@@ -4985,6 +5017,9 @@ function bulkUpdateServicesByFilter(payload) {
|
|
|
4985
5017
|
method: "POST",
|
|
4986
5018
|
methodFqn: "wix.bookings.services.v2.ServicesService.BulkUpdateServicesByFilter",
|
|
4987
5019
|
packageName: PACKAGE_NAME,
|
|
5020
|
+
migrationOptions: {
|
|
5021
|
+
optInTransformResponse: true
|
|
5022
|
+
},
|
|
4988
5023
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
4989
5024
|
protoPath: "/v2/bulk/services/update-by-filter",
|
|
4990
5025
|
data: serializedData,
|
|
@@ -5003,6 +5038,9 @@ function deleteService(payload) {
|
|
|
5003
5038
|
method: "DELETE",
|
|
5004
5039
|
methodFqn: "wix.bookings.services.v2.ServicesService.DeleteService",
|
|
5005
5040
|
packageName: PACKAGE_NAME,
|
|
5041
|
+
migrationOptions: {
|
|
5042
|
+
optInTransformResponse: true
|
|
5043
|
+
},
|
|
5006
5044
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
5007
5045
|
protoPath: "/v2/services/{serviceId}",
|
|
5008
5046
|
data: payload,
|
|
@@ -5021,6 +5059,9 @@ function bulkDeleteServices(payload) {
|
|
|
5021
5059
|
method: "POST",
|
|
5022
5060
|
methodFqn: "wix.bookings.services.v2.ServicesService.BulkDeleteServices",
|
|
5023
5061
|
packageName: PACKAGE_NAME,
|
|
5062
|
+
migrationOptions: {
|
|
5063
|
+
optInTransformResponse: true
|
|
5064
|
+
},
|
|
5024
5065
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
5025
5066
|
protoPath: "/v2/bulk/services/delete",
|
|
5026
5067
|
data: payload,
|
|
@@ -5086,6 +5127,9 @@ function bulkDeleteServicesByFilter(payload) {
|
|
|
5086
5127
|
method: "POST",
|
|
5087
5128
|
methodFqn: "wix.bookings.services.v2.ServicesService.BulkDeleteServicesByFilter",
|
|
5088
5129
|
packageName: PACKAGE_NAME,
|
|
5130
|
+
migrationOptions: {
|
|
5131
|
+
optInTransformResponse: true
|
|
5132
|
+
},
|
|
5089
5133
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
5090
5134
|
protoPath: "/v2/bulk/services/delete-by-filter",
|
|
5091
5135
|
data: payload,
|
|
@@ -5104,6 +5148,9 @@ function queryServices(payload) {
|
|
|
5104
5148
|
method: "POST",
|
|
5105
5149
|
methodFqn: "wix.bookings.services.v2.ServicesService.QueryServices",
|
|
5106
5150
|
packageName: PACKAGE_NAME,
|
|
5151
|
+
migrationOptions: {
|
|
5152
|
+
optInTransformResponse: true
|
|
5153
|
+
},
|
|
5107
5154
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
5108
5155
|
protoPath: "/v2/services/query",
|
|
5109
5156
|
data: payload,
|
|
@@ -5174,6 +5221,9 @@ function searchServices(payload) {
|
|
|
5174
5221
|
method: "POST",
|
|
5175
5222
|
methodFqn: "wix.bookings.services.v2.ServicesService.SearchServices",
|
|
5176
5223
|
packageName: PACKAGE_NAME,
|
|
5224
|
+
migrationOptions: {
|
|
5225
|
+
optInTransformResponse: true
|
|
5226
|
+
},
|
|
5177
5227
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
5178
5228
|
protoPath: "/v2/services/search",
|
|
5179
5229
|
data: serializedData,
|
|
@@ -5250,6 +5300,9 @@ function queryPolicies(payload) {
|
|
|
5250
5300
|
method: "POST",
|
|
5251
5301
|
methodFqn: "wix.bookings.services.v2.ServicesService.QueryPolicies",
|
|
5252
5302
|
packageName: PACKAGE_NAME,
|
|
5303
|
+
migrationOptions: {
|
|
5304
|
+
optInTransformResponse: true
|
|
5305
|
+
},
|
|
5253
5306
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
5254
5307
|
protoPath: "/v2/services/policies/query",
|
|
5255
5308
|
data: payload,
|
|
@@ -5376,6 +5429,9 @@ function queryBookingForms(payload) {
|
|
|
5376
5429
|
method: "POST",
|
|
5377
5430
|
methodFqn: "wix.bookings.services.v2.ServicesService.QueryBookingForms",
|
|
5378
5431
|
packageName: PACKAGE_NAME,
|
|
5432
|
+
migrationOptions: {
|
|
5433
|
+
optInTransformResponse: true
|
|
5434
|
+
},
|
|
5379
5435
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
5380
5436
|
protoPath: "/v2/services/booking-forms/query",
|
|
5381
5437
|
data: payload,
|
|
@@ -5394,6 +5450,9 @@ function countServices(payload) {
|
|
|
5394
5450
|
method: "POST",
|
|
5395
5451
|
methodFqn: "wix.bookings.services.v2.ServicesService.CountServices",
|
|
5396
5452
|
packageName: PACKAGE_NAME,
|
|
5453
|
+
migrationOptions: {
|
|
5454
|
+
optInTransformResponse: true
|
|
5455
|
+
},
|
|
5397
5456
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
5398
5457
|
protoPath: "/v2/services/count",
|
|
5399
5458
|
data: payload,
|
|
@@ -5412,6 +5471,9 @@ function queryLocations(payload) {
|
|
|
5412
5471
|
method: "POST",
|
|
5413
5472
|
methodFqn: "wix.bookings.services.v2.ServicesService.QueryLocations",
|
|
5414
5473
|
packageName: PACKAGE_NAME,
|
|
5474
|
+
migrationOptions: {
|
|
5475
|
+
optInTransformResponse: true
|
|
5476
|
+
},
|
|
5415
5477
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
5416
5478
|
protoPath: "/v2/services/locations/query",
|
|
5417
5479
|
data: payload,
|
|
@@ -5455,6 +5517,9 @@ function queryCategories(payload) {
|
|
|
5455
5517
|
method: "POST",
|
|
5456
5518
|
methodFqn: "wix.bookings.services.v2.ServicesService.QueryCategories",
|
|
5457
5519
|
packageName: PACKAGE_NAME,
|
|
5520
|
+
migrationOptions: {
|
|
5521
|
+
optInTransformResponse: true
|
|
5522
|
+
},
|
|
5458
5523
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
5459
5524
|
protoPath: "/v2/services/categories/query",
|
|
5460
5525
|
data: payload,
|
|
@@ -5504,6 +5569,9 @@ function setServiceLocations(payload) {
|
|
|
5504
5569
|
method: "POST",
|
|
5505
5570
|
methodFqn: "wix.bookings.services.v2.ServicesService.SetServiceLocations",
|
|
5506
5571
|
packageName: PACKAGE_NAME,
|
|
5572
|
+
migrationOptions: {
|
|
5573
|
+
optInTransformResponse: true
|
|
5574
|
+
},
|
|
5507
5575
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
5508
5576
|
protoPath: "/v2/services/{serviceId}/locations",
|
|
5509
5577
|
data: serializedData,
|
|
@@ -5557,6 +5625,9 @@ function enablePricingPlansForService(payload) {
|
|
|
5557
5625
|
method: "POST",
|
|
5558
5626
|
methodFqn: "wix.bookings.services.v2.ServicesService.EnablePricingPlansForService",
|
|
5559
5627
|
packageName: PACKAGE_NAME,
|
|
5628
|
+
migrationOptions: {
|
|
5629
|
+
optInTransformResponse: true
|
|
5630
|
+
},
|
|
5560
5631
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
5561
5632
|
protoPath: "/v2/services/{serviceId}/pricing-plans/add",
|
|
5562
5633
|
data: payload,
|
|
@@ -5610,6 +5681,9 @@ function disablePricingPlansForService(payload) {
|
|
|
5610
5681
|
method: "POST",
|
|
5611
5682
|
methodFqn: "wix.bookings.services.v2.ServicesService.DisablePricingPlansForService",
|
|
5612
5683
|
packageName: PACKAGE_NAME,
|
|
5684
|
+
migrationOptions: {
|
|
5685
|
+
optInTransformResponse: true
|
|
5686
|
+
},
|
|
5613
5687
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
5614
5688
|
protoPath: "/v2/services/{serviceId}/pricing-plans/remove",
|
|
5615
5689
|
data: payload,
|
|
@@ -5663,6 +5737,9 @@ function setCustomSlug(payload) {
|
|
|
5663
5737
|
method: "POST",
|
|
5664
5738
|
methodFqn: "wix.bookings.services.v2.ServicesService.SetCustomSlug",
|
|
5665
5739
|
packageName: PACKAGE_NAME,
|
|
5740
|
+
migrationOptions: {
|
|
5741
|
+
optInTransformResponse: true
|
|
5742
|
+
},
|
|
5666
5743
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
5667
5744
|
protoPath: "/v2/services/{serviceId}/slugs/custom",
|
|
5668
5745
|
data: payload,
|
|
@@ -5717,6 +5794,9 @@ function validateSlug(payload) {
|
|
|
5717
5794
|
method: "POST",
|
|
5718
5795
|
methodFqn: "wix.bookings.services.v2.ServicesService.ValidateSlug",
|
|
5719
5796
|
packageName: PACKAGE_NAME,
|
|
5797
|
+
migrationOptions: {
|
|
5798
|
+
optInTransformResponse: true
|
|
5799
|
+
},
|
|
5720
5800
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
5721
5801
|
protoPath: "/v2/services/slugs/validate",
|
|
5722
5802
|
data: payload,
|
|
@@ -5735,6 +5815,9 @@ function cloneService(payload) {
|
|
|
5735
5815
|
method: "POST",
|
|
5736
5816
|
methodFqn: "wix.bookings.services.v2.ServicesService.CloneService",
|
|
5737
5817
|
packageName: PACKAGE_NAME,
|
|
5818
|
+
migrationOptions: {
|
|
5819
|
+
optInTransformResponse: true
|
|
5820
|
+
},
|
|
5738
5821
|
url: resolveWixBookingsServicesV2ServicesServiceUrl({
|
|
5739
5822
|
protoPath: "/v2/services/clone",
|
|
5740
5823
|
data: payload,
|
|
@@ -5821,6 +5904,12 @@ var SortingMethodType = /* @__PURE__ */ ((SortingMethodType2) => {
|
|
|
5821
5904
|
SortingMethodType2["CUSTOM"] = "CUSTOM";
|
|
5822
5905
|
return SortingMethodType2;
|
|
5823
5906
|
})(SortingMethodType || {});
|
|
5907
|
+
var TaxableAddressType = /* @__PURE__ */ ((TaxableAddressType2) => {
|
|
5908
|
+
TaxableAddressType2["UNKNOWN_TAXABLE_ADDRESS_TYPE"] = "UNKNOWN_TAXABLE_ADDRESS_TYPE";
|
|
5909
|
+
TaxableAddressType2["BUSINESS"] = "BUSINESS";
|
|
5910
|
+
TaxableAddressType2["BILLING"] = "BILLING";
|
|
5911
|
+
return TaxableAddressType2;
|
|
5912
|
+
})(TaxableAddressType || {});
|
|
5824
5913
|
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
5825
5914
|
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
5826
5915
|
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
@@ -8178,6 +8267,17 @@ createEventModule(
|
|
|
8178
8267
|
);
|
|
8179
8268
|
createEventModule(onBookingUpdated);
|
|
8180
8269
|
|
|
8270
|
+
// ../../../node_modules/@wix/sdk/node_modules/@wix/sdk-types/build/index.mjs
|
|
8271
|
+
function EventDefinition2(type, isDomainEvent = false, transformations = (x) => x) {
|
|
8272
|
+
return () => ({
|
|
8273
|
+
__type: "event-definition",
|
|
8274
|
+
type,
|
|
8275
|
+
isDomainEvent,
|
|
8276
|
+
transformations
|
|
8277
|
+
});
|
|
8278
|
+
}
|
|
8279
|
+
var SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
8280
|
+
|
|
8181
8281
|
// ../../../node_modules/@wix/sdk/build/ambassador-modules.js
|
|
8182
8282
|
var parseMethod = (method) => {
|
|
8183
8283
|
switch (method) {
|
|
@@ -8320,15 +8420,228 @@ function objectToKeyValue(input) {
|
|
|
8320
8420
|
return Object.entries(input).filter(([_, value]) => Boolean(value)).map(([key, value]) => `${key}=${value}`).join(",");
|
|
8321
8421
|
}
|
|
8322
8422
|
|
|
8423
|
+
// ../../../node_modules/@wix/sdk/node_modules/@wix/sdk-runtime/build/context.js
|
|
8424
|
+
function runWithoutContext2(fn) {
|
|
8425
|
+
const globalContext = globalThis.__wix_context__;
|
|
8426
|
+
const moduleContext = {
|
|
8427
|
+
client: wixContext.client,
|
|
8428
|
+
elevatedClient: wixContext.elevatedClient
|
|
8429
|
+
};
|
|
8430
|
+
let closureContext;
|
|
8431
|
+
globalThis.__wix_context__ = void 0;
|
|
8432
|
+
wixContext.client = void 0;
|
|
8433
|
+
wixContext.elevatedClient = void 0;
|
|
8434
|
+
if (typeof $wixContext !== "undefined") {
|
|
8435
|
+
closureContext = {
|
|
8436
|
+
client: $wixContext?.client,
|
|
8437
|
+
elevatedClient: $wixContext?.elevatedClient
|
|
8438
|
+
};
|
|
8439
|
+
delete $wixContext.client;
|
|
8440
|
+
delete $wixContext.elevatedClient;
|
|
8441
|
+
}
|
|
8442
|
+
try {
|
|
8443
|
+
return fn();
|
|
8444
|
+
} finally {
|
|
8445
|
+
globalThis.__wix_context__ = globalContext;
|
|
8446
|
+
wixContext.client = moduleContext.client;
|
|
8447
|
+
wixContext.elevatedClient = moduleContext.elevatedClient;
|
|
8448
|
+
if (typeof $wixContext !== "undefined") {
|
|
8449
|
+
$wixContext.client = closureContext.client;
|
|
8450
|
+
$wixContext.elevatedClient = closureContext.elevatedClient;
|
|
8451
|
+
}
|
|
8452
|
+
}
|
|
8453
|
+
}
|
|
8454
|
+
|
|
8455
|
+
// ../../../node_modules/@wix/sdk/node_modules/@wix/sdk-runtime/build/utils.js
|
|
8456
|
+
function constantCase2(input) {
|
|
8457
|
+
return split2(input).map((part) => part.toLocaleUpperCase()).join("_");
|
|
8458
|
+
}
|
|
8459
|
+
var SPLIT_LOWER_UPPER_RE2 = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu");
|
|
8460
|
+
var SPLIT_UPPER_UPPER_RE2 = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu");
|
|
8461
|
+
var SPLIT_REPLACE_VALUE2 = "$1\0$2";
|
|
8462
|
+
var DEFAULT_STRIP_REGEXP2 = /[^\p{L}\d]+/giu;
|
|
8463
|
+
function split2(value) {
|
|
8464
|
+
let result = value.trim();
|
|
8465
|
+
result = result.replace(SPLIT_LOWER_UPPER_RE2, SPLIT_REPLACE_VALUE2).replace(SPLIT_UPPER_UPPER_RE2, SPLIT_REPLACE_VALUE2);
|
|
8466
|
+
result = result.replace(DEFAULT_STRIP_REGEXP2, "\0");
|
|
8467
|
+
let start = 0;
|
|
8468
|
+
let end = result.length;
|
|
8469
|
+
while (result.charAt(start) === "\0") {
|
|
8470
|
+
start++;
|
|
8471
|
+
}
|
|
8472
|
+
if (start === end) {
|
|
8473
|
+
return [];
|
|
8474
|
+
}
|
|
8475
|
+
while (result.charAt(end - 1) === "\0") {
|
|
8476
|
+
end--;
|
|
8477
|
+
}
|
|
8478
|
+
return result.slice(start, end).split(/\0/g);
|
|
8479
|
+
}
|
|
8480
|
+
|
|
8481
|
+
// ../../../node_modules/@wix/sdk/node_modules/@wix/sdk-runtime/build/transform-error.js
|
|
8482
|
+
var isValidationError2 = (httpClientError) => "validationError" in (httpClientError.response?.data?.details ?? {});
|
|
8483
|
+
var isApplicationError2 = (httpClientError) => "applicationError" in (httpClientError.response?.data?.details ?? {});
|
|
8484
|
+
var isClientError2 = (httpClientError) => (httpClientError.response?.status ?? -1) >= 400 && (httpClientError.response?.status ?? -1) < 500;
|
|
8485
|
+
function transformError2(httpClientError, pathsToArguments = {
|
|
8486
|
+
explicitPathsToArguments: {},
|
|
8487
|
+
spreadPathsToArguments: {},
|
|
8488
|
+
singleArgumentUnchanged: false
|
|
8489
|
+
}, argumentNames = []) {
|
|
8490
|
+
if (typeof httpClientError !== "object" || httpClientError === null) {
|
|
8491
|
+
throw httpClientError;
|
|
8492
|
+
}
|
|
8493
|
+
if (isValidationError2(httpClientError)) {
|
|
8494
|
+
return buildValidationError2(httpClientError, pathsToArguments, argumentNames);
|
|
8495
|
+
}
|
|
8496
|
+
if (isApplicationError2(httpClientError)) {
|
|
8497
|
+
return buildApplicationError2(httpClientError);
|
|
8498
|
+
}
|
|
8499
|
+
if (isClientError2(httpClientError)) {
|
|
8500
|
+
const status = httpClientError.response?.status;
|
|
8501
|
+
const statusText = httpClientError.response?.statusText ?? "UNKNOWN";
|
|
8502
|
+
const message = httpClientError.response?.data?.message ?? statusText;
|
|
8503
|
+
const details = {
|
|
8504
|
+
applicationError: {
|
|
8505
|
+
description: statusText,
|
|
8506
|
+
code: constantCase2(statusText),
|
|
8507
|
+
data: {}
|
|
8508
|
+
},
|
|
8509
|
+
requestId: httpClientError.requestId
|
|
8510
|
+
};
|
|
8511
|
+
return wrapError2(httpClientError, {
|
|
8512
|
+
message: JSON.stringify({
|
|
8513
|
+
message,
|
|
8514
|
+
details
|
|
8515
|
+
}, null, 2),
|
|
8516
|
+
extraProperties: {
|
|
8517
|
+
details,
|
|
8518
|
+
status
|
|
8519
|
+
}
|
|
8520
|
+
});
|
|
8521
|
+
}
|
|
8522
|
+
return buildSystemError2(httpClientError);
|
|
8523
|
+
}
|
|
8524
|
+
var buildValidationError2 = (httpClientError, pathsToArguments, argumentNames) => {
|
|
8525
|
+
const validationErrorResponse = httpClientError.response?.data;
|
|
8526
|
+
const requestId = httpClientError.requestId;
|
|
8527
|
+
const { fieldViolations } = validationErrorResponse.details.validationError;
|
|
8528
|
+
const transformedFieldViolations = violationsWithRenamedFields2(pathsToArguments, fieldViolations, argumentNames)?.sort((a, b) => a.field < b.field ? -1 : 1);
|
|
8529
|
+
const message = `INVALID_ARGUMENT: ${transformedFieldViolations?.map(({ field, description }) => `"${field}" ${description}`)?.join(", ")}`;
|
|
8530
|
+
const details = {
|
|
8531
|
+
validationError: { fieldViolations: transformedFieldViolations },
|
|
8532
|
+
requestId
|
|
8533
|
+
};
|
|
8534
|
+
return wrapError2(httpClientError, {
|
|
8535
|
+
message: JSON.stringify({ message, details }, null, 2),
|
|
8536
|
+
extraProperties: {
|
|
8537
|
+
details,
|
|
8538
|
+
status: httpClientError.response?.status,
|
|
8539
|
+
requestId
|
|
8540
|
+
}
|
|
8541
|
+
});
|
|
8542
|
+
};
|
|
8543
|
+
var wrapError2 = (baseError, { message, extraProperties }) => {
|
|
8544
|
+
return Object.assign(baseError, {
|
|
8545
|
+
...extraProperties,
|
|
8546
|
+
message
|
|
8547
|
+
});
|
|
8548
|
+
};
|
|
8549
|
+
var buildApplicationError2 = (httpClientError) => {
|
|
8550
|
+
const status = httpClientError.response?.status;
|
|
8551
|
+
const statusText = httpClientError.response?.statusText ?? "UNKNOWN";
|
|
8552
|
+
const message = httpClientError.response?.data?.message ?? statusText;
|
|
8553
|
+
const description = httpClientError.response?.data?.details?.applicationError?.description ?? statusText;
|
|
8554
|
+
const code = httpClientError.response?.data?.details?.applicationError?.code ?? constantCase2(statusText);
|
|
8555
|
+
const data = httpClientError.response?.data?.details?.applicationError?.data ?? {};
|
|
8556
|
+
const combinedMessage = message === description ? message : `${message}: ${description}`;
|
|
8557
|
+
const details = {
|
|
8558
|
+
applicationError: {
|
|
8559
|
+
description,
|
|
8560
|
+
code,
|
|
8561
|
+
data
|
|
8562
|
+
},
|
|
8563
|
+
requestId: httpClientError.requestId
|
|
8564
|
+
};
|
|
8565
|
+
return wrapError2(httpClientError, {
|
|
8566
|
+
message: JSON.stringify({ message: combinedMessage, details }, null, 2),
|
|
8567
|
+
extraProperties: {
|
|
8568
|
+
details,
|
|
8569
|
+
status,
|
|
8570
|
+
requestId: httpClientError.requestId
|
|
8571
|
+
}
|
|
8572
|
+
});
|
|
8573
|
+
};
|
|
8574
|
+
var buildSystemError2 = (httpClientError) => {
|
|
8575
|
+
const message = httpClientError.requestId ? `System error occurred, request-id: ${httpClientError.requestId}` : `System error occurred: ${JSON.stringify(httpClientError)}`;
|
|
8576
|
+
return wrapError2(httpClientError, {
|
|
8577
|
+
message,
|
|
8578
|
+
extraProperties: {
|
|
8579
|
+
requestId: httpClientError.requestId,
|
|
8580
|
+
status: httpClientError.response?.status,
|
|
8581
|
+
code: constantCase2(httpClientError.response?.statusText ?? "UNKNOWN"),
|
|
8582
|
+
...!httpClientError.response && {
|
|
8583
|
+
runtimeError: httpClientError
|
|
8584
|
+
}
|
|
8585
|
+
}
|
|
8586
|
+
});
|
|
8587
|
+
};
|
|
8588
|
+
var violationsWithRenamedFields2 = ({ spreadPathsToArguments, explicitPathsToArguments, singleArgumentUnchanged }, fieldViolations, argumentNames) => {
|
|
8589
|
+
const allPathsToArguments = {
|
|
8590
|
+
...spreadPathsToArguments,
|
|
8591
|
+
...explicitPathsToArguments
|
|
8592
|
+
};
|
|
8593
|
+
const allPathsToArgumentsKeys = Object.keys(allPathsToArguments);
|
|
8594
|
+
return fieldViolations?.filter((fieldViolation) => {
|
|
8595
|
+
const containedInAMoreSpecificViolationField = fieldViolations.some((anotherViolation) => anotherViolation.field.length > fieldViolation.field.length && anotherViolation.field.startsWith(fieldViolation.field) && allPathsToArgumentsKeys.includes(anotherViolation.field));
|
|
8596
|
+
return !containedInAMoreSpecificViolationField;
|
|
8597
|
+
}).map((fieldViolation) => {
|
|
8598
|
+
const exactMatchArgumentExpression = explicitPathsToArguments[fieldViolation.field];
|
|
8599
|
+
if (exactMatchArgumentExpression) {
|
|
8600
|
+
return {
|
|
8601
|
+
...fieldViolation,
|
|
8602
|
+
field: withRenamedArgument2(exactMatchArgumentExpression, argumentNames)
|
|
8603
|
+
};
|
|
8604
|
+
}
|
|
8605
|
+
const longestPartialPathMatch = allPathsToArgumentsKeys?.sort((a, b) => b.length - a.length)?.find((path2) => fieldViolation.field.startsWith(path2));
|
|
8606
|
+
if (longestPartialPathMatch) {
|
|
8607
|
+
const partialMatchArgumentExpression = allPathsToArguments[longestPartialPathMatch];
|
|
8608
|
+
if (partialMatchArgumentExpression) {
|
|
8609
|
+
return {
|
|
8610
|
+
...fieldViolation,
|
|
8611
|
+
field: fieldViolation.field.replace(longestPartialPathMatch, withRenamedArgument2(partialMatchArgumentExpression, argumentNames))
|
|
8612
|
+
};
|
|
8613
|
+
}
|
|
8614
|
+
}
|
|
8615
|
+
if (singleArgumentUnchanged) {
|
|
8616
|
+
return {
|
|
8617
|
+
...fieldViolation,
|
|
8618
|
+
field: `${argumentNames[0]}.${fieldViolation.field}`
|
|
8619
|
+
};
|
|
8620
|
+
}
|
|
8621
|
+
return fieldViolation;
|
|
8622
|
+
});
|
|
8623
|
+
};
|
|
8624
|
+
var withRenamedArgument2 = (fieldValue, argumentNames) => {
|
|
8625
|
+
const argIndex = getArgumentIndex2(fieldValue);
|
|
8626
|
+
if (argIndex !== null && typeof argIndex !== "undefined") {
|
|
8627
|
+
return fieldValue.replace(`$[${argIndex}]`, argumentNames[argIndex]);
|
|
8628
|
+
}
|
|
8629
|
+
return fieldValue;
|
|
8630
|
+
};
|
|
8631
|
+
var getArgumentIndex2 = (s) => {
|
|
8632
|
+
const match = s.match(/\$\[(?<argIndex>\d+)\]/);
|
|
8633
|
+
return match && match.groups && Number(match.groups.argIndex);
|
|
8634
|
+
};
|
|
8635
|
+
|
|
8323
8636
|
// ../../../node_modules/@wix/sdk/build/rest-modules.js
|
|
8324
8637
|
function buildRESTDescriptor(origFunc, publicMetadata, boundFetch, errorHandler, wixAPIFetch, getActiveToken, options, hostName, useCDN) {
|
|
8325
|
-
return
|
|
8638
|
+
return runWithoutContext2(() => origFunc({
|
|
8326
8639
|
request: async (factory) => {
|
|
8327
8640
|
const requestOptions = factory({
|
|
8328
8641
|
host: options?.HTTPHost || DEFAULT_API_URL
|
|
8329
8642
|
});
|
|
8330
8643
|
let request = requestOptions;
|
|
8331
|
-
if (request.method === "GET" && request.fallback?.length && request.params
|
|
8644
|
+
if (request.method === "GET" && request.fallback?.length && (request.params?.toString().length ?? 0) > 4e3) {
|
|
8332
8645
|
request = requestOptions.fallback[0];
|
|
8333
8646
|
}
|
|
8334
8647
|
const domain = options?.HTTPHost ?? DEFAULT_API_URL;
|
|
@@ -8358,7 +8671,7 @@ function buildRESTDescriptor(origFunc, publicMetadata, boundFetch, errorHandler,
|
|
|
8358
8671
|
requestId: res.headers.get("X-Wix-Request-Id"),
|
|
8359
8672
|
details: dataError
|
|
8360
8673
|
});
|
|
8361
|
-
const transformedError =
|
|
8674
|
+
const transformedError = transformError2(error);
|
|
8362
8675
|
errorHandler?.handleError(transformedError, {
|
|
8363
8676
|
requestOptions: {
|
|
8364
8677
|
url: request.url,
|
|
@@ -8369,7 +8682,13 @@ function buildRESTDescriptor(origFunc, publicMetadata, boundFetch, errorHandler,
|
|
|
8369
8682
|
});
|
|
8370
8683
|
throw error;
|
|
8371
8684
|
}
|
|
8372
|
-
const
|
|
8685
|
+
const rawData = await res.json();
|
|
8686
|
+
const data = (
|
|
8687
|
+
// we only transform the response if the optInTransformResponse flag is set
|
|
8688
|
+
// this is for backwards compatibility as some users might rely on not transforming the response
|
|
8689
|
+
// in older modules. In that case the modules would not have the optInTransformResponse flag set
|
|
8690
|
+
request.migrationOptions?.optInTransformResponse && request.transformResponse ? Array.isArray(request.transformResponse) ? request.transformResponse[0](rawData) : request.transformResponse(rawData) : rawData
|
|
8691
|
+
);
|
|
8373
8692
|
return {
|
|
8374
8693
|
data,
|
|
8375
8694
|
headers: res.headers,
|
|
@@ -8549,8 +8868,8 @@ function eventHandlersModules(authStrategy) {
|
|
|
8549
8868
|
})));
|
|
8550
8869
|
},
|
|
8551
8870
|
apps: {
|
|
8552
|
-
AppInstalled:
|
|
8553
|
-
AppRemoved:
|
|
8871
|
+
AppInstalled: EventDefinition2("AppInstalled")(),
|
|
8872
|
+
AppRemoved: EventDefinition2("AppRemoved")()
|
|
8554
8873
|
}
|
|
8555
8874
|
};
|
|
8556
8875
|
return {
|
|
@@ -8741,7 +9060,7 @@ function createClient(config) {
|
|
|
8741
9060
|
}
|
|
8742
9061
|
const apiBaseUrl = config.host?.apiBaseUrl ?? DEFAULT_API_URL;
|
|
8743
9062
|
const shouldUseCDN = config.useCDN === void 0 ? config.auth?.shouldUseCDN : config.useCDN;
|
|
8744
|
-
return buildRESTDescriptor(
|
|
9063
|
+
return buildRESTDescriptor(runWithoutContext2(() => isAmbassadorModule(modules)) ? toHTTPModule(modules) : modules, metadata ?? {}, boundFetch, config.host?.getErrorHandler?.(), (relativeUrl, fetchOptions) => {
|
|
8745
9064
|
const finalUrl = new URL(relativeUrl, `https://${apiBaseUrl}`);
|
|
8746
9065
|
finalUrl.host = apiBaseUrl;
|
|
8747
9066
|
finalUrl.protocol = "https";
|
|
@@ -8933,7 +9252,7 @@ var getSetupPrompt = () => {
|
|
|
8933
9252
|
var generateMockServices = async (env) => {
|
|
8934
9253
|
console.log(`[${VERTICAL_NAME}-plugin-generateData] Generating mock services...`);
|
|
8935
9254
|
const model = await env.providers.getOpenAIProvider({
|
|
8936
|
-
model: "
|
|
9255
|
+
model: "GPT_4O_2024_11_20",
|
|
8937
9256
|
tag: "Bookings Setup Agent",
|
|
8938
9257
|
responseFormat: { type: "json_object" }
|
|
8939
9258
|
});
|
|
@@ -9187,15 +9506,9 @@ IF THE SITE IS IN ENGLISH OR THE LANGUAGE IS NOT SPECIFIED, YOU MUST NOT READ OR
|
|
|
9187
9506
|
`;
|
|
9188
9507
|
};
|
|
9189
9508
|
|
|
9190
|
-
// src/wix-apis.ts
|
|
9191
|
-
var installWixApp = async (env, appId) => {
|
|
9192
|
-
};
|
|
9193
|
-
|
|
9194
9509
|
// src/index.ts
|
|
9195
9510
|
var install = async (env) => {
|
|
9196
9511
|
console.log(`[${VERTICAL_NAME}-plugin-install] Starting installation`, env);
|
|
9197
|
-
console.log(`[${VERTICAL_NAME}-plugin-install] Installing vertical functionality...`);
|
|
9198
|
-
await installWixApp();
|
|
9199
9512
|
console.log(`[${VERTICAL_NAME}-plugin-install] Unzipping and merging plugin files...`);
|
|
9200
9513
|
await unzipAndMergePluginFiles(env, PLUGIN_FILES_ZIP_URL);
|
|
9201
9514
|
console.log(`
|