@kohost/api-client 3.3.20 → 3.4.4
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/cjs/AMQPClient/index.js +1 -0
- package/dist/cjs/Client/index.js +940 -1590
- package/dist/cjs/schemas/space.json +9 -1
- package/dist/esm/Client.js +967 -1632
- package/dist/esm/Client.js.map +3 -3
- package/dist/esm/Commands.js +16 -32
- package/dist/esm/Commands.js.map +1 -1
- package/dist/esm/Events.js +3 -6
- package/dist/esm/Events.js.map +1 -1
- package/dist/esm/Models.js +984 -1366
- package/dist/esm/Models.js.map +4 -4
- package/dist/esm/SocketIoClient.js +51 -61
- package/dist/esm/SocketIoClient.js.map +2 -2
- package/dist/esm/defs.js +31 -48
- package/dist/esm/defs.js.map +1 -1
- package/dist/esm/utils.js +987 -1370
- package/dist/esm/utils.js.map +4 -4
- package/dist/types/AMQPClient/index.d.ts +2 -2
- package/dist/types/AMQPClient/index.d.ts.map +1 -1
- package/dist/types/Client/index.d.ts +1 -2
- package/dist/types/Errors/index.d.ts +0 -36
- package/dist/types/Errors/index.d.ts.map +1 -1
- package/dist/types/Events/Event.d.ts +4 -12
- package/dist/types/Events/Event.d.ts.map +1 -1
- package/dist/types/Models/Entity.d.ts +1 -1
- package/dist/types/Models/Entity.d.ts.map +1 -1
- package/dist/types/Models/Ticket.d.ts +1 -1
- package/dist/types/Models/Ticket.d.ts.map +1 -1
- package/dist/types/Models/TimeSheet.d.ts +1 -1
- package/dist/types/Models/TimeSheet.d.ts.map +1 -1
- package/dist/types/Models/User.d.ts +1 -1
- package/dist/types/Models/User.d.ts.map +1 -1
- package/dist/types/SocketIoClient/index.d.ts +1 -2
- package/dist/types/defs/index.d.ts +0 -1
- package/dist/types/index.d.ts +0 -9
- package/dist/types/schemas/SpaceSchema.d.ts +1 -0
- package/dist/types/utils/entityFactory.d.ts +1 -2
- package/dist/types/utils/entityFactory.d.ts.map +1 -1
- package/dist/types/utils/errorFactory.d.ts +1 -6
- package/dist/types/utils/errorFactory.d.ts.map +1 -1
- package/dist/types/utils/eventFactory.d.ts +1 -2
- package/dist/types/utils/eventFactory.d.ts.map +1 -1
- package/dist/useCases/AddDefaultScenesToRooms.js +4 -8
- package/dist/useCases/AddScenesToRoom.js +4 -8
- package/dist/useCases/AssignSpaceToReservation.js +4 -8
- package/dist/useCases/AutoAssociateDiscoveredDevices.js +28 -0
- package/dist/useCases/AutoCloseTickets.js +28 -0
- package/dist/useCases/BatchNotifyCheckIn.js +4 -8
- package/dist/useCases/BatchNotifyCheckOut.js +4 -8
- package/dist/useCases/BatchNotifyMissedCheckOut.js +4 -8
- package/dist/useCases/BatchNotifyPreArrival.js +4 -8
- package/dist/useCases/CheckInReservation.js +4 -8
- package/dist/useCases/CheckOutReservation.js +4 -8
- package/dist/useCases/CheckVerificationCode.js +4 -8
- package/dist/useCases/CreateAlarm.js +4 -8
- package/dist/useCases/CreateAnnouncement.js +4 -8
- package/dist/useCases/CreateCamera.js +4 -8
- package/dist/useCases/CreateCateory.js +4 -8
- package/dist/useCases/CreateCourtesy.js +4 -8
- package/dist/useCases/CreateDefaultScenes.js +4 -8
- package/dist/useCases/CreateDimmer.js +4 -8
- package/dist/useCases/CreateDiscoveredDevice.js +4 -8
- package/dist/useCases/CreateDiscoveredDeviceAssociation.js +4 -8
- package/dist/useCases/CreateDiscoveredDeviceAssociationMap.js +28 -0
- package/dist/useCases/CreateImageUploadEndpoint.js +4 -8
- package/dist/useCases/CreateLock.js +4 -8
- package/dist/useCases/CreateMediaSource.js +4 -8
- package/dist/useCases/CreateOrganization.js +4 -8
- package/dist/useCases/CreatePolicy.js +4 -8
- package/dist/useCases/CreateProperty.js +4 -8
- package/dist/useCases/CreateReservation.js +4 -8
- package/dist/useCases/CreateRoom.js +4 -8
- package/dist/useCases/CreateRoomInSpace.js +4 -8
- package/dist/useCases/CreateScene.js +4 -8
- package/dist/useCases/CreateSpace.js +4 -8
- package/dist/useCases/CreateSwitch.js +4 -8
- package/dist/useCases/CreateThermostat.js +4 -8
- package/dist/useCases/CreateTicket.js +4 -8
- package/dist/useCases/CreateTicketMessage.js +4 -8
- package/dist/useCases/CreateTimeSheet.js +4 -8
- package/dist/useCases/CreateTimeSheetTimeEntry.js +4 -8
- package/dist/useCases/CreateUser.js +4 -8
- package/dist/useCases/CreateUserMobileKey.js +4 -8
- package/dist/useCases/CreateWindowCovering.js +4 -8
- package/dist/useCases/DeleteAlarm.js +4 -8
- package/dist/useCases/DeleteAnnouncement.js +4 -8
- package/dist/useCases/DeleteCamera.js +4 -8
- package/dist/useCases/DeleteCategory.js +4 -8
- package/dist/useCases/DeleteCourtesy.js +4 -8
- package/dist/useCases/DeleteDimmer.js +4 -8
- package/dist/useCases/DeleteDiscoveredDevice.js +4 -8
- package/dist/useCases/DeleteLock.js +4 -8
- package/dist/useCases/DeleteMediaFile.js +4 -8
- package/dist/useCases/DeleteMediaSource.js +4 -8
- package/dist/useCases/DeletePolicy.js +4 -8
- package/dist/useCases/DeleteReservation.js +4 -8
- package/dist/useCases/DeleteRoom.js +4 -8
- package/dist/useCases/DeleteSpace.js +4 -8
- package/dist/useCases/DeleteSwitch.js +4 -8
- package/dist/useCases/DeleteThermostat.js +4 -8
- package/dist/useCases/DeleteTicket.js +4 -8
- package/dist/useCases/DeleteTimeSheet.js +4 -8
- package/dist/useCases/DeleteTimeSheetTimeEntry.js +4 -8
- package/dist/useCases/DeleteUser.js +4 -8
- package/dist/useCases/DeleteUserCredential.js +28 -0
- package/dist/useCases/DeleteWindowCovering.js +4 -8
- package/dist/useCases/DescribeAlarm.js +4 -8
- package/dist/useCases/DescribeAlarmConfig.js +4 -8
- package/dist/useCases/DescribeAnnouncement.js +4 -8
- package/dist/useCases/DescribeCamera.js +4 -8
- package/dist/useCases/DescribeCategory.js +4 -8
- package/dist/useCases/DescribeCourtesy.js +4 -8
- package/dist/useCases/DescribeDimmer.js +4 -8
- package/dist/useCases/DescribeDiscoveredDevice.js +4 -8
- package/dist/useCases/DescribeLock.js +4 -8
- package/dist/useCases/DescribeLockCredential.js +4 -8
- package/dist/useCases/DescribeMediaSource.js +4 -8
- package/dist/useCases/DescribeMyAuth.js +4 -8
- package/dist/useCases/DescribeMyMobileKeyApp.js +4 -8
- package/dist/useCases/DescribeMyOrganization.js +4 -8
- package/dist/useCases/DescribeMyPasskeyRegistrations.js +4 -8
- package/dist/useCases/DescribeOrganization.js +4 -8
- package/dist/useCases/DescribePolicy.js +4 -8
- package/dist/useCases/DescribeProduct.js +4 -8
- package/dist/useCases/DescribeProperty.js +4 -8
- package/dist/useCases/DescribeReservation.js +4 -8
- package/dist/useCases/DescribeReservationEarlyCheckInProducts.js +4 -8
- package/dist/useCases/DescribeReservationLateCheckOutProducts.js +4 -8
- package/dist/useCases/DescribeReservationPetProducts.js +4 -8
- package/dist/useCases/DescribeReservationPromos.js +4 -8
- package/dist/useCases/DescribeReservationRoomUpgrades.js +4 -8
- package/dist/useCases/DescribeRoom.js +4 -8
- package/dist/useCases/DescribeSOS.js +4 -8
- package/dist/useCases/DescribeSelf.js +4 -8
- package/dist/useCases/DescribeSpace.js +4 -8
- package/dist/useCases/DescribeSwitch.js +4 -8
- package/dist/useCases/DescribeThermostat.js +4 -8
- package/dist/useCases/DescribeTicket.js +4 -8
- package/dist/useCases/DescribeTicketStats.js +4 -8
- package/dist/useCases/DescribeTimeSheet.js +4 -8
- package/dist/useCases/DescribeTimeSheetStats.js +4 -8
- package/dist/useCases/DescribeUser.js +4 -8
- package/dist/useCases/DescribeWindowCovering.js +4 -8
- package/dist/useCases/DiscoverReservations.js +4 -8
- package/dist/useCases/EmailUserAccountSetup.js +4 -8
- package/dist/useCases/FinishRegisterPasskey.js +4 -8
- package/dist/useCases/ListAlarms.js +4 -8
- package/dist/useCases/ListAnnouncements.js +4 -8
- package/dist/useCases/ListCameras.js +4 -8
- package/dist/useCases/ListCategories.js +4 -8
- package/dist/useCases/ListCourtesy.js +4 -8
- package/dist/useCases/ListDimmers.js +4 -8
- package/dist/useCases/ListDiscoveredDevices.js +4 -8
- package/dist/useCases/ListLocks.js +4 -8
- package/dist/useCases/ListMediaSources.js +4 -8
- package/dist/useCases/ListMyOrders.js +4 -8
- package/dist/useCases/ListMyProperties.js +4 -8
- package/dist/useCases/ListMyReservations.js +4 -8
- package/dist/useCases/ListMySpaces.js +4 -8
- package/dist/useCases/ListMyTickets.js +4 -8
- package/dist/useCases/ListMyTimeSheets.js +4 -8
- package/dist/useCases/ListOrders.js +4 -8
- package/dist/useCases/ListOrganizations.js +4 -8
- package/dist/useCases/ListPolicies.js +4 -8
- package/dist/useCases/ListProducts.js +4 -8
- package/dist/useCases/ListProperties.js +4 -8
- package/dist/useCases/ListReservations.js +4 -8
- package/dist/useCases/ListRooms.js +4 -8
- package/dist/useCases/ListRoomsInSpace.js +4 -8
- package/dist/useCases/ListScenes.js +4 -8
- package/dist/useCases/ListSpaces.js +4 -8
- package/dist/useCases/ListSwitches.js +4 -8
- package/dist/useCases/ListTeam.js +4 -8
- package/dist/useCases/ListThermostats.js +4 -8
- package/dist/useCases/ListTickets.js +4 -8
- package/dist/useCases/ListTimeSheets.js +4 -8
- package/dist/useCases/ListUserMobileKeys.js +4 -8
- package/dist/useCases/ListUserOrders.js +4 -8
- package/dist/useCases/ListUserReservations.js +4 -8
- package/dist/useCases/ListUserSpaces.js +4 -8
- package/dist/useCases/ListUsers.js +4 -8
- package/dist/useCases/ListWindowCoverings.js +4 -8
- package/dist/useCases/LoginFinish.js +4 -8
- package/dist/useCases/LoginStart.js +4 -8
- package/dist/useCases/LogoutUser.js +4 -8
- package/dist/useCases/MatchUserIdentification.js +4 -8
- package/dist/useCases/OCRDocument.js +4 -8
- package/dist/useCases/PurchaseReservationEarlyCheckInProducts.js +4 -8
- package/dist/useCases/PurchaseReservationLateCheckOutProducts.js +4 -8
- package/dist/useCases/PurchaseReservationPetProducts.js +4 -8
- package/dist/useCases/PurchaseReservationPromos.js +4 -8
- package/dist/useCases/PurchaseReservationRoomUpgrades.js +4 -8
- package/dist/useCases/RefreshToken.js +4 -8
- package/dist/useCases/RequestLoginToken.js +4 -8
- package/dist/useCases/SendCheckInSMS.js +4 -8
- package/dist/useCases/SendCheckOutSMS.js +4 -8
- package/dist/useCases/SendPreArrivalEmail.js +4 -8
- package/dist/useCases/SendPreArrivalSMS.js +4 -8
- package/dist/useCases/SendRoomControlSMS.js +4 -8
- package/dist/useCases/SendVerificationCode.js +4 -8
- package/dist/useCases/SetAlarm.js +4 -8
- package/dist/useCases/SetCamera.js +4 -8
- package/dist/useCases/SetCourtesy.js +4 -8
- package/dist/useCases/SetDimmer.js +4 -8
- package/dist/useCases/SetLock.js +4 -8
- package/dist/useCases/SetMediaSource.js +4 -8
- package/dist/useCases/SetRoomScene.js +4 -8
- package/dist/useCases/SetScene.js +4 -8
- package/dist/useCases/SetSpaceScene.js +4 -8
- package/dist/useCases/SetSwitch.js +4 -8
- package/dist/useCases/SetThermostat.js +4 -8
- package/dist/useCases/SetWindowCovering.js +4 -8
- package/dist/useCases/StartRegisterPasskey.js +4 -8
- package/dist/useCases/StartSOS.js +4 -8
- package/dist/useCases/StopSOS.js +4 -8
- package/dist/useCases/TipUser.js +4 -8
- package/dist/useCases/UpdateAlarm.js +4 -8
- package/dist/useCases/UpdateAnnouncement.js +4 -8
- package/dist/useCases/UpdateCamera.js +4 -8
- package/dist/useCases/UpdateCategory.js +4 -8
- package/dist/useCases/UpdateCourtesy.js +4 -8
- package/dist/useCases/UpdateDimmer.js +4 -8
- package/dist/useCases/UpdateDiscoveredDevice.js +4 -8
- package/dist/useCases/UpdateLock.js +4 -8
- package/dist/useCases/UpdateMediaSource.js +4 -8
- package/dist/useCases/UpdateMessageReadStatus.js +4 -8
- package/dist/useCases/UpdateOrganization.js +4 -8
- package/dist/useCases/UpdatePolicy.js +4 -8
- package/dist/useCases/UpdateProperty.js +4 -8
- package/dist/useCases/UpdateReservation.js +4 -8
- package/dist/useCases/UpdateReservationExpectedArrivalTime.js +4 -8
- package/dist/useCases/UpdateRoom.js +4 -8
- package/dist/useCases/UpdateSelf.js +4 -8
- package/dist/useCases/UpdateSpace.js +4 -8
- package/dist/useCases/UpdateSwitch.js +4 -8
- package/dist/useCases/UpdateThermostat.js +4 -8
- package/dist/useCases/UpdateTicket.js +4 -8
- package/dist/useCases/UpdateTicketStatus.js +4 -8
- package/dist/useCases/UpdateTimeSheet.js +4 -8
- package/dist/useCases/UpdateTimeSheetTimeEntry.js +4 -8
- package/dist/useCases/UpdateUser.js +4 -8
- package/dist/useCases/UpdateWindowCovering.js +4 -8
- package/dist/useCases/UploadImage.js +4 -8
- package/dist/useCases/UpsertDiscoveredDevice.js +4 -8
- package/package.json +9 -10
package/dist/esm/Models.js
CHANGED
|
@@ -364,43 +364,43 @@ var require_codegen = __commonJS({
|
|
|
364
364
|
var code_1 = require_code();
|
|
365
365
|
var scope_1 = require_scope();
|
|
366
366
|
var code_2 = require_code();
|
|
367
|
-
Object.defineProperty(exports, "_", { enumerable: true, get: function() {
|
|
367
|
+
Object.defineProperty(exports, "_", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
368
368
|
return code_2._;
|
|
369
|
-
} });
|
|
370
|
-
Object.defineProperty(exports, "str", { enumerable: true, get: function() {
|
|
369
|
+
}, "get") });
|
|
370
|
+
Object.defineProperty(exports, "str", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
371
371
|
return code_2.str;
|
|
372
|
-
} });
|
|
373
|
-
Object.defineProperty(exports, "strConcat", { enumerable: true, get: function() {
|
|
372
|
+
}, "get") });
|
|
373
|
+
Object.defineProperty(exports, "strConcat", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
374
374
|
return code_2.strConcat;
|
|
375
|
-
} });
|
|
376
|
-
Object.defineProperty(exports, "nil", { enumerable: true, get: function() {
|
|
375
|
+
}, "get") });
|
|
376
|
+
Object.defineProperty(exports, "nil", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
377
377
|
return code_2.nil;
|
|
378
|
-
} });
|
|
379
|
-
Object.defineProperty(exports, "getProperty", { enumerable: true, get: function() {
|
|
378
|
+
}, "get") });
|
|
379
|
+
Object.defineProperty(exports, "getProperty", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
380
380
|
return code_2.getProperty;
|
|
381
|
-
} });
|
|
382
|
-
Object.defineProperty(exports, "stringify", { enumerable: true, get: function() {
|
|
381
|
+
}, "get") });
|
|
382
|
+
Object.defineProperty(exports, "stringify", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
383
383
|
return code_2.stringify;
|
|
384
|
-
} });
|
|
385
|
-
Object.defineProperty(exports, "regexpCode", { enumerable: true, get: function() {
|
|
384
|
+
}, "get") });
|
|
385
|
+
Object.defineProperty(exports, "regexpCode", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
386
386
|
return code_2.regexpCode;
|
|
387
|
-
} });
|
|
388
|
-
Object.defineProperty(exports, "Name", { enumerable: true, get: function() {
|
|
387
|
+
}, "get") });
|
|
388
|
+
Object.defineProperty(exports, "Name", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
389
389
|
return code_2.Name;
|
|
390
|
-
} });
|
|
390
|
+
}, "get") });
|
|
391
391
|
var scope_2 = require_scope();
|
|
392
|
-
Object.defineProperty(exports, "Scope", { enumerable: true, get: function() {
|
|
392
|
+
Object.defineProperty(exports, "Scope", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
393
393
|
return scope_2.Scope;
|
|
394
|
-
} });
|
|
395
|
-
Object.defineProperty(exports, "ValueScope", { enumerable: true, get: function() {
|
|
394
|
+
}, "get") });
|
|
395
|
+
Object.defineProperty(exports, "ValueScope", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
396
396
|
return scope_2.ValueScope;
|
|
397
|
-
} });
|
|
398
|
-
Object.defineProperty(exports, "ValueScopeName", { enumerable: true, get: function() {
|
|
397
|
+
}, "get") });
|
|
398
|
+
Object.defineProperty(exports, "ValueScopeName", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
399
399
|
return scope_2.ValueScopeName;
|
|
400
|
-
} });
|
|
401
|
-
Object.defineProperty(exports, "varKinds", { enumerable: true, get: function() {
|
|
400
|
+
}, "get") });
|
|
401
|
+
Object.defineProperty(exports, "varKinds", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
402
402
|
return scope_2.varKinds;
|
|
403
|
-
} });
|
|
403
|
+
}, "get") });
|
|
404
404
|
exports.operators = {
|
|
405
405
|
GT: new code_1._Code(">"),
|
|
406
406
|
GTE: new code_1._Code(">="),
|
|
@@ -1267,25 +1267,25 @@ var require_util = __commonJS({
|
|
|
1267
1267
|
__name(makeMergeEvaluated, "makeMergeEvaluated");
|
|
1268
1268
|
exports.mergeEvaluated = {
|
|
1269
1269
|
props: makeMergeEvaluated({
|
|
1270
|
-
mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => {
|
|
1270
|
+
mergeNames: /* @__PURE__ */ __name((gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => {
|
|
1271
1271
|
gen.if((0, codegen_1._)`${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._)`${to} || {}`).code((0, codegen_1._)`Object.assign(${to}, ${from})`));
|
|
1272
|
-
}),
|
|
1273
|
-
mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => {
|
|
1272
|
+
}), "mergeNames"),
|
|
1273
|
+
mergeToName: /* @__PURE__ */ __name((gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => {
|
|
1274
1274
|
if (from === true) {
|
|
1275
1275
|
gen.assign(to, true);
|
|
1276
1276
|
} else {
|
|
1277
1277
|
gen.assign(to, (0, codegen_1._)`${to} || {}`);
|
|
1278
1278
|
setEvaluated(gen, to, from);
|
|
1279
1279
|
}
|
|
1280
|
-
}),
|
|
1281
|
-
mergeValues: (from, to) => from === true ? true : { ...from, ...to },
|
|
1280
|
+
}), "mergeToName"),
|
|
1281
|
+
mergeValues: /* @__PURE__ */ __name((from, to) => from === true ? true : { ...from, ...to }, "mergeValues"),
|
|
1282
1282
|
resultToName: evaluatedPropsToName
|
|
1283
1283
|
}),
|
|
1284
1284
|
items: makeMergeEvaluated({
|
|
1285
|
-
mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._)`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),
|
|
1286
|
-
mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._)`${to} > ${from} ? ${to} : ${from}`)),
|
|
1287
|
-
mergeValues: (from, to) => from === true ? true : Math.max(from, to),
|
|
1288
|
-
resultToName: (gen, items) => gen.var("items", items)
|
|
1285
|
+
mergeNames: /* @__PURE__ */ __name((gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._)`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)), "mergeNames"),
|
|
1286
|
+
mergeToName: /* @__PURE__ */ __name((gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._)`${to} > ${from} ? ${to} : ${from}`)), "mergeToName"),
|
|
1287
|
+
mergeValues: /* @__PURE__ */ __name((from, to) => from === true ? true : Math.max(from, to), "mergeValues"),
|
|
1288
|
+
resultToName: /* @__PURE__ */ __name((gen, items) => gen.var("items", items), "resultToName")
|
|
1289
1289
|
})
|
|
1290
1290
|
};
|
|
1291
1291
|
function evaluatedPropsToName(gen, ps) {
|
|
@@ -1388,10 +1388,10 @@ var require_errors = __commonJS({
|
|
|
1388
1388
|
var util_1 = require_util();
|
|
1389
1389
|
var names_1 = require_names();
|
|
1390
1390
|
exports.keywordError = {
|
|
1391
|
-
message: ({ keyword }) => (0, codegen_1.str)`must pass "${keyword}" keyword validation
|
|
1391
|
+
message: /* @__PURE__ */ __name(({ keyword }) => (0, codegen_1.str)`must pass "${keyword}" keyword validation`, "message")
|
|
1392
1392
|
};
|
|
1393
1393
|
exports.keyword$DataError = {
|
|
1394
|
-
message: ({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`"${keyword}" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`"${keyword}" keyword is invalid ($data)
|
|
1394
|
+
message: /* @__PURE__ */ __name(({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`"${keyword}" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`"${keyword}" keyword is invalid ($data)`, "message")
|
|
1395
1395
|
};
|
|
1396
1396
|
function reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) {
|
|
1397
1397
|
const { it } = cxt;
|
|
@@ -1792,8 +1792,8 @@ var require_dataType = __commonJS({
|
|
|
1792
1792
|
__name(checkDataTypes, "checkDataTypes");
|
|
1793
1793
|
exports.checkDataTypes = checkDataTypes;
|
|
1794
1794
|
var typeError = {
|
|
1795
|
-
message: ({ schema }) => `must be ${schema}`,
|
|
1796
|
-
params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._)`{type: ${schema}}` : (0, codegen_1._)`{type: ${schemaValue}}
|
|
1795
|
+
message: /* @__PURE__ */ __name(({ schema }) => `must be ${schema}`, "message"),
|
|
1796
|
+
params: /* @__PURE__ */ __name(({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._)`{type: ${schema}}` : (0, codegen_1._)`{type: ${schemaValue}}`, "params")
|
|
1797
1797
|
};
|
|
1798
1798
|
function reportTypeError(it) {
|
|
1799
1799
|
const cxt = getTypeErrorContext(it);
|
|
@@ -2229,38 +2229,28 @@ var require_fast_deep_equal = __commonJS({
|
|
|
2229
2229
|
"node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
2230
2230
|
"use strict";
|
|
2231
2231
|
module.exports = /* @__PURE__ */ __name(function equal(a, b) {
|
|
2232
|
-
if (a === b)
|
|
2233
|
-
return true;
|
|
2232
|
+
if (a === b) return true;
|
|
2234
2233
|
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
2235
|
-
if (a.constructor !== b.constructor)
|
|
2236
|
-
return false;
|
|
2234
|
+
if (a.constructor !== b.constructor) return false;
|
|
2237
2235
|
var length, i, keys;
|
|
2238
2236
|
if (Array.isArray(a)) {
|
|
2239
2237
|
length = a.length;
|
|
2240
|
-
if (length != b.length)
|
|
2241
|
-
return false;
|
|
2238
|
+
if (length != b.length) return false;
|
|
2242
2239
|
for (i = length; i-- !== 0; )
|
|
2243
|
-
if (!equal(a[i], b[i]))
|
|
2244
|
-
return false;
|
|
2240
|
+
if (!equal(a[i], b[i])) return false;
|
|
2245
2241
|
return true;
|
|
2246
2242
|
}
|
|
2247
|
-
if (a.constructor === RegExp)
|
|
2248
|
-
|
|
2249
|
-
if (a.
|
|
2250
|
-
return a.valueOf() === b.valueOf();
|
|
2251
|
-
if (a.toString !== Object.prototype.toString)
|
|
2252
|
-
return a.toString() === b.toString();
|
|
2243
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
2244
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
2245
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
2253
2246
|
keys = Object.keys(a);
|
|
2254
2247
|
length = keys.length;
|
|
2255
|
-
if (length !== Object.keys(b).length)
|
|
2256
|
-
return false;
|
|
2248
|
+
if (length !== Object.keys(b).length) return false;
|
|
2257
2249
|
for (i = length; i-- !== 0; )
|
|
2258
|
-
if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
|
|
2259
|
-
return false;
|
|
2250
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
2260
2251
|
for (i = length; i-- !== 0; ) {
|
|
2261
2252
|
var key = keys[i];
|
|
2262
|
-
if (!equal(a[key], b[key]))
|
|
2263
|
-
return false;
|
|
2253
|
+
if (!equal(a[key], b[key])) return false;
|
|
2264
2254
|
}
|
|
2265
2255
|
return true;
|
|
2266
2256
|
}
|
|
@@ -3367,1070 +3357,702 @@ var require_data = __commonJS({
|
|
|
3367
3357
|
}
|
|
3368
3358
|
});
|
|
3369
3359
|
|
|
3370
|
-
// node_modules/uri
|
|
3371
|
-
var
|
|
3372
|
-
"node_modules/uri
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3360
|
+
// node_modules/fast-uri/lib/scopedChars.js
|
|
3361
|
+
var require_scopedChars = __commonJS({
|
|
3362
|
+
"node_modules/fast-uri/lib/scopedChars.js"(exports, module) {
|
|
3363
|
+
"use strict";
|
|
3364
|
+
var HEX = {
|
|
3365
|
+
0: 0,
|
|
3366
|
+
1: 1,
|
|
3367
|
+
2: 2,
|
|
3368
|
+
3: 3,
|
|
3369
|
+
4: 4,
|
|
3370
|
+
5: 5,
|
|
3371
|
+
6: 6,
|
|
3372
|
+
7: 7,
|
|
3373
|
+
8: 8,
|
|
3374
|
+
9: 9,
|
|
3375
|
+
a: 10,
|
|
3376
|
+
A: 10,
|
|
3377
|
+
b: 11,
|
|
3378
|
+
B: 11,
|
|
3379
|
+
c: 12,
|
|
3380
|
+
C: 12,
|
|
3381
|
+
d: 13,
|
|
3382
|
+
D: 13,
|
|
3383
|
+
e: 14,
|
|
3384
|
+
E: 14,
|
|
3385
|
+
f: 15,
|
|
3386
|
+
F: 15
|
|
3387
|
+
};
|
|
3388
|
+
module.exports = {
|
|
3389
|
+
HEX
|
|
3390
|
+
};
|
|
3391
|
+
}
|
|
3392
|
+
});
|
|
3393
|
+
|
|
3394
|
+
// node_modules/fast-uri/lib/utils.js
|
|
3395
|
+
var require_utils = __commonJS({
|
|
3396
|
+
"node_modules/fast-uri/lib/utils.js"(exports, module) {
|
|
3397
|
+
"use strict";
|
|
3398
|
+
var { HEX } = require_scopedChars();
|
|
3399
|
+
function normalizeIPv4(host) {
|
|
3400
|
+
if (findToken(host, ".") < 3) {
|
|
3401
|
+
return { host, isIPV4: false };
|
|
3402
|
+
}
|
|
3403
|
+
const matches = host.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u) || [];
|
|
3404
|
+
const [address] = matches;
|
|
3405
|
+
if (address) {
|
|
3406
|
+
return { host: stripLeadingZeros(address, "."), isIPV4: true };
|
|
3407
|
+
} else {
|
|
3408
|
+
return { host, isIPV4: false };
|
|
3409
|
+
}
|
|
3410
|
+
}
|
|
3411
|
+
__name(normalizeIPv4, "normalizeIPv4");
|
|
3412
|
+
function stringArrayToHexStripped(input, keepZero = false) {
|
|
3413
|
+
let acc = "";
|
|
3414
|
+
let strip = true;
|
|
3415
|
+
for (const c of input) {
|
|
3416
|
+
if (HEX[c] === void 0) return void 0;
|
|
3417
|
+
if (c !== "0" && strip === true) strip = false;
|
|
3418
|
+
if (!strip) acc += c;
|
|
3419
|
+
}
|
|
3420
|
+
if (keepZero && acc.length === 0) acc = "0";
|
|
3421
|
+
return acc;
|
|
3422
|
+
}
|
|
3423
|
+
__name(stringArrayToHexStripped, "stringArrayToHexStripped");
|
|
3424
|
+
function getIPV6(input) {
|
|
3425
|
+
let tokenCount = 0;
|
|
3426
|
+
const output = { error: false, address: "", zone: "" };
|
|
3427
|
+
const address = [];
|
|
3428
|
+
const buffer = [];
|
|
3429
|
+
let isZone = false;
|
|
3430
|
+
let endipv6Encountered = false;
|
|
3431
|
+
let endIpv6 = false;
|
|
3432
|
+
function consume() {
|
|
3433
|
+
if (buffer.length) {
|
|
3434
|
+
if (isZone === false) {
|
|
3435
|
+
const hex = stringArrayToHexStripped(buffer);
|
|
3436
|
+
if (hex !== void 0) {
|
|
3437
|
+
address.push(hex);
|
|
3438
|
+
} else {
|
|
3439
|
+
output.error = true;
|
|
3440
|
+
return false;
|
|
3441
|
+
}
|
|
3442
|
+
}
|
|
3443
|
+
buffer.length = 0;
|
|
3380
3444
|
}
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3445
|
+
return true;
|
|
3446
|
+
}
|
|
3447
|
+
__name(consume, "consume");
|
|
3448
|
+
for (let i = 0; i < input.length; i++) {
|
|
3449
|
+
const cursor = input[i];
|
|
3450
|
+
if (cursor === "[" || cursor === "]") {
|
|
3451
|
+
continue;
|
|
3452
|
+
}
|
|
3453
|
+
if (cursor === ":") {
|
|
3454
|
+
if (endipv6Encountered === true) {
|
|
3455
|
+
endIpv6 = true;
|
|
3456
|
+
}
|
|
3457
|
+
if (!consume()) {
|
|
3458
|
+
break;
|
|
3459
|
+
}
|
|
3460
|
+
tokenCount++;
|
|
3461
|
+
address.push(":");
|
|
3462
|
+
if (tokenCount > 7) {
|
|
3463
|
+
output.error = true;
|
|
3464
|
+
break;
|
|
3465
|
+
}
|
|
3466
|
+
if (i - 1 >= 0 && input[i - 1] === ":") {
|
|
3467
|
+
endipv6Encountered = true;
|
|
3386
3468
|
}
|
|
3387
|
-
|
|
3388
|
-
|
|
3469
|
+
continue;
|
|
3470
|
+
} else if (cursor === "%") {
|
|
3471
|
+
if (!consume()) {
|
|
3472
|
+
break;
|
|
3473
|
+
}
|
|
3474
|
+
isZone = true;
|
|
3389
3475
|
} else {
|
|
3390
|
-
|
|
3476
|
+
buffer.push(cursor);
|
|
3477
|
+
continue;
|
|
3391
3478
|
}
|
|
3392
3479
|
}
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
__name(typeOf, "typeOf");
|
|
3402
|
-
function toUpperCase(str) {
|
|
3403
|
-
return str.toUpperCase();
|
|
3480
|
+
if (buffer.length) {
|
|
3481
|
+
if (isZone) {
|
|
3482
|
+
output.zone = buffer.join("");
|
|
3483
|
+
} else if (endIpv6) {
|
|
3484
|
+
address.push(buffer.join(""));
|
|
3485
|
+
} else {
|
|
3486
|
+
address.push(stringArrayToHexStripped(buffer));
|
|
3487
|
+
}
|
|
3404
3488
|
}
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3489
|
+
output.address = address.join("");
|
|
3490
|
+
return output;
|
|
3491
|
+
}
|
|
3492
|
+
__name(getIPV6, "getIPV6");
|
|
3493
|
+
function normalizeIPv6(host, opts = {}) {
|
|
3494
|
+
if (findToken(host, ":") < 2) {
|
|
3495
|
+
return { host, isIPV6: false };
|
|
3408
3496
|
}
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3497
|
+
const ipv6 = getIPV6(host);
|
|
3498
|
+
if (!ipv6.error) {
|
|
3499
|
+
let newHost = ipv6.address;
|
|
3500
|
+
let escapedHost = ipv6.address;
|
|
3501
|
+
if (ipv6.zone) {
|
|
3502
|
+
newHost += "%" + ipv6.zone;
|
|
3503
|
+
escapedHost += "%25" + ipv6.zone;
|
|
3416
3504
|
}
|
|
3417
|
-
return
|
|
3418
|
-
}
|
|
3419
|
-
|
|
3420
|
-
function buildExps(isIRI2) {
|
|
3421
|
-
var ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$2 = merge(DIGIT$$, "[A-Fa-f]"), LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$2 = subexp(subexp("%[EFef]" + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2) + "|" + subexp("%" + HEXDIG$$2 + HEXDIG$$2)), GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI2 ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", IPRIVATE$$ = isIRI2 ? "[\\uE000-\\uF8FF]" : "[]", UNRESERVED$$2 = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$2 + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$2 + "|" + PCT_ENCODED$2) + "+"), IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$2 + "{2})") + ZONEID$), IPVFUTURE$ = subexp("[vV]" + HEXDIG$$2 + "+\\." + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), REG_NAME$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$";
|
|
3422
|
-
return {
|
|
3423
|
-
NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
|
|
3424
|
-
NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
|
|
3425
|
-
NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
|
|
3426
|
-
NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
|
|
3427
|
-
NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
|
|
3428
|
-
NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
|
|
3429
|
-
NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
|
|
3430
|
-
ESCAPE: new RegExp(merge("[^]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
|
|
3431
|
-
UNRESERVED: new RegExp(UNRESERVED$$2, "g"),
|
|
3432
|
-
OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$2, RESERVED$$), "g"),
|
|
3433
|
-
PCT_ENCODED: new RegExp(PCT_ENCODED$2, "g"),
|
|
3434
|
-
IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
|
|
3435
|
-
IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$2 + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$")
|
|
3436
|
-
//RFC 6874, with relaxed parsing rules
|
|
3437
|
-
};
|
|
3505
|
+
return { host: newHost, escapedHost, isIPV6: true };
|
|
3506
|
+
} else {
|
|
3507
|
+
return { host, isIPV6: false };
|
|
3438
3508
|
}
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
if (i && _arr.length === i)
|
|
3452
|
-
break;
|
|
3453
|
-
}
|
|
3454
|
-
} catch (err) {
|
|
3455
|
-
_d = true;
|
|
3456
|
-
_e = err;
|
|
3457
|
-
} finally {
|
|
3458
|
-
try {
|
|
3459
|
-
if (!_n && _i["return"])
|
|
3460
|
-
_i["return"]();
|
|
3461
|
-
} finally {
|
|
3462
|
-
if (_d)
|
|
3463
|
-
throw _e;
|
|
3464
|
-
}
|
|
3509
|
+
}
|
|
3510
|
+
__name(normalizeIPv6, "normalizeIPv6");
|
|
3511
|
+
function stripLeadingZeros(str, token) {
|
|
3512
|
+
let out = "";
|
|
3513
|
+
let skip = true;
|
|
3514
|
+
const l = str.length;
|
|
3515
|
+
for (let i = 0; i < l; i++) {
|
|
3516
|
+
const c = str[i];
|
|
3517
|
+
if (c === "0" && skip) {
|
|
3518
|
+
if (i + 1 <= l && str[i + 1] === token || i + 1 === l) {
|
|
3519
|
+
out += c;
|
|
3520
|
+
skip = false;
|
|
3465
3521
|
}
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
return function(arr, i) {
|
|
3470
|
-
if (Array.isArray(arr)) {
|
|
3471
|
-
return arr;
|
|
3472
|
-
} else if (Symbol.iterator in Object(arr)) {
|
|
3473
|
-
return sliceIterator(arr, i);
|
|
3522
|
+
} else {
|
|
3523
|
+
if (c === token) {
|
|
3524
|
+
skip = true;
|
|
3474
3525
|
} else {
|
|
3475
|
-
|
|
3476
|
-
}
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3526
|
+
skip = false;
|
|
3527
|
+
}
|
|
3528
|
+
out += c;
|
|
3529
|
+
}
|
|
3530
|
+
}
|
|
3531
|
+
return out;
|
|
3532
|
+
}
|
|
3533
|
+
__name(stripLeadingZeros, "stripLeadingZeros");
|
|
3534
|
+
function findToken(str, token) {
|
|
3535
|
+
let ind = 0;
|
|
3536
|
+
for (let i = 0; i < str.length; i++) {
|
|
3537
|
+
if (str[i] === token) ind++;
|
|
3538
|
+
}
|
|
3539
|
+
return ind;
|
|
3540
|
+
}
|
|
3541
|
+
__name(findToken, "findToken");
|
|
3542
|
+
var RDS1 = /^\.\.?\//u;
|
|
3543
|
+
var RDS2 = /^\/\.(?:\/|$)/u;
|
|
3544
|
+
var RDS3 = /^\/\.\.(?:\/|$)/u;
|
|
3545
|
+
var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/u;
|
|
3546
|
+
function removeDotSegments(input) {
|
|
3547
|
+
const output = [];
|
|
3548
|
+
while (input.length) {
|
|
3549
|
+
if (input.match(RDS1)) {
|
|
3550
|
+
input = input.replace(RDS1, "");
|
|
3551
|
+
} else if (input.match(RDS2)) {
|
|
3552
|
+
input = input.replace(RDS2, "/");
|
|
3553
|
+
} else if (input.match(RDS3)) {
|
|
3554
|
+
input = input.replace(RDS3, "/");
|
|
3555
|
+
output.pop();
|
|
3556
|
+
} else if (input === "." || input === "..") {
|
|
3557
|
+
input = "";
|
|
3484
3558
|
} else {
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
var tMin = 1;
|
|
3491
|
-
var tMax = 26;
|
|
3492
|
-
var skew = 38;
|
|
3493
|
-
var damp = 700;
|
|
3494
|
-
var initialBias = 72;
|
|
3495
|
-
var initialN = 128;
|
|
3496
|
-
var delimiter = "-";
|
|
3497
|
-
var regexPunycode = /^xn--/;
|
|
3498
|
-
var regexNonASCII = /[^\0-\x7E]/;
|
|
3499
|
-
var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g;
|
|
3500
|
-
var errors = {
|
|
3501
|
-
"overflow": "Overflow: input needs wider integers to process",
|
|
3502
|
-
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
3503
|
-
"invalid-input": "Invalid input"
|
|
3504
|
-
};
|
|
3505
|
-
var baseMinusTMin = base - tMin;
|
|
3506
|
-
var floor = Math.floor;
|
|
3507
|
-
var stringFromCharCode = String.fromCharCode;
|
|
3508
|
-
function error$1(type) {
|
|
3509
|
-
throw new RangeError(errors[type]);
|
|
3510
|
-
}
|
|
3511
|
-
__name(error$1, "error$1");
|
|
3512
|
-
function map(array, fn) {
|
|
3513
|
-
var result = [];
|
|
3514
|
-
var length = array.length;
|
|
3515
|
-
while (length--) {
|
|
3516
|
-
result[length] = fn(array[length]);
|
|
3517
|
-
}
|
|
3518
|
-
return result;
|
|
3519
|
-
}
|
|
3520
|
-
__name(map, "map");
|
|
3521
|
-
function mapDomain(string, fn) {
|
|
3522
|
-
var parts = string.split("@");
|
|
3523
|
-
var result = "";
|
|
3524
|
-
if (parts.length > 1) {
|
|
3525
|
-
result = parts[0] + "@";
|
|
3526
|
-
string = parts[1];
|
|
3527
|
-
}
|
|
3528
|
-
string = string.replace(regexSeparators, ".");
|
|
3529
|
-
var labels = string.split(".");
|
|
3530
|
-
var encoded = map(labels, fn).join(".");
|
|
3531
|
-
return result + encoded;
|
|
3532
|
-
}
|
|
3533
|
-
__name(mapDomain, "mapDomain");
|
|
3534
|
-
function ucs2decode(string) {
|
|
3535
|
-
var output = [];
|
|
3536
|
-
var counter = 0;
|
|
3537
|
-
var length = string.length;
|
|
3538
|
-
while (counter < length) {
|
|
3539
|
-
var value = string.charCodeAt(counter++);
|
|
3540
|
-
if (value >= 55296 && value <= 56319 && counter < length) {
|
|
3541
|
-
var extra = string.charCodeAt(counter++);
|
|
3542
|
-
if ((extra & 64512) == 56320) {
|
|
3543
|
-
output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
|
|
3544
|
-
} else {
|
|
3545
|
-
output.push(value);
|
|
3546
|
-
counter--;
|
|
3547
|
-
}
|
|
3559
|
+
const im = input.match(RDS5);
|
|
3560
|
+
if (im) {
|
|
3561
|
+
const s = im[0];
|
|
3562
|
+
input = input.slice(s.length);
|
|
3563
|
+
output.push(s);
|
|
3548
3564
|
} else {
|
|
3549
|
-
|
|
3550
|
-
}
|
|
3551
|
-
}
|
|
3552
|
-
return output;
|
|
3553
|
-
}
|
|
3554
|
-
__name(ucs2decode, "ucs2decode");
|
|
3555
|
-
var ucs2encode = /* @__PURE__ */ __name(function ucs2encode2(array) {
|
|
3556
|
-
return String.fromCodePoint.apply(String, toConsumableArray(array));
|
|
3557
|
-
}, "ucs2encode");
|
|
3558
|
-
var basicToDigit = /* @__PURE__ */ __name(function basicToDigit2(codePoint) {
|
|
3559
|
-
if (codePoint - 48 < 10) {
|
|
3560
|
-
return codePoint - 22;
|
|
3561
|
-
}
|
|
3562
|
-
if (codePoint - 65 < 26) {
|
|
3563
|
-
return codePoint - 65;
|
|
3564
|
-
}
|
|
3565
|
-
if (codePoint - 97 < 26) {
|
|
3566
|
-
return codePoint - 97;
|
|
3567
|
-
}
|
|
3568
|
-
return base;
|
|
3569
|
-
}, "basicToDigit");
|
|
3570
|
-
var digitToBasic = /* @__PURE__ */ __name(function digitToBasic2(digit, flag) {
|
|
3571
|
-
return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
|
|
3572
|
-
}, "digitToBasic");
|
|
3573
|
-
var adapt = /* @__PURE__ */ __name(function adapt2(delta, numPoints, firstTime) {
|
|
3574
|
-
var k = 0;
|
|
3575
|
-
delta = firstTime ? floor(delta / damp) : delta >> 1;
|
|
3576
|
-
delta += floor(delta / numPoints);
|
|
3577
|
-
for (
|
|
3578
|
-
;
|
|
3579
|
-
/* no initialization */
|
|
3580
|
-
delta > baseMinusTMin * tMax >> 1;
|
|
3581
|
-
k += base
|
|
3582
|
-
) {
|
|
3583
|
-
delta = floor(delta / baseMinusTMin);
|
|
3584
|
-
}
|
|
3585
|
-
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
|
|
3586
|
-
}, "adapt");
|
|
3587
|
-
var decode = /* @__PURE__ */ __name(function decode2(input) {
|
|
3588
|
-
var output = [];
|
|
3589
|
-
var inputLength = input.length;
|
|
3590
|
-
var i = 0;
|
|
3591
|
-
var n = initialN;
|
|
3592
|
-
var bias = initialBias;
|
|
3593
|
-
var basic = input.lastIndexOf(delimiter);
|
|
3594
|
-
if (basic < 0) {
|
|
3595
|
-
basic = 0;
|
|
3596
|
-
}
|
|
3597
|
-
for (var j = 0; j < basic; ++j) {
|
|
3598
|
-
if (input.charCodeAt(j) >= 128) {
|
|
3599
|
-
error$1("not-basic");
|
|
3600
|
-
}
|
|
3601
|
-
output.push(input.charCodeAt(j));
|
|
3602
|
-
}
|
|
3603
|
-
for (var index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
|
|
3604
|
-
var oldi = i;
|
|
3605
|
-
for (
|
|
3606
|
-
var w = 1, k = base;
|
|
3607
|
-
;
|
|
3608
|
-
/* no condition */
|
|
3609
|
-
k += base
|
|
3610
|
-
) {
|
|
3611
|
-
if (index >= inputLength) {
|
|
3612
|
-
error$1("invalid-input");
|
|
3613
|
-
}
|
|
3614
|
-
var digit = basicToDigit(input.charCodeAt(index++));
|
|
3615
|
-
if (digit >= base || digit > floor((maxInt - i) / w)) {
|
|
3616
|
-
error$1("overflow");
|
|
3617
|
-
}
|
|
3618
|
-
i += digit * w;
|
|
3619
|
-
var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
|
|
3620
|
-
if (digit < t) {
|
|
3621
|
-
break;
|
|
3622
|
-
}
|
|
3623
|
-
var baseMinusT = base - t;
|
|
3624
|
-
if (w > floor(maxInt / baseMinusT)) {
|
|
3625
|
-
error$1("overflow");
|
|
3626
|
-
}
|
|
3627
|
-
w *= baseMinusT;
|
|
3628
|
-
}
|
|
3629
|
-
var out = output.length + 1;
|
|
3630
|
-
bias = adapt(i - oldi, out, oldi == 0);
|
|
3631
|
-
if (floor(i / out) > maxInt - n) {
|
|
3632
|
-
error$1("overflow");
|
|
3633
|
-
}
|
|
3634
|
-
n += floor(i / out);
|
|
3635
|
-
i %= out;
|
|
3636
|
-
output.splice(i++, 0, n);
|
|
3637
|
-
}
|
|
3638
|
-
return String.fromCodePoint.apply(String, output);
|
|
3639
|
-
}, "decode");
|
|
3640
|
-
var encode = /* @__PURE__ */ __name(function encode2(input) {
|
|
3641
|
-
var output = [];
|
|
3642
|
-
input = ucs2decode(input);
|
|
3643
|
-
var inputLength = input.length;
|
|
3644
|
-
var n = initialN;
|
|
3645
|
-
var delta = 0;
|
|
3646
|
-
var bias = initialBias;
|
|
3647
|
-
var _iteratorNormalCompletion = true;
|
|
3648
|
-
var _didIteratorError = false;
|
|
3649
|
-
var _iteratorError = void 0;
|
|
3650
|
-
try {
|
|
3651
|
-
for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
3652
|
-
var _currentValue2 = _step.value;
|
|
3653
|
-
if (_currentValue2 < 128) {
|
|
3654
|
-
output.push(stringFromCharCode(_currentValue2));
|
|
3655
|
-
}
|
|
3565
|
+
throw new Error("Unexpected dot segment condition");
|
|
3656
3566
|
}
|
|
3657
|
-
} catch (err) {
|
|
3658
|
-
_didIteratorError = true;
|
|
3659
|
-
_iteratorError = err;
|
|
3660
|
-
} finally {
|
|
3661
|
-
try {
|
|
3662
|
-
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
3663
|
-
_iterator.return();
|
|
3664
|
-
}
|
|
3665
|
-
} finally {
|
|
3666
|
-
if (_didIteratorError) {
|
|
3667
|
-
throw _iteratorError;
|
|
3668
|
-
}
|
|
3669
|
-
}
|
|
3670
|
-
}
|
|
3671
|
-
var basicLength = output.length;
|
|
3672
|
-
var handledCPCount = basicLength;
|
|
3673
|
-
if (basicLength) {
|
|
3674
|
-
output.push(delimiter);
|
|
3675
3567
|
}
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
var k = base;
|
|
3721
|
-
;
|
|
3722
|
-
/* no condition */
|
|
3723
|
-
k += base
|
|
3724
|
-
) {
|
|
3725
|
-
var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
|
|
3726
|
-
if (q < t) {
|
|
3727
|
-
break;
|
|
3728
|
-
}
|
|
3729
|
-
var qMinusT = q - t;
|
|
3730
|
-
var baseMinusT = base - t;
|
|
3731
|
-
output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));
|
|
3732
|
-
q = floor(qMinusT / baseMinusT);
|
|
3733
|
-
}
|
|
3734
|
-
output.push(stringFromCharCode(digitToBasic(q, 0)));
|
|
3735
|
-
bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
|
|
3736
|
-
delta = 0;
|
|
3737
|
-
++handledCPCount;
|
|
3738
|
-
}
|
|
3739
|
-
}
|
|
3740
|
-
} catch (err) {
|
|
3741
|
-
_didIteratorError3 = true;
|
|
3742
|
-
_iteratorError3 = err;
|
|
3743
|
-
} finally {
|
|
3744
|
-
try {
|
|
3745
|
-
if (!_iteratorNormalCompletion3 && _iterator3.return) {
|
|
3746
|
-
_iterator3.return();
|
|
3747
|
-
}
|
|
3748
|
-
} finally {
|
|
3749
|
-
if (_didIteratorError3) {
|
|
3750
|
-
throw _iteratorError3;
|
|
3751
|
-
}
|
|
3752
|
-
}
|
|
3568
|
+
}
|
|
3569
|
+
return output.join("");
|
|
3570
|
+
}
|
|
3571
|
+
__name(removeDotSegments, "removeDotSegments");
|
|
3572
|
+
function normalizeComponentEncoding(components, esc) {
|
|
3573
|
+
const func = esc !== true ? escape : unescape;
|
|
3574
|
+
if (components.scheme !== void 0) {
|
|
3575
|
+
components.scheme = func(components.scheme);
|
|
3576
|
+
}
|
|
3577
|
+
if (components.userinfo !== void 0) {
|
|
3578
|
+
components.userinfo = func(components.userinfo);
|
|
3579
|
+
}
|
|
3580
|
+
if (components.host !== void 0) {
|
|
3581
|
+
components.host = func(components.host);
|
|
3582
|
+
}
|
|
3583
|
+
if (components.path !== void 0) {
|
|
3584
|
+
components.path = func(components.path);
|
|
3585
|
+
}
|
|
3586
|
+
if (components.query !== void 0) {
|
|
3587
|
+
components.query = func(components.query);
|
|
3588
|
+
}
|
|
3589
|
+
if (components.fragment !== void 0) {
|
|
3590
|
+
components.fragment = func(components.fragment);
|
|
3591
|
+
}
|
|
3592
|
+
return components;
|
|
3593
|
+
}
|
|
3594
|
+
__name(normalizeComponentEncoding, "normalizeComponentEncoding");
|
|
3595
|
+
function recomposeAuthority(components, options) {
|
|
3596
|
+
const uriTokens = [];
|
|
3597
|
+
if (components.userinfo !== void 0) {
|
|
3598
|
+
uriTokens.push(components.userinfo);
|
|
3599
|
+
uriTokens.push("@");
|
|
3600
|
+
}
|
|
3601
|
+
if (components.host !== void 0) {
|
|
3602
|
+
let host = unescape(components.host);
|
|
3603
|
+
const ipV4res = normalizeIPv4(host);
|
|
3604
|
+
if (ipV4res.isIPV4) {
|
|
3605
|
+
host = ipV4res.host;
|
|
3606
|
+
} else {
|
|
3607
|
+
const ipV6res = normalizeIPv6(ipV4res.host, { isIPV4: false });
|
|
3608
|
+
if (ipV6res.isIPV6 === true) {
|
|
3609
|
+
host = `[${ipV6res.escapedHost}]`;
|
|
3610
|
+
} else {
|
|
3611
|
+
host = components.host;
|
|
3753
3612
|
}
|
|
3754
|
-
++delta;
|
|
3755
|
-
++n;
|
|
3756
3613
|
}
|
|
3757
|
-
|
|
3758
|
-
}
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
"
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3614
|
+
uriTokens.push(host);
|
|
3615
|
+
}
|
|
3616
|
+
if (typeof components.port === "number" || typeof components.port === "string") {
|
|
3617
|
+
uriTokens.push(":");
|
|
3618
|
+
uriTokens.push(String(components.port));
|
|
3619
|
+
}
|
|
3620
|
+
return uriTokens.length ? uriTokens.join("") : void 0;
|
|
3621
|
+
}
|
|
3622
|
+
__name(recomposeAuthority, "recomposeAuthority");
|
|
3623
|
+
module.exports = {
|
|
3624
|
+
recomposeAuthority,
|
|
3625
|
+
normalizeComponentEncoding,
|
|
3626
|
+
removeDotSegments,
|
|
3627
|
+
normalizeIPv4,
|
|
3628
|
+
normalizeIPv6,
|
|
3629
|
+
stringArrayToHexStripped
|
|
3630
|
+
};
|
|
3631
|
+
}
|
|
3632
|
+
});
|
|
3633
|
+
|
|
3634
|
+
// node_modules/fast-uri/lib/schemes.js
|
|
3635
|
+
var require_schemes = __commonJS({
|
|
3636
|
+
"node_modules/fast-uri/lib/schemes.js"(exports, module) {
|
|
3637
|
+
"use strict";
|
|
3638
|
+
var UUID_REG = /^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu;
|
|
3639
|
+
var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
|
|
3640
|
+
function isSecure(wsComponents) {
|
|
3641
|
+
return typeof wsComponents.secure === "boolean" ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
|
|
3642
|
+
}
|
|
3643
|
+
__name(isSecure, "isSecure");
|
|
3644
|
+
function httpParse(components) {
|
|
3645
|
+
if (!components.host) {
|
|
3646
|
+
components.error = components.error || "HTTP URIs must have a host.";
|
|
3647
|
+
}
|
|
3648
|
+
return components;
|
|
3649
|
+
}
|
|
3650
|
+
__name(httpParse, "httpParse");
|
|
3651
|
+
function httpSerialize(components) {
|
|
3652
|
+
const secure = String(components.scheme).toLowerCase() === "https";
|
|
3653
|
+
if (components.port === (secure ? 443 : 80) || components.port === "") {
|
|
3654
|
+
components.port = void 0;
|
|
3655
|
+
}
|
|
3656
|
+
if (!components.path) {
|
|
3657
|
+
components.path = "/";
|
|
3658
|
+
}
|
|
3659
|
+
return components;
|
|
3660
|
+
}
|
|
3661
|
+
__name(httpSerialize, "httpSerialize");
|
|
3662
|
+
function wsParse(wsComponents) {
|
|
3663
|
+
wsComponents.secure = isSecure(wsComponents);
|
|
3664
|
+
wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : "");
|
|
3665
|
+
wsComponents.path = void 0;
|
|
3666
|
+
wsComponents.query = void 0;
|
|
3667
|
+
return wsComponents;
|
|
3668
|
+
}
|
|
3669
|
+
__name(wsParse, "wsParse");
|
|
3670
|
+
function wsSerialize(wsComponents) {
|
|
3671
|
+
if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
|
|
3672
|
+
wsComponents.port = void 0;
|
|
3673
|
+
}
|
|
3674
|
+
if (typeof wsComponents.secure === "boolean") {
|
|
3675
|
+
wsComponents.scheme = wsComponents.secure ? "wss" : "ws";
|
|
3676
|
+
wsComponents.secure = void 0;
|
|
3677
|
+
}
|
|
3678
|
+
if (wsComponents.resourceName) {
|
|
3679
|
+
const [path, query] = wsComponents.resourceName.split("?");
|
|
3680
|
+
wsComponents.path = path && path !== "/" ? path : void 0;
|
|
3681
|
+
wsComponents.query = query;
|
|
3682
|
+
wsComponents.resourceName = void 0;
|
|
3683
|
+
}
|
|
3684
|
+
wsComponents.fragment = void 0;
|
|
3685
|
+
return wsComponents;
|
|
3686
|
+
}
|
|
3687
|
+
__name(wsSerialize, "wsSerialize");
|
|
3688
|
+
function urnParse(urnComponents, options) {
|
|
3689
|
+
if (!urnComponents.path) {
|
|
3690
|
+
urnComponents.error = "URN can not be parsed";
|
|
3691
|
+
return urnComponents;
|
|
3692
|
+
}
|
|
3693
|
+
const matches = urnComponents.path.match(URN_REG);
|
|
3694
|
+
if (matches) {
|
|
3695
|
+
const scheme = options.scheme || urnComponents.scheme || "urn";
|
|
3696
|
+
urnComponents.nid = matches[1].toLowerCase();
|
|
3697
|
+
urnComponents.nss = matches[2];
|
|
3698
|
+
const urnScheme = `${scheme}:${options.nid || urnComponents.nid}`;
|
|
3699
|
+
const schemeHandler = SCHEMES[urnScheme];
|
|
3700
|
+
urnComponents.path = void 0;
|
|
3701
|
+
if (schemeHandler) {
|
|
3702
|
+
urnComponents = schemeHandler.parse(urnComponents, options);
|
|
3703
|
+
}
|
|
3704
|
+
} else {
|
|
3705
|
+
urnComponents.error = urnComponents.error || "URN can not be parsed.";
|
|
3706
|
+
}
|
|
3707
|
+
return urnComponents;
|
|
3708
|
+
}
|
|
3709
|
+
__name(urnParse, "urnParse");
|
|
3710
|
+
function urnSerialize(urnComponents, options) {
|
|
3711
|
+
const scheme = options.scheme || urnComponents.scheme || "urn";
|
|
3712
|
+
const nid = urnComponents.nid.toLowerCase();
|
|
3713
|
+
const urnScheme = `${scheme}:${options.nid || nid}`;
|
|
3714
|
+
const schemeHandler = SCHEMES[urnScheme];
|
|
3715
|
+
if (schemeHandler) {
|
|
3716
|
+
urnComponents = schemeHandler.serialize(urnComponents, options);
|
|
3717
|
+
}
|
|
3718
|
+
const uriComponents = urnComponents;
|
|
3719
|
+
const nss = urnComponents.nss;
|
|
3720
|
+
uriComponents.path = `${nid || options.nid}:${nss}`;
|
|
3721
|
+
options.skipEscape = true;
|
|
3722
|
+
return uriComponents;
|
|
3723
|
+
}
|
|
3724
|
+
__name(urnSerialize, "urnSerialize");
|
|
3725
|
+
function urnuuidParse(urnComponents, options) {
|
|
3726
|
+
const uuidComponents = urnComponents;
|
|
3727
|
+
uuidComponents.uuid = uuidComponents.nss;
|
|
3728
|
+
uuidComponents.nss = void 0;
|
|
3729
|
+
if (!options.tolerant && (!uuidComponents.uuid || !UUID_REG.test(uuidComponents.uuid))) {
|
|
3730
|
+
uuidComponents.error = uuidComponents.error || "UUID is not valid.";
|
|
3731
|
+
}
|
|
3732
|
+
return uuidComponents;
|
|
3733
|
+
}
|
|
3734
|
+
__name(urnuuidParse, "urnuuidParse");
|
|
3735
|
+
function urnuuidSerialize(uuidComponents) {
|
|
3736
|
+
const urnComponents = uuidComponents;
|
|
3737
|
+
urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
|
|
3738
|
+
return urnComponents;
|
|
3739
|
+
}
|
|
3740
|
+
__name(urnuuidSerialize, "urnuuidSerialize");
|
|
3741
|
+
var http = {
|
|
3742
|
+
scheme: "http",
|
|
3743
|
+
domainHost: true,
|
|
3744
|
+
parse: httpParse,
|
|
3745
|
+
serialize: httpSerialize
|
|
3746
|
+
};
|
|
3747
|
+
var https = {
|
|
3748
|
+
scheme: "https",
|
|
3749
|
+
domainHost: http.domainHost,
|
|
3750
|
+
parse: httpParse,
|
|
3751
|
+
serialize: httpSerialize
|
|
3752
|
+
};
|
|
3753
|
+
var ws = {
|
|
3754
|
+
scheme: "ws",
|
|
3755
|
+
domainHost: true,
|
|
3756
|
+
parse: wsParse,
|
|
3757
|
+
serialize: wsSerialize
|
|
3758
|
+
};
|
|
3759
|
+
var wss = {
|
|
3760
|
+
scheme: "wss",
|
|
3761
|
+
domainHost: ws.domainHost,
|
|
3762
|
+
parse: ws.parse,
|
|
3763
|
+
serialize: ws.serialize
|
|
3764
|
+
};
|
|
3765
|
+
var urn = {
|
|
3766
|
+
scheme: "urn",
|
|
3767
|
+
parse: urnParse,
|
|
3768
|
+
serialize: urnSerialize,
|
|
3769
|
+
skipNormalize: true
|
|
3770
|
+
};
|
|
3771
|
+
var urnuuid = {
|
|
3772
|
+
scheme: "urn:uuid",
|
|
3773
|
+
parse: urnuuidParse,
|
|
3774
|
+
serialize: urnuuidSerialize,
|
|
3775
|
+
skipNormalize: true
|
|
3776
|
+
};
|
|
3777
|
+
var SCHEMES = {
|
|
3778
|
+
http,
|
|
3779
|
+
https,
|
|
3780
|
+
ws,
|
|
3781
|
+
wss,
|
|
3782
|
+
urn,
|
|
3783
|
+
"urn:uuid": urnuuid
|
|
3784
|
+
};
|
|
3785
|
+
module.exports = SCHEMES;
|
|
3786
|
+
}
|
|
3787
|
+
});
|
|
3788
|
+
|
|
3789
|
+
// node_modules/fast-uri/index.js
|
|
3790
|
+
var require_fast_uri = __commonJS({
|
|
3791
|
+
"node_modules/fast-uri/index.js"(exports, module) {
|
|
3792
|
+
"use strict";
|
|
3793
|
+
var { normalizeIPv6, normalizeIPv4, removeDotSegments, recomposeAuthority, normalizeComponentEncoding } = require_utils();
|
|
3794
|
+
var SCHEMES = require_schemes();
|
|
3795
|
+
function normalize(uri, options) {
|
|
3796
|
+
if (typeof uri === "string") {
|
|
3797
|
+
uri = serialize(parse(uri, options), options);
|
|
3798
|
+
} else if (typeof uri === "object") {
|
|
3799
|
+
uri = parse(serialize(uri, options), options);
|
|
3800
|
+
}
|
|
3801
|
+
return uri;
|
|
3802
|
+
}
|
|
3803
|
+
__name(normalize, "normalize");
|
|
3804
|
+
function resolve(baseURI, relativeURI, options) {
|
|
3805
|
+
const schemelessOptions = Object.assign({ scheme: "null" }, options);
|
|
3806
|
+
const resolved = resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
3807
|
+
return serialize(resolved, { ...schemelessOptions, skipEscape: true });
|
|
3808
|
+
}
|
|
3809
|
+
__name(resolve, "resolve");
|
|
3810
|
+
function resolveComponents(base, relative, options, skipNormalization) {
|
|
3811
|
+
const target = {};
|
|
3812
|
+
if (!skipNormalization) {
|
|
3813
|
+
base = parse(serialize(base, options), options);
|
|
3814
|
+
relative = parse(serialize(relative, options), options);
|
|
3815
|
+
}
|
|
3816
|
+
options = options || {};
|
|
3817
|
+
if (!options.tolerant && relative.scheme) {
|
|
3818
|
+
target.scheme = relative.scheme;
|
|
3819
|
+
target.userinfo = relative.userinfo;
|
|
3820
|
+
target.host = relative.host;
|
|
3821
|
+
target.port = relative.port;
|
|
3822
|
+
target.path = removeDotSegments(relative.path || "");
|
|
3823
|
+
target.query = relative.query;
|
|
3824
|
+
} else {
|
|
3825
|
+
if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
|
|
3826
|
+
target.userinfo = relative.userinfo;
|
|
3827
|
+
target.host = relative.host;
|
|
3828
|
+
target.port = relative.port;
|
|
3829
|
+
target.path = removeDotSegments(relative.path || "");
|
|
3830
|
+
target.query = relative.query;
|
|
3831
|
+
} else {
|
|
3832
|
+
if (!relative.path) {
|
|
3833
|
+
target.path = base.path;
|
|
3834
|
+
if (relative.query !== void 0) {
|
|
3835
|
+
target.query = relative.query;
|
|
3829
3836
|
} else {
|
|
3830
|
-
|
|
3837
|
+
target.query = base.query;
|
|
3831
3838
|
}
|
|
3832
|
-
i += 9;
|
|
3833
3839
|
} else {
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
function _normalizeComponentEncoding(components, protocol) {
|
|
3842
|
-
function decodeUnreserved2(str) {
|
|
3843
|
-
var decStr = pctDecChars(str);
|
|
3844
|
-
return !decStr.match(protocol.UNRESERVED) ? str : decStr;
|
|
3845
|
-
}
|
|
3846
|
-
__name(decodeUnreserved2, "decodeUnreserved");
|
|
3847
|
-
if (components.scheme)
|
|
3848
|
-
components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved2).toLowerCase().replace(protocol.NOT_SCHEME, "");
|
|
3849
|
-
if (components.userinfo !== void 0)
|
|
3850
|
-
components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
|
|
3851
|
-
if (components.host !== void 0)
|
|
3852
|
-
components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved2).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
|
|
3853
|
-
if (components.path !== void 0)
|
|
3854
|
-
components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
|
|
3855
|
-
if (components.query !== void 0)
|
|
3856
|
-
components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
|
|
3857
|
-
if (components.fragment !== void 0)
|
|
3858
|
-
components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
|
|
3859
|
-
return components;
|
|
3860
|
-
}
|
|
3861
|
-
__name(_normalizeComponentEncoding, "_normalizeComponentEncoding");
|
|
3862
|
-
function _stripLeadingZeros(str) {
|
|
3863
|
-
return str.replace(/^0*(.*)/, "$1") || "0";
|
|
3864
|
-
}
|
|
3865
|
-
__name(_stripLeadingZeros, "_stripLeadingZeros");
|
|
3866
|
-
function _normalizeIPv4(host, protocol) {
|
|
3867
|
-
var matches = host.match(protocol.IPV4ADDRESS) || [];
|
|
3868
|
-
var _matches = slicedToArray(matches, 2), address = _matches[1];
|
|
3869
|
-
if (address) {
|
|
3870
|
-
return address.split(".").map(_stripLeadingZeros).join(".");
|
|
3871
|
-
} else {
|
|
3872
|
-
return host;
|
|
3873
|
-
}
|
|
3874
|
-
}
|
|
3875
|
-
__name(_normalizeIPv4, "_normalizeIPv4");
|
|
3876
|
-
function _normalizeIPv6(host, protocol) {
|
|
3877
|
-
var matches = host.match(protocol.IPV6ADDRESS) || [];
|
|
3878
|
-
var _matches2 = slicedToArray(matches, 3), address = _matches2[1], zone = _matches2[2];
|
|
3879
|
-
if (address) {
|
|
3880
|
-
var _address$toLowerCase$ = address.toLowerCase().split("::").reverse(), _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), last = _address$toLowerCase$2[0], first = _address$toLowerCase$2[1];
|
|
3881
|
-
var firstFields = first ? first.split(":").map(_stripLeadingZeros) : [];
|
|
3882
|
-
var lastFields = last.split(":").map(_stripLeadingZeros);
|
|
3883
|
-
var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);
|
|
3884
|
-
var fieldCount = isLastFieldIPv4Address ? 7 : 8;
|
|
3885
|
-
var lastFieldsStart = lastFields.length - fieldCount;
|
|
3886
|
-
var fields = Array(fieldCount);
|
|
3887
|
-
for (var x = 0; x < fieldCount; ++x) {
|
|
3888
|
-
fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || "";
|
|
3889
|
-
}
|
|
3890
|
-
if (isLastFieldIPv4Address) {
|
|
3891
|
-
fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);
|
|
3892
|
-
}
|
|
3893
|
-
var allZeroFields = fields.reduce(function(acc, field, index) {
|
|
3894
|
-
if (!field || field === "0") {
|
|
3895
|
-
var lastLongest = acc[acc.length - 1];
|
|
3896
|
-
if (lastLongest && lastLongest.index + lastLongest.length === index) {
|
|
3897
|
-
lastLongest.length++;
|
|
3840
|
+
if (relative.path.charAt(0) === "/") {
|
|
3841
|
+
target.path = removeDotSegments(relative.path);
|
|
3842
|
+
} else {
|
|
3843
|
+
if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
|
|
3844
|
+
target.path = "/" + relative.path;
|
|
3845
|
+
} else if (!base.path) {
|
|
3846
|
+
target.path = relative.path;
|
|
3898
3847
|
} else {
|
|
3899
|
-
|
|
3848
|
+
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
|
|
3900
3849
|
}
|
|
3850
|
+
target.path = removeDotSegments(target.path);
|
|
3901
3851
|
}
|
|
3902
|
-
|
|
3903
|
-
}, []);
|
|
3904
|
-
var longestZeroFields = allZeroFields.sort(function(a, b) {
|
|
3905
|
-
return b.length - a.length;
|
|
3906
|
-
})[0];
|
|
3907
|
-
var newHost = void 0;
|
|
3908
|
-
if (longestZeroFields && longestZeroFields.length > 1) {
|
|
3909
|
-
var newFirst = fields.slice(0, longestZeroFields.index);
|
|
3910
|
-
var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);
|
|
3911
|
-
newHost = newFirst.join(":") + "::" + newLast.join(":");
|
|
3912
|
-
} else {
|
|
3913
|
-
newHost = fields.join(":");
|
|
3852
|
+
target.query = relative.query;
|
|
3914
3853
|
}
|
|
3915
|
-
|
|
3916
|
-
|
|
3854
|
+
target.userinfo = base.userinfo;
|
|
3855
|
+
target.host = base.host;
|
|
3856
|
+
target.port = base.port;
|
|
3857
|
+
}
|
|
3858
|
+
target.scheme = base.scheme;
|
|
3859
|
+
}
|
|
3860
|
+
target.fragment = relative.fragment;
|
|
3861
|
+
return target;
|
|
3862
|
+
}
|
|
3863
|
+
__name(resolveComponents, "resolveComponents");
|
|
3864
|
+
function equal(uriA, uriB, options) {
|
|
3865
|
+
if (typeof uriA === "string") {
|
|
3866
|
+
uriA = unescape(uriA);
|
|
3867
|
+
uriA = serialize(normalizeComponentEncoding(parse(uriA, options), true), { ...options, skipEscape: true });
|
|
3868
|
+
} else if (typeof uriA === "object") {
|
|
3869
|
+
uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
|
|
3870
|
+
}
|
|
3871
|
+
if (typeof uriB === "string") {
|
|
3872
|
+
uriB = unescape(uriB);
|
|
3873
|
+
uriB = serialize(normalizeComponentEncoding(parse(uriB, options), true), { ...options, skipEscape: true });
|
|
3874
|
+
} else if (typeof uriB === "object") {
|
|
3875
|
+
uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
|
|
3876
|
+
}
|
|
3877
|
+
return uriA.toLowerCase() === uriB.toLowerCase();
|
|
3878
|
+
}
|
|
3879
|
+
__name(equal, "equal");
|
|
3880
|
+
function serialize(cmpts, opts) {
|
|
3881
|
+
const components = {
|
|
3882
|
+
host: cmpts.host,
|
|
3883
|
+
scheme: cmpts.scheme,
|
|
3884
|
+
userinfo: cmpts.userinfo,
|
|
3885
|
+
port: cmpts.port,
|
|
3886
|
+
path: cmpts.path,
|
|
3887
|
+
query: cmpts.query,
|
|
3888
|
+
nid: cmpts.nid,
|
|
3889
|
+
nss: cmpts.nss,
|
|
3890
|
+
uuid: cmpts.uuid,
|
|
3891
|
+
fragment: cmpts.fragment,
|
|
3892
|
+
reference: cmpts.reference,
|
|
3893
|
+
resourceName: cmpts.resourceName,
|
|
3894
|
+
secure: cmpts.secure,
|
|
3895
|
+
error: ""
|
|
3896
|
+
};
|
|
3897
|
+
const options = Object.assign({}, opts);
|
|
3898
|
+
const uriTokens = [];
|
|
3899
|
+
const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
|
|
3900
|
+
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);
|
|
3901
|
+
if (components.path !== void 0) {
|
|
3902
|
+
if (!options.skipEscape) {
|
|
3903
|
+
components.path = escape(components.path);
|
|
3904
|
+
if (components.scheme !== void 0) {
|
|
3905
|
+
components.path = components.path.split("%3A").join(":");
|
|
3917
3906
|
}
|
|
3918
|
-
return newHost;
|
|
3919
3907
|
} else {
|
|
3920
|
-
|
|
3921
|
-
}
|
|
3922
|
-
}
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
if (
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3908
|
+
components.path = unescape(components.path);
|
|
3909
|
+
}
|
|
3910
|
+
}
|
|
3911
|
+
if (options.reference !== "suffix" && components.scheme) {
|
|
3912
|
+
uriTokens.push(components.scheme);
|
|
3913
|
+
uriTokens.push(":");
|
|
3914
|
+
}
|
|
3915
|
+
const authority = recomposeAuthority(components, options);
|
|
3916
|
+
if (authority !== void 0) {
|
|
3917
|
+
if (options.reference !== "suffix") {
|
|
3918
|
+
uriTokens.push("//");
|
|
3919
|
+
}
|
|
3920
|
+
uriTokens.push(authority);
|
|
3921
|
+
if (components.path && components.path.charAt(0) !== "/") {
|
|
3922
|
+
uriTokens.push("/");
|
|
3923
|
+
}
|
|
3924
|
+
}
|
|
3925
|
+
if (components.path !== void 0) {
|
|
3926
|
+
let s = components.path;
|
|
3927
|
+
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
3928
|
+
s = removeDotSegments(s);
|
|
3929
|
+
}
|
|
3930
|
+
if (authority === void 0) {
|
|
3931
|
+
s = s.replace(/^\/\//u, "/%2F");
|
|
3932
|
+
}
|
|
3933
|
+
uriTokens.push(s);
|
|
3934
|
+
}
|
|
3935
|
+
if (components.query !== void 0) {
|
|
3936
|
+
uriTokens.push("?");
|
|
3937
|
+
uriTokens.push(components.query);
|
|
3938
|
+
}
|
|
3939
|
+
if (components.fragment !== void 0) {
|
|
3940
|
+
uriTokens.push("#");
|
|
3941
|
+
uriTokens.push(components.fragment);
|
|
3942
|
+
}
|
|
3943
|
+
return uriTokens.join("");
|
|
3944
|
+
}
|
|
3945
|
+
__name(serialize, "serialize");
|
|
3946
|
+
var hexLookUp = Array.from({ length: 127 }, (v, k) => /[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(k)));
|
|
3947
|
+
function nonSimpleDomain(value) {
|
|
3948
|
+
let code = 0;
|
|
3949
|
+
for (let i = 0, len = value.length; i < len; ++i) {
|
|
3950
|
+
code = value.charCodeAt(i);
|
|
3951
|
+
if (code > 126 || hexLookUp[code]) {
|
|
3952
|
+
return true;
|
|
3953
|
+
}
|
|
3954
|
+
}
|
|
3955
|
+
return false;
|
|
3956
|
+
}
|
|
3957
|
+
__name(nonSimpleDomain, "nonSimpleDomain");
|
|
3958
|
+
var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
3959
|
+
function parse(uri, opts) {
|
|
3960
|
+
const options = Object.assign({}, opts);
|
|
3961
|
+
const parsed = {
|
|
3962
|
+
scheme: void 0,
|
|
3963
|
+
userinfo: void 0,
|
|
3964
|
+
host: "",
|
|
3965
|
+
port: void 0,
|
|
3966
|
+
path: "",
|
|
3967
|
+
query: void 0,
|
|
3968
|
+
fragment: void 0
|
|
3969
|
+
};
|
|
3970
|
+
const gotEncoding = uri.indexOf("%") !== -1;
|
|
3971
|
+
let isIP = false;
|
|
3972
|
+
if (options.reference === "suffix") uri = (options.scheme ? options.scheme + ":" : "") + "//" + uri;
|
|
3973
|
+
const matches = uri.match(URI_PARSE);
|
|
3974
|
+
if (matches) {
|
|
3975
|
+
parsed.scheme = matches[1];
|
|
3976
|
+
parsed.userinfo = matches[3];
|
|
3977
|
+
parsed.host = matches[4];
|
|
3978
|
+
parsed.port = parseInt(matches[5], 10);
|
|
3979
|
+
parsed.path = matches[6] || "";
|
|
3980
|
+
parsed.query = matches[7];
|
|
3981
|
+
parsed.fragment = matches[8];
|
|
3982
|
+
if (isNaN(parsed.port)) {
|
|
3983
|
+
parsed.port = matches[5];
|
|
3984
|
+
}
|
|
3985
|
+
if (parsed.host) {
|
|
3986
|
+
const ipv4result = normalizeIPv4(parsed.host);
|
|
3987
|
+
if (ipv4result.isIPV4 === false) {
|
|
3988
|
+
const ipv6result = normalizeIPv6(ipv4result.host, { isIPV4: false });
|
|
3989
|
+
parsed.host = ipv6result.host.toLowerCase();
|
|
3990
|
+
isIP = ipv6result.isIPV6;
|
|
3982
3991
|
} else {
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
if (schemeHandler && schemeHandler.parse) {
|
|
3986
|
-
schemeHandler.parse(components, options);
|
|
3992
|
+
parsed.host = ipv4result.host;
|
|
3993
|
+
isIP = true;
|
|
3987
3994
|
}
|
|
3995
|
+
}
|
|
3996
|
+
if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && !parsed.path && parsed.query === void 0) {
|
|
3997
|
+
parsed.reference = "same-document";
|
|
3998
|
+
} else if (parsed.scheme === void 0) {
|
|
3999
|
+
parsed.reference = "relative";
|
|
4000
|
+
} else if (parsed.fragment === void 0) {
|
|
4001
|
+
parsed.reference = "absolute";
|
|
3988
4002
|
} else {
|
|
3989
|
-
|
|
3990
|
-
}
|
|
3991
|
-
return components;
|
|
3992
|
-
}
|
|
3993
|
-
__name(parse, "parse");
|
|
3994
|
-
function _recomposeAuthority(components, options) {
|
|
3995
|
-
var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
|
|
3996
|
-
var uriTokens = [];
|
|
3997
|
-
if (components.userinfo !== void 0) {
|
|
3998
|
-
uriTokens.push(components.userinfo);
|
|
3999
|
-
uriTokens.push("@");
|
|
4000
|
-
}
|
|
4001
|
-
if (components.host !== void 0) {
|
|
4002
|
-
uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function(_, $1, $2) {
|
|
4003
|
-
return "[" + $1 + ($2 ? "%25" + $2 : "") + "]";
|
|
4004
|
-
}));
|
|
4005
|
-
}
|
|
4006
|
-
if (typeof components.port === "number" || typeof components.port === "string") {
|
|
4007
|
-
uriTokens.push(":");
|
|
4008
|
-
uriTokens.push(String(components.port));
|
|
4009
|
-
}
|
|
4010
|
-
return uriTokens.length ? uriTokens.join("") : void 0;
|
|
4011
|
-
}
|
|
4012
|
-
__name(_recomposeAuthority, "_recomposeAuthority");
|
|
4013
|
-
var RDS1 = /^\.\.?\//;
|
|
4014
|
-
var RDS2 = /^\/\.(\/|$)/;
|
|
4015
|
-
var RDS3 = /^\/\.\.(\/|$)/;
|
|
4016
|
-
var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/;
|
|
4017
|
-
function removeDotSegments(input) {
|
|
4018
|
-
var output = [];
|
|
4019
|
-
while (input.length) {
|
|
4020
|
-
if (input.match(RDS1)) {
|
|
4021
|
-
input = input.replace(RDS1, "");
|
|
4022
|
-
} else if (input.match(RDS2)) {
|
|
4023
|
-
input = input.replace(RDS2, "/");
|
|
4024
|
-
} else if (input.match(RDS3)) {
|
|
4025
|
-
input = input.replace(RDS3, "/");
|
|
4026
|
-
output.pop();
|
|
4027
|
-
} else if (input === "." || input === "..") {
|
|
4028
|
-
input = "";
|
|
4029
|
-
} else {
|
|
4030
|
-
var im = input.match(RDS5);
|
|
4031
|
-
if (im) {
|
|
4032
|
-
var s = im[0];
|
|
4033
|
-
input = input.slice(s.length);
|
|
4034
|
-
output.push(s);
|
|
4035
|
-
} else {
|
|
4036
|
-
throw new Error("Unexpected dot segment condition");
|
|
4037
|
-
}
|
|
4038
|
-
}
|
|
4003
|
+
parsed.reference = "uri";
|
|
4039
4004
|
}
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
var uriTokens = [];
|
|
4047
|
-
var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
|
|
4048
|
-
if (schemeHandler && schemeHandler.serialize)
|
|
4049
|
-
schemeHandler.serialize(components, options);
|
|
4050
|
-
if (components.host) {
|
|
4051
|
-
if (protocol.IPV6ADDRESS.test(components.host)) {
|
|
4052
|
-
} else if (options.domainHost || schemeHandler && schemeHandler.domainHost) {
|
|
4005
|
+
if (options.reference && options.reference !== "suffix" && options.reference !== parsed.reference) {
|
|
4006
|
+
parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
|
|
4007
|
+
}
|
|
4008
|
+
const schemeHandler = SCHEMES[(options.scheme || parsed.scheme || "").toLowerCase()];
|
|
4009
|
+
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
|
|
4010
|
+
if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
4053
4011
|
try {
|
|
4054
|
-
|
|
4012
|
+
parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
|
|
4055
4013
|
} catch (e) {
|
|
4056
|
-
|
|
4014
|
+
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
4057
4015
|
}
|
|
4058
4016
|
}
|
|
4059
4017
|
}
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
uriTokens.push(":");
|
|
4064
|
-
}
|
|
4065
|
-
var authority = _recomposeAuthority(components, options);
|
|
4066
|
-
if (authority !== void 0) {
|
|
4067
|
-
if (options.reference !== "suffix") {
|
|
4068
|
-
uriTokens.push("//");
|
|
4018
|
+
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
4019
|
+
if (gotEncoding && parsed.scheme !== void 0) {
|
|
4020
|
+
parsed.scheme = unescape(parsed.scheme);
|
|
4069
4021
|
}
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
uriTokens.push("/");
|
|
4022
|
+
if (gotEncoding && parsed.userinfo !== void 0) {
|
|
4023
|
+
parsed.userinfo = unescape(parsed.userinfo);
|
|
4073
4024
|
}
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
var s = components.path;
|
|
4077
|
-
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
4078
|
-
s = removeDotSegments(s);
|
|
4025
|
+
if (gotEncoding && parsed.host !== void 0) {
|
|
4026
|
+
parsed.host = unescape(parsed.host);
|
|
4079
4027
|
}
|
|
4080
|
-
if (
|
|
4081
|
-
|
|
4028
|
+
if (parsed.path !== void 0 && parsed.path.length) {
|
|
4029
|
+
parsed.path = escape(unescape(parsed.path));
|
|
4030
|
+
}
|
|
4031
|
+
if (parsed.fragment !== void 0 && parsed.fragment.length) {
|
|
4032
|
+
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
4082
4033
|
}
|
|
4083
|
-
uriTokens.push(s);
|
|
4084
|
-
}
|
|
4085
|
-
if (components.query !== void 0) {
|
|
4086
|
-
uriTokens.push("?");
|
|
4087
|
-
uriTokens.push(components.query);
|
|
4088
4034
|
}
|
|
4089
|
-
if (
|
|
4090
|
-
|
|
4091
|
-
uriTokens.push(components.fragment);
|
|
4035
|
+
if (schemeHandler && schemeHandler.parse) {
|
|
4036
|
+
schemeHandler.parse(parsed, options);
|
|
4092
4037
|
}
|
|
4093
|
-
|
|
4038
|
+
} else {
|
|
4039
|
+
parsed.error = parsed.error || "URI can not be parsed.";
|
|
4094
4040
|
}
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
target.path = removeDotSegments(relative.path || "");
|
|
4111
|
-
target.query = relative.query;
|
|
4112
|
-
} else {
|
|
4113
|
-
if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
|
|
4114
|
-
target.userinfo = relative.userinfo;
|
|
4115
|
-
target.host = relative.host;
|
|
4116
|
-
target.port = relative.port;
|
|
4117
|
-
target.path = removeDotSegments(relative.path || "");
|
|
4118
|
-
target.query = relative.query;
|
|
4119
|
-
} else {
|
|
4120
|
-
if (!relative.path) {
|
|
4121
|
-
target.path = base2.path;
|
|
4122
|
-
if (relative.query !== void 0) {
|
|
4123
|
-
target.query = relative.query;
|
|
4124
|
-
} else {
|
|
4125
|
-
target.query = base2.query;
|
|
4126
|
-
}
|
|
4127
|
-
} else {
|
|
4128
|
-
if (relative.path.charAt(0) === "/") {
|
|
4129
|
-
target.path = removeDotSegments(relative.path);
|
|
4130
|
-
} else {
|
|
4131
|
-
if ((base2.userinfo !== void 0 || base2.host !== void 0 || base2.port !== void 0) && !base2.path) {
|
|
4132
|
-
target.path = "/" + relative.path;
|
|
4133
|
-
} else if (!base2.path) {
|
|
4134
|
-
target.path = relative.path;
|
|
4135
|
-
} else {
|
|
4136
|
-
target.path = base2.path.slice(0, base2.path.lastIndexOf("/") + 1) + relative.path;
|
|
4137
|
-
}
|
|
4138
|
-
target.path = removeDotSegments(target.path);
|
|
4139
|
-
}
|
|
4140
|
-
target.query = relative.query;
|
|
4141
|
-
}
|
|
4142
|
-
target.userinfo = base2.userinfo;
|
|
4143
|
-
target.host = base2.host;
|
|
4144
|
-
target.port = base2.port;
|
|
4145
|
-
}
|
|
4146
|
-
target.scheme = base2.scheme;
|
|
4147
|
-
}
|
|
4148
|
-
target.fragment = relative.fragment;
|
|
4149
|
-
return target;
|
|
4150
|
-
}
|
|
4151
|
-
__name(resolveComponents, "resolveComponents");
|
|
4152
|
-
function resolve(baseURI, relativeURI, options) {
|
|
4153
|
-
var schemelessOptions = assign({ scheme: "null" }, options);
|
|
4154
|
-
return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
|
|
4155
|
-
}
|
|
4156
|
-
__name(resolve, "resolve");
|
|
4157
|
-
function normalize(uri, options) {
|
|
4158
|
-
if (typeof uri === "string") {
|
|
4159
|
-
uri = serialize(parse(uri, options), options);
|
|
4160
|
-
} else if (typeOf(uri) === "object") {
|
|
4161
|
-
uri = parse(serialize(uri, options), options);
|
|
4162
|
-
}
|
|
4163
|
-
return uri;
|
|
4164
|
-
}
|
|
4165
|
-
__name(normalize, "normalize");
|
|
4166
|
-
function equal(uriA, uriB, options) {
|
|
4167
|
-
if (typeof uriA === "string") {
|
|
4168
|
-
uriA = serialize(parse(uriA, options), options);
|
|
4169
|
-
} else if (typeOf(uriA) === "object") {
|
|
4170
|
-
uriA = serialize(uriA, options);
|
|
4171
|
-
}
|
|
4172
|
-
if (typeof uriB === "string") {
|
|
4173
|
-
uriB = serialize(parse(uriB, options), options);
|
|
4174
|
-
} else if (typeOf(uriB) === "object") {
|
|
4175
|
-
uriB = serialize(uriB, options);
|
|
4176
|
-
}
|
|
4177
|
-
return uriA === uriB;
|
|
4178
|
-
}
|
|
4179
|
-
__name(equal, "equal");
|
|
4180
|
-
function escapeComponent(str, options) {
|
|
4181
|
-
return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);
|
|
4182
|
-
}
|
|
4183
|
-
__name(escapeComponent, "escapeComponent");
|
|
4184
|
-
function unescapeComponent(str, options) {
|
|
4185
|
-
return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
|
|
4186
|
-
}
|
|
4187
|
-
__name(unescapeComponent, "unescapeComponent");
|
|
4188
|
-
var handler = {
|
|
4189
|
-
scheme: "http",
|
|
4190
|
-
domainHost: true,
|
|
4191
|
-
parse: /* @__PURE__ */ __name(function parse2(components, options) {
|
|
4192
|
-
if (!components.host) {
|
|
4193
|
-
components.error = components.error || "HTTP URIs must have a host.";
|
|
4194
|
-
}
|
|
4195
|
-
return components;
|
|
4196
|
-
}, "parse"),
|
|
4197
|
-
serialize: /* @__PURE__ */ __name(function serialize2(components, options) {
|
|
4198
|
-
var secure = String(components.scheme).toLowerCase() === "https";
|
|
4199
|
-
if (components.port === (secure ? 443 : 80) || components.port === "") {
|
|
4200
|
-
components.port = void 0;
|
|
4201
|
-
}
|
|
4202
|
-
if (!components.path) {
|
|
4203
|
-
components.path = "/";
|
|
4204
|
-
}
|
|
4205
|
-
return components;
|
|
4206
|
-
}, "serialize")
|
|
4207
|
-
};
|
|
4208
|
-
var handler$1 = {
|
|
4209
|
-
scheme: "https",
|
|
4210
|
-
domainHost: handler.domainHost,
|
|
4211
|
-
parse: handler.parse,
|
|
4212
|
-
serialize: handler.serialize
|
|
4213
|
-
};
|
|
4214
|
-
function isSecure(wsComponents) {
|
|
4215
|
-
return typeof wsComponents.secure === "boolean" ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
|
|
4216
|
-
}
|
|
4217
|
-
__name(isSecure, "isSecure");
|
|
4218
|
-
var handler$2 = {
|
|
4219
|
-
scheme: "ws",
|
|
4220
|
-
domainHost: true,
|
|
4221
|
-
parse: /* @__PURE__ */ __name(function parse2(components, options) {
|
|
4222
|
-
var wsComponents = components;
|
|
4223
|
-
wsComponents.secure = isSecure(wsComponents);
|
|
4224
|
-
wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : "");
|
|
4225
|
-
wsComponents.path = void 0;
|
|
4226
|
-
wsComponents.query = void 0;
|
|
4227
|
-
return wsComponents;
|
|
4228
|
-
}, "parse"),
|
|
4229
|
-
serialize: /* @__PURE__ */ __name(function serialize2(wsComponents, options) {
|
|
4230
|
-
if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
|
|
4231
|
-
wsComponents.port = void 0;
|
|
4232
|
-
}
|
|
4233
|
-
if (typeof wsComponents.secure === "boolean") {
|
|
4234
|
-
wsComponents.scheme = wsComponents.secure ? "wss" : "ws";
|
|
4235
|
-
wsComponents.secure = void 0;
|
|
4236
|
-
}
|
|
4237
|
-
if (wsComponents.resourceName) {
|
|
4238
|
-
var _wsComponents$resourc = wsComponents.resourceName.split("?"), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), path = _wsComponents$resourc2[0], query = _wsComponents$resourc2[1];
|
|
4239
|
-
wsComponents.path = path && path !== "/" ? path : void 0;
|
|
4240
|
-
wsComponents.query = query;
|
|
4241
|
-
wsComponents.resourceName = void 0;
|
|
4242
|
-
}
|
|
4243
|
-
wsComponents.fragment = void 0;
|
|
4244
|
-
return wsComponents;
|
|
4245
|
-
}, "serialize")
|
|
4246
|
-
};
|
|
4247
|
-
var handler$3 = {
|
|
4248
|
-
scheme: "wss",
|
|
4249
|
-
domainHost: handler$2.domainHost,
|
|
4250
|
-
parse: handler$2.parse,
|
|
4251
|
-
serialize: handler$2.serialize
|
|
4252
|
-
};
|
|
4253
|
-
var O = {};
|
|
4254
|
-
var isIRI = true;
|
|
4255
|
-
var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]";
|
|
4256
|
-
var HEXDIG$$ = "[0-9A-Fa-f]";
|
|
4257
|
-
var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$));
|
|
4258
|
-
var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";
|
|
4259
|
-
var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";
|
|
4260
|
-
var VCHAR$$ = merge(QTEXT$$, '[\\"\\\\]');
|
|
4261
|
-
var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";
|
|
4262
|
-
var UNRESERVED = new RegExp(UNRESERVED$$, "g");
|
|
4263
|
-
var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g");
|
|
4264
|
-
var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g");
|
|
4265
|
-
var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g");
|
|
4266
|
-
var NOT_HFVALUE = NOT_HFNAME;
|
|
4267
|
-
function decodeUnreserved(str) {
|
|
4268
|
-
var decStr = pctDecChars(str);
|
|
4269
|
-
return !decStr.match(UNRESERVED) ? str : decStr;
|
|
4270
|
-
}
|
|
4271
|
-
__name(decodeUnreserved, "decodeUnreserved");
|
|
4272
|
-
var handler$4 = {
|
|
4273
|
-
scheme: "mailto",
|
|
4274
|
-
parse: /* @__PURE__ */ __name(function parse$$1(components, options) {
|
|
4275
|
-
var mailtoComponents = components;
|
|
4276
|
-
var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
|
|
4277
|
-
mailtoComponents.path = void 0;
|
|
4278
|
-
if (mailtoComponents.query) {
|
|
4279
|
-
var unknownHeaders = false;
|
|
4280
|
-
var headers = {};
|
|
4281
|
-
var hfields = mailtoComponents.query.split("&");
|
|
4282
|
-
for (var x = 0, xl = hfields.length; x < xl; ++x) {
|
|
4283
|
-
var hfield = hfields[x].split("=");
|
|
4284
|
-
switch (hfield[0]) {
|
|
4285
|
-
case "to":
|
|
4286
|
-
var toAddrs = hfield[1].split(",");
|
|
4287
|
-
for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) {
|
|
4288
|
-
to.push(toAddrs[_x]);
|
|
4289
|
-
}
|
|
4290
|
-
break;
|
|
4291
|
-
case "subject":
|
|
4292
|
-
mailtoComponents.subject = unescapeComponent(hfield[1], options);
|
|
4293
|
-
break;
|
|
4294
|
-
case "body":
|
|
4295
|
-
mailtoComponents.body = unescapeComponent(hfield[1], options);
|
|
4296
|
-
break;
|
|
4297
|
-
default:
|
|
4298
|
-
unknownHeaders = true;
|
|
4299
|
-
headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);
|
|
4300
|
-
break;
|
|
4301
|
-
}
|
|
4302
|
-
}
|
|
4303
|
-
if (unknownHeaders)
|
|
4304
|
-
mailtoComponents.headers = headers;
|
|
4305
|
-
}
|
|
4306
|
-
mailtoComponents.query = void 0;
|
|
4307
|
-
for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {
|
|
4308
|
-
var addr = to[_x2].split("@");
|
|
4309
|
-
addr[0] = unescapeComponent(addr[0]);
|
|
4310
|
-
if (!options.unicodeSupport) {
|
|
4311
|
-
try {
|
|
4312
|
-
addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());
|
|
4313
|
-
} catch (e) {
|
|
4314
|
-
mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e;
|
|
4315
|
-
}
|
|
4316
|
-
} else {
|
|
4317
|
-
addr[1] = unescapeComponent(addr[1], options).toLowerCase();
|
|
4318
|
-
}
|
|
4319
|
-
to[_x2] = addr.join("@");
|
|
4320
|
-
}
|
|
4321
|
-
return mailtoComponents;
|
|
4322
|
-
}, "parse$$1"),
|
|
4323
|
-
serialize: /* @__PURE__ */ __name(function serialize$$1(mailtoComponents, options) {
|
|
4324
|
-
var components = mailtoComponents;
|
|
4325
|
-
var to = toArray(mailtoComponents.to);
|
|
4326
|
-
if (to) {
|
|
4327
|
-
for (var x = 0, xl = to.length; x < xl; ++x) {
|
|
4328
|
-
var toAddr = String(to[x]);
|
|
4329
|
-
var atIdx = toAddr.lastIndexOf("@");
|
|
4330
|
-
var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);
|
|
4331
|
-
var domain = toAddr.slice(atIdx + 1);
|
|
4332
|
-
try {
|
|
4333
|
-
domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain);
|
|
4334
|
-
} catch (e) {
|
|
4335
|
-
components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
|
|
4336
|
-
}
|
|
4337
|
-
to[x] = localPart + "@" + domain;
|
|
4338
|
-
}
|
|
4339
|
-
components.path = to.join(",");
|
|
4340
|
-
}
|
|
4341
|
-
var headers = mailtoComponents.headers = mailtoComponents.headers || {};
|
|
4342
|
-
if (mailtoComponents.subject)
|
|
4343
|
-
headers["subject"] = mailtoComponents.subject;
|
|
4344
|
-
if (mailtoComponents.body)
|
|
4345
|
-
headers["body"] = mailtoComponents.body;
|
|
4346
|
-
var fields = [];
|
|
4347
|
-
for (var name in headers) {
|
|
4348
|
-
if (headers[name] !== O[name]) {
|
|
4349
|
-
fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));
|
|
4350
|
-
}
|
|
4351
|
-
}
|
|
4352
|
-
if (fields.length) {
|
|
4353
|
-
components.query = fields.join("&");
|
|
4354
|
-
}
|
|
4355
|
-
return components;
|
|
4356
|
-
}, "serialize$$1")
|
|
4357
|
-
};
|
|
4358
|
-
var URN_PARSE = /^([^\:]+)\:(.*)/;
|
|
4359
|
-
var handler$5 = {
|
|
4360
|
-
scheme: "urn",
|
|
4361
|
-
parse: /* @__PURE__ */ __name(function parse$$1(components, options) {
|
|
4362
|
-
var matches = components.path && components.path.match(URN_PARSE);
|
|
4363
|
-
var urnComponents = components;
|
|
4364
|
-
if (matches) {
|
|
4365
|
-
var scheme = options.scheme || urnComponents.scheme || "urn";
|
|
4366
|
-
var nid = matches[1].toLowerCase();
|
|
4367
|
-
var nss = matches[2];
|
|
4368
|
-
var urnScheme = scheme + ":" + (options.nid || nid);
|
|
4369
|
-
var schemeHandler = SCHEMES[urnScheme];
|
|
4370
|
-
urnComponents.nid = nid;
|
|
4371
|
-
urnComponents.nss = nss;
|
|
4372
|
-
urnComponents.path = void 0;
|
|
4373
|
-
if (schemeHandler) {
|
|
4374
|
-
urnComponents = schemeHandler.parse(urnComponents, options);
|
|
4375
|
-
}
|
|
4376
|
-
} else {
|
|
4377
|
-
urnComponents.error = urnComponents.error || "URN can not be parsed.";
|
|
4378
|
-
}
|
|
4379
|
-
return urnComponents;
|
|
4380
|
-
}, "parse$$1"),
|
|
4381
|
-
serialize: /* @__PURE__ */ __name(function serialize$$1(urnComponents, options) {
|
|
4382
|
-
var scheme = options.scheme || urnComponents.scheme || "urn";
|
|
4383
|
-
var nid = urnComponents.nid;
|
|
4384
|
-
var urnScheme = scheme + ":" + (options.nid || nid);
|
|
4385
|
-
var schemeHandler = SCHEMES[urnScheme];
|
|
4386
|
-
if (schemeHandler) {
|
|
4387
|
-
urnComponents = schemeHandler.serialize(urnComponents, options);
|
|
4388
|
-
}
|
|
4389
|
-
var uriComponents = urnComponents;
|
|
4390
|
-
var nss = urnComponents.nss;
|
|
4391
|
-
uriComponents.path = (nid || options.nid) + ":" + nss;
|
|
4392
|
-
return uriComponents;
|
|
4393
|
-
}, "serialize$$1")
|
|
4394
|
-
};
|
|
4395
|
-
var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
|
|
4396
|
-
var handler$6 = {
|
|
4397
|
-
scheme: "urn:uuid",
|
|
4398
|
-
parse: /* @__PURE__ */ __name(function parse2(urnComponents, options) {
|
|
4399
|
-
var uuidComponents = urnComponents;
|
|
4400
|
-
uuidComponents.uuid = uuidComponents.nss;
|
|
4401
|
-
uuidComponents.nss = void 0;
|
|
4402
|
-
if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
|
|
4403
|
-
uuidComponents.error = uuidComponents.error || "UUID is not valid.";
|
|
4404
|
-
}
|
|
4405
|
-
return uuidComponents;
|
|
4406
|
-
}, "parse"),
|
|
4407
|
-
serialize: /* @__PURE__ */ __name(function serialize2(uuidComponents, options) {
|
|
4408
|
-
var urnComponents = uuidComponents;
|
|
4409
|
-
urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
|
|
4410
|
-
return urnComponents;
|
|
4411
|
-
}, "serialize")
|
|
4412
|
-
};
|
|
4413
|
-
SCHEMES[handler.scheme] = handler;
|
|
4414
|
-
SCHEMES[handler$1.scheme] = handler$1;
|
|
4415
|
-
SCHEMES[handler$2.scheme] = handler$2;
|
|
4416
|
-
SCHEMES[handler$3.scheme] = handler$3;
|
|
4417
|
-
SCHEMES[handler$4.scheme] = handler$4;
|
|
4418
|
-
SCHEMES[handler$5.scheme] = handler$5;
|
|
4419
|
-
SCHEMES[handler$6.scheme] = handler$6;
|
|
4420
|
-
exports2.SCHEMES = SCHEMES;
|
|
4421
|
-
exports2.pctEncChar = pctEncChar;
|
|
4422
|
-
exports2.pctDecChars = pctDecChars;
|
|
4423
|
-
exports2.parse = parse;
|
|
4424
|
-
exports2.removeDotSegments = removeDotSegments;
|
|
4425
|
-
exports2.serialize = serialize;
|
|
4426
|
-
exports2.resolveComponents = resolveComponents;
|
|
4427
|
-
exports2.resolve = resolve;
|
|
4428
|
-
exports2.normalize = normalize;
|
|
4429
|
-
exports2.equal = equal;
|
|
4430
|
-
exports2.escapeComponent = escapeComponent;
|
|
4431
|
-
exports2.unescapeComponent = unescapeComponent;
|
|
4432
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
4433
|
-
});
|
|
4041
|
+
return parsed;
|
|
4042
|
+
}
|
|
4043
|
+
__name(parse, "parse");
|
|
4044
|
+
var fastUri = {
|
|
4045
|
+
SCHEMES,
|
|
4046
|
+
normalize,
|
|
4047
|
+
resolve,
|
|
4048
|
+
resolveComponents,
|
|
4049
|
+
equal,
|
|
4050
|
+
serialize,
|
|
4051
|
+
parse
|
|
4052
|
+
};
|
|
4053
|
+
module.exports = fastUri;
|
|
4054
|
+
module.exports.default = fastUri;
|
|
4055
|
+
module.exports.fastUri = fastUri;
|
|
4434
4056
|
}
|
|
4435
4057
|
});
|
|
4436
4058
|
|
|
@@ -4439,7 +4061,7 @@ var require_uri = __commonJS({
|
|
|
4439
4061
|
"node_modules/ajv/dist/runtime/uri.js"(exports) {
|
|
4440
4062
|
"use strict";
|
|
4441
4063
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4442
|
-
var uri =
|
|
4064
|
+
var uri = require_fast_uri();
|
|
4443
4065
|
uri.code = 'require("ajv/dist/runtime/uri").default';
|
|
4444
4066
|
exports.default = uri;
|
|
4445
4067
|
}
|
|
@@ -4452,28 +4074,28 @@ var require_core = __commonJS({
|
|
|
4452
4074
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4453
4075
|
exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
|
|
4454
4076
|
var validate_1 = require_validate();
|
|
4455
|
-
Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() {
|
|
4077
|
+
Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
4456
4078
|
return validate_1.KeywordCxt;
|
|
4457
|
-
} });
|
|
4079
|
+
}, "get") });
|
|
4458
4080
|
var codegen_1 = require_codegen();
|
|
4459
|
-
Object.defineProperty(exports, "_", { enumerable: true, get: function() {
|
|
4081
|
+
Object.defineProperty(exports, "_", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
4460
4082
|
return codegen_1._;
|
|
4461
|
-
} });
|
|
4462
|
-
Object.defineProperty(exports, "str", { enumerable: true, get: function() {
|
|
4083
|
+
}, "get") });
|
|
4084
|
+
Object.defineProperty(exports, "str", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
4463
4085
|
return codegen_1.str;
|
|
4464
|
-
} });
|
|
4465
|
-
Object.defineProperty(exports, "stringify", { enumerable: true, get: function() {
|
|
4086
|
+
}, "get") });
|
|
4087
|
+
Object.defineProperty(exports, "stringify", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
4466
4088
|
return codegen_1.stringify;
|
|
4467
|
-
} });
|
|
4468
|
-
Object.defineProperty(exports, "nil", { enumerable: true, get: function() {
|
|
4089
|
+
}, "get") });
|
|
4090
|
+
Object.defineProperty(exports, "nil", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
4469
4091
|
return codegen_1.nil;
|
|
4470
|
-
} });
|
|
4471
|
-
Object.defineProperty(exports, "Name", { enumerable: true, get: function() {
|
|
4092
|
+
}, "get") });
|
|
4093
|
+
Object.defineProperty(exports, "Name", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
4472
4094
|
return codegen_1.Name;
|
|
4473
|
-
} });
|
|
4474
|
-
Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function() {
|
|
4095
|
+
}, "get") });
|
|
4096
|
+
Object.defineProperty(exports, "CodeGen", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
4475
4097
|
return codegen_1.CodeGen;
|
|
4476
|
-
} });
|
|
4098
|
+
}, "get") });
|
|
4477
4099
|
var validation_error_1 = require_validation_error();
|
|
4478
4100
|
var ref_error_1 = require_ref_error();
|
|
4479
4101
|
var rules_1 = require_rules();
|
|
@@ -5259,8 +4881,8 @@ var require_limitNumber = __commonJS({
|
|
|
5259
4881
|
exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }
|
|
5260
4882
|
};
|
|
5261
4883
|
var error = {
|
|
5262
|
-
message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`,
|
|
5263
|
-
params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}
|
|
4884
|
+
message: /* @__PURE__ */ __name(({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`, "message"),
|
|
4885
|
+
params: /* @__PURE__ */ __name(({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`, "params")
|
|
5264
4886
|
};
|
|
5265
4887
|
var def = {
|
|
5266
4888
|
keyword: Object.keys(KWDs),
|
|
@@ -5284,8 +4906,8 @@ var require_multipleOf = __commonJS({
|
|
|
5284
4906
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5285
4907
|
var codegen_1 = require_codegen();
|
|
5286
4908
|
var error = {
|
|
5287
|
-
message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`,
|
|
5288
|
-
params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}
|
|
4909
|
+
message: /* @__PURE__ */ __name(({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`, "message"),
|
|
4910
|
+
params: /* @__PURE__ */ __name(({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}`, "params")
|
|
5289
4911
|
};
|
|
5290
4912
|
var def = {
|
|
5291
4913
|
keyword: "multipleOf",
|
|
@@ -5345,7 +4967,7 @@ var require_limitLength = __commonJS({
|
|
|
5345
4967
|
const comp = keyword === "maxLength" ? "more" : "fewer";
|
|
5346
4968
|
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`;
|
|
5347
4969
|
},
|
|
5348
|
-
params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}
|
|
4970
|
+
params: /* @__PURE__ */ __name(({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`, "params")
|
|
5349
4971
|
};
|
|
5350
4972
|
var def = {
|
|
5351
4973
|
keyword: ["maxLength", "minLength"],
|
|
@@ -5372,8 +4994,8 @@ var require_pattern = __commonJS({
|
|
|
5372
4994
|
var code_1 = require_code2();
|
|
5373
4995
|
var codegen_1 = require_codegen();
|
|
5374
4996
|
var error = {
|
|
5375
|
-
message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
|
|
5376
|
-
params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}
|
|
4997
|
+
message: /* @__PURE__ */ __name(({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`, "message"),
|
|
4998
|
+
params: /* @__PURE__ */ __name(({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}`, "params")
|
|
5377
4999
|
};
|
|
5378
5000
|
var def = {
|
|
5379
5001
|
keyword: "pattern",
|
|
@@ -5403,7 +5025,7 @@ var require_limitProperties = __commonJS({
|
|
|
5403
5025
|
const comp = keyword === "maxProperties" ? "more" : "fewer";
|
|
5404
5026
|
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`;
|
|
5405
5027
|
},
|
|
5406
|
-
params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}
|
|
5028
|
+
params: /* @__PURE__ */ __name(({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`, "params")
|
|
5407
5029
|
};
|
|
5408
5030
|
var def = {
|
|
5409
5031
|
keyword: ["maxProperties", "minProperties"],
|
|
@@ -5430,8 +5052,8 @@ var require_required = __commonJS({
|
|
|
5430
5052
|
var codegen_1 = require_codegen();
|
|
5431
5053
|
var util_1 = require_util();
|
|
5432
5054
|
var error = {
|
|
5433
|
-
message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`,
|
|
5434
|
-
params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}
|
|
5055
|
+
message: /* @__PURE__ */ __name(({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`, "message"),
|
|
5056
|
+
params: /* @__PURE__ */ __name(({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}`, "params")
|
|
5435
5057
|
};
|
|
5436
5058
|
var def = {
|
|
5437
5059
|
keyword: "required",
|
|
@@ -5518,7 +5140,7 @@ var require_limitItems = __commonJS({
|
|
|
5518
5140
|
const comp = keyword === "maxItems" ? "more" : "fewer";
|
|
5519
5141
|
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`;
|
|
5520
5142
|
},
|
|
5521
|
-
params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}
|
|
5143
|
+
params: /* @__PURE__ */ __name(({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`, "params")
|
|
5522
5144
|
};
|
|
5523
5145
|
var def = {
|
|
5524
5146
|
keyword: ["maxItems", "minItems"],
|
|
@@ -5557,8 +5179,8 @@ var require_uniqueItems = __commonJS({
|
|
|
5557
5179
|
var util_1 = require_util();
|
|
5558
5180
|
var equal_1 = require_equal();
|
|
5559
5181
|
var error = {
|
|
5560
|
-
message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`,
|
|
5561
|
-
params: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}
|
|
5182
|
+
message: /* @__PURE__ */ __name(({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`, "message"),
|
|
5183
|
+
params: /* @__PURE__ */ __name(({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}`, "params")
|
|
5562
5184
|
};
|
|
5563
5185
|
var def = {
|
|
5564
5186
|
keyword: "uniqueItems",
|
|
@@ -5628,7 +5250,7 @@ var require_const = __commonJS({
|
|
|
5628
5250
|
var equal_1 = require_equal();
|
|
5629
5251
|
var error = {
|
|
5630
5252
|
message: "must be equal to constant",
|
|
5631
|
-
params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}
|
|
5253
|
+
params: /* @__PURE__ */ __name(({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}`, "params")
|
|
5632
5254
|
};
|
|
5633
5255
|
var def = {
|
|
5634
5256
|
keyword: "const",
|
|
@@ -5657,7 +5279,7 @@ var require_enum = __commonJS({
|
|
|
5657
5279
|
var equal_1 = require_equal();
|
|
5658
5280
|
var error = {
|
|
5659
5281
|
message: "must be equal to one of the allowed values",
|
|
5660
|
-
params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}
|
|
5282
|
+
params: /* @__PURE__ */ __name(({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}`, "params")
|
|
5661
5283
|
};
|
|
5662
5284
|
var def = {
|
|
5663
5285
|
keyword: "enum",
|
|
@@ -5745,8 +5367,8 @@ var require_additionalItems = __commonJS({
|
|
|
5745
5367
|
var codegen_1 = require_codegen();
|
|
5746
5368
|
var util_1 = require_util();
|
|
5747
5369
|
var error = {
|
|
5748
|
-
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
5749
|
-
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}
|
|
5370
|
+
message: /* @__PURE__ */ __name(({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, "message"),
|
|
5371
|
+
params: /* @__PURE__ */ __name(({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`, "params")
|
|
5750
5372
|
};
|
|
5751
5373
|
var def = {
|
|
5752
5374
|
keyword: "additionalItems",
|
|
@@ -5861,7 +5483,7 @@ var require_prefixItems = __commonJS({
|
|
|
5861
5483
|
type: "array",
|
|
5862
5484
|
schemaType: ["array"],
|
|
5863
5485
|
before: "uniqueItems",
|
|
5864
|
-
code: (cxt) => (0, items_1.validateTuple)(cxt, "items")
|
|
5486
|
+
code: /* @__PURE__ */ __name((cxt) => (0, items_1.validateTuple)(cxt, "items"), "code")
|
|
5865
5487
|
};
|
|
5866
5488
|
exports.default = def;
|
|
5867
5489
|
}
|
|
@@ -5877,8 +5499,8 @@ var require_items2020 = __commonJS({
|
|
|
5877
5499
|
var code_1 = require_code2();
|
|
5878
5500
|
var additionalItems_1 = require_additionalItems();
|
|
5879
5501
|
var error = {
|
|
5880
|
-
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
5881
|
-
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}
|
|
5502
|
+
message: /* @__PURE__ */ __name(({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, "message"),
|
|
5503
|
+
params: /* @__PURE__ */ __name(({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`, "params")
|
|
5882
5504
|
};
|
|
5883
5505
|
var def = {
|
|
5884
5506
|
keyword: "items",
|
|
@@ -5910,8 +5532,8 @@ var require_contains = __commonJS({
|
|
|
5910
5532
|
var codegen_1 = require_codegen();
|
|
5911
5533
|
var util_1 = require_util();
|
|
5912
5534
|
var error = {
|
|
5913
|
-
message: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1.str)`must contain at least ${min} valid item(s)` : (0, codegen_1.str)`must contain at least ${min} and no more than ${max} valid item(s)`,
|
|
5914
|
-
params: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}
|
|
5535
|
+
message: /* @__PURE__ */ __name(({ params: { min, max } }) => max === void 0 ? (0, codegen_1.str)`must contain at least ${min} valid item(s)` : (0, codegen_1.str)`must contain at least ${min} and no more than ${max} valid item(s)`, "message"),
|
|
5536
|
+
params: /* @__PURE__ */ __name(({ params: { min, max } }) => max === void 0 ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}`, "params")
|
|
5915
5537
|
};
|
|
5916
5538
|
var def = {
|
|
5917
5539
|
keyword: "contains",
|
|
@@ -6009,14 +5631,14 @@ var require_dependencies = __commonJS({
|
|
|
6009
5631
|
var util_1 = require_util();
|
|
6010
5632
|
var code_1 = require_code2();
|
|
6011
5633
|
exports.error = {
|
|
6012
|
-
message: ({ params: { property, depsCount, deps } }) => {
|
|
5634
|
+
message: /* @__PURE__ */ __name(({ params: { property, depsCount, deps } }) => {
|
|
6013
5635
|
const property_ies = depsCount === 1 ? "property" : "properties";
|
|
6014
5636
|
return (0, codegen_1.str)`must have ${property_ies} ${deps} when property ${property} is present`;
|
|
6015
|
-
},
|
|
6016
|
-
params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._)`{property: ${property},
|
|
5637
|
+
}, "message"),
|
|
5638
|
+
params: /* @__PURE__ */ __name(({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._)`{property: ${property},
|
|
6017
5639
|
missingProperty: ${missingProperty},
|
|
6018
5640
|
depsCount: ${depsCount},
|
|
6019
|
-
deps: ${deps}}
|
|
5641
|
+
deps: ${deps}}`, "params")
|
|
6020
5642
|
// TODO change to reference
|
|
6021
5643
|
};
|
|
6022
5644
|
var def = {
|
|
@@ -6105,7 +5727,7 @@ var require_propertyNames = __commonJS({
|
|
|
6105
5727
|
var util_1 = require_util();
|
|
6106
5728
|
var error = {
|
|
6107
5729
|
message: "property name must be valid",
|
|
6108
|
-
params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}
|
|
5730
|
+
params: /* @__PURE__ */ __name(({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}`, "params")
|
|
6109
5731
|
};
|
|
6110
5732
|
var def = {
|
|
6111
5733
|
keyword: "propertyNames",
|
|
@@ -6150,7 +5772,7 @@ var require_additionalProperties = __commonJS({
|
|
|
6150
5772
|
var util_1 = require_util();
|
|
6151
5773
|
var error = {
|
|
6152
5774
|
message: "must NOT have additional properties",
|
|
6153
|
-
params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}
|
|
5775
|
+
params: /* @__PURE__ */ __name(({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}`, "params")
|
|
6154
5776
|
};
|
|
6155
5777
|
var def = {
|
|
6156
5778
|
keyword: "additionalProperties",
|
|
@@ -6444,7 +6066,7 @@ var require_oneOf = __commonJS({
|
|
|
6444
6066
|
var util_1 = require_util();
|
|
6445
6067
|
var error = {
|
|
6446
6068
|
message: "must match exactly one schema in oneOf",
|
|
6447
|
-
params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}
|
|
6069
|
+
params: /* @__PURE__ */ __name(({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}`, "params")
|
|
6448
6070
|
};
|
|
6449
6071
|
var def = {
|
|
6450
6072
|
keyword: "oneOf",
|
|
@@ -6529,8 +6151,8 @@ var require_if = __commonJS({
|
|
|
6529
6151
|
var codegen_1 = require_codegen();
|
|
6530
6152
|
var util_1 = require_util();
|
|
6531
6153
|
var error = {
|
|
6532
|
-
message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`,
|
|
6533
|
-
params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}
|
|
6154
|
+
message: /* @__PURE__ */ __name(({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`, "message"),
|
|
6155
|
+
params: /* @__PURE__ */ __name(({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}`, "params")
|
|
6534
6156
|
};
|
|
6535
6157
|
var def = {
|
|
6536
6158
|
keyword: "if",
|
|
@@ -6667,8 +6289,8 @@ var require_format = __commonJS({
|
|
|
6667
6289
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6668
6290
|
var codegen_1 = require_codegen();
|
|
6669
6291
|
var error = {
|
|
6670
|
-
message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`,
|
|
6671
|
-
params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}
|
|
6292
|
+
message: /* @__PURE__ */ __name(({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`, "message"),
|
|
6293
|
+
params: /* @__PURE__ */ __name(({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}`, "params")
|
|
6672
6294
|
};
|
|
6673
6295
|
var def = {
|
|
6674
6296
|
keyword: "format",
|
|
@@ -6839,8 +6461,8 @@ var require_discriminator = __commonJS({
|
|
|
6839
6461
|
var ref_error_1 = require_ref_error();
|
|
6840
6462
|
var util_1 = require_util();
|
|
6841
6463
|
var error = {
|
|
6842
|
-
message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`,
|
|
6843
|
-
params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}
|
|
6464
|
+
message: /* @__PURE__ */ __name(({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`, "message"),
|
|
6465
|
+
params: /* @__PURE__ */ __name(({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`, "params")
|
|
6844
6466
|
};
|
|
6845
6467
|
var def = {
|
|
6846
6468
|
keyword: "discriminator",
|
|
@@ -7136,36 +6758,36 @@ var require_ajv = __commonJS({
|
|
|
7136
6758
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7137
6759
|
exports.default = Ajv;
|
|
7138
6760
|
var validate_1 = require_validate();
|
|
7139
|
-
Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() {
|
|
6761
|
+
Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
7140
6762
|
return validate_1.KeywordCxt;
|
|
7141
|
-
} });
|
|
6763
|
+
}, "get") });
|
|
7142
6764
|
var codegen_1 = require_codegen();
|
|
7143
|
-
Object.defineProperty(exports, "_", { enumerable: true, get: function() {
|
|
6765
|
+
Object.defineProperty(exports, "_", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
7144
6766
|
return codegen_1._;
|
|
7145
|
-
} });
|
|
7146
|
-
Object.defineProperty(exports, "str", { enumerable: true, get: function() {
|
|
6767
|
+
}, "get") });
|
|
6768
|
+
Object.defineProperty(exports, "str", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
7147
6769
|
return codegen_1.str;
|
|
7148
|
-
} });
|
|
7149
|
-
Object.defineProperty(exports, "stringify", { enumerable: true, get: function() {
|
|
6770
|
+
}, "get") });
|
|
6771
|
+
Object.defineProperty(exports, "stringify", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
7150
6772
|
return codegen_1.stringify;
|
|
7151
|
-
} });
|
|
7152
|
-
Object.defineProperty(exports, "nil", { enumerable: true, get: function() {
|
|
6773
|
+
}, "get") });
|
|
6774
|
+
Object.defineProperty(exports, "nil", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
7153
6775
|
return codegen_1.nil;
|
|
7154
|
-
} });
|
|
7155
|
-
Object.defineProperty(exports, "Name", { enumerable: true, get: function() {
|
|
6776
|
+
}, "get") });
|
|
6777
|
+
Object.defineProperty(exports, "Name", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
7156
6778
|
return codegen_1.Name;
|
|
7157
|
-
} });
|
|
7158
|
-
Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function() {
|
|
6779
|
+
}, "get") });
|
|
6780
|
+
Object.defineProperty(exports, "CodeGen", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
7159
6781
|
return codegen_1.CodeGen;
|
|
7160
|
-
} });
|
|
6782
|
+
}, "get") });
|
|
7161
6783
|
var validation_error_1 = require_validation_error();
|
|
7162
|
-
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function() {
|
|
6784
|
+
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
7163
6785
|
return validation_error_1.default;
|
|
7164
|
-
} });
|
|
6786
|
+
}, "get") });
|
|
7165
6787
|
var ref_error_1 = require_ref_error();
|
|
7166
|
-
Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function() {
|
|
6788
|
+
Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
7167
6789
|
return ref_error_1.default;
|
|
7168
|
-
} });
|
|
6790
|
+
}, "get") });
|
|
7169
6791
|
}
|
|
7170
6792
|
});
|
|
7171
6793
|
|
|
@@ -7183,8 +6805,10 @@ var require_formats = __commonJS({
|
|
|
7183
6805
|
// date: http://tools.ietf.org/html/rfc3339#section-5.6
|
|
7184
6806
|
date: fmtDef(date, compareDate),
|
|
7185
6807
|
// date-time: http://tools.ietf.org/html/rfc3339#section-5.6
|
|
7186
|
-
time: fmtDef(
|
|
7187
|
-
"date-time": fmtDef(
|
|
6808
|
+
time: fmtDef(getTime(true), compareTime),
|
|
6809
|
+
"date-time": fmtDef(getDateTime(true), compareDateTime),
|
|
6810
|
+
"iso-time": fmtDef(getTime(), compareIsoTime),
|
|
6811
|
+
"iso-date-time": fmtDef(getDateTime(), compareIsoDateTime),
|
|
7188
6812
|
// duration: https://tools.ietf.org/html/rfc3339#appendix-A
|
|
7189
6813
|
duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,
|
|
7190
6814
|
uri,
|
|
@@ -7197,7 +6821,7 @@ var require_formats = __commonJS({
|
|
|
7197
6821
|
email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
|
|
7198
6822
|
hostname: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,
|
|
7199
6823
|
// optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
|
|
7200
|
-
ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[
|
|
6824
|
+
ipv4: /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,
|
|
7201
6825
|
ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
|
|
7202
6826
|
regex,
|
|
7203
6827
|
// uuid: http://tools.ietf.org/html/rfc4122
|
|
@@ -7227,8 +6851,10 @@ var require_formats = __commonJS({
|
|
|
7227
6851
|
exports.fastFormats = {
|
|
7228
6852
|
...exports.fullFormats,
|
|
7229
6853
|
date: fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, compareDate),
|
|
7230
|
-
time: fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)
|
|
7231
|
-
"date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\
|
|
6854
|
+
time: fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareTime),
|
|
6855
|
+
"date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareDateTime),
|
|
6856
|
+
"iso-time": fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoTime),
|
|
6857
|
+
"iso-date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoDateTime),
|
|
7232
6858
|
// uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
|
|
7233
6859
|
uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
|
|
7234
6860
|
"uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
|
|
@@ -7264,41 +6890,75 @@ var require_formats = __commonJS({
|
|
|
7264
6890
|
return 0;
|
|
7265
6891
|
}
|
|
7266
6892
|
__name(compareDate, "compareDate");
|
|
7267
|
-
var TIME = /^(\d\d):(\d\d):(\d\d
|
|
7268
|
-
function
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
6893
|
+
var TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
6894
|
+
function getTime(strictTimeZone) {
|
|
6895
|
+
return /* @__PURE__ */ __name(function time(str) {
|
|
6896
|
+
const matches = TIME.exec(str);
|
|
6897
|
+
if (!matches)
|
|
6898
|
+
return false;
|
|
6899
|
+
const hr = +matches[1];
|
|
6900
|
+
const min = +matches[2];
|
|
6901
|
+
const sec = +matches[3];
|
|
6902
|
+
const tz = matches[4];
|
|
6903
|
+
const tzSign = matches[5] === "-" ? -1 : 1;
|
|
6904
|
+
const tzH = +(matches[6] || 0);
|
|
6905
|
+
const tzM = +(matches[7] || 0);
|
|
6906
|
+
if (tzH > 23 || tzM > 59 || strictTimeZone && !tz)
|
|
6907
|
+
return false;
|
|
6908
|
+
if (hr <= 23 && min <= 59 && sec < 60)
|
|
6909
|
+
return true;
|
|
6910
|
+
const utcMin = min - tzM * tzSign;
|
|
6911
|
+
const utcHr = hr - tzH * tzSign - (utcMin < 0 ? 1 : 0);
|
|
6912
|
+
return (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61;
|
|
6913
|
+
}, "time");
|
|
6914
|
+
}
|
|
6915
|
+
__name(getTime, "getTime");
|
|
6916
|
+
function compareTime(s1, s2) {
|
|
6917
|
+
if (!(s1 && s2))
|
|
6918
|
+
return void 0;
|
|
6919
|
+
const t1 = (/* @__PURE__ */ new Date("2020-01-01T" + s1)).valueOf();
|
|
6920
|
+
const t2 = (/* @__PURE__ */ new Date("2020-01-01T" + s2)).valueOf();
|
|
6921
|
+
if (!(t1 && t2))
|
|
6922
|
+
return void 0;
|
|
6923
|
+
return t1 - t2;
|
|
6924
|
+
}
|
|
6925
|
+
__name(compareTime, "compareTime");
|
|
6926
|
+
function compareIsoTime(t1, t2) {
|
|
7280
6927
|
if (!(t1 && t2))
|
|
7281
6928
|
return void 0;
|
|
7282
6929
|
const a1 = TIME.exec(t1);
|
|
7283
6930
|
const a2 = TIME.exec(t2);
|
|
7284
6931
|
if (!(a1 && a2))
|
|
7285
6932
|
return void 0;
|
|
7286
|
-
t1 = a1[1] + a1[2] + a1[3]
|
|
7287
|
-
t2 = a2[1] + a2[2] + a2[3]
|
|
6933
|
+
t1 = a1[1] + a1[2] + a1[3];
|
|
6934
|
+
t2 = a2[1] + a2[2] + a2[3];
|
|
7288
6935
|
if (t1 > t2)
|
|
7289
6936
|
return 1;
|
|
7290
6937
|
if (t1 < t2)
|
|
7291
6938
|
return -1;
|
|
7292
6939
|
return 0;
|
|
7293
6940
|
}
|
|
7294
|
-
__name(
|
|
6941
|
+
__name(compareIsoTime, "compareIsoTime");
|
|
7295
6942
|
var DATE_TIME_SEPARATOR = /t|\s/i;
|
|
7296
|
-
function
|
|
7297
|
-
const
|
|
7298
|
-
return
|
|
7299
|
-
|
|
7300
|
-
|
|
6943
|
+
function getDateTime(strictTimeZone) {
|
|
6944
|
+
const time = getTime(strictTimeZone);
|
|
6945
|
+
return /* @__PURE__ */ __name(function date_time(str) {
|
|
6946
|
+
const dateTime = str.split(DATE_TIME_SEPARATOR);
|
|
6947
|
+
return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1]);
|
|
6948
|
+
}, "date_time");
|
|
6949
|
+
}
|
|
6950
|
+
__name(getDateTime, "getDateTime");
|
|
7301
6951
|
function compareDateTime(dt1, dt2) {
|
|
6952
|
+
if (!(dt1 && dt2))
|
|
6953
|
+
return void 0;
|
|
6954
|
+
const d1 = new Date(dt1).valueOf();
|
|
6955
|
+
const d2 = new Date(dt2).valueOf();
|
|
6956
|
+
if (!(d1 && d2))
|
|
6957
|
+
return void 0;
|
|
6958
|
+
return d1 - d2;
|
|
6959
|
+
}
|
|
6960
|
+
__name(compareDateTime, "compareDateTime");
|
|
6961
|
+
function compareIsoDateTime(dt1, dt2) {
|
|
7302
6962
|
if (!(dt1 && dt2))
|
|
7303
6963
|
return void 0;
|
|
7304
6964
|
const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR);
|
|
@@ -7308,7 +6968,7 @@ var require_formats = __commonJS({
|
|
|
7308
6968
|
return void 0;
|
|
7309
6969
|
return res || compareTime(t1, t2);
|
|
7310
6970
|
}
|
|
7311
|
-
__name(
|
|
6971
|
+
__name(compareIsoDateTime, "compareIsoDateTime");
|
|
7312
6972
|
var NOT_URI_FRAGMENT = /\/|:/;
|
|
7313
6973
|
var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
7314
6974
|
function uri(str) {
|
|
@@ -7366,8 +7026,8 @@ var require_limit = __commonJS({
|
|
|
7366
7026
|
formatExclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }
|
|
7367
7027
|
};
|
|
7368
7028
|
var error = {
|
|
7369
|
-
message: ({ keyword, schemaCode }) => codegen_1.str`should be ${KWDs[keyword].okStr} ${schemaCode}`,
|
|
7370
|
-
params: ({ keyword, schemaCode }) => codegen_1._`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}
|
|
7029
|
+
message: /* @__PURE__ */ __name(({ keyword, schemaCode }) => (0, codegen_1.str)`should be ${KWDs[keyword].okStr} ${schemaCode}`, "message"),
|
|
7030
|
+
params: /* @__PURE__ */ __name(({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`, "params")
|
|
7371
7031
|
};
|
|
7372
7032
|
exports.formatLimitDefinition = {
|
|
7373
7033
|
keyword: Object.keys(KWDs),
|
|
@@ -7390,8 +7050,8 @@ var require_limit = __commonJS({
|
|
|
7390
7050
|
ref: self.formats,
|
|
7391
7051
|
code: opts.code.formats
|
|
7392
7052
|
});
|
|
7393
|
-
const fmt = gen.const("fmt", codegen_1._`${fmts}[${fCxt.schemaCode}]`);
|
|
7394
|
-
cxt.fail$data(codegen_1.or(codegen_1._`typeof ${fmt} != "object"`, codegen_1._`${fmt} instanceof RegExp`, codegen_1._`typeof ${fmt}.compare != "function"`, compareCode(fmt)));
|
|
7053
|
+
const fmt = gen.const("fmt", (0, codegen_1._)`${fmts}[${fCxt.schemaCode}]`);
|
|
7054
|
+
cxt.fail$data((0, codegen_1.or)((0, codegen_1._)`typeof ${fmt} != "object"`, (0, codegen_1._)`${fmt} instanceof RegExp`, (0, codegen_1._)`typeof ${fmt}.compare != "function"`, compareCode(fmt)));
|
|
7395
7055
|
}
|
|
7396
7056
|
__name(validate$DataFormat, "validate$DataFormat");
|
|
7397
7057
|
function validateFormat() {
|
|
@@ -7405,13 +7065,13 @@ var require_limit = __commonJS({
|
|
|
7405
7065
|
const fmt = gen.scopeValue("formats", {
|
|
7406
7066
|
key: format,
|
|
7407
7067
|
ref: fmtDef,
|
|
7408
|
-
code: opts.code.formats ? codegen_1._`${opts.code.formats}${codegen_1.getProperty(format)}` : void 0
|
|
7068
|
+
code: opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(format)}` : void 0
|
|
7409
7069
|
});
|
|
7410
7070
|
cxt.fail$data(compareCode(fmt));
|
|
7411
7071
|
}
|
|
7412
7072
|
__name(validateFormat, "validateFormat");
|
|
7413
7073
|
function compareCode(fmt) {
|
|
7414
|
-
return codegen_1._`${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword].fail} 0`;
|
|
7074
|
+
return (0, codegen_1._)`${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword].fail} 0`;
|
|
7415
7075
|
}
|
|
7416
7076
|
__name(compareCode, "compareCode");
|
|
7417
7077
|
},
|
|
@@ -7444,7 +7104,7 @@ var require_dist = __commonJS({
|
|
|
7444
7104
|
const list = opts.formats || formats_1.formatNames;
|
|
7445
7105
|
addFormats(ajv, list, formats, exportName);
|
|
7446
7106
|
if (opts.keywords)
|
|
7447
|
-
limit_1.default(ajv);
|
|
7107
|
+
(0, limit_1.default)(ajv);
|
|
7448
7108
|
return ajv;
|
|
7449
7109
|
}, "formatsPlugin");
|
|
7450
7110
|
formatsPlugin.get = (name, mode = "full") => {
|
|
@@ -7457,7 +7117,7 @@ var require_dist = __commonJS({
|
|
|
7457
7117
|
function addFormats(ajv, list, fs, exportName) {
|
|
7458
7118
|
var _a;
|
|
7459
7119
|
var _b;
|
|
7460
|
-
(_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : _b.formats = codegen_1._`require("ajv-formats/dist/formats").${exportName}`;
|
|
7120
|
+
(_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
7461
7121
|
for (const f of list)
|
|
7462
7122
|
ajv.addFormat(f, fs[f]);
|
|
7463
7123
|
}
|
|
@@ -8161,8 +7821,7 @@ var init_index_browser = __esm({
|
|
|
8161
7821
|
let j = step;
|
|
8162
7822
|
while (j--) {
|
|
8163
7823
|
id += alphabet[bytes[j] & mask] || "";
|
|
8164
|
-
if (id.length === size)
|
|
8165
|
-
return id;
|
|
7824
|
+
if (id.length === size) return id;
|
|
8166
7825
|
}
|
|
8167
7826
|
}
|
|
8168
7827
|
};
|
|
@@ -8213,8 +7872,7 @@ var require_Entity = __commonJS({
|
|
|
8213
7872
|
return Object.keys(this.validator.schema.properties);
|
|
8214
7873
|
}
|
|
8215
7874
|
#_setId(data) {
|
|
8216
|
-
if (data._id)
|
|
8217
|
-
data.id = data._id;
|
|
7875
|
+
if (data._id) data.id = data._id;
|
|
8218
7876
|
if (!data.id) {
|
|
8219
7877
|
data.id = this.constructor.generateId();
|
|
8220
7878
|
}
|
|
@@ -8222,8 +7880,7 @@ var require_Entity = __commonJS({
|
|
|
8222
7880
|
}
|
|
8223
7881
|
#_setProperties(data) {
|
|
8224
7882
|
this.schemaProperties.forEach((key) => {
|
|
8225
|
-
if (data[key] !== void 0)
|
|
8226
|
-
this[key] = data[key];
|
|
7883
|
+
if (data[key] !== void 0) this[key] = data[key];
|
|
8227
7884
|
});
|
|
8228
7885
|
}
|
|
8229
7886
|
#_setTimestamps(isNew) {
|
|
@@ -8358,9 +8015,9 @@ var require_Reservation = __commonJS({
|
|
|
8358
8015
|
value: schema
|
|
8359
8016
|
});
|
|
8360
8017
|
Object.defineProperty(Reservation.prototype, "validator", {
|
|
8361
|
-
get: function() {
|
|
8018
|
+
get: /* @__PURE__ */ __name(function() {
|
|
8362
8019
|
return validator;
|
|
8363
|
-
}
|
|
8020
|
+
}, "get")
|
|
8364
8021
|
});
|
|
8365
8022
|
Object.defineProperty(Reservation, "validProperties", {
|
|
8366
8023
|
value: Object.keys(schema.properties)
|
|
@@ -8475,8 +8132,7 @@ var require_MediaFile = __commonJS({
|
|
|
8475
8132
|
createImageVariant(params) {
|
|
8476
8133
|
if (this.mimeType != "image/*")
|
|
8477
8134
|
throw new RequestError("Only dynamic images can have variants");
|
|
8478
|
-
if (!this.url)
|
|
8479
|
-
throw new RequestError("MediaFile has no url");
|
|
8135
|
+
if (!this.url) throw new RequestError("MediaFile has no url");
|
|
8480
8136
|
const query = Object.keys(params).map((key) => `${key}=${params[key]}`).join(",");
|
|
8481
8137
|
return this.url.replace(/\/public$/, `/${query}`);
|
|
8482
8138
|
}
|
|
@@ -8485,9 +8141,9 @@ var require_MediaFile = __commonJS({
|
|
|
8485
8141
|
value: schema
|
|
8486
8142
|
});
|
|
8487
8143
|
Object.defineProperty(MediaFile.prototype, "validator", {
|
|
8488
|
-
get: function() {
|
|
8144
|
+
get: /* @__PURE__ */ __name(function() {
|
|
8489
8145
|
return validator;
|
|
8490
|
-
}
|
|
8146
|
+
}, "get")
|
|
8491
8147
|
});
|
|
8492
8148
|
Object.defineProperty(MediaFile, "validProperties", {
|
|
8493
8149
|
value: Object.keys(schema.properties)
|
|
@@ -8572,9 +8228,9 @@ var require_Switch = __commonJS({
|
|
|
8572
8228
|
value: schema
|
|
8573
8229
|
});
|
|
8574
8230
|
Object.defineProperty(Switch.prototype, "validator", {
|
|
8575
|
-
get: function() {
|
|
8231
|
+
get: /* @__PURE__ */ __name(function() {
|
|
8576
8232
|
return validator;
|
|
8577
|
-
}
|
|
8233
|
+
}, "get")
|
|
8578
8234
|
});
|
|
8579
8235
|
Object.defineProperty(Switch, "validProperties", {
|
|
8580
8236
|
value: Object.keys(schema.properties)
|
|
@@ -8703,9 +8359,9 @@ var require_Alarm = __commonJS({
|
|
|
8703
8359
|
value: schema
|
|
8704
8360
|
});
|
|
8705
8361
|
Object.defineProperty(Alarm.prototype, "validator", {
|
|
8706
|
-
get: function() {
|
|
8362
|
+
get: /* @__PURE__ */ __name(function() {
|
|
8707
8363
|
return validator;
|
|
8708
|
-
}
|
|
8364
|
+
}, "get")
|
|
8709
8365
|
});
|
|
8710
8366
|
Object.defineProperty(Alarm, "validProperties", {
|
|
8711
8367
|
value: Object.keys(schema.properties)
|
|
@@ -8803,9 +8459,9 @@ var require_Dimmer = __commonJS({
|
|
|
8803
8459
|
value: schema
|
|
8804
8460
|
});
|
|
8805
8461
|
Object.defineProperty(Dimmer.prototype, "validator", {
|
|
8806
|
-
get: function() {
|
|
8462
|
+
get: /* @__PURE__ */ __name(function() {
|
|
8807
8463
|
return validator;
|
|
8808
|
-
}
|
|
8464
|
+
}, "get")
|
|
8809
8465
|
});
|
|
8810
8466
|
Object.defineProperty(Dimmer, "validProperties", {
|
|
8811
8467
|
value: Object.keys(schema.properties)
|
|
@@ -8899,9 +8555,9 @@ var require_Lock = __commonJS({
|
|
|
8899
8555
|
value: schema
|
|
8900
8556
|
});
|
|
8901
8557
|
Object.defineProperty(Lock.prototype, "validator", {
|
|
8902
|
-
get: function() {
|
|
8558
|
+
get: /* @__PURE__ */ __name(function() {
|
|
8903
8559
|
return validator;
|
|
8904
|
-
}
|
|
8560
|
+
}, "get")
|
|
8905
8561
|
});
|
|
8906
8562
|
Object.defineProperty(Lock, "validProperties", {
|
|
8907
8563
|
value: Object.keys(schema.properties)
|
|
@@ -9108,8 +8764,7 @@ var require_Thermostat = __commonJS({
|
|
|
9108
8764
|
switch (action) {
|
|
9109
8765
|
case "hvacMode":
|
|
9110
8766
|
case "fanMode": {
|
|
9111
|
-
if (old[action] !== _new[action])
|
|
9112
|
-
delta[action] = 1;
|
|
8767
|
+
if (old[action] !== _new[action]) delta[action] = 1;
|
|
9113
8768
|
break;
|
|
9114
8769
|
}
|
|
9115
8770
|
case "setpoints": {
|
|
@@ -9135,9 +8790,9 @@ var require_Thermostat = __commonJS({
|
|
|
9135
8790
|
value: schema
|
|
9136
8791
|
});
|
|
9137
8792
|
Object.defineProperty(Thermostat.prototype, "validator", {
|
|
9138
|
-
get: function() {
|
|
8793
|
+
get: /* @__PURE__ */ __name(function() {
|
|
9139
8794
|
return validator;
|
|
9140
|
-
}
|
|
8795
|
+
}, "get")
|
|
9141
8796
|
});
|
|
9142
8797
|
Object.defineProperty(Thermostat, "validProperties", {
|
|
9143
8798
|
value: Object.keys(schema.properties)
|
|
@@ -9244,9 +8899,9 @@ var require_WindowCovering = __commonJS({
|
|
|
9244
8899
|
value: schema
|
|
9245
8900
|
});
|
|
9246
8901
|
Object.defineProperty(WindowCovering.prototype, "validator", {
|
|
9247
|
-
get: function() {
|
|
8902
|
+
get: /* @__PURE__ */ __name(function() {
|
|
9248
8903
|
return validator;
|
|
9249
|
-
}
|
|
8904
|
+
}, "get")
|
|
9250
8905
|
});
|
|
9251
8906
|
Object.defineProperty(WindowCovering, "validProperties", {
|
|
9252
8907
|
value: Object.keys(schema.properties)
|
|
@@ -9354,9 +9009,9 @@ var require_Identification = __commonJS({
|
|
|
9354
9009
|
value: schema
|
|
9355
9010
|
});
|
|
9356
9011
|
Object.defineProperty(Identification.prototype, "validator", {
|
|
9357
|
-
get: function() {
|
|
9012
|
+
get: /* @__PURE__ */ __name(function() {
|
|
9358
9013
|
return validator;
|
|
9359
|
-
}
|
|
9014
|
+
}, "get")
|
|
9360
9015
|
});
|
|
9361
9016
|
Object.defineProperty(Identification, "validProperties", {
|
|
9362
9017
|
value: Object.keys(schema.properties)
|
|
@@ -9459,9 +9114,9 @@ var require_Policy = __commonJS({
|
|
|
9459
9114
|
value: schema
|
|
9460
9115
|
});
|
|
9461
9116
|
Object.defineProperty(Policy.prototype, "validator", {
|
|
9462
|
-
get: function() {
|
|
9117
|
+
get: /* @__PURE__ */ __name(function() {
|
|
9463
9118
|
return validator;
|
|
9464
|
-
}
|
|
9119
|
+
}, "get")
|
|
9465
9120
|
});
|
|
9466
9121
|
Object.defineProperty(Policy, "validProperties", {
|
|
9467
9122
|
value: Object.keys(schema.properties)
|
|
@@ -9739,8 +9394,7 @@ var init_index_browser2 = __esm({
|
|
|
9739
9394
|
let i = step;
|
|
9740
9395
|
while (i--) {
|
|
9741
9396
|
id += alphabet[bytes[i] & mask] || "";
|
|
9742
|
-
if (id.length === size)
|
|
9743
|
-
return id;
|
|
9397
|
+
if (id.length === size) return id;
|
|
9744
9398
|
}
|
|
9745
9399
|
}
|
|
9746
9400
|
};
|
|
@@ -9791,8 +9445,7 @@ var require_User = __commonJS({
|
|
|
9791
9445
|
* @param {UserType} user - The user object of type User.
|
|
9792
9446
|
*/
|
|
9793
9447
|
constructor(user) {
|
|
9794
|
-
if (user.photo)
|
|
9795
|
-
user.photo = new MediaFile(user.photo);
|
|
9448
|
+
if (user.photo) user.photo = new MediaFile(user.photo);
|
|
9796
9449
|
if (user.reservations) {
|
|
9797
9450
|
user.reservations = user.reservations.map((res) => new Reservation(res));
|
|
9798
9451
|
}
|
|
@@ -9829,20 +9482,20 @@ var require_User = __commonJS({
|
|
|
9829
9482
|
value: schema
|
|
9830
9483
|
});
|
|
9831
9484
|
Object.defineProperty(User.prototype, "validator", {
|
|
9832
|
-
get: function() {
|
|
9485
|
+
get: /* @__PURE__ */ __name(function() {
|
|
9833
9486
|
return validator;
|
|
9834
|
-
}
|
|
9487
|
+
}, "get")
|
|
9835
9488
|
});
|
|
9836
9489
|
Object.defineProperty(User, "validProperties", {
|
|
9837
9490
|
value: Object.keys(schema.properties)
|
|
9838
9491
|
});
|
|
9839
9492
|
Object.defineProperty(User.prototype, "fullName", {
|
|
9840
|
-
get: function() {
|
|
9493
|
+
get: /* @__PURE__ */ __name(function() {
|
|
9841
9494
|
return `${this.firstName} ${this.lastName}`;
|
|
9842
|
-
}
|
|
9495
|
+
}, "get")
|
|
9843
9496
|
});
|
|
9844
9497
|
Object.defineProperty(User.prototype, "roles", {
|
|
9845
|
-
get: function() {
|
|
9498
|
+
get: /* @__PURE__ */ __name(function() {
|
|
9846
9499
|
const roles = /* @__PURE__ */ new Set();
|
|
9847
9500
|
if (this.permissions) {
|
|
9848
9501
|
for (const permission of this.permissions) {
|
|
@@ -9850,32 +9503,32 @@ var require_User = __commonJS({
|
|
|
9850
9503
|
}
|
|
9851
9504
|
}
|
|
9852
9505
|
return Array.from(roles);
|
|
9853
|
-
}
|
|
9506
|
+
}, "get")
|
|
9854
9507
|
});
|
|
9855
9508
|
Object.defineProperty(User.prototype, "isSuperAdmin", {
|
|
9856
|
-
get: function() {
|
|
9509
|
+
get: /* @__PURE__ */ __name(function() {
|
|
9857
9510
|
return this.roles.includes("SuperAdmin");
|
|
9858
|
-
}
|
|
9511
|
+
}, "get")
|
|
9859
9512
|
});
|
|
9860
9513
|
Object.defineProperty(User.prototype, "isAdmin", {
|
|
9861
|
-
get: function() {
|
|
9514
|
+
get: /* @__PURE__ */ __name(function() {
|
|
9862
9515
|
return this.roles.includes("Admin") || this.roles.includes("Administrator");
|
|
9863
|
-
}
|
|
9516
|
+
}, "get")
|
|
9864
9517
|
});
|
|
9865
9518
|
Object.defineProperty(User.prototype, "isManager", {
|
|
9866
|
-
get: function() {
|
|
9519
|
+
get: /* @__PURE__ */ __name(function() {
|
|
9867
9520
|
return this.roles.includes("Manager");
|
|
9868
|
-
}
|
|
9521
|
+
}, "get")
|
|
9869
9522
|
});
|
|
9870
9523
|
Object.defineProperty(User.prototype, "isUser", {
|
|
9871
|
-
get: function() {
|
|
9524
|
+
get: /* @__PURE__ */ __name(function() {
|
|
9872
9525
|
return this.roles.includes("User");
|
|
9873
|
-
}
|
|
9526
|
+
}, "get")
|
|
9874
9527
|
});
|
|
9875
9528
|
Object.defineProperty(User.prototype, "isGuest", {
|
|
9876
|
-
get: function() {
|
|
9529
|
+
get: /* @__PURE__ */ __name(function() {
|
|
9877
9530
|
return this.roles.includes("Guest");
|
|
9878
|
-
}
|
|
9531
|
+
}, "get")
|
|
9879
9532
|
});
|
|
9880
9533
|
module.exports = User;
|
|
9881
9534
|
}
|
|
@@ -10027,17 +9680,17 @@ var require_SystemUser = __commonJS({
|
|
|
10027
9680
|
value: schema
|
|
10028
9681
|
});
|
|
10029
9682
|
Object.defineProperty(SystemUser.prototype, "validator", {
|
|
10030
|
-
get: function() {
|
|
9683
|
+
get: /* @__PURE__ */ __name(function() {
|
|
10031
9684
|
return validator;
|
|
10032
|
-
}
|
|
9685
|
+
}, "get")
|
|
10033
9686
|
});
|
|
10034
9687
|
Object.defineProperty(SystemUser, "validProperties", {
|
|
10035
9688
|
value: Object.keys(schema.properties)
|
|
10036
9689
|
});
|
|
10037
9690
|
Object.defineProperty(SystemUser.prototype, "fullName", {
|
|
10038
|
-
get: function() {
|
|
9691
|
+
get: /* @__PURE__ */ __name(function() {
|
|
10039
9692
|
return `${this.firstName} ${this.lastName}`;
|
|
10040
|
-
}
|
|
9693
|
+
}, "get")
|
|
10041
9694
|
});
|
|
10042
9695
|
module.exports = SystemUser;
|
|
10043
9696
|
}
|
|
@@ -10123,9 +9776,9 @@ var require_Courtesy = __commonJS({
|
|
|
10123
9776
|
value: schema
|
|
10124
9777
|
});
|
|
10125
9778
|
Object.defineProperty(Courtesy.prototype, "validator", {
|
|
10126
|
-
get: function() {
|
|
9779
|
+
get: /* @__PURE__ */ __name(function() {
|
|
10127
9780
|
return validator;
|
|
10128
|
-
}
|
|
9781
|
+
}, "get")
|
|
10129
9782
|
});
|
|
10130
9783
|
Object.defineProperty(Courtesy, "validProperties", {
|
|
10131
9784
|
value: Object.keys(schema.properties)
|
|
@@ -10266,9 +9919,9 @@ var require_Camera = __commonJS({
|
|
|
10266
9919
|
value: schema
|
|
10267
9920
|
});
|
|
10268
9921
|
Object.defineProperty(Camera.prototype, "validator", {
|
|
10269
|
-
get: function() {
|
|
9922
|
+
get: /* @__PURE__ */ __name(function() {
|
|
10270
9923
|
return validator;
|
|
10271
|
-
}
|
|
9924
|
+
}, "get")
|
|
10272
9925
|
});
|
|
10273
9926
|
Object.defineProperty(Camera, "validProperties", {
|
|
10274
9927
|
value: Object.keys(schema.properties)
|
|
@@ -10341,9 +9994,9 @@ var require_MotionSensor = __commonJS({
|
|
|
10341
9994
|
value: schema
|
|
10342
9995
|
});
|
|
10343
9996
|
Object.defineProperty(MotionSensor.prototype, "validator", {
|
|
10344
|
-
get: function() {
|
|
9997
|
+
get: /* @__PURE__ */ __name(function() {
|
|
10345
9998
|
return validator;
|
|
10346
|
-
}
|
|
9999
|
+
}, "get")
|
|
10347
10000
|
});
|
|
10348
10001
|
Object.defineProperty(MotionSensor, "validProperties", {
|
|
10349
10002
|
value: Object.keys(schema.properties)
|
|
@@ -10628,9 +10281,9 @@ var require_MediaSource = __commonJS({
|
|
|
10628
10281
|
value: schema
|
|
10629
10282
|
});
|
|
10630
10283
|
Object.defineProperty(MediaSource.prototype, "validator", {
|
|
10631
|
-
get: function() {
|
|
10284
|
+
get: /* @__PURE__ */ __name(function() {
|
|
10632
10285
|
return validator;
|
|
10633
|
-
}
|
|
10286
|
+
}, "get")
|
|
10634
10287
|
});
|
|
10635
10288
|
Object.defineProperty(MediaSource, "validProperties", {
|
|
10636
10289
|
value: Object.keys(schema.properties)
|
|
@@ -10928,8 +10581,7 @@ var require_Scene = __commonJS({
|
|
|
10928
10581
|
for (const deviceType in sceneDevices) {
|
|
10929
10582
|
const sceneData = sceneDevices[deviceType];
|
|
10930
10583
|
const roomDevices = room[deviceType];
|
|
10931
|
-
if (sceneId === "1" && restore && deviceType !== "thermostats")
|
|
10932
|
-
continue;
|
|
10584
|
+
if (sceneId === "1" && restore && deviceType !== "thermostats") continue;
|
|
10933
10585
|
for (const data of sceneData) {
|
|
10934
10586
|
const { id, ...deviceProps } = data;
|
|
10935
10587
|
if (id === "*") {
|
|
@@ -11037,9 +10689,9 @@ var require_Scene = __commonJS({
|
|
|
11037
10689
|
value: schema
|
|
11038
10690
|
});
|
|
11039
10691
|
Object.defineProperty(Scene.prototype, "validator", {
|
|
11040
|
-
get: function() {
|
|
10692
|
+
get: /* @__PURE__ */ __name(function() {
|
|
11041
10693
|
return validator;
|
|
11042
|
-
}
|
|
10694
|
+
}, "get")
|
|
11043
10695
|
});
|
|
11044
10696
|
Object.defineProperty(Scene, "validProperties", {
|
|
11045
10697
|
value: Object.keys(schema.properties)
|
|
@@ -11177,9 +10829,9 @@ var require_Room = __commonJS({
|
|
|
11177
10829
|
value: schema
|
|
11178
10830
|
});
|
|
11179
10831
|
Object.defineProperty(Room.prototype, "validator", {
|
|
11180
|
-
get: function() {
|
|
10832
|
+
get: /* @__PURE__ */ __name(function() {
|
|
11181
10833
|
return validator;
|
|
11182
|
-
}
|
|
10834
|
+
}, "get")
|
|
11183
10835
|
});
|
|
11184
10836
|
Object.defineProperty(Room, "validProperties", {
|
|
11185
10837
|
value: Object.keys(schema.properties)
|
|
@@ -11187,70 +10839,48 @@ var require_Room = __commonJS({
|
|
|
11187
10839
|
function mapRoomData(data) {
|
|
11188
10840
|
const roomData = structuredClone(data);
|
|
11189
10841
|
roomData.dimmers?.map((dimmer) => {
|
|
11190
|
-
if (dimmer instanceof Dimmer)
|
|
11191
|
-
|
|
11192
|
-
else
|
|
11193
|
-
return new Dimmer(dimmer);
|
|
10842
|
+
if (dimmer instanceof Dimmer) return dimmer;
|
|
10843
|
+
else return new Dimmer(dimmer);
|
|
11194
10844
|
});
|
|
11195
10845
|
roomData.switches?.map((switch_) => {
|
|
11196
|
-
if (switch_ instanceof Switch)
|
|
11197
|
-
|
|
11198
|
-
else
|
|
11199
|
-
return new Switch(switch_);
|
|
10846
|
+
if (switch_ instanceof Switch) return switch_;
|
|
10847
|
+
else return new Switch(switch_);
|
|
11200
10848
|
});
|
|
11201
10849
|
roomData.windowCoverings?.map((windowCovering) => {
|
|
11202
|
-
if (windowCovering instanceof WindowCovering)
|
|
11203
|
-
|
|
11204
|
-
else
|
|
11205
|
-
return new WindowCovering(windowCovering);
|
|
10850
|
+
if (windowCovering instanceof WindowCovering) return windowCovering;
|
|
10851
|
+
else return new WindowCovering(windowCovering);
|
|
11206
10852
|
});
|
|
11207
10853
|
roomData.thermostats?.map((thermostat) => {
|
|
11208
|
-
if (thermostat instanceof Thermostat)
|
|
11209
|
-
|
|
11210
|
-
else
|
|
11211
|
-
return new Thermostat(thermostat);
|
|
10854
|
+
if (thermostat instanceof Thermostat) return thermostat;
|
|
10855
|
+
else return new Thermostat(thermostat);
|
|
11212
10856
|
});
|
|
11213
10857
|
roomData.locks?.map((lock) => {
|
|
11214
|
-
if (lock instanceof Lock)
|
|
11215
|
-
|
|
11216
|
-
else
|
|
11217
|
-
return new Lock(lock);
|
|
10858
|
+
if (lock instanceof Lock) return lock;
|
|
10859
|
+
else return new Lock(lock);
|
|
11218
10860
|
});
|
|
11219
10861
|
roomData.courtesy?.map((courtesy) => {
|
|
11220
|
-
if (courtesy instanceof Courtesy)
|
|
11221
|
-
|
|
11222
|
-
else
|
|
11223
|
-
return new Courtesy(courtesy);
|
|
10862
|
+
if (courtesy instanceof Courtesy) return courtesy;
|
|
10863
|
+
else return new Courtesy(courtesy);
|
|
11224
10864
|
});
|
|
11225
10865
|
roomData.mediaSources?.map((source) => {
|
|
11226
|
-
if (source instanceof MediaSource)
|
|
11227
|
-
|
|
11228
|
-
else
|
|
11229
|
-
return new MediaSource(source);
|
|
10866
|
+
if (source instanceof MediaSource) return source;
|
|
10867
|
+
else return new MediaSource(source);
|
|
11230
10868
|
});
|
|
11231
10869
|
roomData.cameras?.map((camera) => {
|
|
11232
|
-
if (camera instanceof Camera)
|
|
11233
|
-
|
|
11234
|
-
else
|
|
11235
|
-
return new Camera(camera);
|
|
10870
|
+
if (camera instanceof Camera) return camera;
|
|
10871
|
+
else return new Camera(camera);
|
|
11236
10872
|
});
|
|
11237
10873
|
roomData.alarms?.map((alarm) => {
|
|
11238
|
-
if (alarm instanceof Alarm)
|
|
11239
|
-
|
|
11240
|
-
else
|
|
11241
|
-
return new Alarm(alarm);
|
|
10874
|
+
if (alarm instanceof Alarm) return alarm;
|
|
10875
|
+
else return new Alarm(alarm);
|
|
11242
10876
|
});
|
|
11243
10877
|
roomData.motionSensors?.map((motionSensor) => {
|
|
11244
|
-
if (motionSensor instanceof MotionSensor)
|
|
11245
|
-
|
|
11246
|
-
else
|
|
11247
|
-
return new MotionSensor(motionSensor);
|
|
10878
|
+
if (motionSensor instanceof MotionSensor) return motionSensor;
|
|
10879
|
+
else return new MotionSensor(motionSensor);
|
|
11248
10880
|
});
|
|
11249
10881
|
roomData.scenes?.map((scene) => {
|
|
11250
|
-
if (scene instanceof Scene)
|
|
11251
|
-
|
|
11252
|
-
else
|
|
11253
|
-
return new Scene(scene);
|
|
10882
|
+
if (scene instanceof Scene) return scene;
|
|
10883
|
+
else return new Scene(scene);
|
|
11254
10884
|
});
|
|
11255
10885
|
return roomData;
|
|
11256
10886
|
}
|
|
@@ -11324,7 +10954,8 @@ var require_space = __commonJS({
|
|
|
11324
10954
|
default: {
|
|
11325
10955
|
active: false,
|
|
11326
10956
|
allowed: false,
|
|
11327
|
-
previousState: null
|
|
10957
|
+
previousState: null,
|
|
10958
|
+
allowedBy: []
|
|
11328
10959
|
},
|
|
11329
10960
|
properties: {
|
|
11330
10961
|
active: {
|
|
@@ -11339,6 +10970,13 @@ var require_space = __commonJS({
|
|
|
11339
10970
|
type: "boolean",
|
|
11340
10971
|
default: false
|
|
11341
10972
|
},
|
|
10973
|
+
allowedBy: {
|
|
10974
|
+
type: "array",
|
|
10975
|
+
items: {
|
|
10976
|
+
type: "string",
|
|
10977
|
+
enum: ["occupancy", "automation"]
|
|
10978
|
+
}
|
|
10979
|
+
},
|
|
11342
10980
|
previousState: {
|
|
11343
10981
|
type: ["object", "null"],
|
|
11344
10982
|
properties: {
|
|
@@ -11443,8 +11081,7 @@ var require_Space = __commonJS({
|
|
|
11443
11081
|
get floor() {
|
|
11444
11082
|
const floors = /* @__PURE__ */ new Set();
|
|
11445
11083
|
this.room.forEach((room) => {
|
|
11446
|
-
if (room.floor)
|
|
11447
|
-
floors.add(room.floor);
|
|
11084
|
+
if (room.floor) floors.add(room.floor);
|
|
11448
11085
|
});
|
|
11449
11086
|
return floors.size == 1 ? [...floors][0] : void 0;
|
|
11450
11087
|
}
|
|
@@ -11480,9 +11117,9 @@ var require_Space = __commonJS({
|
|
|
11480
11117
|
value: schema
|
|
11481
11118
|
});
|
|
11482
11119
|
Object.defineProperty(Space.prototype, "validator", {
|
|
11483
|
-
get: function() {
|
|
11120
|
+
get: /* @__PURE__ */ __name(function() {
|
|
11484
11121
|
return validator;
|
|
11485
|
-
}
|
|
11122
|
+
}, "get")
|
|
11486
11123
|
});
|
|
11487
11124
|
Object.defineProperty(Space, "validProperties", {
|
|
11488
11125
|
value: Object.keys(schema.properties)
|
|
@@ -11491,10 +11128,8 @@ var require_Space = __commonJS({
|
|
|
11491
11128
|
const spaceData = structuredClone(data);
|
|
11492
11129
|
if (spaceData.rooms?.length) {
|
|
11493
11130
|
spaceData.rooms.map((room) => {
|
|
11494
|
-
if (typeof room === "string")
|
|
11495
|
-
|
|
11496
|
-
if (room instanceof Room)
|
|
11497
|
-
return room;
|
|
11131
|
+
if (typeof room === "string") return room;
|
|
11132
|
+
if (room instanceof Room) return room;
|
|
11498
11133
|
return new Room(room);
|
|
11499
11134
|
});
|
|
11500
11135
|
}
|
|
@@ -11579,9 +11214,9 @@ var require_Category = __commonJS({
|
|
|
11579
11214
|
value: schema
|
|
11580
11215
|
});
|
|
11581
11216
|
Object.defineProperty(Category.prototype, "validator", {
|
|
11582
|
-
get: function() {
|
|
11217
|
+
get: /* @__PURE__ */ __name(function() {
|
|
11583
11218
|
return validator;
|
|
11584
|
-
}
|
|
11219
|
+
}, "get")
|
|
11585
11220
|
});
|
|
11586
11221
|
Object.defineProperty(Category, "validProperties", {
|
|
11587
11222
|
value: Object.keys(schema.properties)
|
|
@@ -11831,17 +11466,16 @@ var require_Ticket = __commonJS({
|
|
|
11831
11466
|
value: schema
|
|
11832
11467
|
});
|
|
11833
11468
|
Object.defineProperty(Ticket.prototype, "validator", {
|
|
11834
|
-
get: function() {
|
|
11469
|
+
get: /* @__PURE__ */ __name(function() {
|
|
11835
11470
|
return validator;
|
|
11836
|
-
}
|
|
11471
|
+
}, "get")
|
|
11837
11472
|
});
|
|
11838
11473
|
Object.defineProperty(Ticket, "validProperties", {
|
|
11839
11474
|
value: Object.keys(schema.properties)
|
|
11840
11475
|
});
|
|
11841
11476
|
function mapConversationData(data) {
|
|
11842
11477
|
const ticketData = structuredClone(data);
|
|
11843
|
-
if (!ticketData.conversation)
|
|
11844
|
-
ticketData.conversation = [];
|
|
11478
|
+
if (!ticketData.conversation) ticketData.conversation = [];
|
|
11845
11479
|
ticketData.conversation = ticketData.conversation.map((msg) => {
|
|
11846
11480
|
if (msg.media) {
|
|
11847
11481
|
msg.media = new MediaFile(msg.media);
|
|
@@ -11921,9 +11555,9 @@ var require_Gateway = __commonJS({
|
|
|
11921
11555
|
value: schema
|
|
11922
11556
|
});
|
|
11923
11557
|
Object.defineProperty(Gateway.prototype, "validator", {
|
|
11924
|
-
get: function() {
|
|
11558
|
+
get: /* @__PURE__ */ __name(function() {
|
|
11925
11559
|
return validator;
|
|
11926
|
-
}
|
|
11560
|
+
}, "get")
|
|
11927
11561
|
});
|
|
11928
11562
|
Object.defineProperty(Gateway, "validProperties", {
|
|
11929
11563
|
value: Object.keys(schema.properties)
|
|
@@ -12009,9 +11643,9 @@ var require_Product = __commonJS({
|
|
|
12009
11643
|
value: schema
|
|
12010
11644
|
});
|
|
12011
11645
|
Object.defineProperty(Product.prototype, "validator", {
|
|
12012
|
-
get: function() {
|
|
11646
|
+
get: /* @__PURE__ */ __name(function() {
|
|
12013
11647
|
return validator;
|
|
12014
|
-
}
|
|
11648
|
+
}, "get")
|
|
12015
11649
|
});
|
|
12016
11650
|
Object.defineProperty(Product, "validProperties", {
|
|
12017
11651
|
value: Object.keys(schema.properties)
|
|
@@ -12245,14 +11879,11 @@ var require_Order = __commonJS({
|
|
|
12245
11879
|
}
|
|
12246
11880
|
getTaxTotal() {
|
|
12247
11881
|
const taxes = this.taxes;
|
|
12248
|
-
if (!taxes)
|
|
12249
|
-
return 0;
|
|
11882
|
+
if (!taxes) return 0;
|
|
12250
11883
|
return this.items.reduce((acc, item) => {
|
|
12251
|
-
if (!item.taxClass)
|
|
12252
|
-
return acc;
|
|
11884
|
+
if (!item.taxClass) return acc;
|
|
12253
11885
|
const tax = taxes.find((t) => t.class === item.taxClass);
|
|
12254
|
-
if (!tax)
|
|
12255
|
-
return acc;
|
|
11886
|
+
if (!tax) return acc;
|
|
12256
11887
|
const { rateType, rate } = tax;
|
|
12257
11888
|
if (rateType === "percentage") {
|
|
12258
11889
|
return acc + item.price * rate;
|
|
@@ -12262,14 +11893,11 @@ var require_Order = __commonJS({
|
|
|
12262
11893
|
}
|
|
12263
11894
|
getDeliveryTotal() {
|
|
12264
11895
|
const delivery = this.delivery;
|
|
12265
|
-
if (!delivery)
|
|
12266
|
-
return 0;
|
|
11896
|
+
if (!delivery) return 0;
|
|
12267
11897
|
return this.items.reduce((acc, item) => {
|
|
12268
|
-
if (!item.deliveryClass)
|
|
12269
|
-
return acc;
|
|
11898
|
+
if (!item.deliveryClass) return acc;
|
|
12270
11899
|
const d = delivery.find((d2) => d2.class === item.deliveryClass);
|
|
12271
|
-
if (!d)
|
|
12272
|
-
return acc;
|
|
11900
|
+
if (!d) return acc;
|
|
12273
11901
|
const { rateType, rate } = d;
|
|
12274
11902
|
if (rateType === "percentage") {
|
|
12275
11903
|
return acc + item.price * rate;
|
|
@@ -12299,9 +11927,9 @@ var require_Order = __commonJS({
|
|
|
12299
11927
|
value: schema
|
|
12300
11928
|
});
|
|
12301
11929
|
Object.defineProperty(Order.prototype, "validator", {
|
|
12302
|
-
get: function() {
|
|
11930
|
+
get: /* @__PURE__ */ __name(function() {
|
|
12303
11931
|
return validator;
|
|
12304
|
-
}
|
|
11932
|
+
}, "get")
|
|
12305
11933
|
});
|
|
12306
11934
|
Object.defineProperty(Order, "validProperties", {
|
|
12307
11935
|
value: Object.keys(schema.properties)
|
|
@@ -12381,9 +12009,9 @@ var require_DiscoveredDevice = __commonJS({
|
|
|
12381
12009
|
value: schema
|
|
12382
12010
|
});
|
|
12383
12011
|
Object.defineProperty(DiscoveredDevice.prototype, "validator", {
|
|
12384
|
-
get: function() {
|
|
12012
|
+
get: /* @__PURE__ */ __name(function() {
|
|
12385
12013
|
return validator;
|
|
12386
|
-
}
|
|
12014
|
+
}, "get")
|
|
12387
12015
|
});
|
|
12388
12016
|
Object.defineProperty(DiscoveredDevice, "validProperties", {
|
|
12389
12017
|
value: Object.keys(schema.properties)
|
|
@@ -12453,9 +12081,9 @@ var require_DeviceRouter = __commonJS({
|
|
|
12453
12081
|
value: schema
|
|
12454
12082
|
});
|
|
12455
12083
|
Object.defineProperty(DeviceRouter.prototype, "validator", {
|
|
12456
|
-
get: function() {
|
|
12084
|
+
get: /* @__PURE__ */ __name(function() {
|
|
12457
12085
|
return validator;
|
|
12458
|
-
}
|
|
12086
|
+
}, "get")
|
|
12459
12087
|
});
|
|
12460
12088
|
Object.defineProperty(DeviceRouter, "validProperties", {
|
|
12461
12089
|
value: Object.keys(schema.properties)
|
|
@@ -12550,9 +12178,9 @@ var require_Credential = __commonJS({
|
|
|
12550
12178
|
value: schema
|
|
12551
12179
|
});
|
|
12552
12180
|
Object.defineProperty(Credential.prototype, "validator", {
|
|
12553
|
-
get: function() {
|
|
12181
|
+
get: /* @__PURE__ */ __name(function() {
|
|
12554
12182
|
return validator;
|
|
12555
|
-
}
|
|
12183
|
+
}, "get")
|
|
12556
12184
|
});
|
|
12557
12185
|
Object.defineProperty(Credential, "validProperties", {
|
|
12558
12186
|
value: Object.keys(schema.properties)
|
|
@@ -12624,9 +12252,9 @@ var require_ShortLink = __commonJS({
|
|
|
12624
12252
|
value: schema
|
|
12625
12253
|
});
|
|
12626
12254
|
Object.defineProperty(ShortLink.prototype, "validator", {
|
|
12627
|
-
get: function() {
|
|
12255
|
+
get: /* @__PURE__ */ __name(function() {
|
|
12628
12256
|
return validator;
|
|
12629
|
-
}
|
|
12257
|
+
}, "get")
|
|
12630
12258
|
});
|
|
12631
12259
|
Object.defineProperty(ShortLink, "validProperties", {
|
|
12632
12260
|
value: Object.keys(schema.properties)
|
|
@@ -12742,9 +12370,9 @@ var require_EnergyReportShard = __commonJS({
|
|
|
12742
12370
|
value: schema
|
|
12743
12371
|
});
|
|
12744
12372
|
Object.defineProperty(EnergyReportShard.prototype, "validator", {
|
|
12745
|
-
get: function() {
|
|
12373
|
+
get: /* @__PURE__ */ __name(function() {
|
|
12746
12374
|
return validator;
|
|
12747
|
-
}
|
|
12375
|
+
}, "get")
|
|
12748
12376
|
});
|
|
12749
12377
|
Object.defineProperty(EnergyReportShard, "validProperties", {
|
|
12750
12378
|
value: Object.keys(schema.properties)
|
|
@@ -12871,9 +12499,9 @@ var require_EnergyReport = __commonJS({
|
|
|
12871
12499
|
value: schema
|
|
12872
12500
|
});
|
|
12873
12501
|
Object.defineProperty(EnergyReport.prototype, "validator", {
|
|
12874
|
-
get: function() {
|
|
12502
|
+
get: /* @__PURE__ */ __name(function() {
|
|
12875
12503
|
return validator;
|
|
12876
|
-
}
|
|
12504
|
+
}, "get")
|
|
12877
12505
|
});
|
|
12878
12506
|
Object.defineProperty(EnergyReport, "validProperties", {
|
|
12879
12507
|
value: Object.keys(schema.properties)
|
|
@@ -12976,9 +12604,9 @@ var require_SmsMessage = __commonJS({
|
|
|
12976
12604
|
value: schema
|
|
12977
12605
|
});
|
|
12978
12606
|
Object.defineProperty(SMSMessage.prototype, "validator", {
|
|
12979
|
-
get: function() {
|
|
12607
|
+
get: /* @__PURE__ */ __name(function() {
|
|
12980
12608
|
return validator;
|
|
12981
|
-
}
|
|
12609
|
+
}, "get")
|
|
12982
12610
|
});
|
|
12983
12611
|
Object.defineProperty(SMSMessage, "validProperties", {
|
|
12984
12612
|
value: Object.keys(schema.properties)
|
|
@@ -13091,9 +12719,9 @@ var require_EmailMessage = __commonJS({
|
|
|
13091
12719
|
value: schema
|
|
13092
12720
|
});
|
|
13093
12721
|
Object.defineProperty(EmailMessage.prototype, "validator", {
|
|
13094
|
-
get: function() {
|
|
12722
|
+
get: /* @__PURE__ */ __name(function() {
|
|
13095
12723
|
return validator;
|
|
13096
|
-
}
|
|
12724
|
+
}, "get")
|
|
13097
12725
|
});
|
|
13098
12726
|
Object.defineProperty(EmailMessage, "validProperties", {
|
|
13099
12727
|
value: Object.keys(schema.properties)
|
|
@@ -13181,9 +12809,9 @@ var require_Announcement = __commonJS({
|
|
|
13181
12809
|
value: schema
|
|
13182
12810
|
});
|
|
13183
12811
|
Object.defineProperty(Announcement.prototype, "validator", {
|
|
13184
|
-
get: function() {
|
|
12812
|
+
get: /* @__PURE__ */ __name(function() {
|
|
13185
12813
|
return validator;
|
|
13186
|
-
}
|
|
12814
|
+
}, "get")
|
|
13187
12815
|
});
|
|
13188
12816
|
Object.defineProperty(Announcement, "validProperties", {
|
|
13189
12817
|
value: Object.keys(schema.properties)
|
|
@@ -13284,19 +12912,14 @@ var require_TimeSheet = __commonJS({
|
|
|
13284
12912
|
}
|
|
13285
12913
|
if (timesheet.timeEntries && Array.isArray(timesheet.timeEntries)) {
|
|
13286
12914
|
timesheet.timeEntries = timesheet.timeEntries.map((t) => {
|
|
13287
|
-
if (!t.id)
|
|
13288
|
-
|
|
13289
|
-
if (t.
|
|
13290
|
-
t.start = new Date(t.start);
|
|
13291
|
-
if (t.end)
|
|
13292
|
-
t.end = new Date(t.end);
|
|
12915
|
+
if (!t.id) t.id = _TimeSheet.generateTimeEntryId();
|
|
12916
|
+
if (t.start) t.start = new Date(t.start);
|
|
12917
|
+
if (t.end) t.end = new Date(t.end);
|
|
13293
12918
|
return t;
|
|
13294
12919
|
});
|
|
13295
12920
|
timesheet.timeEntries.sort((a, b) => {
|
|
13296
|
-
if (a.start < b.start)
|
|
13297
|
-
|
|
13298
|
-
if (a.start > b.start)
|
|
13299
|
-
return 1;
|
|
12921
|
+
if (a.start < b.start) return -1;
|
|
12922
|
+
if (a.start > b.start) return 1;
|
|
13300
12923
|
return 0;
|
|
13301
12924
|
});
|
|
13302
12925
|
}
|
|
@@ -13310,9 +12933,9 @@ var require_TimeSheet = __commonJS({
|
|
|
13310
12933
|
value: schema
|
|
13311
12934
|
});
|
|
13312
12935
|
Object.defineProperty(TimeSheet.prototype, "validator", {
|
|
13313
|
-
get: function() {
|
|
12936
|
+
get: /* @__PURE__ */ __name(function() {
|
|
13314
12937
|
return validator;
|
|
13315
|
-
}
|
|
12938
|
+
}, "get")
|
|
13316
12939
|
});
|
|
13317
12940
|
Object.defineProperty(TimeSheet, "validProperties", {
|
|
13318
12941
|
value: Object.keys(schema.properties)
|
|
@@ -13755,9 +13378,9 @@ var require_Property = __commonJS({
|
|
|
13755
13378
|
value: schema
|
|
13756
13379
|
});
|
|
13757
13380
|
Object.defineProperty(Property.prototype, "validator", {
|
|
13758
|
-
get: function() {
|
|
13381
|
+
get: /* @__PURE__ */ __name(function() {
|
|
13759
13382
|
return validator;
|
|
13760
|
-
}
|
|
13383
|
+
}, "get")
|
|
13761
13384
|
});
|
|
13762
13385
|
Object.defineProperty(Property, "validProperties", {
|
|
13763
13386
|
value: Object.keys(schema.properties)
|
|
@@ -13956,9 +13579,9 @@ var require_Organization = __commonJS({
|
|
|
13956
13579
|
value: schema
|
|
13957
13580
|
});
|
|
13958
13581
|
Object.defineProperty(Organization.prototype, "validator", {
|
|
13959
|
-
get: function() {
|
|
13582
|
+
get: /* @__PURE__ */ __name(function() {
|
|
13960
13583
|
return validator;
|
|
13961
|
-
}
|
|
13584
|
+
}, "get")
|
|
13962
13585
|
});
|
|
13963
13586
|
Object.defineProperty(Organization, "validProperties", {
|
|
13964
13587
|
value: Object.keys(schema.properties)
|
|
@@ -14049,9 +13672,4 @@ var require_Models = __commonJS({
|
|
|
14049
13672
|
}
|
|
14050
13673
|
});
|
|
14051
13674
|
export default require_Models();
|
|
14052
|
-
/*! Bundled license information:
|
|
14053
|
-
|
|
14054
|
-
uri-js/dist/es5/uri.all.js:
|
|
14055
|
-
(** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js *)
|
|
14056
|
-
*/
|
|
14057
13675
|
//# sourceMappingURL=Models.js.map
|