diff --git a/.jobs.yml b/.jobs.yml index c9ad3882..9eedccac 100644 --- a/.jobs.yml +++ b/.jobs.yml @@ -28,6 +28,7 @@ helper/python-test-helper: - script: test dependencies: - helper/python-test-helper:build + - helper/python-test-helper:lint tags: - test @@ -107,6 +108,7 @@ services/auth: - script: test dependencies: - services/auth:build + - services/auth:lint tags: - test @@ -124,6 +126,7 @@ services/authorization: - script: build dependencies: - services/common:build + - services/common:lint - script: build-docker dependencies: - services/authorization:build @@ -135,28 +138,111 @@ services/authorization: - script: test dependencies: - services/authorization:build + - services/authorization:lint tags: - test +services/booking/src/common: + - script: build + dependencies: + - helper/crosslab-typescript-addon:build + - helper/openapi-codegeneration:build + - services/booking:build-spec + - services/booking/src/booking-backend:build-spec + - services/booking/src/booking-frontend:build-spec + - services/booking/src/schedule-service:build-spec + - services/device:build-spec + - clients/api/js:build + +services/booking/src/device-reservation: + - script: build + dependencies: + - services/booking/src/common:build + - script: test + dependencies: + - services/booking/src/device-reservation:build + tags: + - test + - script: build-docker + dependencies: + - services/booking/src/device-reservation:build + +services/booking/src/test_common: + - script: build + dependencies: + - services/booking/src/common:build + - services/booking/src/device-reservation:build + +services/booking/src/booking-backend: + - script: build-spec + paths: + - ./api + - script: build + dependencies: + - services/booking:build-spec + - services/booking/src/test_common:build + - script: test + dependencies: + - services/booking/src/booking-backend:build + tags: + - test + - script: build-docker + dependencies: + - services/booking/src/booking-backend:build + +services/booking/src/booking-frontend: + - script: build-spec + paths: + - ./api + - script: build + dependencies: + - services/booking:build-spec + - services/booking/src/booking-backend:build + - script: test + dependencies: + - services/booking/src/booking-frontend:build + tags: + - test + - script: build-docker + dependencies: + - services/booking/src/booking-frontend:build + +services/booking/src/schedule-service: + - script: build-spec + paths: + - ./api + - script: build + dependencies: + - services/booking:build-spec + - services/common:build + - services/booking/src/common:build + - services/booking/src/test_common:build + - helper/crosslab-typescript-addon:build + - helper/openapi-codegeneration:build + # - script: test + # dependencies: + # - services/booking/src/schedule-service:build + # tags: + # - test + - script: build-docker + dependencies: + - services/booking/src/schedule-service:build + services/booking: - - script: build-spec -# - script: lint-spec -# dependencies: -# - services/booking:build-spec -# tags: -# - test -# - script: build -# dependencies: -# - services/booking:build-spec -# - services/common:build -# - helper/crosslab-typescript-addon:build -# - helper/openapi-codegeneration:build -# - clients/api/js:build -# - script: test -# dependencies: -# - services/booking:build -# tags: -# - test + - script: build-spec + paths: + - ./api + dependencies: + - services/booking/src/booking-frontend:build-spec + - services/booking/src/booking-backend:build-spec + - services/booking/src/schedule-service:build-spec + - script: lint-spec + paths: + - ./api + dependencies: + - services/booking:build-spec + tags: + - test services/device: - script: build-spec @@ -199,6 +285,10 @@ services/experiment: - script: build dependencies: - services/experiment:build-spec + - services/booking/src/booking-backend:build-spec + - services/booking/src/booking-frontend:build-spec + - services/booking/src/schedule-service:build-spec + - services/booking:build-spec - services/common:build - helper/crosslab-typescript-addon:build - helper/openapi-codegeneration:build @@ -316,6 +406,7 @@ clients/api/python: - script: test dependencies: - clients/api/python:build + - clients/api/python:lint tags: - test @@ -332,7 +423,9 @@ clients/soa/python: - test - script: test dependencies: + - clients/api/python:test - clients/soa/python:build + - clients/soa/python:lint - helper/python-test-helper:test tags: - test @@ -360,7 +453,10 @@ clients/soa_services/electricalConnection/python: - test - script: test dependencies: + - clients/api/python:test + - clients/soa/python:test - clients/soa_services/electricalConnection/python:build + - clients/soa_services/electricalConnection/python:lint - helper/python-test-helper:test tags: - test @@ -387,7 +483,10 @@ clients/soa_services/webcam/python: - test - script: test dependencies: + - clients/api/python:test + - clients/soa/python:test - clients/soa_services/webcam/python:build + - clients/soa_services/webcam/python:lint - helper/python-test-helper:test tags: - test @@ -414,7 +513,10 @@ clients/soa_services/file/python: - test - script: test dependencies: + - clients/api/python:test + - clients/soa/python:test - clients/soa_services/file/python:build + - clients/soa_services/file/python:lint - helper/python-test-helper:test tags: - test @@ -441,7 +543,10 @@ clients/soa_services/message/python: - test - script: test dependencies: + - clients/api/python:test + - clients/soa/python:test - clients/soa_services/message/python:build + - clients/soa_services/message/python:lint - helper/python-test-helper:test tags: - test @@ -468,7 +573,10 @@ clients/soa_services/parameter/python: - test - script: test dependencies: + - clients/api/python:test + - clients/soa/python:test - clients/soa_services/message/python:build + - clients/soa_services/message/python:lint - helper/python-test-helper:test tags: - test @@ -493,11 +601,24 @@ integration-test: - services/common:build - services/auth:build - services/authorization:build -# - services/booking:build + - services/booking/src/booking-backend:build + - services/booking/src/booking-frontend:build + - services/booking/src/device-reservation:build + - services/booking/src/schedule-service:build - services/device:build - services/experiment:build - services/federation:build - services/gateway:build + - services/auth:build-docker + - services/authorization:build-docker + - services/booking/src/booking-backend:build-docker + - services/booking/src/booking-frontend:build-docker + - services/booking/src/device-reservation:build-docker + - services/booking/src/schedule-service:build-docker + - services/device:build-docker + - services/experiment:build-docker + - services/federation:build-docker + - services/gateway:build-docker - clients/api/js:build - clients/soa/js:build - clients/soa_services/electricalConnection/js:build @@ -509,4 +630,4 @@ integration-test: dependencies: - integration-test:test tags: - - test \ No newline at end of file + - test diff --git a/clients/api/python/src/crosslab/api_client/client.py b/clients/api/python/src/crosslab/api_client/client.py index 5f490bfa..0eb0342e 100644 --- a/clients/api/python/src/crosslab/api_client/client.py +++ b/clients/api/python/src/crosslab/api_client/client.py @@ -63,6 +63,18 @@ UpdateInstitutionRequest, UpdateInstitutionResponse, DeleteInstitutionResponse, + ScheduleRequest, + ScheduleResponse, + NewBookingRequest, + NewBookingResponse, + UpdateBookingRequest, + UpdateBookingResponse, + DeleteBookingResponse, + GetBookingResponse, + DestroyBookingResponse, + LockBookingResponse, + UnlockBookingResponse, + BookingCallbackResponse, ListPlatformResponse, RegisterPlatformResponse, GetPlatformResponse, @@ -824,7 +836,7 @@ async def patch_peerconnection_device_status(self, url: str, body: PatchPeerconn return resp raise Exception(f"Unexpected status code: {status}") - async def list_experiments(self, url: str = "/experiments") -> ListExperimentsResponse: # noqa: E501 + async def list_experiments(self, url: str = "/experiments", experimentStatus: Optional[str] = None) -> ListExperimentsResponse: # noqa: E501 """ List experiments """ # noqa: E501 @@ -838,8 +850,17 @@ async def list_experiments(self, url: str = "/experiments") -> ListExperimentsRe valid_url = '/'+m.group(2)+'/experiments' if valid_url.startswith('//'): valid_url = valid_url[1:] + + # build query params + query_params: Dict[str, Union[List[str], str]] = {} + if experimentStatus: + if isinstance(experimentStatus, list): + query_params['experimentStatus'] = experimentStatus + else: + query_params['experimentStatus'] = str(experimentStatus) + # make http call - status, resp = await self._fetch(valid_url, method="get") + status, resp = await self._fetch(valid_url, method="get", params=query_params) # transform response if status == 200: @@ -1188,6 +1209,205 @@ async def delete_institution(self, url: str) -> DeleteInstitutionResponse: # no return resp raise Exception(f"Unexpected status code: {status}") + async def schedule(self, url: str = "/schedule", body: Optional[ScheduleRequest] = None) -> ScheduleResponse: # noqa: E501 + """ + Returns the free / booked times for given experiment. + """ # noqa: E501 + if not self.BASE_URL: + raise Exception("No base url set") + + # match path to url schema + m = re.search(r'^('+re.escape(self.BASE_URL)+r')?\/?()(schedule)?$', url) + if m is None: + raise Exception("Invalid url") + valid_url = '/'+m.group(2)+'/schedule' + if valid_url.startswith('//'): + valid_url = valid_url[1:] + # make http call + status, resp = await self._fetch(valid_url, method="post", body=body) + + # transform response + if status == 200: + return resp + raise Exception(f"Unexpected status code: {status}") + + async def newBooking(self, body: NewBookingRequest, url: str = "/booking") -> NewBookingResponse: # noqa: E501 + """ + Books an experiment. + """ # noqa: E501 + if not self.BASE_URL: + raise Exception("No base url set") + + # match path to url schema + m = re.search(r'^('+re.escape(self.BASE_URL)+r')?\/?()(booking)?$', url) + if m is None: + raise Exception("Invalid url") + valid_url = '/'+m.group(2)+'/booking' + if valid_url.startswith('//'): + valid_url = valid_url[1:] + # make http call + status, resp = await self._fetch(valid_url, method="post", body=body) + + # transform response + if status == 200: + return resp + raise Exception(f"Unexpected status code: {status}") + + async def updateBooking(self, url: str, body: UpdateBookingRequest) -> UpdateBookingResponse: # noqa: E501 + """ + Allows the addition of devices to a booking (removing of devices is not supportet) or the registration of callbacks. For adding devices, the scope 'booking:use' is required. + + """ # noqa: E501 + if not self.BASE_URL: + raise Exception("No base url set") + + # match path to url schema + m = re.search(r'^('+re.escape(self.BASE_URL)+r')?\/?(booking\/[^?]*?)()?$', url) + if m is None: + raise Exception("Invalid url") + valid_url = '/'+m.group(2)+'' + if valid_url.startswith('//'): + valid_url = valid_url[1:] + # make http call + status, resp = await self._fetch(valid_url, method="patch", body=body) + + # transform response + if status == 200: + return resp + raise Exception(f"Unexpected status code: {status}") + + async def deleteBooking(self, url: str) -> DeleteBookingResponse: # noqa: E501 + """ + Cancels a booking, as long as the booking was originally done by you. + """ # noqa: E501 + if not self.BASE_URL: + raise Exception("No base url set") + + # match path to url schema + m = re.search(r'^('+re.escape(self.BASE_URL)+r')?\/?(booking\/[^?]*?)()?$', url) + if m is None: + raise Exception("Invalid url") + valid_url = '/'+m.group(2)+'' + if valid_url.startswith('//'): + valid_url = valid_url[1:] + # make http call + status, resp = await self._fetch(valid_url, method="delete") + + # transform response + if status == 200: + return resp + raise Exception(f"Unexpected status code: {status}") + + async def getBooking(self, url: str) -> GetBookingResponse: # noqa: E501 + """ + Returns whether a list of devices is currently booked for a user. + """ # noqa: E501 + if not self.BASE_URL: + raise Exception("No base url set") + + # match path to url schema + m = re.search(r'^('+re.escape(self.BASE_URL)+r')?\/?(booking\/[^?]*?)()?$', url) + if m is None: + raise Exception("Invalid url") + valid_url = '/'+m.group(2)+'' + if valid_url.startswith('//'): + valid_url = valid_url[1:] + # make http call + status, resp = await self._fetch(valid_url, method="get") + + # transform response + if status == 200: + return resp + raise Exception(f"Unexpected status code: {status}") + + async def destroyBooking(self, url: str) -> DestroyBookingResponse: # noqa: E501 + """ + Allows selected persons (like lab manager) to remove a user booking. To avoid mistakes, this is a different path than normal delete. + """ # noqa: E501 + if not self.BASE_URL: + raise Exception("No base url set") + + # match path to url schema + m = re.search(r'^('+re.escape(self.BASE_URL)+r')?\/?(booking\/[^?]*?)(\/destroy)?$', url) + if m is None: + raise Exception("Invalid url") + valid_url = '/'+m.group(2)+'/destroy' + if valid_url.startswith('//'): + valid_url = valid_url[1:] + # make http call + status, resp = await self._fetch(valid_url, method="delete") + + # transform response + if status == 200: + return resp + raise Exception(f"Unexpected status code: {status}") + + async def lockBooking(self, url: str) -> LockBookingResponse: # noqa: E501 + """ + Locks the current booking so the devices can be used. This sets the status to "active" This means that the booking can not be cancelled or (currently not implemented) the end time can not be set to a prior time. If called multiple times, the booking will be locked only once. + """ # noqa: E501 + if not self.BASE_URL: + raise Exception("No base url set") + + # match path to url schema + m = re.search(r'^('+re.escape(self.BASE_URL)+r')?\/?(booking\/[^?]*?)(\/lock)?$', url) + if m is None: + raise Exception("Invalid url") + valid_url = '/'+m.group(2)+'/lock' + if valid_url.startswith('//'): + valid_url = valid_url[1:] + # make http call + status, resp = await self._fetch(valid_url, method="put") + + # transform response + if status == 200: + return resp + raise Exception(f"Unexpected status code: {status}") + + async def unlockBooking(self, url: str) -> UnlockBookingResponse: # noqa: E501 + """ + Unlocks all devices belonging to a booking, status will be set to 'booked'. + """ # noqa: E501 + if not self.BASE_URL: + raise Exception("No base url set") + + # match path to url schema + m = re.search(r'^('+re.escape(self.BASE_URL)+r')?\/?(booking\/[^?]*?)(\/lock)?$', url) + if m is None: + raise Exception("Invalid url") + valid_url = '/'+m.group(2)+'/lock' + if valid_url.startswith('//'): + valid_url = valid_url[1:] + # make http call + status, resp = await self._fetch(valid_url, method="delete") + + # transform response + if status == 200: + return resp + raise Exception(f"Unexpected status code: {status}") + + async def bookingCallback(self, url: str) -> BookingCallbackResponse: # noqa: E501 + """ + Callback used for updating device info / booking info. + """ # noqa: E501 + if not self.BASE_URL: + raise Exception("No base url set") + + # match path to url schema + m = re.search(r'^('+re.escape(self.BASE_URL)+r')?\/?(booking_callback\/[^?]*?)()?$', url) + if m is None: + raise Exception("Invalid url") + valid_url = '/'+m.group(2)+'' + if valid_url.startswith('//'): + valid_url = valid_url[1:] + # make http call + status, resp = await self._fetch(valid_url, method="post") + + # transform response + if status == 200: + return resp + raise Exception(f"Unexpected status code: {status}") + async def list_platform(self, url: str = "/lti/platform") -> ListPlatformResponse: # noqa: E501 """ List all platforms. diff --git a/clients/api/python/src/crosslab/api_client/schemas.py b/clients/api/python/src/crosslab/api_client/schemas.py index 7d91c839..ce8c9063 100644 --- a/clients/api/python/src/crosslab/api_client/schemas.py +++ b/clients/api/python/src/crosslab/api_client/schemas.py @@ -3645,6 +3645,278 @@ class UpdateInstitutionResponse200(TypedDict): DeleteInstitutionResponse: TypeAlias = None +class ScheduleRequestExperimentDevicesItems(TypedDict): + """ + A device might either be a physical/virtual device or a group of device.Properties: + - ID: Unique ID of the device. Contains the institution (by having an end point at that institution) + """ + ID: str + + +class ScheduleRequestExperiment(TypedDict): + """ + An experiment describes a set of devices and how they should be connected (potentially among other metadata).Properties: + - Devices: List of devices used in experiment. + - Description: User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + + """ + Devices: List[ScheduleRequestExperimentDevicesItems] + Description: NotRequired[str] + + +class ScheduleRequestTime(TypedDict): + """ + A time slot represents a slice of time used for bookings.Properties: + - Start: Start time of the booking. + - End: End time of the booking. + """ + Start: str + End: str + + +class ScheduleRequest(TypedDict): + """ + Properties: + - Experiment: An experiment describes a set of devices and how they should be connected (potentially among other metadata). + - Time: A time slot represents a slice of time used for bookings. + - Combined: If true, show only one timetable per device instead of one for all available physical devices. + - onlyOwn: (private) Show only devices of this institution. Give an error if a device of an other institution is requested. + """ + Experiment: ScheduleRequestExperiment + Time: ScheduleRequestTime + Combined: NotRequired[bool] + onlyOwn: NotRequired[bool] + + +class ScheduleResponse200ItemsBookedItems(TypedDict): + """ + A time slot represents a slice of time used for bookings.Properties: + - Start: Start time of the booking. + - End: End time of the booking. + """ + Start: str + End: str + + +class ScheduleResponse200ItemsFreeItems(TypedDict): + """ + A time slot represents a slice of time used for bookings.Properties: + - Start: Start time of the booking. + - End: End time of the booking. + """ + Start: str + End: str + + +class ScheduleResponse200Items(TypedDict): + """ + Properties: + - Device: ID of the device (or * if combined). + - Booked: Array of booked times. + - Free: Array of free times. + """ + Device: str + Booked: List[ScheduleResponse200ItemsBookedItems] + Free: List[ScheduleResponse200ItemsFreeItems] + + +ScheduleResponse200: TypeAlias = List[ScheduleResponse200Items] + + +ScheduleResponse404: TypeAlias = str + + +ScheduleResponse422: TypeAlias = str + + +ScheduleResponse500: TypeAlias = str + + +ScheduleResponse: TypeAlias = Union[ScheduleResponse200, ScheduleResponse404, ScheduleResponse422, ScheduleResponse500] + + +class NewBookingRequestDevicesItems(TypedDict): + """ + A device might either be a physical/virtual device or a group of device.Properties: + - ID: Unique ID of the device. Contains the institution (by having an end point at that institution) + """ + ID: str + + +class NewBookingRequestTime(TypedDict): + """ + A time slot represents a slice of time used for bookings.Properties: + - Start: Start time of the booking. + - End: End time of the booking. + """ + Start: str + End: str + + +class NewBookingRequest(TypedDict): + """ + Properties: + - Devices: List of devices which should be added. + - Time: A time slot represents a slice of time used for bookings. + - Type: Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + """ + Devices: List[NewBookingRequestDevicesItems] + Time: NewBookingRequestTime + Type: NotRequired[Literal["normal"]] + + +class NewBookingResponse200(TypedDict): + """ + Properties: + - BookingID: ID at which the booking can be managed. + """ + BookingID: str + + +NewBookingResponse500: TypeAlias = str + + +NewBookingResponse: TypeAlias = Union[NewBookingResponse200, NewBookingResponse500] + + +class UpdateBookingRequestAlt1DevicesItems(TypedDict): + """ + A device might either be a physical/virtual device or a group of device.Properties: + - ID: Unique ID of the device. Contains the institution (by having an end point at that institution) + """ + ID: str + + +class UpdateBookingRequestAlt1(TypedDict): + """ + Use this request for adding devices.Properties: + - Locked: Expresses whether the devices should be locked. Must match current status of booking. Is assumed to be false if not set. + - Devices: List of devices which should be added. + """ + Locked: NotRequired[bool] + Devices: NotRequired[List[UpdateBookingRequestAlt1DevicesItems]] + + +class UpdateBookingRequestAlt2(TypedDict): + """ + Use this request for adding callbacks.Properties: + - Callback: Callback which should be called at changes. + """ + Callback: NotRequired[str] + + +UpdateBookingRequest = Union[UpdateBookingRequestAlt1, UpdateBookingRequestAlt2] + + +class UpdateBookingResponse200(TypedDict): + """ + Properties: + - BookingID + """ + BookingID: str + + +UpdateBookingResponse400: TypeAlias = str + + +UpdateBookingResponse500: TypeAlias = str + + +UpdateBookingResponse: TypeAlias = Union[UpdateBookingResponse200, UpdateBookingResponse400, UpdateBookingResponse500] + + +DeleteBookingResponse500: TypeAlias = str + + +DeleteBookingResponse: TypeAlias = DeleteBookingResponse500 + + +class GetBookingResponse200BookingTime(TypedDict): + """ + A time slot represents a slice of time used for bookings.Properties: + - Start: Start time of the booking. + - End: End time of the booking. + """ + Start: str + End: str + + +class GetBookingResponse200Booking(TypedDict): + """ + A booking in the booking system.Properties: + - ID: Unique ID of the booking. + - Time: A time slot represents a slice of time used for bookings. + - Devices + - Type: Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + - Status: Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + + - You: If true, this booking was done by you. + - External: Shows whether the booking was done by an external institution. + - Message: User readable notes about the status of the booking (e.g. if devices are unknown). + """ + ID: str + Time: GetBookingResponse200BookingTime + Devices: List[str] + Type: NotRequired[Literal["normal"]] + Status: Literal["pending", "booked", "rejected", "cancelled", "active", "active-pending", "active-rejected"] + You: bool + External: bool + Message: NotRequired[str] + + +class GetBookingResponse200(TypedDict): + """ + Properties: + - Booking: A booking in the booking system. + - Locked: Shows if the booking is in a locked status. + """ + Booking: GetBookingResponse200Booking + Locked: bool + + +GetBookingResponse500: TypeAlias = str + + +GetBookingResponse: TypeAlias = Union[GetBookingResponse200, GetBookingResponse500] + + +DestroyBookingResponse500: TypeAlias = str + + +DestroyBookingResponse: TypeAlias = DestroyBookingResponse500 + + +class LockBookingResponse200Items(TypedDict): + """ + Properties: + - Requested + - Selected + """ + Requested: str + Selected: str + + +LockBookingResponse200: TypeAlias = List[LockBookingResponse200Items] + + +LockBookingResponse500: TypeAlias = str + + +LockBookingResponse: TypeAlias = Union[LockBookingResponse200, LockBookingResponse500] + + +UnlockBookingResponse500: TypeAlias = str + + +UnlockBookingResponse: TypeAlias = UnlockBookingResponse500 + + +BookingCallbackResponse500: TypeAlias = str + + +BookingCallbackResponse: TypeAlias = BookingCallbackResponse500 + + class ListPlatformResponse200ItemsRegistration(TypedDict): """ Properties: diff --git a/clients/api/python/tests/test_openapi.py b/clients/api/python/tests/test_openapi.py index 5c2da656..386e2680 100644 --- a/clients/api/python/tests/test_openapi.py +++ b/clients/api/python/tests/test_openapi.py @@ -3466,7 +3466,7 @@ async def test_list_experiments(aioresponses: aioresponses): url_variant = r'experiments' full_url = BASE_URL+r'/experiments' - parameter_list = [{}, ] + parameter_list = [{"experimentStatus": "test_string", }, {}, ] for parameters in parameter_list: response_200_dict = json.loads(r'[{"url":"http://NwclrXAIoAJHMVyKoIoS.xxfoad9OtNWxMyq2kGx5D4","status":"created"},{"url":"https://gpvQwLgrWBBvxozT.rdbpyyMAR8WSBkoXtkDeX7BysNkrZe.8SlFVwdKIGbmewpJjeU0ayCar6q74SqFK8vAvqSrmK1BfSqgJCQPcF","status":"created"}]') @@ -5574,6 +5574,1278 @@ async def test_delete_institution(aioresponses: aioresponses): resp = await client.delete_institution(url=full_url, **parameters) +@pytest.mark.asyncio +async def test_schedule(aioresponses: aioresponses): + url = r'/schedule' + url_variant = r'schedule' + full_url = BASE_URL+r'/schedule' + + request = json.loads(r'{"Experiment":{"Devices":[{"ID":"https://eoKzcaLEO.jigrLrN,QtmSeOrwdDkjY4"},{"ID":"https://dJaL.omM0GRYOmeEyMOG8,lOwfYgxMRtEfPZWHiX,HISaF0nFZxn37U4ILuINMGozBLrh.aOLN8uc6"}],"Description":"in dolore pariatur ut"},"Time":{"Start":"1981-06-10T04:14:08.0Z","End":"1951-06-17T02:47:39.0Z"}}') + + parameter_list = [{}, ] + + for parameters in parameter_list: + response_200_dict = json.loads(r'[{"Device":"deserunt","Booked":[{"Start":"1948-05-28T02:28:12.0Z","End":"2011-12-30T01:38:02.0Z"},{"Start":"1985-12-18T10:09:01.0Z","End":"1978-01-18T18:32:01.0Z"}],"Free":[{"Start":"1961-12-22T19:04:41.0Z","End":"2001-11-27T06:05:08.0Z"},{"Start":"2012-02-02T16:18:57.0Z","End":"1966-03-15T22:35:31.0Z"},{"Start":"1982-08-02T04:58:59.0Z","End":"1994-05-06T05:04:50.0Z"},{"Start":"2008-12-26T17:21:24.0Z","End":"1983-12-05T17:38:55.0Z"}]},{"Device":"voluptate sed","Booked":[{"Start":"2013-11-17T05:48:45.0Z","End":"1998-12-07T01:30:34.0Z"},{"Start":"1984-09-11T04:11:16.0Z","End":"1970-10-28T01:19:38.0Z"},{"Start":"1958-04-10T07:56:51.0Z","End":"1960-07-18T04:47:46.0Z"}],"Free":[{"Start":"1982-08-29T04:12:21.0Z","End":"1968-11-30T13:07:01.0Z"}]},{"Device":"irure laboris consequat minim","Booked":[{"Start":"2010-02-25T04:35:02.0Z","End":"1959-09-10T01:34:53.0Z"}],"Free":[{"Start":"2001-04-09T22:29:19.0Z","End":"2005-06-04T08:28:39.0Z"},{"Start":"1979-01-07T05:35:26.0Z","End":"2019-06-10T21:57:56.0Z"},{"Start":"1971-01-18T04:03:03.0Z","End":"1960-05-19T05:07:48.0Z"}]},{"Device":"est et","Booked":[{"Start":"1969-01-26T21:55:52.0Z","End":"2014-09-15T10:37:51.0Z"},{"Start":"1976-11-11T14:44:42.0Z","End":"2013-12-15T19:03:32.0Z"}],"Free":[{"Start":"1963-05-16T13:25:55.0Z","End":"2011-06-21T19:03:17.0Z"},{"Start":"1944-05-29T20:44:47.0Z","End":"1962-03-04T14:52:27.0Z"},{"Start":"1977-04-02T14:22:19.0Z","End":"2011-07-11T16:07:14.0Z"}]}]') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200, payload=response_200_dict) + async with APIClient(BASE_URL) as client: + resp = await client.schedule(body=request, **parameters) + assert normalize_result(resp) == normalize_result(response_200_dict) + + for parameters in parameter_list: + response_200_dict = json.loads(r'[{"Device":"deserunt","Booked":[{"Start":"1948-05-28T02:28:12.0Z","End":"2011-12-30T01:38:02.0Z"},{"Start":"1985-12-18T10:09:01.0Z","End":"1978-01-18T18:32:01.0Z"}],"Free":[{"Start":"1961-12-22T19:04:41.0Z","End":"2001-11-27T06:05:08.0Z"},{"Start":"2012-02-02T16:18:57.0Z","End":"1966-03-15T22:35:31.0Z"},{"Start":"1982-08-02T04:58:59.0Z","End":"1994-05-06T05:04:50.0Z"},{"Start":"2008-12-26T17:21:24.0Z","End":"1983-12-05T17:38:55.0Z"}]},{"Device":"voluptate sed","Booked":[{"Start":"2013-11-17T05:48:45.0Z","End":"1998-12-07T01:30:34.0Z"},{"Start":"1984-09-11T04:11:16.0Z","End":"1970-10-28T01:19:38.0Z"},{"Start":"1958-04-10T07:56:51.0Z","End":"1960-07-18T04:47:46.0Z"}],"Free":[{"Start":"1982-08-29T04:12:21.0Z","End":"1968-11-30T13:07:01.0Z"}]},{"Device":"irure laboris consequat minim","Booked":[{"Start":"2010-02-25T04:35:02.0Z","End":"1959-09-10T01:34:53.0Z"}],"Free":[{"Start":"2001-04-09T22:29:19.0Z","End":"2005-06-04T08:28:39.0Z"},{"Start":"1979-01-07T05:35:26.0Z","End":"2019-06-10T21:57:56.0Z"},{"Start":"1971-01-18T04:03:03.0Z","End":"1960-05-19T05:07:48.0Z"}]},{"Device":"est et","Booked":[{"Start":"1969-01-26T21:55:52.0Z","End":"2014-09-15T10:37:51.0Z"},{"Start":"1976-11-11T14:44:42.0Z","End":"2013-12-15T19:03:32.0Z"}],"Free":[{"Start":"1963-05-16T13:25:55.0Z","End":"2011-06-21T19:03:17.0Z"},{"Start":"1944-05-29T20:44:47.0Z","End":"1962-03-04T14:52:27.0Z"},{"Start":"1977-04-02T14:22:19.0Z","End":"2011-07-11T16:07:14.0Z"}]}]') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200, payload=response_200_dict) + async with APIClient(BASE_URL) as client: + resp = await client.schedule(url=url, body=request, **parameters) + assert normalize_result(resp) == normalize_result(response_200_dict) + + for parameters in parameter_list: + response_200_dict = json.loads(r'[{"Device":"deserunt","Booked":[{"Start":"1948-05-28T02:28:12.0Z","End":"2011-12-30T01:38:02.0Z"},{"Start":"1985-12-18T10:09:01.0Z","End":"1978-01-18T18:32:01.0Z"}],"Free":[{"Start":"1961-12-22T19:04:41.0Z","End":"2001-11-27T06:05:08.0Z"},{"Start":"2012-02-02T16:18:57.0Z","End":"1966-03-15T22:35:31.0Z"},{"Start":"1982-08-02T04:58:59.0Z","End":"1994-05-06T05:04:50.0Z"},{"Start":"2008-12-26T17:21:24.0Z","End":"1983-12-05T17:38:55.0Z"}]},{"Device":"voluptate sed","Booked":[{"Start":"2013-11-17T05:48:45.0Z","End":"1998-12-07T01:30:34.0Z"},{"Start":"1984-09-11T04:11:16.0Z","End":"1970-10-28T01:19:38.0Z"},{"Start":"1958-04-10T07:56:51.0Z","End":"1960-07-18T04:47:46.0Z"}],"Free":[{"Start":"1982-08-29T04:12:21.0Z","End":"1968-11-30T13:07:01.0Z"}]},{"Device":"irure laboris consequat minim","Booked":[{"Start":"2010-02-25T04:35:02.0Z","End":"1959-09-10T01:34:53.0Z"}],"Free":[{"Start":"2001-04-09T22:29:19.0Z","End":"2005-06-04T08:28:39.0Z"},{"Start":"1979-01-07T05:35:26.0Z","End":"2019-06-10T21:57:56.0Z"},{"Start":"1971-01-18T04:03:03.0Z","End":"1960-05-19T05:07:48.0Z"}]},{"Device":"est et","Booked":[{"Start":"1969-01-26T21:55:52.0Z","End":"2014-09-15T10:37:51.0Z"},{"Start":"1976-11-11T14:44:42.0Z","End":"2013-12-15T19:03:32.0Z"}],"Free":[{"Start":"1963-05-16T13:25:55.0Z","End":"2011-06-21T19:03:17.0Z"},{"Start":"1944-05-29T20:44:47.0Z","End":"1962-03-04T14:52:27.0Z"},{"Start":"1977-04-02T14:22:19.0Z","End":"2011-07-11T16:07:14.0Z"}]}]') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200, payload=response_200_dict) + async with APIClient(BASE_URL) as client: + resp = await client.schedule(url=url_variant, body=request, **parameters) + assert normalize_result(resp) == normalize_result(response_200_dict) + + for parameters in parameter_list: + response_200_dict = json.loads(r'[{"Device":"deserunt","Booked":[{"Start":"1948-05-28T02:28:12.0Z","End":"2011-12-30T01:38:02.0Z"},{"Start":"1985-12-18T10:09:01.0Z","End":"1978-01-18T18:32:01.0Z"}],"Free":[{"Start":"1961-12-22T19:04:41.0Z","End":"2001-11-27T06:05:08.0Z"},{"Start":"2012-02-02T16:18:57.0Z","End":"1966-03-15T22:35:31.0Z"},{"Start":"1982-08-02T04:58:59.0Z","End":"1994-05-06T05:04:50.0Z"},{"Start":"2008-12-26T17:21:24.0Z","End":"1983-12-05T17:38:55.0Z"}]},{"Device":"voluptate sed","Booked":[{"Start":"2013-11-17T05:48:45.0Z","End":"1998-12-07T01:30:34.0Z"},{"Start":"1984-09-11T04:11:16.0Z","End":"1970-10-28T01:19:38.0Z"},{"Start":"1958-04-10T07:56:51.0Z","End":"1960-07-18T04:47:46.0Z"}],"Free":[{"Start":"1982-08-29T04:12:21.0Z","End":"1968-11-30T13:07:01.0Z"}]},{"Device":"irure laboris consequat minim","Booked":[{"Start":"2010-02-25T04:35:02.0Z","End":"1959-09-10T01:34:53.0Z"}],"Free":[{"Start":"2001-04-09T22:29:19.0Z","End":"2005-06-04T08:28:39.0Z"},{"Start":"1979-01-07T05:35:26.0Z","End":"2019-06-10T21:57:56.0Z"},{"Start":"1971-01-18T04:03:03.0Z","End":"1960-05-19T05:07:48.0Z"}]},{"Device":"est et","Booked":[{"Start":"1969-01-26T21:55:52.0Z","End":"2014-09-15T10:37:51.0Z"},{"Start":"1976-11-11T14:44:42.0Z","End":"2013-12-15T19:03:32.0Z"}],"Free":[{"Start":"1963-05-16T13:25:55.0Z","End":"2011-06-21T19:03:17.0Z"},{"Start":"1944-05-29T20:44:47.0Z","End":"1962-03-04T14:52:27.0Z"},{"Start":"1977-04-02T14:22:19.0Z","End":"2011-07-11T16:07:14.0Z"}]}]') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200, payload=response_200_dict) + async with APIClient(BASE_URL) as client: + resp = await client.schedule(url=full_url, body=request, **parameters) + assert normalize_result(resp) == normalize_result(response_200_dict) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=400) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=400) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=400) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=400) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=full_url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=full_url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=full_url, body=request, **parameters) + + for parameters in parameter_list: + response_404_dict = json.loads(r'"commodo in"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404, payload=response_404_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(body=request, **parameters) + + for parameters in parameter_list: + response_404_dict = json.loads(r'"commodo in"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404, payload=response_404_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=url, body=request, **parameters) + + for parameters in parameter_list: + response_404_dict = json.loads(r'"commodo in"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404, payload=response_404_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + response_404_dict = json.loads(r'"commodo in"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404, payload=response_404_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=full_url, body=request, **parameters) + + for parameters in parameter_list: + response_422_dict = json.loads(r'"mollit"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=422, payload=response_422_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(body=request, **parameters) + + for parameters in parameter_list: + response_422_dict = json.loads(r'"mollit"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=422, payload=response_422_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=url, body=request, **parameters) + + for parameters in parameter_list: + response_422_dict = json.loads(r'"mollit"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=422, payload=response_422_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + response_422_dict = json.loads(r'"mollit"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=422, payload=response_422_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=full_url, body=request, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"veniam ex eu"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(body=request, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"veniam ex eu"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=url, body=request, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"veniam ex eu"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"veniam ex eu"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=full_url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.schedule(url=full_url, body=request, **parameters) + + +@pytest.mark.asyncio +async def test_newBooking(aioresponses: aioresponses): + url = r'/booking' + url_variant = r'booking' + full_url = BASE_URL+r'/booking' + + request = json.loads(r'{"Devices":[{"ID":"https://oCCTTNStvcBbcmLKslaSMmqVGx.auzBY3BJWu8x-QporrHYcC9bqsef8NDutN5ohOWawZbhZ8r"},{"ID":"http://fxAFgbruxuEEUzmlpkQyPQjTvbNrEUlw.dbgFCsvm,LZ+kIzgghTNqyNTtrGAlQq2MjmMn1grGk2ZkZRGoZxQ+A0N"}],"Time":{"Start":"1957-06-19T20:42:50.0Z","End":"2017-12-16T17:13:02.0Z"},"Type":"normal"}') + + parameter_list = [{}, ] + + for parameters in parameter_list: + response_200_dict = json.loads(r'{"BookingID":"https://zurWHxnuNekdQetiawWc.uncovYoMyvENFntDMplEsNtcFgBUP17FfZ2Wkcx1SeQnu+iggAOfJGk"}') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200, payload=response_200_dict) + async with APIClient(BASE_URL) as client: + resp = await client.newBooking(body=request, **parameters) + assert normalize_result(resp) == normalize_result(response_200_dict) + + for parameters in parameter_list: + response_200_dict = json.loads(r'{"BookingID":"https://zurWHxnuNekdQetiawWc.uncovYoMyvENFntDMplEsNtcFgBUP17FfZ2Wkcx1SeQnu+iggAOfJGk"}') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200, payload=response_200_dict) + async with APIClient(BASE_URL) as client: + resp = await client.newBooking(url=url, body=request, **parameters) + assert normalize_result(resp) == normalize_result(response_200_dict) + + for parameters in parameter_list: + response_200_dict = json.loads(r'{"BookingID":"https://zurWHxnuNekdQetiawWc.uncovYoMyvENFntDMplEsNtcFgBUP17FfZ2Wkcx1SeQnu+iggAOfJGk"}') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200, payload=response_200_dict) + async with APIClient(BASE_URL) as client: + resp = await client.newBooking(url=url_variant, body=request, **parameters) + assert normalize_result(resp) == normalize_result(response_200_dict) + + for parameters in parameter_list: + response_200_dict = json.loads(r'{"BookingID":"https://zurWHxnuNekdQetiawWc.uncovYoMyvENFntDMplEsNtcFgBUP17FfZ2Wkcx1SeQnu+iggAOfJGk"}') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200, payload=response_200_dict) + async with APIClient(BASE_URL) as client: + resp = await client.newBooking(url=full_url, body=request, **parameters) + assert normalize_result(resp) == normalize_result(response_200_dict) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.newBooking(body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.newBooking(url=url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.newBooking(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.newBooking(url=full_url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.newBooking(body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.newBooking(url=url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.newBooking(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.newBooking(url=full_url, body=request, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"ea mollit"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.newBooking(body=request, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"ea mollit"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.newBooking(url=url, body=request, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"ea mollit"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.newBooking(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"ea mollit"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.newBooking(url=full_url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.newBooking(body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.newBooking(url=url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.newBooking(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.newBooking(url=full_url, body=request, **parameters) + + +@pytest.mark.asyncio +async def test_updateBooking(aioresponses: aioresponses): + url = r'/booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c' + url_variant = r'booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c' + full_url = BASE_URL+r'/booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c' + + request = json.loads(r'{"Locked":true,"Devices":[{"ID":"http://k.wgaOIBHxZfiNzV7AkaVuQ1UvsgVbtXmOHr3UacIqwT3BazSLm68y1Js"},{"ID":"https://ohlnuiclAHELGBqVjSlJNnwurIJTY.dfpkNwARhVGSLnPEP8jC7LYUNTZu-+lz9F5bZHXYqjq"}]}') + + parameter_list = [{}, ] + + for parameters in parameter_list: + response_200_dict = json.loads(r'{"BookingID":"http://akJjTPgNsQCcPFMaZe.zlmvloXia0bqBjdT1Rfy3PSFGpCVkgqoAa9GgiZHg4r"}') + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200, payload=response_200_dict) + async with APIClient(BASE_URL) as client: + resp = await client.updateBooking(url=url, body=request, **parameters) + assert normalize_result(resp) == normalize_result(response_200_dict) + + for parameters in parameter_list: + response_200_dict = json.loads(r'{"BookingID":"http://akJjTPgNsQCcPFMaZe.zlmvloXia0bqBjdT1Rfy3PSFGpCVkgqoAa9GgiZHg4r"}') + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200, payload=response_200_dict) + async with APIClient(BASE_URL) as client: + resp = await client.updateBooking(url=url_variant, body=request, **parameters) + assert normalize_result(resp) == normalize_result(response_200_dict) + + for parameters in parameter_list: + response_200_dict = json.loads(r'{"BookingID":"http://akJjTPgNsQCcPFMaZe.zlmvloXia0bqBjdT1Rfy3PSFGpCVkgqoAa9GgiZHg4r"}') + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200, payload=response_200_dict) + async with APIClient(BASE_URL) as client: + resp = await client.updateBooking(url=full_url, body=request, **parameters) + assert normalize_result(resp) == normalize_result(response_200_dict) + + for parameters in parameter_list: + response_400_dict = json.loads(r'"ad fugiat"') + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=400, payload=response_400_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=url, body=request, **parameters) + + for parameters in parameter_list: + response_400_dict = json.loads(r'"ad fugiat"') + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=400, payload=response_400_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + response_400_dict = json.loads(r'"ad fugiat"') + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=400, payload=response_400_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=full_url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=full_url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=full_url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=full_url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=423) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=423) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=423) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=full_url, body=request, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"ad fugiat"') + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=url, body=request, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"ad fugiat"') + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"ad fugiat"') + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=full_url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=url, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=url_variant, body=request, **parameters) + + for parameters in parameter_list: + aioresponses.patch(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.updateBooking(url=full_url, body=request, **parameters) + + +@pytest.mark.asyncio +async def test_deleteBooking(aioresponses: aioresponses): + url = r'/booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c' + url_variant = r'booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c' + full_url = BASE_URL+r'/booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c' + + parameter_list = [{}, ] + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200) + async with APIClient(BASE_URL) as client: + resp = await client.deleteBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200) + async with APIClient(BASE_URL) as client: + resp = await client.deleteBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200) + async with APIClient(BASE_URL) as client: + resp = await client.deleteBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=423) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=423) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=423) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=full_url, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"ad fugiat"') + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=url, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"ad fugiat"') + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"ad fugiat"') + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.deleteBooking(url=full_url, **parameters) + + +@pytest.mark.asyncio +async def test_getBooking(aioresponses: aioresponses): + url = r'/booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c' + url_variant = r'booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c' + full_url = BASE_URL+r'/booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c' + + parameter_list = [{}, ] + + for parameters in parameter_list: + response_200_dict = json.loads(r'{"Booking":{"ID":"https://qhQkiiruUxtUtbGmjaXwNC.neZld0VWn5OHMWi2rZ8oi-sv2W7RJlGiu6E4TtMQzwHyNISGmkg+CY2OCvHTxFBaYGO0u","Time":{"Start":"1964-12-11T17:12:39.0Z","End":"1983-03-23T22:36:39.0Z"},"Devices":["https://MSoPGR.qbojgUH2Y+tqKvMJEQorqAvvxtqCXZthUzmwJuZ-2MkJyv5WEWtPYwH9n,F","http://dvGWLhbJbQJ.ejdS","https://gVgJcnupaGdLWloiORp.eroxDq3cPowUmAwFkPcgEW,oivqBNl1+MGJFwwoJyw,Hn","http://ySSHqBm.dwyCPbuiqQ0Xmz-.4"],"Status":"rejected","You":false,"External":false,"Message":"adipisicing ad id pariatur nulla","Type":"normal"},"Locked":false}') + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200, payload=response_200_dict) + async with APIClient(BASE_URL) as client: + resp = await client.getBooking(url=url, **parameters) + assert normalize_result(resp) == normalize_result(response_200_dict) + + for parameters in parameter_list: + response_200_dict = json.loads(r'{"Booking":{"ID":"https://qhQkiiruUxtUtbGmjaXwNC.neZld0VWn5OHMWi2rZ8oi-sv2W7RJlGiu6E4TtMQzwHyNISGmkg+CY2OCvHTxFBaYGO0u","Time":{"Start":"1964-12-11T17:12:39.0Z","End":"1983-03-23T22:36:39.0Z"},"Devices":["https://MSoPGR.qbojgUH2Y+tqKvMJEQorqAvvxtqCXZthUzmwJuZ-2MkJyv5WEWtPYwH9n,F","http://dvGWLhbJbQJ.ejdS","https://gVgJcnupaGdLWloiORp.eroxDq3cPowUmAwFkPcgEW,oivqBNl1+MGJFwwoJyw,Hn","http://ySSHqBm.dwyCPbuiqQ0Xmz-.4"],"Status":"rejected","You":false,"External":false,"Message":"adipisicing ad id pariatur nulla","Type":"normal"},"Locked":false}') + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200, payload=response_200_dict) + async with APIClient(BASE_URL) as client: + resp = await client.getBooking(url=url_variant, **parameters) + assert normalize_result(resp) == normalize_result(response_200_dict) + + for parameters in parameter_list: + response_200_dict = json.loads(r'{"Booking":{"ID":"https://qhQkiiruUxtUtbGmjaXwNC.neZld0VWn5OHMWi2rZ8oi-sv2W7RJlGiu6E4TtMQzwHyNISGmkg+CY2OCvHTxFBaYGO0u","Time":{"Start":"1964-12-11T17:12:39.0Z","End":"1983-03-23T22:36:39.0Z"},"Devices":["https://MSoPGR.qbojgUH2Y+tqKvMJEQorqAvvxtqCXZthUzmwJuZ-2MkJyv5WEWtPYwH9n,F","http://dvGWLhbJbQJ.ejdS","https://gVgJcnupaGdLWloiORp.eroxDq3cPowUmAwFkPcgEW,oivqBNl1+MGJFwwoJyw,Hn","http://ySSHqBm.dwyCPbuiqQ0Xmz-.4"],"Status":"rejected","You":false,"External":false,"Message":"adipisicing ad id pariatur nulla","Type":"normal"},"Locked":false}') + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200, payload=response_200_dict) + async with APIClient(BASE_URL) as client: + resp = await client.getBooking(url=full_url, **parameters) + assert normalize_result(resp) == normalize_result(response_200_dict) + + for parameters in parameter_list: + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.getBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.getBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.getBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.getBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.getBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.getBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.getBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.getBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.getBooking(url=full_url, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"elit commodo minim eu"') + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.getBooking(url=url, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"elit commodo minim eu"') + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.getBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"elit commodo minim eu"') + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.getBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.getBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.getBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.get(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.getBooking(url=full_url, **parameters) + + +@pytest.mark.asyncio +async def test_destroyBooking(aioresponses: aioresponses): + url = r'/booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c/destroy' + url_variant = r'booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c/destroy' + full_url = BASE_URL+r'/booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c/destroy' + + parameter_list = [{}, ] + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200) + async with APIClient(BASE_URL) as client: + resp = await client.destroyBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200) + async with APIClient(BASE_URL) as client: + resp = await client.destroyBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200) + async with APIClient(BASE_URL) as client: + resp = await client.destroyBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=423) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=423) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=423) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=full_url, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"ad fugiat"') + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=url, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"ad fugiat"') + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"ad fugiat"') + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.destroyBooking(url=full_url, **parameters) + + +@pytest.mark.asyncio +async def test_lockBooking(aioresponses: aioresponses): + url = r'/booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c/lock' + url_variant = r'booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c/lock' + full_url = BASE_URL+r'/booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c/lock' + + parameter_list = [{}, ] + + for parameters in parameter_list: + response_200_dict = json.loads(r'[{"Requested":"http://yiRyQY.upcxSE+-Dt+yeL","Selected":"https://aEfpYLsPzTiKHUjDdaZqyoDJwdYyi.rfmpCGiIatB7d6ON,0Wr2XkcBvhL3t6nyVirx8SDzb"},{"Requested":"https://toVVoQmUnSXuahwfeTRxpNnDE.yug7Zz9nBIdQhW2GZYygo31sewyh.G","Selected":"https://XQIUSphplmT.pubUJoCRaU9etAf0uivpRC0jsje"},{"Requested":"http://Kvsu.pyqaRVJ1uwJ8xaFz1uG4rpgnZCX9zyfTcIwWdiBhXpoISjdduhUDF7E.vDe","Selected":"https://zNdrBJZQW.dqqlUM1nRzvtbRxn7+Fb6zHE3eCJCd,5rMpCPM3tut64+SnKGZIOayPKVhIItvniaBYx5zat7b"},{"Requested":"https://fdZmspjHNxJbzMQYgWwCJpuojNSkAVlOa.ngfhBC3TgaCQn-pN,xiJngw3PjoMMmYluRriS33e","Selected":"https://VhHcokmycuzIDimdpNZcNDEwblRDme.fdciB9nT,qyP8szCg9nMT2EnE-lfj7LQEbLZ0owZ7Q,WJbT"},{"Requested":"https://JzNxIalMPxPXEijJi.uumgKo-dgJE","Selected":"https://tuN.faDII-kaqNvW"}]') + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200, payload=response_200_dict) + async with APIClient(BASE_URL) as client: + resp = await client.lockBooking(url=url, **parameters) + assert normalize_result(resp) == normalize_result(response_200_dict) + + for parameters in parameter_list: + response_200_dict = json.loads(r'[{"Requested":"http://yiRyQY.upcxSE+-Dt+yeL","Selected":"https://aEfpYLsPzTiKHUjDdaZqyoDJwdYyi.rfmpCGiIatB7d6ON,0Wr2XkcBvhL3t6nyVirx8SDzb"},{"Requested":"https://toVVoQmUnSXuahwfeTRxpNnDE.yug7Zz9nBIdQhW2GZYygo31sewyh.G","Selected":"https://XQIUSphplmT.pubUJoCRaU9etAf0uivpRC0jsje"},{"Requested":"http://Kvsu.pyqaRVJ1uwJ8xaFz1uG4rpgnZCX9zyfTcIwWdiBhXpoISjdduhUDF7E.vDe","Selected":"https://zNdrBJZQW.dqqlUM1nRzvtbRxn7+Fb6zHE3eCJCd,5rMpCPM3tut64+SnKGZIOayPKVhIItvniaBYx5zat7b"},{"Requested":"https://fdZmspjHNxJbzMQYgWwCJpuojNSkAVlOa.ngfhBC3TgaCQn-pN,xiJngw3PjoMMmYluRriS33e","Selected":"https://VhHcokmycuzIDimdpNZcNDEwblRDme.fdciB9nT,qyP8szCg9nMT2EnE-lfj7LQEbLZ0owZ7Q,WJbT"},{"Requested":"https://JzNxIalMPxPXEijJi.uumgKo-dgJE","Selected":"https://tuN.faDII-kaqNvW"}]') + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200, payload=response_200_dict) + async with APIClient(BASE_URL) as client: + resp = await client.lockBooking(url=url_variant, **parameters) + assert normalize_result(resp) == normalize_result(response_200_dict) + + for parameters in parameter_list: + response_200_dict = json.loads(r'[{"Requested":"http://yiRyQY.upcxSE+-Dt+yeL","Selected":"https://aEfpYLsPzTiKHUjDdaZqyoDJwdYyi.rfmpCGiIatB7d6ON,0Wr2XkcBvhL3t6nyVirx8SDzb"},{"Requested":"https://toVVoQmUnSXuahwfeTRxpNnDE.yug7Zz9nBIdQhW2GZYygo31sewyh.G","Selected":"https://XQIUSphplmT.pubUJoCRaU9etAf0uivpRC0jsje"},{"Requested":"http://Kvsu.pyqaRVJ1uwJ8xaFz1uG4rpgnZCX9zyfTcIwWdiBhXpoISjdduhUDF7E.vDe","Selected":"https://zNdrBJZQW.dqqlUM1nRzvtbRxn7+Fb6zHE3eCJCd,5rMpCPM3tut64+SnKGZIOayPKVhIItvniaBYx5zat7b"},{"Requested":"https://fdZmspjHNxJbzMQYgWwCJpuojNSkAVlOa.ngfhBC3TgaCQn-pN,xiJngw3PjoMMmYluRriS33e","Selected":"https://VhHcokmycuzIDimdpNZcNDEwblRDme.fdciB9nT,qyP8szCg9nMT2EnE-lfj7LQEbLZ0owZ7Q,WJbT"},{"Requested":"https://JzNxIalMPxPXEijJi.uumgKo-dgJE","Selected":"https://tuN.faDII-kaqNvW"}]') + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200, payload=response_200_dict) + async with APIClient(BASE_URL) as client: + resp = await client.lockBooking(url=full_url, **parameters) + assert normalize_result(resp) == normalize_result(response_200_dict) + + for parameters in parameter_list: + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=412) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=412) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=412) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=full_url, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"enim culpa"') + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=url, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"enim culpa"') + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"enim culpa"') + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.put(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.lockBooking(url=full_url, **parameters) + + +@pytest.mark.asyncio +async def test_unlockBooking(aioresponses: aioresponses): + url = r'/booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c/lock' + url_variant = r'booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c/lock' + full_url = BASE_URL+r'/booking/c799cc2e-cdc5-4143-973a-6f56a5afa82c/lock' + + parameter_list = [{}, ] + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200) + async with APIClient(BASE_URL) as client: + resp = await client.unlockBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200) + async with APIClient(BASE_URL) as client: + resp = await client.unlockBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200) + async with APIClient(BASE_URL) as client: + resp = await client.unlockBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=401) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=403) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=412) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=412) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=412) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=full_url, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"veniam ex eu"') + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=url, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"veniam ex eu"') + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"veniam ex eu"') + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.delete(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.unlockBooking(url=full_url, **parameters) + + +@pytest.mark.asyncio +async def test_bookingCallback(aioresponses: aioresponses): + url = r'/booking_callback/c799cc2e-cdc5-4143-973a-6f56a5afa82c' + url_variant = r'booking_callback/c799cc2e-cdc5-4143-973a-6f56a5afa82c' + full_url = BASE_URL+r'/booking_callback/c799cc2e-cdc5-4143-973a-6f56a5afa82c' + + parameter_list = [{}, ] + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200) + async with APIClient(BASE_URL) as client: + resp = await client.bookingCallback(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200) + async with APIClient(BASE_URL) as client: + resp = await client.bookingCallback(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=200) + async with APIClient(BASE_URL) as client: + resp = await client.bookingCallback(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.bookingCallback(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.bookingCallback(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=404) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.bookingCallback(url=full_url, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"veniam ex eu"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.bookingCallback(url=url, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"veniam ex eu"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.bookingCallback(url=url_variant, **parameters) + + for parameters in parameter_list: + response_500_dict = json.loads(r'"veniam ex eu"') + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=500, payload=response_500_dict) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.bookingCallback(url=full_url, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.bookingCallback(url=url, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.bookingCallback(url=url_variant, **parameters) + + for parameters in parameter_list: + aioresponses.post(re.compile(re.escape(full_url)+r'(\?.*)?'), status=503) + async with APIClient(BASE_URL) as client: + with pytest.raises(Exception): + resp = await client.bookingCallback(url=full_url, **parameters) + + @pytest.mark.asyncio async def test_list_platform(aioresponses: aioresponses): url = r'/lti/platform' diff --git a/clients/soa/python/scripts/lint.sh b/clients/soa/python/scripts/lint.sh index c739c426..82243291 100755 --- a/clients/soa/python/scripts/lint.sh +++ b/clients/soa/python/scripts/lint.sh @@ -1,3 +1,9 @@ #!/bin/sh -tox -e lint \ No newline at end of file +mkdir -p dependencies +cp ../../api/python/dist/python-latest.tar.gz ./dependencies/api-client.tar.gz +cp ../../../helper/python-test-helper/dist/python-latest.tar.gz ./dependencies/python-test-helper.tar.gz + +tox -e lint + +rm -r dependencies \ No newline at end of file diff --git a/clients/soa/python/scripts/test.sh b/clients/soa/python/scripts/test.sh index 088c7722..08cd57ad 100755 --- a/clients/soa/python/scripts/test.sh +++ b/clients/soa/python/scripts/test.sh @@ -1,3 +1,9 @@ #!/bin/sh -tox --recreate --skip-env lint \ No newline at end of file +mkdir -p dependencies +cp ../../api/python/dist/python-latest.tar.gz ./dependencies/api-client.tar.gz +cp ../../../helper/python-test-helper/dist/python-latest.tar.gz ./dependencies/python-test-helper.tar.gz + +tox --recreate --skip-env lint + +rm -r dependencies \ No newline at end of file diff --git a/clients/soa/python/tox.ini b/clients/soa/python/tox.ini index 4cefb0ca..0c133c79 100644 --- a/clients/soa/python/tox.ini +++ b/clients/soa/python/tox.ini @@ -46,7 +46,7 @@ deps = flake8 mypy types-python-dateutil - ../../api/python + ./dependencies/api-client.tar.gz commands = flake8 src mypy --check-untyped-defs src diff --git a/clients/soa_services/electricalConnection/python/.vscode/settings.json b/clients/soa_services/electricalConnection/python/.vscode/settings.json index 8f7703e3..c115d7cb 100644 --- a/clients/soa_services/electricalConnection/python/.vscode/settings.json +++ b/clients/soa_services/electricalConnection/python/.vscode/settings.json @@ -7,7 +7,7 @@ "editor.defaultFormatter": "ms-python.black-formatter", "editor.formatOnSave": true, "editor.codeActionsOnSave": { - "source.organizeImports": true + "source.organizeImports": "explicit" }, }, "isort.args": [ diff --git a/clients/soa_services/electricalConnection/python/scripts/lint.sh b/clients/soa_services/electricalConnection/python/scripts/lint.sh index c739c426..d22fb7a7 100755 --- a/clients/soa_services/electricalConnection/python/scripts/lint.sh +++ b/clients/soa_services/electricalConnection/python/scripts/lint.sh @@ -1,3 +1,9 @@ #!/bin/sh -tox -e lint \ No newline at end of file +mkdir -p dependencies +cp ../../api/python/dist/python-latest.tar.gz ./dependencies/api-client.tar.gz +cp ../../soa/python/dist/python-latest.tar.gz ./dependencies/soa-client.tar.gz + +tox -e lint + +rm -r dependencies \ No newline at end of file diff --git a/clients/soa_services/electricalConnection/python/scripts/test.sh b/clients/soa_services/electricalConnection/python/scripts/test.sh index 088c7722..9a774f37 100755 --- a/clients/soa_services/electricalConnection/python/scripts/test.sh +++ b/clients/soa_services/electricalConnection/python/scripts/test.sh @@ -1,3 +1,10 @@ #!/bin/sh -tox --recreate --skip-env lint \ No newline at end of file +mkdir -p dependencies +cp ../../api/python/dist/python-latest.tar.gz ./dependencies/api-client.tar.gz +cp ../../soa/python/dist/python-latest.tar.gz ./dependencies/soa-client.tar.gz +cp ../../../helper/python-test-helper/dist/python-latest.tar.gz ./dependencies/python-test-helper.tar.gz + +tox --recreate --skip-env lint + +rm -r dependencies \ No newline at end of file diff --git a/clients/soa_services/electricalConnection/python/setup.cfg b/clients/soa_services/electricalConnection/python/setup.cfg index e42e4d27..83bbec46 100644 --- a/clients/soa_services/electricalConnection/python/setup.cfg +++ b/clients/soa_services/electricalConnection/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = crosslab_soa_service_electrical -version = +version = 0.2.7+dev.ce78fa35 author = Johannes Nau author_email = johannes.nau@tu-ilmenau.de description = The CrossLab SOA Electrical Service diff --git a/clients/soa_services/electricalConnection/python/tox.ini b/clients/soa_services/electricalConnection/python/tox.ini index 69f009a3..3d3fc30b 100644 --- a/clients/soa_services/electricalConnection/python/tox.ini +++ b/clients/soa_services/electricalConnection/python/tox.ini @@ -14,9 +14,9 @@ deps = coverage pytest pytest-asyncio - ../../../api/python - ../../../soa/python - ../../../../helper/python-test-helper + ./dependencies/api-client.tar.gz + ./dependencies/soa-client.tar.gz + ./dependencies/python-test-helper.tar.gz commands = coverage run --source crosslab.soa_services.electrical -m pytest -W error @@ -45,8 +45,8 @@ basepython = deps = flake8 mypy - -e ../../../api/python - -e ../../../soa/python + ./dependencies/api-client.tar.gz + ./dependencies/soa-client.tar.gz commands = flake8 src mypy --check-untyped-defs src diff --git a/clients/soa_services/file/python/scripts/lint.sh b/clients/soa_services/file/python/scripts/lint.sh index c739c426..d22fb7a7 100755 --- a/clients/soa_services/file/python/scripts/lint.sh +++ b/clients/soa_services/file/python/scripts/lint.sh @@ -1,3 +1,9 @@ #!/bin/sh -tox -e lint \ No newline at end of file +mkdir -p dependencies +cp ../../api/python/dist/python-latest.tar.gz ./dependencies/api-client.tar.gz +cp ../../soa/python/dist/python-latest.tar.gz ./dependencies/soa-client.tar.gz + +tox -e lint + +rm -r dependencies \ No newline at end of file diff --git a/clients/soa_services/file/python/scripts/test.sh b/clients/soa_services/file/python/scripts/test.sh index 088c7722..9a774f37 100755 --- a/clients/soa_services/file/python/scripts/test.sh +++ b/clients/soa_services/file/python/scripts/test.sh @@ -1,3 +1,10 @@ #!/bin/sh -tox --recreate --skip-env lint \ No newline at end of file +mkdir -p dependencies +cp ../../api/python/dist/python-latest.tar.gz ./dependencies/api-client.tar.gz +cp ../../soa/python/dist/python-latest.tar.gz ./dependencies/soa-client.tar.gz +cp ../../../helper/python-test-helper/dist/python-latest.tar.gz ./dependencies/python-test-helper.tar.gz + +tox --recreate --skip-env lint + +rm -r dependencies \ No newline at end of file diff --git a/clients/soa_services/file/python/tox.ini b/clients/soa_services/file/python/tox.ini index 21fa7d19..f7a2ee40 100644 --- a/clients/soa_services/file/python/tox.ini +++ b/clients/soa_services/file/python/tox.ini @@ -13,9 +13,9 @@ envlist = deps = coverage pytest - ../../../api/python - ../../../soa/python - ../../../../helper/python-test-helper + ./dependencies/api-client.tar.gz + ./dependencies/soa-client.tar.gz + ./dependencies/python-test-helper.tar.gz commands = coverage run --source crosslab.soa_services.file -m pytest @@ -44,8 +44,8 @@ basepython = deps = flake8 mypy - ../../../api/python - ../../../soa/python + ./dependencies/api-client.tar.gz + ./dependencies/soa-client.tar.gz commands = flake8 src mypy --check-untyped-defs src diff --git a/clients/soa_services/message/python/scripts/lint.sh b/clients/soa_services/message/python/scripts/lint.sh index c739c426..d22fb7a7 100755 --- a/clients/soa_services/message/python/scripts/lint.sh +++ b/clients/soa_services/message/python/scripts/lint.sh @@ -1,3 +1,9 @@ #!/bin/sh -tox -e lint \ No newline at end of file +mkdir -p dependencies +cp ../../api/python/dist/python-latest.tar.gz ./dependencies/api-client.tar.gz +cp ../../soa/python/dist/python-latest.tar.gz ./dependencies/soa-client.tar.gz + +tox -e lint + +rm -r dependencies \ No newline at end of file diff --git a/clients/soa_services/message/python/scripts/test.sh b/clients/soa_services/message/python/scripts/test.sh index 088c7722..9a774f37 100755 --- a/clients/soa_services/message/python/scripts/test.sh +++ b/clients/soa_services/message/python/scripts/test.sh @@ -1,3 +1,10 @@ #!/bin/sh -tox --recreate --skip-env lint \ No newline at end of file +mkdir -p dependencies +cp ../../api/python/dist/python-latest.tar.gz ./dependencies/api-client.tar.gz +cp ../../soa/python/dist/python-latest.tar.gz ./dependencies/soa-client.tar.gz +cp ../../../helper/python-test-helper/dist/python-latest.tar.gz ./dependencies/python-test-helper.tar.gz + +tox --recreate --skip-env lint + +rm -r dependencies \ No newline at end of file diff --git a/clients/soa_services/message/python/tox.ini b/clients/soa_services/message/python/tox.ini index 93589d9e..bca2ac79 100644 --- a/clients/soa_services/message/python/tox.ini +++ b/clients/soa_services/message/python/tox.ini @@ -13,9 +13,9 @@ envlist = deps = coverage pytest - ../../../api/python - ../../../soa/python - ../../../../helper/python-test-helper + ./dependencies/api-client.tar.gz + ./dependencies/soa-client.tar.gz + ./dependencies/python-test-helper.tar.gz commands = coverage run --source crosslab.soa_services.message -m pytest -W error @@ -44,8 +44,8 @@ basepython = deps = flake8 mypy - ../../../api/python - ../../../soa/python + ./dependencies/api-client.tar.gz + ./dependencies/soa-client.tar.gz commands = flake8 src mypy --check-untyped-defs src diff --git a/clients/soa_services/parameter/python/scripts/lint.sh b/clients/soa_services/parameter/python/scripts/lint.sh index c739c426..d22fb7a7 100755 --- a/clients/soa_services/parameter/python/scripts/lint.sh +++ b/clients/soa_services/parameter/python/scripts/lint.sh @@ -1,3 +1,9 @@ #!/bin/sh -tox -e lint \ No newline at end of file +mkdir -p dependencies +cp ../../api/python/dist/python-latest.tar.gz ./dependencies/api-client.tar.gz +cp ../../soa/python/dist/python-latest.tar.gz ./dependencies/soa-client.tar.gz + +tox -e lint + +rm -r dependencies \ No newline at end of file diff --git a/clients/soa_services/parameter/python/scripts/test.sh b/clients/soa_services/parameter/python/scripts/test.sh index 088c7722..9a774f37 100755 --- a/clients/soa_services/parameter/python/scripts/test.sh +++ b/clients/soa_services/parameter/python/scripts/test.sh @@ -1,3 +1,10 @@ #!/bin/sh -tox --recreate --skip-env lint \ No newline at end of file +mkdir -p dependencies +cp ../../api/python/dist/python-latest.tar.gz ./dependencies/api-client.tar.gz +cp ../../soa/python/dist/python-latest.tar.gz ./dependencies/soa-client.tar.gz +cp ../../../helper/python-test-helper/dist/python-latest.tar.gz ./dependencies/python-test-helper.tar.gz + +tox --recreate --skip-env lint + +rm -r dependencies \ No newline at end of file diff --git a/clients/soa_services/parameter/python/setup.cfg b/clients/soa_services/parameter/python/setup.cfg index 71a9a533..a0c4649a 100644 --- a/clients/soa_services/parameter/python/setup.cfg +++ b/clients/soa_services/parameter/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = crosslab_soa_service_parameter -version = +version = 0.2.7+dev.ce78fa35 author = Johannes Nau author_email = johannes.nau@tu-ilmenau.de description = The CrossLab SOA parameter Service. diff --git a/clients/soa_services/parameter/python/tox.ini b/clients/soa_services/parameter/python/tox.ini index 00bc66d7..960cd35c 100644 --- a/clients/soa_services/parameter/python/tox.ini +++ b/clients/soa_services/parameter/python/tox.ini @@ -13,9 +13,9 @@ envlist = deps = coverage pytest - ../../../api/python - ../../../soa/python - ../../../../helper/python-test-helper + ./dependencies/api-client.tar.gz + ./dependencies/soa-client.tar.gz + ./dependencies/python-test-helper.tar.gz commands = coverage run --source crosslab.soa_services.parameter -m pytest -W error @@ -44,8 +44,8 @@ basepython = deps = flake8 mypy - ../../../api/python - ../../../soa/python + ./dependencies/api-client.tar.gz + ./dependencies/soa-client.tar.gz commands = flake8 src mypy --check-untyped-defs src diff --git a/clients/soa_services/webcam/python/scripts/lint.sh b/clients/soa_services/webcam/python/scripts/lint.sh index c739c426..d22fb7a7 100755 --- a/clients/soa_services/webcam/python/scripts/lint.sh +++ b/clients/soa_services/webcam/python/scripts/lint.sh @@ -1,3 +1,9 @@ #!/bin/sh -tox -e lint \ No newline at end of file +mkdir -p dependencies +cp ../../api/python/dist/python-latest.tar.gz ./dependencies/api-client.tar.gz +cp ../../soa/python/dist/python-latest.tar.gz ./dependencies/soa-client.tar.gz + +tox -e lint + +rm -r dependencies \ No newline at end of file diff --git a/clients/soa_services/webcam/python/scripts/test.sh b/clients/soa_services/webcam/python/scripts/test.sh index 088c7722..9a774f37 100755 --- a/clients/soa_services/webcam/python/scripts/test.sh +++ b/clients/soa_services/webcam/python/scripts/test.sh @@ -1,3 +1,10 @@ #!/bin/sh -tox --recreate --skip-env lint \ No newline at end of file +mkdir -p dependencies +cp ../../api/python/dist/python-latest.tar.gz ./dependencies/api-client.tar.gz +cp ../../soa/python/dist/python-latest.tar.gz ./dependencies/soa-client.tar.gz +cp ../../../helper/python-test-helper/dist/python-latest.tar.gz ./dependencies/python-test-helper.tar.gz + +tox --recreate --skip-env lint + +rm -r dependencies \ No newline at end of file diff --git a/clients/soa_services/webcam/python/tox.ini b/clients/soa_services/webcam/python/tox.ini index bced4250..997e9a8d 100644 --- a/clients/soa_services/webcam/python/tox.ini +++ b/clients/soa_services/webcam/python/tox.ini @@ -14,9 +14,9 @@ deps = coverage pytest pytest-asyncio - ../../../api/python - ../../../soa/python - ../../../../helper/python-test-helper + ./dependencies/api-client.tar.gz + ./dependencies/soa-client.tar.gz + ./dependencies/python-test-helper.tar.gz commands = coverage run --source crosslab.soa_services.webcam -m pytest @@ -45,8 +45,8 @@ basepython = deps = flake8 mypy - ../../../api/python - ../../../soa/python + ./dependencies/api-client.tar.gz + ./dependencies/soa-client.tar.gz commands = flake8 src mypy --check-untyped-defs src diff --git a/common/node/scripts/set-scene.sh b/common/node/scripts/set-scene.sh index 23d9543e..3fba4f54 100755 --- a/common/node/scripts/set-scene.sh +++ b/common/node/scripts/set-scene.sh @@ -10,4 +10,13 @@ if [ ! -d "$ROOT_DIR/lib" ] && [ ! -d "$ROOT_DIR/app" ]; then fi if [ ! -d "$ROOT_DIR/node_modules" ]; then npm ci 2>/dev/null >/dev/null +fi + +filename=$(tar xfO $ROOT_DIR/dist/npm-latest.tgz package/package.json | jq -r '"\(.name)-\(.version).tgz"' | sed 's/@//g' | sed 's/\//-/g') +original=$(readlink -f $ROOT_DIR/dist/npm-latest.tgz) +new=$ROOT_DIR/dist/$filename + +if [ "$original" != "$new" ]; then + mv $original $new + ln -sf $filename $ROOT_DIR/dist/npm-latest.tgz fi \ No newline at end of file diff --git a/deployment/production/core/.env b/deployment/production/core/.env index f92dd9aa..0723bd27 100644 --- a/deployment/production/core/.env +++ b/deployment/production/core/.env @@ -29,4 +29,8 @@ COOKIE_SECRET= # The Logging level for the application # Options are: fatal, error, warn, info, debug, trace # Default is warn -# LOGGING_LEVEL=info \ No newline at end of file +# LOGGING_LEVEL=info + +# The default password for rabbitmq +# Choose a strong password. E.g. using `pwgen 64` +RABBITMQ_PASSWORD= \ No newline at end of file diff --git a/deployment/production/core/config/mariadb/00_init_dbs_and_users.sql b/deployment/production/core/config/mariadb/00_init_dbs_and_users.sql index 2fde4749..d0054407 100755 --- a/deployment/production/core/config/mariadb/00_init_dbs_and_users.sql +++ b/deployment/production/core/config/mariadb/00_init_dbs_and_users.sql @@ -4,6 +4,7 @@ CREATE DATABASE IF NOT EXISTS device DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf CREATE DATABASE IF NOT EXISTS experiment DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci; CREATE DATABASE IF NOT EXISTS federation DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci; CREATE DATABASE IF NOT EXISTS lti DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci; +CREATE DATABASE IF NOT EXISTS booking DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci; CREATE USER IF NOT EXISTS authentication@'%'; CREATE USER IF NOT EXISTS authorization@'%'; @@ -11,6 +12,7 @@ CREATE USER IF NOT EXISTS device@'%'; CREATE USER IF NOT EXISTS experiment@'%'; CREATE USER IF NOT EXISTS federation@'%'; CREATE USER IF NOT EXISTS lti@'%'; +CREATE USER IF NOT EXISTS booking@'%'; GRANT ALL PRIVILEGES ON authentication.* to authentication@'%'; GRANT ALL PRIVILEGES ON authorization.* to authorization@'%'; @@ -18,5 +20,13 @@ GRANT ALL PRIVILEGES ON device.* to device@'%'; GRANT ALL PRIVILEGES ON experiment.* to experiment@'%'; GRANT ALL PRIVILEGES ON federation.* to federation@'%'; GRANT ALL PRIVILEGES ON lti.* to lti@'%'; +GRANT ALL PRIVILEGES ON booking.* to booking@'%'; -FLUSH PRIVILEGES; \ No newline at end of file +FLUSH PRIVILEGES; + +USE booking; +CREATE TABLE booking (`id` BIGINT UNSIGNED AUTO_INCREMENT, `start` DATETIME(3) NOT NULL, `end` DATETIME(3) NOT NULL, `type` ENUM('normal'), `status` ENUM('pending', 'booked', 'rejected', 'cancelled', 'active', 'active-pending', 'active-rejected') NOT NULL, `user` TEXT NOT NULL, `message` LONGTEXT, PRIMARY KEY (`id`)); +CREATE TABLE bookeddevices (`id` BIGINT UNSIGNED AUTO_INCREMENT, `booking` BIGINT UNSIGNED NOT NULL, `originaldevice` TEXT NOT NULL, `originalposition` INT NOT NULL, `bookeddevice` TEXT, `remotereference` TEXT, `local` BOOLEAN, PRIMARY KEY (`id`), `reservation` BIGINT UNSIGNED, FOREIGN KEY(`booking`) REFERENCES booking (`id`) ON DELETE CASCADE ON UPDATE RESTRICT); +CREATE TABLE bookingcallbacks (`id` BIGINT UNSIGNED AUTO_INCREMENT, `booking` BIGINT UNSIGNED NOT NULL, `url` TEXT NOT NULL, PRIMARY KEY (`id`), FOREIGN KEY(`booking`) REFERENCES booking (`id`) ON DELETE CASCADE ON UPDATE RESTRICT); +CREATE TABLE callback (`id` VARCHAR(600), `type` INTEGER, `targetbooking` BIGINT UNSIGNED NOT NULL, `parameters` JSON NOT NULL DEFAULT "{}", PRIMARY KEY(`id`)); +CREATE TABLE reservation (`id` BIGINT UNSIGNED AUTO_INCREMENT, `device` TEXT NOT NULL, `start` DATETIME(3) NOT NULL, `end` DATETIME(3) NOT NULL, `bookingreference` TEXT NOT NULL, PRIMARY KEY (`id`)); \ No newline at end of file diff --git a/deployment/production/core/docker-compose.yml b/deployment/production/core/docker-compose.yml index 6b1f1b3b..0343ba48 100644 --- a/deployment/production/core/docker-compose.yml +++ b/deployment/production/core/docker-compose.yml @@ -23,7 +23,7 @@ x-config: &common-config AUTHORIZATION_SERVER: "http://authorization:3010" AUTHORIZATION_PSK: "${AUTHORIZATION_PSK:?}" LOGGING: "${LOGGING_LEVEL:-warn}" - BASE_URL: https://${API_BASE_URL} + BASE_URL: ${API_BASE_URL} DB_TYPE: mariadb DB_HOST: db DB_PORT: 3306 @@ -31,10 +31,16 @@ x-config: &common-config DEVICE_SERVICE_URL: "http://device:3001" EXPERIMENT_SERVICE_URL: "http://experiment:3002" FEDERATION_SERVICE_URL: "http://federation:3003" + BOOKING_FRONTEND_URL: "http://booking-frontend:3004" + BOOKING_BACKEND_URL: "http://booking-backend:3005" + SCHEDULE_SERVICE_URL: "http://schedule-service:3006" AUTH_SERVICE_DOMAIN: "authentication:3000" DEVICE_SERVICE_DOMAIN: "device:3001" EXPERIMENT_SERVICE_DOMAIN: "experiment:3002" FEDERATION_SERVICE_DOMAIN: "federation:3003" + BOOKING_FRONTEND_DOMAIN: "booking-frontend:3004" + BOOKING_BACKEND_DOMAIN: "booking-backend:3005" + SCHEDULE_SERVICE_DOMAIN: "schedule-service:3006" AUTHORIZATION_SERVICE_DOMAIN: "authorization:3010" services: @@ -49,8 +55,25 @@ services: environment: MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:?} healthcheck: - test: ["CMD", "healthcheck.sh", "--su=mysql", "--connect", "--innodb_initialized"] + test: + [ + "CMD", + "healthcheck.sh", + "--su=mysql", + "--connect", + "--innodb_initialized", + ] restart: on-failure + rabbitmq: + image: rabbitmq:3.13.4 + environment: + RABBITMQ_DEFAULT_USER: rabbitmq + RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD:?} + volumes: + - ~/.docker-conf/rabbitmq/data:/var/lib/rabbitmq + - ~/.docker-conf/rabbitmq/log:/var/log/rabbitmq + networks: + backend: gateway: image: crosslab/gateway-service:latest ports: @@ -84,6 +107,41 @@ services: networks: backend: restart: on-failure + booking-frontend: + image: crosslab/booking-frontend:latest + environment: + <<: *common-config + BOOKING_DSN: mysql://booking@db:3306/booking?supportBigNumbers=true&bigNumberStrings=true + AMQP_URL: amqp://rabbitmq:${RABBITMQ_PASSWORD:?}@rabbitmq:5672 + networks: + backend: + restart: on-failure + booking-backend: + image: crosslab/booking-backend:latest + environment: + <<: *common-config + BOOKING_DSN: mysql://booking@db:3306/booking?supportBigNumbers=true&bigNumberStrings=true + AMQP_URL: amqp://rabbitmq:${RABBITMQ_PASSWORD:?}@rabbitmq:5672 + networks: + backend: + restart: on-failure + schedule: + image: crosslab/schedule-service:latest + environment: + <<: *common-config + BOOKING_DSN: mysql://booking@db:3306/booking?supportBigNumbers=true&bigNumberStrings=true + networks: + backend: + restart: on-failure + device-reservation: + image: crosslab/device-reservation:latest + environment: + <<: *common-config + BOOKING_DSN: mysql://booking@db:3306/booking?supportBigNumbers=true&bigNumberStrings=true + AMQP_URL: amqp://rabbitmq:${RABBITMQ_PASSWORD:?}@rabbitmq:5672 + networks: + backend: + restart: on-failure device: image: crosslab/device-service:latest environment: diff --git a/helper/builder/package-lock.json b/helper/builder/package-lock.json new file mode 100644 index 00000000..966e4237 --- /dev/null +++ b/helper/builder/package-lock.json @@ -0,0 +1,1799 @@ +{ + "name": "builder", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "builder", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "chalk": "^5.3.0", + "fuzzy": "^0.1.3", + "inquirer": "^9.2.19", + "inquirer-autocomplete-prompt": "^3.0.1", + "inquirer-search-list": "^1.2.6", + "js-yaml": "^4.1.0", + "terminal-kit": "^3.1.1" + }, + "devDependencies": { + "@types/inquirer": "^9.0.7", + "@types/inquirer-autocomplete-prompt": "^3.0.3", + "@types/js-yaml": "^4.0.9", + "@types/node": "^20.12.7", + "@types/terminal-kit": "^2.5.6", + "tsx": "^4.7.2", + "typescript": "^5.4.5" + } + }, + "node_modules/@cronvel/get-pixels": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@cronvel/get-pixels/-/get-pixels-3.4.1.tgz", + "integrity": "sha512-gB5C5nDIacLUdsMuW8YsM9SzK3vaFANe4J11CVXpovpy7bZUGrcJKmc6m/0gWG789pKr6XSZY2aEetjFvSRw5g==", + "dependencies": { + "jpeg-js": "^0.4.4", + "ndarray": "^1.0.19", + "ndarray-pack": "^1.1.1", + "node-bitmap": "0.0.1", + "omggif": "^1.0.10", + "pngjs": "^6.0.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@inquirer/figures": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.1.tgz", + "integrity": "sha512-mtup3wVKia3ZwULPHcbs4Mor8Voi+iIXEWD7wCNbIO6lYR62oPCTQyrddi5OMYVXHzeCSoneZwJuS8sBvlEwDw==", + "engines": { + "node": ">=18" + } + }, + "node_modules/@ljharb/through": { + "version": "2.3.13", + "resolved": "https://registry.npmjs.org/@ljharb/through/-/through-2.3.13.tgz", + "integrity": "sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==", + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/@types/inquirer": { + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/@types/inquirer/-/inquirer-9.0.7.tgz", + "integrity": "sha512-Q0zyBupO6NxGRZut/JdmqYKOnN95Eg5V8Csg3PGKkP+FnvsUZx1jAyK7fztIszxxMuoBA6E3KXWvdZVXIpx60g==", + "dev": true, + "dependencies": { + "@types/through": "*", + "rxjs": "^7.2.0" + } + }, + "node_modules/@types/inquirer-autocomplete-prompt": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/inquirer-autocomplete-prompt/-/inquirer-autocomplete-prompt-3.0.3.tgz", + "integrity": "sha512-OQCW09mEECgvhcppbQRgZSmWskWv58l+WwyUvWB1oxTu3CZj8keYSDZR9U8owUzJ5Zeux5kacN9iVPJLXcoLXg==", + "dev": true, + "dependencies": { + "@types/inquirer": "*" + } + }, + "node_modules/@types/js-yaml": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz", + "integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==", + "dev": true + }, + "node_modules/@types/nextgen-events": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@types/nextgen-events/-/nextgen-events-1.1.4.tgz", + "integrity": "sha512-YczHp+887i3MpHUOCOztk7y10SklNZ3aQlToKnu0LON0ZdFpgwq8POtnATAoFz8V1IxyR6d8pp8ZyYkUIy26Cw==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.12.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", + "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/terminal-kit": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@types/terminal-kit/-/terminal-kit-2.5.6.tgz", + "integrity": "sha512-S5kRC7wzduRj/Wrc8BCRPfQBSWi3bj3CCUBIkmrzBzrc0sjgxPqYZPvdDxhuBGCsOPZFJiDSrzUa9mYXVOOm4g==", + "dev": true, + "dependencies": { + "@types/nextgen-events": "*" + } + }, + "node_modules/@types/through": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/through/-/through-0.0.33.tgz", + "integrity": "sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" + }, + "node_modules/chroma-js": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chroma-js/-/chroma-js-2.4.2.tgz", + "integrity": "sha512-U9eDw6+wt7V8z5NncY2jJfZa+hUH8XEj8FQHgFJTrUFnJfXYf4Ml4adI2vXZOjqRDpFWtYVWypDfZwnJ+HIR4A==" + }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-width": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", + "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", + "engines": { + "node": ">= 12" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/cwise-compiler": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/cwise-compiler/-/cwise-compiler-1.1.3.tgz", + "integrity": "sha512-WXlK/m+Di8DMMcCjcWr4i+XzcQra9eCdXIJrgh4TUgh0pIS/yJduLxS9JgefsHJ/YVLdgPtXm9r62W92MvanEQ==", + "dependencies": { + "uniq": "^1.0.0" + } + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/fuzzy": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/fuzzy/-/fuzzy-0.1.3.tgz", + "integrity": "sha512-/gZffu4ykarLrCiP3Ygsa86UAo1E5vEVlvTrpkKywXSbP9Xhln3oSp9QSV57gEq3JFFpGJ4GZ+5zdEp3FcUh4w==", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-tsconfig": { + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.3.tgz", + "integrity": "sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/inquirer": { + "version": "9.2.19", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.2.19.tgz", + "integrity": "sha512-WpxOT71HGsFya6/mj5PUue0sWwbpbiPfAR+332zLj/siB0QA1PZM8v3GepegFV1Op189UxHUCF6y8AySdtOMVA==", + "dependencies": { + "@inquirer/figures": "^1.0.1", + "@ljharb/through": "^2.3.13", + "ansi-escapes": "^4.3.2", + "chalk": "^5.3.0", + "cli-cursor": "^3.1.0", + "cli-width": "^4.1.0", + "external-editor": "^3.1.0", + "lodash": "^4.17.21", + "mute-stream": "1.0.0", + "ora": "^5.4.1", + "run-async": "^3.0.0", + "rxjs": "^7.8.1", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^6.2.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/inquirer-autocomplete-prompt": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/inquirer-autocomplete-prompt/-/inquirer-autocomplete-prompt-3.0.1.tgz", + "integrity": "sha512-DQBXwX2fVQPVUzu4v4lGgtNgyjcX2+rTyphb2MeSOQh3xUayKAfHAF4y0KgsMi06m6ZiR3xIOdzMZMfQgX2m9w==", + "dependencies": { + "ansi-escapes": "^6.0.0", + "figures": "^5.0.0", + "picocolors": "^1.0.0", + "run-async": "^2.4.1", + "rxjs": "^7.5.6" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "inquirer": "^9.1.0" + } + }, + "node_modules/inquirer-autocomplete-prompt/node_modules/ansi-escapes": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.1.tgz", + "integrity": "sha512-4nJ3yixlEthEJ9Rk4vPcdBRkZvQZlYyu8j4/Mqz5sgIkddmEnH2Yj2ZrnP9S3tQOvSNRUIgVNF/1yPpRAGNRig==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer-autocomplete-prompt/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer-autocomplete-prompt/node_modules/figures": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", + "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", + "dependencies": { + "escape-string-regexp": "^5.0.0", + "is-unicode-supported": "^1.2.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer-autocomplete-prompt/node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer-autocomplete-prompt/node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/inquirer-search-list": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/inquirer-search-list/-/inquirer-search-list-1.2.6.tgz", + "integrity": "sha512-C4pKSW7FOYnkAloH8rB4FiM91H1v08QFZZJh6KRt//bMfdDBIhgdX8wjHvrVH2bu5oIo6wYqGpzSBxkeClPxew==", + "dependencies": { + "chalk": "^2.3.0", + "figures": "^2.0.0", + "fuzzy": "^0.1.3", + "inquirer": "^3.3.0" + } + }, + "node_modules/inquirer-search-list/node_modules/ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer-search-list/node_modules/ansi-regex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer-search-list/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer-search-list/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer-search-list/node_modules/chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha512-j/Toj7f1z98Hh2cYo2BVr85EpIRWqUi7rtRSGxh/cqUjqrnJe9l9UE7IUGd2vQ2p+kSHLkSzObQPZPLUC6TQwg==" + }, + "node_modules/inquirer-search-list/node_modules/cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", + "dependencies": { + "restore-cursor": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer-search-list/node_modules/cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==" + }, + "node_modules/inquirer-search-list/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/inquirer-search-list/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/inquirer-search-list/node_modules/external-editor": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "dependencies": { + "chardet": "^0.4.0", + "iconv-lite": "^0.4.17", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/inquirer-search-list/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer-search-list/node_modules/inquirer": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "dependencies": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.0.4", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rx-lite": "^4.0.8", + "rx-lite-aggregates": "^4.0.8", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + } + }, + "node_modules/inquirer-search-list/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer-search-list/node_modules/mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer-search-list/node_modules/mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==" + }, + "node_modules/inquirer-search-list/node_modules/onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", + "dependencies": { + "mimic-fn": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer-search-list/node_modules/restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", + "dependencies": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer-search-list/node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/inquirer-search-list/node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer-search-list/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer-search-list/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/iota-array": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/iota-array/-/iota-array-1.0.0.tgz", + "integrity": "sha512-pZ2xT+LOHckCatGQ3DcG/a+QuEqvoxqkiL7tvE8nn3uuu+f6i1TtpB5/FtWFbxUuVr5PZCx8KskuGatbJDXOWA==" + }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jpeg-js": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz", + "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/lazyness": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/lazyness/-/lazyness-1.2.0.tgz", + "integrity": "sha512-KenL6EFbwxBwRxG93t0gcUyi0Nw0Ub31FJKN1laA4UscdkL1K1AxUd0gYZdcLU3v+x+wcFi4uQKS5hL+fk500g==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/mute-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", + "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/ndarray": { + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/ndarray/-/ndarray-1.0.19.tgz", + "integrity": "sha512-B4JHA4vdyZU30ELBw3g7/p9bZupyew5a7tX1Y/gGeF2hafrPaQZhgrGQfsvgfYbgdFZjYwuEcnaobeM/WMW+HQ==", + "dependencies": { + "iota-array": "^1.0.0", + "is-buffer": "^1.0.2" + } + }, + "node_modules/ndarray-pack": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ndarray-pack/-/ndarray-pack-1.2.1.tgz", + "integrity": "sha512-51cECUJMT0rUZNQa09EoKsnFeDL4x2dHRT0VR5U2H5ZgEcm95ZDWcMA5JShroXjHOejmAD/fg8+H+OvUnVXz2g==", + "dependencies": { + "cwise-compiler": "^1.1.2", + "ndarray": "^1.0.13" + } + }, + "node_modules/nextgen-events": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/nextgen-events/-/nextgen-events-1.5.3.tgz", + "integrity": "sha512-P6qw6kenNXP+J9XlKJNi/MNHUQ+Lx5K8FEcSfX7/w8KJdZan5+BB5MKzuNgL2RTjHG1Svg8SehfseVEp8zAqwA==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/node-bitmap": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/node-bitmap/-/node-bitmap-0.0.1.tgz", + "integrity": "sha512-Jx5lPaaLdIaOsj2mVLWMWulXF6GQVdyLvNSxmiYCvZ8Ma2hfKX0POoR2kgKOqz+oFsRreq0yYZjQ2wjE9VNzCA==", + "engines": { + "node": ">=v0.6.5" + } + }, + "node_modules/omggif": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/omggif/-/omggif-1.0.10.tgz", + "integrity": "sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==" + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "node_modules/pngjs": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-6.0.0.tgz", + "integrity": "sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==", + "engines": { + "node": ">=12.13.0" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/run-async": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", + "integrity": "sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha512-Cun9QucwK6MIrp3mry/Y7hqD1oFqTYLQ4pGxaHTjIdaFDWRGGLikqp6u8LcWJnzpoALg9hap+JGk8sFIUuEGNA==" + }, + "node_modules/rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha512-3xPNZGW93oCjiO7PtKxRK6iOVYBWBvtf9QHDfU23Oc+dLIQmAV//UnyXV/yihv81VS/UqoQPk4NegS8EFi55Hg==", + "dependencies": { + "rx-lite": "*" + } + }, + "node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" + }, + "node_modules/seventh": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/seventh/-/seventh-0.9.2.tgz", + "integrity": "sha512-C+dnbBXIEycnrN6/CpFt/Rt8ccMzAX3wbwJU61RTfC8lYPMzSkKkAVWnUEMTZDHdvtlrTupZeCUK4G+uP4TmRQ==", + "dependencies": { + "setimmediate": "^1.0.5" + }, + "engines": { + "node": ">=16.13.0" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-kit": { + "version": "0.18.2", + "resolved": "https://registry.npmjs.org/string-kit/-/string-kit-0.18.2.tgz", + "integrity": "sha512-LInRG+5UVQc8WeWPKi5MITq50hBmmncNuB8bgNRJjSi695cMPLEJf+eNmUYt+PQSkgrZRbzMMmQ5mKAl7PfIxw==", + "engines": { + "node": ">=14.15.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/terminal-kit": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/terminal-kit/-/terminal-kit-3.1.1.tgz", + "integrity": "sha512-R+R47zBQ14Ax2NZCLeuVl2GwonDwQN4iAsjQZICW8gMzaV+VIJMvL4qhUQtzDOhENADyNPQvY1Vz5G0bHHkLEA==", + "dependencies": { + "@cronvel/get-pixels": "^3.4.1", + "chroma-js": "^2.4.2", + "lazyness": "^1.2.0", + "ndarray": "^1.0.19", + "nextgen-events": "^1.5.3", + "seventh": "^0.9.2", + "string-kit": "^0.18.1", + "tree-kit": "^0.8.7" + }, + "engines": { + "node": ">=16.13.0" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/tree-kit": { + "version": "0.8.7", + "resolved": "https://registry.npmjs.org/tree-kit/-/tree-kit-0.8.7.tgz", + "integrity": "sha512-BA/cp8KBvbBDkunxIuoBqzz3pYHL7J8QdzbKohK09urOpHFYqEe/xWGKkECEQG+LvfREd1GNqH3643GYFX8wSQ==", + "engines": { + "node": ">=16.13.0" + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, + "node_modules/tsx": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.7.2.tgz", + "integrity": "sha512-BCNd4kz6fz12fyrgCTEdZHGJ9fWTGeUzXmQysh0RVocDY3h4frk05ZNCXSy4kIenF7y/QnrdiVpTsyNRn6vlAw==", + "dev": true, + "dependencies": { + "esbuild": "~0.19.10", + "get-tsconfig": "^4.7.2" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/uniq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA==" + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + } + } +} diff --git a/helper/builder/package.json b/helper/builder/package.json new file mode 100644 index 00000000..73915ba4 --- /dev/null +++ b/helper/builder/package.json @@ -0,0 +1,29 @@ +{ + "name": "builder", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "start": "tsx src/index.ts" + }, + "author": "", + "license": "ISC", + "devDependencies": { + "@types/inquirer": "^9.0.7", + "@types/inquirer-autocomplete-prompt": "^3.0.3", + "@types/js-yaml": "^4.0.9", + "@types/node": "^20.12.7", + "@types/terminal-kit": "^2.5.6", + "tsx": "^4.7.2", + "typescript": "^5.4.5" + }, + "dependencies": { + "chalk": "^5.3.0", + "fuzzy": "^0.1.3", + "inquirer": "^9.2.19", + "inquirer-autocomplete-prompt": "^3.0.1", + "inquirer-search-list": "^1.2.6", + "js-yaml": "^4.1.0", + "terminal-kit": "^3.1.1" + } +} diff --git a/helper/builder/src/actions/clean.ts b/helper/builder/src/actions/clean.ts new file mode 100644 index 00000000..3bae5627 --- /dev/null +++ b/helper/builder/src/actions/clean.ts @@ -0,0 +1,60 @@ +import path from "path"; +import fs from "fs"; +import { execSync } from "child_process"; + +export async function clean(directoryPath: string, script?: string) { + const directory = fs.readdirSync(directoryPath); + const foldersToDelete = ["node_modules", "dist", "build"]; + const packageBakPath = path.resolve(directoryPath, "package.bak"); + const packageJsonPath = path.resolve(directoryPath, "package.json"); + const packageResolvedJsonPath = path.resolve( + directoryPath, + "package.resolved.json" + ); + + for (const item of directory) { + const itemPath = path.resolve(directoryPath, item); + const stat = fs.statSync(itemPath); + + if (!stat.isDirectory()) continue; + + if (foldersToDelete.includes(item)) { + if (item !== "dist") { + try { + fs.rmSync(itemPath, { recursive: true, force: true }); + } catch (error) { + if ( + error && + typeof error === "object" && + "code" in error && + error.code === "EACCES" + ) + execSync(`sudo rm -rf ${itemPath}`); + } + continue; + } + + for (const file of fs.readdirSync(path.resolve(directoryPath, item))) { + if (file.startsWith(script ? `${script}.` : "")) + fs.rmSync(path.resolve(directoryPath, item, file), { force: true }); + } + } + } + + if ( + fs.existsSync(packageResolvedJsonPath) && + fs.existsSync(packageBakPath) && + fs.existsSync(packageJsonPath) + ) { + const packageJson = fs.readFileSync(packageJsonPath, { encoding: "utf-8" }); + const packageResolvedJson = fs.readFileSync(packageResolvedJsonPath, { + encoding: "utf-8", + }); + + if (packageJson === packageResolvedJson) { + fs.renameSync(packageBakPath, packageJsonPath); + } + + fs.rmSync(packageResolvedJsonPath); + } +} diff --git a/helper/builder/src/actions/hash.ts b/helper/builder/src/actions/hash.ts new file mode 100644 index 00000000..1bb92f9d --- /dev/null +++ b/helper/builder/src/actions/hash.ts @@ -0,0 +1,32 @@ +import { execSync } from "child_process"; +import { DependencyGraph } from "../dependency-graph"; +import path from "path"; +import { rootDirectory } from "../root-directory"; +import { Job } from "../projects-loader"; +import fs from "fs"; + +export function hash(job: Job, dependencyGraph: DependencyGraph): string { + const paths = [ + ...(job.paths + ? job.paths.map((p) => path.resolve(rootDirectory, job.project, p)) + : [path.resolve(rootDirectory, job.project)]), + path.resolve(rootDirectory, job.project, `scripts/${job.script}.sh`), + ]; + + for (const dependency of dependencyGraph.getDependencies(`${job.title}`)) { + const [dependencyProject, dependencyScript] = dependency.split(":"); + const dependencyPath = path.resolve( + rootDirectory, + dependencyProject, + `dist/${dependencyScript}.hash` + ); + if (fs.existsSync(dependencyPath)) paths.push(dependencyPath); + } + + return execSync( + `bash ${rootDirectory}/scripts/helper.d/path_hash.sh -p ${paths.join( + " -p " + )}`, + { encoding: "utf-8" } + ); +} diff --git a/helper/builder/src/actions/run-job.ts b/helper/builder/src/actions/run-job.ts new file mode 100644 index 00000000..9d9c2588 --- /dev/null +++ b/helper/builder/src/actions/run-job.ts @@ -0,0 +1,124 @@ +import chalk from "chalk"; +import path from "path"; +import { DependencyGraph, buildDependencyGraph } from "../dependency-graph"; +import { Job, Project, loadJob } from "../projects-loader"; +import fs from "fs"; +import { clean } from "./clean"; +import { rootDirectory } from "../root-directory"; +import { hash } from "./hash"; +import { runSetScene } from "../helper/run-set-scene"; +import { runScript } from "../helper/run-script"; +import { getHash } from "../helper/get-hash"; +import { getStatus } from "../helper/get-status"; +import { RunningJob, renderExecution } from "../helper/render-execution"; + +export async function runJob( + job: Job, + projects: Project[], + execution: "clean" | "normal" | "retry" +) { + const dependencyGraph = buildDependencyGraph([job], projects); + return await _run(dependencyGraph, projects, execution); +} + +export async function runDependencyGraph( + dependencyGraph: DependencyGraph, + projects: Project[], + execution: "clean" | "normal" | "retry" +) { + return _run(dependencyGraph, projects, execution); +} + +async function _run( + dependencyGraph: DependencyGraph, + projects: Project[], + execution: "clean" | "normal" | "retry" +) { + const runningJobs: RunningJob[] = []; + const stopRender = renderExecution(runningJobs, dependencyGraph); + + await dependencyGraph.invert().traverse(async (node, abort) => { + const currentJob = loadJob(node, projects); + if ( + !abort && + (execution === "clean" || + (execution === "retry" && getStatus(currentJob) === "failed") || + (execution === "normal" && + getHash(currentJob) !== hash(currentJob, dependencyGraph))) + ) + await clean( + path.resolve(rootDirectory, currentJob.project), + currentJob.script + ); + + return true; + }); + + await dependencyGraph.invert().traverse(async (node, abort) => { + const currentJob = loadJob(node, projects); + const projectPath = path.resolve(rootDirectory, currentJob.project); + const distPath = path.resolve(projectPath, "dist"); + const statusPath = path.resolve(distPath, `${currentJob.script}.status`); + const hashPath = path.resolve(distPath, `${currentJob.script}.hash`); + const logPath = path.resolve(distPath, `${currentJob.script}.log`); + const badgePath = path.resolve(distPath, `${currentJob.script}.badge`); + + fs.rmSync(badgePath, { force: true }); + fs.rmSync(logPath, { force: true }); + if (!fs.existsSync(distPath)) fs.mkdirSync(distPath); + + const runningJob = { + project: currentJob.project, + script: currentJob.script, + status: abort ? chalk.yellow("aborted") : "running", + }; + runningJobs.push(runningJob); + + if (abort) return false; + + const status = + getHash(currentJob) === hash(currentJob, dependencyGraph) + ? `skipped (${getStatus(currentJob)})` + : await runScript(currentJob, logPath); + + switch (status) { + case "success": + runningJob.status = chalk.green("success"); + break; + case "failed": + runningJob.status = chalk.red("failed"); + break; + case "skipped (success)": + runningJob.status = chalk.green("skipped (success)"); + break; + case "skipped (failed)": + runningJob.status = chalk.red("skipped (failed)"); + break; + case "aborted": + runningJob.status = chalk.yellow("aborted"); + break; + default: + runningJob.status = chalk.gray(status); + } + + if ( + fs.existsSync( + path.resolve(rootDirectory, currentJob.project, "scripts/set-scene.sh") + ) + ) + await runSetScene(currentJob.project); + + if (status !== "aborted" && !status.includes("skipped")) { + fs.writeFileSync( + statusPath, + status.includes("success") ? "success" : "failed" + ); + fs.writeFileSync(hashPath, hash(currentJob, dependencyGraph)); + } + return status.includes("success"); + }); + + await new Promise((resolve) => setTimeout(resolve, 150)); + + stopRender(); +} diff --git a/helper/builder/src/dependency-graph.ts b/helper/builder/src/dependency-graph.ts new file mode 100644 index 00000000..de5bedae --- /dev/null +++ b/helper/builder/src/dependency-graph.ts @@ -0,0 +1,174 @@ +import { terminal } from "terminal-kit"; +import { Job, Project } from "./projects-loader"; + +type Node = string; +type Edge = { + from: Node; + to: Node; +}; +type Path = { + from: Node; + to: Node; + edges: Edge[]; +}; + +export class DependencyGraph { + private roots: Node[] = []; + private leaves: Node[] = []; + private _nodes: Node[] = []; + private edges: Edge[] = []; + private paths: Path[] = []; + + public get nodes() { + return this._nodes; + } + + public addNode(node: Node): void { + if (this._nodes.find((n) => n === node)) return; + this._nodes.push(node); + this.roots.push(node); + this.leaves.push(node); + } + + public addEdge(from: Node, to: Node): void { + if (!this._nodes.find((node) => node === from)) + throw new Error(`Could not find node "${from}"!`); + if (!this._nodes.find((node) => node === to)) + throw new Error(`Could not find node "${to}"!`); + if (from === to) + throw new Error("The dependency graph must not contain any loops!"); + + if (this.edges.find((e) => e.from === from && e.to === to)) return; + + const edge: Edge = { from, to }; + this.edges.push(edge); + this.paths.push({ from, to, edges: [edge] }); + + this.roots = this.roots.filter((root) => edge.to !== root); + this.leaves = this.leaves.filter((leave) => edge.from !== leave); + + for (const path of this.paths) { + if (path.to === from && path.from === to) { + console.error("Found a loop:", [...path.edges, edge]); + throw new Error("The dependency graph must not contain any loops!"); + } + if (path.to === from) + this.paths.push({ from: path.from, to, edges: [...path.edges, edge] }); + } + } + + public invert(): DependencyGraph { + const invertedDependencyGraph = new DependencyGraph(); + + for (const node of this.nodes) { + invertedDependencyGraph.addNode(node); + } + + for (const edge of this.edges) { + invertedDependencyGraph.addEdge(edge.to, edge.from); + } + + return invertedDependencyGraph; + } + + public getDependents(node: Node): Node[] { + return this.edges + .filter((edge) => edge.to === node) + .map((edge) => edge.from); + } + + public getDependencies(node: Node): Node[] { + return this.edges + .filter((edge) => edge.from === node) + .map((edge) => edge.to); + } + + public traverse( + f: (node: Node, abort: boolean) => Promise | boolean + ) { + const running: Promise[] = []; + + return new Promise((resolve) => { + const started: Set = new Set(); + const finished: Set = new Set(); + const failed: Set = new Set(); + + const tf = async (node: Node, abort: boolean) => { + started.add(node); + const success = await f(node, abort); + finished.add(node); + if (!success || abort) failed.add(node); + + if (finished.size === this.nodes.length) { + resolve(); + return; + } + + const dependencies = this.getDependencies(node); + for (const dependency of dependencies) { + const dependents = this.getDependents(dependency); + + if ( + dependents.filter((dependent) => failed.has(dependent)).length > + 0 && + !started.has(dependency) + ) { + running.push(tf(dependency, true)); + continue; + } + + const dependentsLeft = dependents.filter( + (dependent) => !finished.has(dependent) + ).length; + if (!dependentsLeft && !started.has(dependency)) + running.push(tf(dependency, false)); + } + }; + + for (const root of this.roots) { + running.push(tf(root, false)); + } + }); + } +} + +function addDependency( + from: Job, + to: Job, + projects: Project[], + dependencyGraph: DependencyGraph +): void { + dependencyGraph.addNode(to.title); + dependencyGraph.addEdge(from.title, to.title); + + for (const dependency of to.dependencies ?? []) { + const [projectName, script] = dependency.split(":"); + const project = projects.find((p) => p.name === projectName); + const dependencyJob = project?.jobs.find((j) => j.script === script); + if (!dependencyJob) throw new Error(`Could not find job "${dependency}"`); + + addDependency(to, dependencyJob, projects, dependencyGraph); + } +} + +export function buildDependencyGraph( + jobs: Job[], + projects: Project[] +): DependencyGraph { + const dependencyGraph = new DependencyGraph(); + + for (const job of jobs) { + dependencyGraph.addNode(job.title); + + for (const dependency of job.dependencies ?? []) { + const [projectName, script] = dependency.split(":"); + const project = projects.find((p) => p.name === projectName); + const dependencyJob = project?.jobs.find((j) => j.script === script); + if (!dependencyJob) throw new Error(`Could not find job "${dependency}"`); + + addDependency(job, dependencyJob, projects, dependencyGraph); + } + } + + return dependencyGraph; +} diff --git a/helper/builder/src/helper/get-hash.ts b/helper/builder/src/helper/get-hash.ts new file mode 100644 index 00000000..8fa62fe3 --- /dev/null +++ b/helper/builder/src/helper/get-hash.ts @@ -0,0 +1,18 @@ +import fs from "fs"; +import path from "path"; +import { rootDirectory } from "../root-directory"; +import { Job } from "../projects-loader"; + +export function getHash(job: Job): string | undefined { + const hashPath = path.resolve( + rootDirectory, + job.project, + `dist/${job.script}.hash` + ); + + if (fs.existsSync(hashPath)) { + return fs.readFileSync(hashPath, { encoding: "utf-8" }); + } + + return undefined; +} diff --git a/helper/builder/src/helper/get-status.ts b/helper/builder/src/helper/get-status.ts new file mode 100644 index 00000000..035b1711 --- /dev/null +++ b/helper/builder/src/helper/get-status.ts @@ -0,0 +1,20 @@ +import fs from "fs"; +import path from "path"; +import { rootDirectory } from "../root-directory"; +import { Job } from "../projects-loader"; + +export function getStatus(job: Job): string | undefined { + const statusPath = path.resolve( + rootDirectory, + job.project, + `dist/${job.script}.status` + ); + + if (fs.existsSync(statusPath)) { + return fs + .readFileSync(statusPath, { encoding: "utf-8" }) + .replace(/\s/g, ""); + } + + return undefined; +} diff --git a/helper/builder/src/helper/render-execution.ts b/helper/builder/src/helper/render-execution.ts new file mode 100644 index 00000000..0a0e5b63 --- /dev/null +++ b/helper/builder/src/helper/render-execution.ts @@ -0,0 +1,69 @@ +import { terminal } from "terminal-kit"; +import { DependencyGraph } from "../dependency-graph"; + +export type RunningJob = { project: string; script: string; status: string }; + +export function renderExecution( + runningJobs: RunningJob[], + dependencyGraph: DependencyGraph +): () => void { + const status = { x: 0 }; + const loadingInterval = loadingAnimation(status); + const chars = ["â ™", "â ˜", "â °", "â ´", "â ¤", "â ¦", "â †", "â ƒ", "â ‹", "â ‰"]; + let maxLength = 0; + dependencyGraph.nodes.forEach((n) => { + if (n.length > maxLength) maxLength = n.length; + }); + + let printedJobs = 0; + + const interval = setInterval(() => { + const up = printedJobs; + up > 0 && terminal.up(up); + terminal.eraseDisplayBelow(); + terminal.blue( + `Running: ${ + runningJobs.filter((job) => job.status === "running").length + }, Success: ${ + runningJobs.filter((job) => job.status.includes("success")).length + }, Failed: ${ + runningJobs.filter((job) => job.status.includes("failed")).length + }\n` + ); + for (const runningJob of runningJobs) { + if (runningJob.status === "running") + terminal.blue( + `Executing "${runningJob.project}:${runningJob.script}" ${" ".repeat( + maxLength - runningJob.project.length - runningJob.script.length + 1 + )} ${ + runningJob.status === "running" + ? chars[status.x] + : runningJob.status + }\n` + ); + } + printedJobs = + runningJobs.filter((job) => job.status === "running").length + 1; + }, 100); + + return () => { + clearInterval(interval); + clearInterval(loadingInterval); + runningJobs + .filter((job) => job.status.includes("failed")) + .forEach((job) => + terminal.red(`Job ${job.project}:${job.script} failed!\n`) + ); + }; +} + +function loadingAnimation(status: { x: number }, delay = 200) { + status.x = 0; + + const chars = ["â ™", "â ˜", "â °", "â ´", "â ¤", "â ¦", "â †", "â ƒ", "â ‹", "â ‰"]; + + return setInterval(function () { + status.x++; + status.x = status.x % chars.length; + }, delay); +} diff --git a/helper/builder/src/helper/run-script.ts b/helper/builder/src/helper/run-script.ts new file mode 100644 index 00000000..0aa6e35a --- /dev/null +++ b/helper/builder/src/helper/run-script.ts @@ -0,0 +1,34 @@ +import { spawn } from "child_process"; +import path from "path"; +import { rootDirectory } from "../root-directory"; +import fs from "fs"; +import { Job } from "../projects-loader"; +import { addProcess } from "./sigint-handler"; + +export async function runScript( + job: Job, + logPath: string +): Promise<"success" | "failed" | "skipped" | "aborted"> { + const childProcess = spawn("bash", [`scripts/${job.script}.sh`], { + cwd: path.resolve(rootDirectory, job.project), + detached: true, + }); + + return new Promise<"success" | "failed" | "skipped" | "aborted">( + (resolve) => { + addProcess(childProcess, () => resolve("aborted")); + childProcess.on("error", () => { + resolve("failed"); + }); + childProcess.on("exit", () => { + resolve(childProcess.exitCode === 0 ? "success" : "failed"); + }); + childProcess.stdout.on("data", (data) => { + fs.appendFileSync(logPath, data); + }); + childProcess.stderr.on("data", (data) => { + fs.appendFileSync(logPath, data); + }); + } + ); +} diff --git a/helper/builder/src/helper/run-set-scene.ts b/helper/builder/src/helper/run-set-scene.ts new file mode 100644 index 00000000..fa196b1f --- /dev/null +++ b/helper/builder/src/helper/run-set-scene.ts @@ -0,0 +1,22 @@ +import { spawn } from "child_process"; +import path from "path"; +import { rootDirectory } from "../root-directory"; +import { addProcess } from "./sigint-handler"; + +export async function runSetScene(project: string) { + const setSceneProcess = spawn("bash", [`scripts/set-scene.sh`], { + cwd: path.resolve(rootDirectory, project), + detached: true, + }); + + addProcess(setSceneProcess); + + return new Promise((resolve) => { + setSceneProcess.on("error", () => { + resolve(false); + }); + setSceneProcess.on("exit", () => { + resolve(setSceneProcess.exitCode === 0); + }); + }); +} diff --git a/helper/builder/src/helper/sigint-handler.ts b/helper/builder/src/helper/sigint-handler.ts new file mode 100644 index 00000000..cf27c34e --- /dev/null +++ b/helper/builder/src/helper/sigint-handler.ts @@ -0,0 +1,21 @@ +const processes: [ + { pid?: number; exitCode: number | null }, + (() => void) | undefined +][] = []; + +process.on("SIGINT", function () { + for (const proc of processes) { + if (proc[0].pid && proc[0].exitCode === null) + try { + process.kill(-proc[0].pid); + } catch {} + if (proc[1]) proc[1](); + } +}); + +export function addProcess( + proc: { pid?: number; exitCode: number | null }, + callback?: () => void +) { + processes.push([proc, callback]); +} diff --git a/helper/builder/src/index.ts b/helper/builder/src/index.ts new file mode 100644 index 00000000..5c6c093e --- /dev/null +++ b/helper/builder/src/index.ts @@ -0,0 +1,3 @@ +import { mainMenu } from "./prompts/main-menu"; + +mainMenu(); diff --git a/helper/builder/src/projects-loader.ts b/helper/builder/src/projects-loader.ts new file mode 100644 index 00000000..1fbe41ea --- /dev/null +++ b/helper/builder/src/projects-loader.ts @@ -0,0 +1,60 @@ +import fs from "fs"; +import yaml from "js-yaml"; + +export type Job = { + project: string; + title: string; + script: string; + paths?: string[]; + dependencies?: string[]; + tags?: string[]; +}; + +export type Project = { + name: string; + jobs: Job[]; +}; + +type JobPrototype = { + script: string; + dependencies?: string[]; +}; + +type ProjectsDictionary = { + [k: string]: JobPrototype[]; +}; + +export function loadProjects(): Project[] { + const jobsFile = fs.readFileSync("../../.jobs.yml", { encoding: "utf-8" }); + const projectsPrototype = yaml.load(jobsFile) as ProjectsDictionary; + const projects: Project[] = []; + + for (const projectName of Object.keys(projectsPrototype)) { + projects.push({ + name: projectName, + jobs: [ + ...projectsPrototype[projectName].map((job) => { + return { + title: `${projectName}:${job.script}`, + project: projectName, + ...job, + }; + }), + ], + }); + } + + return projects; +} + +export function loadJob(jobTitle: string, projects: Project[]): Job { + const [projectName, script] = jobTitle.split(":"); + + const result = projects + .find((project) => project.name === projectName) + ?.jobs.find((job) => job.script === script); + + if (!result) throw new Error(`could not load job "${jobTitle}"`); + + return result; +} diff --git a/helper/builder/src/prompts/main-menu.ts b/helper/builder/src/prompts/main-menu.ts new file mode 100644 index 00000000..ce937e60 --- /dev/null +++ b/helper/builder/src/prompts/main-menu.ts @@ -0,0 +1,60 @@ +import inquirer from "inquirer"; +import { loadJob, loadProjects } from "../projects-loader"; +import { selectProjectPrompt } from "./select-project"; +import { selectJobPrompt } from "./select-job"; +import { runDependencyGraph, runJob } from "../actions/run-job"; +import { clean } from "../actions/clean"; +import path from "path"; +import { rootDirectory } from "../root-directory"; +import { selectJobExecutionPrompt } from "./select-job-execution"; +import { DependencyGraph, buildDependencyGraph } from "../dependency-graph"; + +export async function mainMenu() { + const projects = loadProjects(); + + const { action } = await inquirer.prompt({ + type: "list", + name: "action", + loop: false, + message: "Select an action:", + choices: [ + "run specific job", + "clean project build files", + "build all", + "execute all jobs", + ], + }); + + switch (action) { + case "run specific job": { + const project = await selectProjectPrompt(projects); + const job = await selectJobPrompt(project.jobs); + const execution = await selectJobExecutionPrompt(); + await runJob(job, projects, execution); + break; + } + case "clean project build files": { + const project = await selectProjectPrompt(projects); + await clean(path.resolve(rootDirectory, project.name)); + break; + } + case "build all": { + const projects = loadProjects(); + const jobs = projects.flatMap((project) => + project.jobs.filter((job) => job.script === "build") + ); + const dependencyGraph = buildDependencyGraph(jobs, projects); + const execution = await selectJobExecutionPrompt(); + await runDependencyGraph(dependencyGraph, projects, execution); + break; + } + case "execute all jobs": { + const projects = loadProjects(); + const jobs = projects.flatMap((project) => project.jobs); + const dependencyGraph = buildDependencyGraph(jobs, projects); + const execution = await selectJobExecutionPrompt(); + await runDependencyGraph(dependencyGraph, projects, execution); + break; + } + } +} diff --git a/helper/builder/src/prompts/select-job-execution.ts b/helper/builder/src/prompts/select-job-execution.ts new file mode 100644 index 00000000..c2f2617d --- /dev/null +++ b/helper/builder/src/prompts/select-job-execution.ts @@ -0,0 +1,25 @@ +import inquirer from "inquirer"; +import AutocompletePrompt from "inquirer-autocomplete-prompt"; +import fuzzy from "fuzzy"; + +inquirer.registerPrompt("autocomplete", AutocompletePrompt); + +export async function selectJobExecutionPrompt(): Promise< + "clean" | "normal" | "retry" +> { + const { execution } = await inquirer.prompt({ + type: "autocomplete", + name: "execution", + message: "Select how to execute the job:", + source: (_: unknown, input = "") => searchExecutionName(input), + } as { name: "execution" }); + + return execution; +} + +function searchExecutionName(input = "") { + const executionNames = ["normal", "retry", "clean"]; + const results = fuzzy.filter(input, executionNames).map((el) => el.original); + + return results; +} diff --git a/helper/builder/src/prompts/select-job.ts b/helper/builder/src/prompts/select-job.ts new file mode 100644 index 00000000..51d43db0 --- /dev/null +++ b/helper/builder/src/prompts/select-job.ts @@ -0,0 +1,29 @@ +import inquirer from "inquirer"; +import { Job } from "../projects-loader"; +import AutocompletePrompt from "inquirer-autocomplete-prompt"; +import fuzzy from "fuzzy"; + +inquirer.registerPrompt("autocomplete", AutocompletePrompt); + +export async function selectJobPrompt(jobs: Job[]): Promise { + const { job } = await inquirer.prompt({ + type: "autocomplete", + name: "job", + message: "Select a job:", + source: (_: unknown, input = "") => searchScriptName(jobs, input), + } as { name: "job" }); + + return job; +} + +function searchScriptName(jobs: Job[], input = "") { + const scriptNames = jobs.map((job) => job.script); + const results = fuzzy.filter(input, scriptNames).map((el) => { + return { + name: el.original, + value: jobs.find((job) => job.script === el.original), + }; + }); + + return results; +} diff --git a/helper/builder/src/prompts/select-project.ts b/helper/builder/src/prompts/select-project.ts new file mode 100644 index 00000000..5833880c --- /dev/null +++ b/helper/builder/src/prompts/select-project.ts @@ -0,0 +1,32 @@ +import inquirer from "inquirer"; +import AutocompletePrompt from "inquirer-autocomplete-prompt"; +import { Project } from "../projects-loader"; +import fuzzy from "fuzzy"; + +inquirer.registerPrompt("autocomplete", AutocompletePrompt); + +export async function selectProjectPrompt( + projects: Project[] +): Promise { + const { project } = await inquirer.prompt({ + type: "autocomplete", + name: "project", + message: "Select a project:", + source: (_: unknown, input: string) => searchProjectName(projects, input), + loop: false, + } as { name: "project" }); + + return project; +} + +async function searchProjectName(projects: Project[], input = "") { + const projectNames = projects.map((project) => project.name); + const results = fuzzy.filter(input, projectNames).map((el) => { + return { + name: el.original, + value: projects.find((project) => project.name === el.original), + }; + }); + + return results; +} diff --git a/helper/builder/src/root-directory.ts b/helper/builder/src/root-directory.ts new file mode 100644 index 00000000..805108bb --- /dev/null +++ b/helper/builder/src/root-directory.ts @@ -0,0 +1,16 @@ +import path from "path"; + +function resolveRootDirectory() { + let currentDir = path.resolve(""); + let i = 1; + + while (!currentDir.endsWith("crosslab")) { + if (currentDir === "/") + throw new Error("Expected root directory with name 'crosslab'"); + currentDir = path.resolve("../".repeat(i++)); + } + + return currentDir; +} + +export const rootDirectory = resolveRootDirectory(); diff --git a/helper/builder/tsconfig.json b/helper/builder/tsconfig.json new file mode 100644 index 00000000..07bf27fd --- /dev/null +++ b/helper/builder/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "commonjs", + "rootDir": "./src", + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true + } +} diff --git a/helper/crosslab-typescript-addon/templates/service-client/client.ts.njk b/helper/crosslab-typescript-addon/templates/service-client/client.ts.njk index e1c4aa19..49917518 100644 --- a/helper/crosslab-typescript-addon/templates/service-client/client.ts.njk +++ b/helper/crosslab-typescript-addon/templates/service-client/client.ts.njk @@ -1,6 +1,15 @@ {%- macro generateIndex() -%} {%- set schemas = (api | resolveSchemas) -%} {%- set operations = (api | resolveOperations) -%} +{%- set validateUrlNeeded = false -%} + +{% for operation in operations | selectattr("external") %} + {%- set requiredUrl = true if operation.parameters and operation.parameters | select("attrequalto", ["in", "path"]) | length > 0 else false %} + {%- set buildUrl = operation.buildUrl %} + {%- if requiredUrl and (not buildUrl) %} + {%- set validateUrlNeeded = true %} + {% endif %} +{% endfor %} /** * This file was automatically generated by openapi-codegeneration. @@ -84,6 +93,7 @@ async function parseResponse(response: Response): Promise { } } +{% if validateUrlNeeded -%} /** * This function checks if a string is a valid http url. * @param string The string to be checked. @@ -133,24 +143,11 @@ function parsePathParameters(url: string, endpoint: string): string[] { * // returns ["username", "role_name"] * validateUrl("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") */ -function validateUrl(url: string, baseUrl: string, endpoint: string): string[] { - if (!isValidHttpUrl(url)) - throw new InvalidUrlError('Provided url is not a valid http url'); - if (!url.startsWith(baseUrl)) - throw new InvalidUrlError('Provided url does not start with the provided base url'); - const pathParameters = parsePathParameters(url, endpoint); - - let extendedBaseUrl = baseUrl + endpoint; - - pathParameters.forEach(pathParameter => { - extendedBaseUrl = extendedBaseUrl.replace('{}', pathParameter); - }); - - if (url !== extendedBaseUrl) - throw new InvalidUrlError('Provided url does not match extended base url'); - - return pathParameters; +function validateUrl(url: string, endpoint: string): string[] { + if (!isValidHttpUrl(url)) throw new InvalidUrlError('Provided url is not a valid http url') + return parsePathParameters(url, endpoint) } +{%- endif %} /** * This function appends a given endpoint to an url. @@ -179,10 +176,11 @@ export class Client { private fixedHeaders: [string, string][] private fetch = async (url: RequestInfo | URL, init: RequestInit) => { let raw_response; + const parsedUrl = new URL(url.toString()) try { if ( - url.toString().startsWith(this.baseUrl) || - url.toString().startsWith(this.serviceUrl) + parsedUrl.toString().startsWith(this.baseUrl) || + parsedUrl.toString().startsWith(this.serviceUrl) ) { raw_response = await fetch(url, init); } else { @@ -213,12 +211,8 @@ export class Client { baseUrl: string, options: { serviceUrl?: string; accessToken?: string, fixedHeaders?: [string, string][] }, ) { - this.baseUrl = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl; - this.serviceUrl = options.serviceUrl - ? options.serviceUrl.endsWith('/') - ? options.serviceUrl.slice(0, -1) - : options.serviceUrl - : this.baseUrl; + this.baseUrl = new URL(baseUrl).toString().slice(0, -1); + this.serviceUrl = new URL(options.serviceUrl ?? this.baseUrl).toString().slice(0, -1); this.accessToken = options.accessToken ?? ''; this.fixedHeaders = options.fixedHeaders ?? []; } @@ -349,7 +343,8 @@ export class Client { {#- Add declaration of request body if defined #} {%- if operation.requestBody -%} {{- bodyName + ": " -}} - {{- operation.requestBody.schema | typeDeclaration(schemas, { "prefixDirectlyResolved": "Types.", "schemaType": "request" }) if operation.requestBody.schema else "Signatures." + cap_name + "Body" -}}, + {{- operation.requestBody.schema | typeDeclaration(schemas, { "prefixDirectlyResolved": "Types.", "schemaType": "request" }) if operation.requestBody.schema else "Signatures." + cap_name + "Body" -}} + {{- " | undefined" if not operation.requestBody.required -}}, {%- endif -%} {#- Add declaration of required parameters #} @@ -475,7 +470,7 @@ export class Client { const urlSuffix = '{{ operation.path | replace(r/{.*?}/g, "{}") }}'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) const [{{ operation.path | replace(r/(.*?{(.*?)})(\/\w*)*/g, "$2,") }}] = - {{- "" }} validateUrl(url, this.baseUrl, '{{ operation.path | replace(r/{.*?}/g, "{}") }}') + {{- "" }} validateUrl(new URL(url).toString(), '{{ operation.path | replace(r/{.*?}/g, "{}") }}') {%- else %} const url = appendToUrl( {{ "options?.url ?? " if optionalUrl }}this.baseUrl, @@ -483,10 +478,11 @@ export class Client { ) {%- endif %} {%- elif optionalUrl %} - const url = appendToUrl({{ "options?.url ?? " if optionalUrl }}this.baseUrl, "{{ operation.path }}") + const url = appendToUrl(options?.url ?? this.baseUrl, "{{ operation.path }}") {%- else %} const url = appendToUrl(this.baseUrl, "{{ operation.path }}") {%- endif %} + console.log("trying to fetch url:", url); {{ body if operation.requestBody }} @@ -517,7 +513,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` {%- endif %} - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) {{ "+ '?' + new URLSearchParams(query)" if queryParameters | length > 0 }}, { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) {{ "+ '?' + new URLSearchParams(query)" if queryParameters | length > 0 }}); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) {{ "+ '?' + new URLSearchParams(query)" if queryParameters | length > 0 }}, { method: "{{ operation.method | upper }}", headers: [ ["Content-Type", "application/json"], diff --git a/helper/dummy-device/python/setup.cfg b/helper/dummy-device/python/setup.cfg index 3a80d82f..d758fd3c 100644 --- a/helper/dummy-device/python/setup.cfg +++ b/helper/dummy-device/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = dummy_device -version = +version = 0.2.7+dev.ce78fa35 author = Johannes Nau author_email = johannes.nau@tu-ilmenau.de description = The Crosslab Dummy Device diff --git a/helper/python-test-helper/setup.cfg b/helper/python-test-helper/setup.cfg index e049814c..ff95b9bc 100644 --- a/helper/python-test-helper/setup.cfg +++ b/helper/python-test-helper/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = test_helper -version = +version = 0.0.0+dev.e84d2ad6 author = Johannes Nau author_email = johannes.nau@tu-ilmenau.de description = Helper Project used in python tests diff --git a/integration-test/.env b/integration-test/.env new file mode 100644 index 00000000..e17bb62a --- /dev/null +++ b/integration-test/.env @@ -0,0 +1,36 @@ +# The port on which the gateway will be exposed +API_PORT=80 +# The port on which the LTI Service will be exposed +LTI_PORT=8081 + +# The domain under which the Crosslab-API will be available +API_BASE_URL=http://localhost:$API_PORT +LTI_BASE_URL=http://localhost:$LTI_PORT + +# The crosslab instance will have a default admin user, with the following password: +ADMIN_PASSWORD=admin + +# The root password for the MySQL database +# Choose a strong password. E.g. using `pwgen 64` +DB_ROOT_PASSWORD=db_test + +# All request to the internal Authorization API use the following key for authentication +# Choose a strong password. E.g. using `pwgen 64` +AUTHORIZATION_PSK=auth_test + +# The Authorization Server and the Authorization Server will share a secret for signing/checking JWTs +# Choose a strong password. E.g. using `pwgen 64` +JWT_SECRET=jwt_test + +# The LTI Service signs its Cookies with a secret +# Choose a strong password. E.g. using `pwgen 64` +COOKIE_SECRET=cookie_test + +# The Logging level for the application +# Options are: fatal, error, warn, info, debug, trace +# Default is warn +LOGGING_LEVEL=info + +# The default password for rabbitmq +# Choose a strong password. E.g. using `pwgen 64` +RABBITMQ_PASSWORD=rabbitmq \ No newline at end of file diff --git a/integration-test/config/mariadb/00_init_dbs_and_users.sql b/integration-test/config/mariadb/00_init_dbs_and_users.sql new file mode 100755 index 00000000..d0054407 --- /dev/null +++ b/integration-test/config/mariadb/00_init_dbs_and_users.sql @@ -0,0 +1,32 @@ +CREATE DATABASE IF NOT EXISTS authentication DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci; +CREATE DATABASE IF NOT EXISTS authorization DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci; +CREATE DATABASE IF NOT EXISTS device DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci; +CREATE DATABASE IF NOT EXISTS experiment DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci; +CREATE DATABASE IF NOT EXISTS federation DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci; +CREATE DATABASE IF NOT EXISTS lti DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci; +CREATE DATABASE IF NOT EXISTS booking DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci; + +CREATE USER IF NOT EXISTS authentication@'%'; +CREATE USER IF NOT EXISTS authorization@'%'; +CREATE USER IF NOT EXISTS device@'%'; +CREATE USER IF NOT EXISTS experiment@'%'; +CREATE USER IF NOT EXISTS federation@'%'; +CREATE USER IF NOT EXISTS lti@'%'; +CREATE USER IF NOT EXISTS booking@'%'; + +GRANT ALL PRIVILEGES ON authentication.* to authentication@'%'; +GRANT ALL PRIVILEGES ON authorization.* to authorization@'%'; +GRANT ALL PRIVILEGES ON device.* to device@'%'; +GRANT ALL PRIVILEGES ON experiment.* to experiment@'%'; +GRANT ALL PRIVILEGES ON federation.* to federation@'%'; +GRANT ALL PRIVILEGES ON lti.* to lti@'%'; +GRANT ALL PRIVILEGES ON booking.* to booking@'%'; + +FLUSH PRIVILEGES; + +USE booking; +CREATE TABLE booking (`id` BIGINT UNSIGNED AUTO_INCREMENT, `start` DATETIME(3) NOT NULL, `end` DATETIME(3) NOT NULL, `type` ENUM('normal'), `status` ENUM('pending', 'booked', 'rejected', 'cancelled', 'active', 'active-pending', 'active-rejected') NOT NULL, `user` TEXT NOT NULL, `message` LONGTEXT, PRIMARY KEY (`id`)); +CREATE TABLE bookeddevices (`id` BIGINT UNSIGNED AUTO_INCREMENT, `booking` BIGINT UNSIGNED NOT NULL, `originaldevice` TEXT NOT NULL, `originalposition` INT NOT NULL, `bookeddevice` TEXT, `remotereference` TEXT, `local` BOOLEAN, PRIMARY KEY (`id`), `reservation` BIGINT UNSIGNED, FOREIGN KEY(`booking`) REFERENCES booking (`id`) ON DELETE CASCADE ON UPDATE RESTRICT); +CREATE TABLE bookingcallbacks (`id` BIGINT UNSIGNED AUTO_INCREMENT, `booking` BIGINT UNSIGNED NOT NULL, `url` TEXT NOT NULL, PRIMARY KEY (`id`), FOREIGN KEY(`booking`) REFERENCES booking (`id`) ON DELETE CASCADE ON UPDATE RESTRICT); +CREATE TABLE callback (`id` VARCHAR(600), `type` INTEGER, `targetbooking` BIGINT UNSIGNED NOT NULL, `parameters` JSON NOT NULL DEFAULT "{}", PRIMARY KEY(`id`)); +CREATE TABLE reservation (`id` BIGINT UNSIGNED AUTO_INCREMENT, `device` TEXT NOT NULL, `start` DATETIME(3) NOT NULL, `end` DATETIME(3) NOT NULL, `bookingreference` TEXT NOT NULL, PRIMARY KEY (`id`)); \ No newline at end of file diff --git a/integration-test/config/rabbitmq/definitions.json b/integration-test/config/rabbitmq/definitions.json new file mode 100644 index 00000000..82684754 --- /dev/null +++ b/integration-test/config/rabbitmq/definitions.json @@ -0,0 +1,19 @@ +{ + "vhosts": [{ "name": "/" }], + "users": [ + { + "name": "rabbitmq", + "password_hash": "MrBZnOlA6iRKCx8KO2zJXGBv5wJjlNy1lsdX0MWuffvInj5I", + "tags": ["administrator"] + } + ], + "permissions": [ + { + "user": "rabbitmq", + "vhost": "/", + "configure": ".*", + "read": ".*", + "write": ".*" + } + ] +} diff --git a/integration-test/config/rabbitmq/enabled_plugins b/integration-test/config/rabbitmq/enabled_plugins new file mode 100644 index 00000000..90fdaa37 --- /dev/null +++ b/integration-test/config/rabbitmq/enabled_plugins @@ -0,0 +1 @@ +[rabbitmq_management]. \ No newline at end of file diff --git a/integration-test/config/rabbitmq/rabbitmq.conf b/integration-test/config/rabbitmq/rabbitmq.conf new file mode 100644 index 00000000..8836d53b --- /dev/null +++ b/integration-test/config/rabbitmq/rabbitmq.conf @@ -0,0 +1,2 @@ +load_definitions = /etc/rabbitmq/definitions.json +password_hashing_module = rabbit_password_hashing_sha256 \ No newline at end of file diff --git a/integration-test/docker-compose.yaml b/integration-test/docker-compose.yaml index 9893b2d2..71404842 100644 --- a/integration-test/docker-compose.yaml +++ b/integration-test/docker-compose.yaml @@ -1,53 +1,174 @@ +# This docker compose file is used to deploy the "core"-services of a Crosslab instance. +# This includes all services to provide the crosslab API. Any additional software like frontend, +# virtual laboratory devices etc. must be deployed on top of this. +# +# All necessary confifguration Options are set via environment variables in the accompanying .env file. +# version: '3' x-config: &common-config - AUTHORIZATION_SERVER: 'http://127.0.0.1:3010' - AUTHORIZATION_PSK: '${AUTHORIZATION_PSK:-TestPSK}' - LOGGING: '${LOGGING:-info}' - AUTH_SERVICE_URL: 'http://127.0.0.1:3000' - DEVICE_SERVICE_URL: 'http://127.0.0.1:3001' - EXPERIMENT_SERVICE_URL: 'http://127.0.0.1:3002' - FEDERATION_SERVICE_URL: 'http://127.0.0.1:3003' - LTI_SERVICE_URL: 'http://127.0.0.1:3004' - BASE_URL: 'http://localhost' + AUTHORIZATION_SERVER: 'http://localhost:3010' + AUTHORIZATION_PSK: '${AUTHORIZATION_PSK:?}' + LOGGING: '${LOGGING_LEVEL:-warn}' + BASE_URL: ${API_BASE_URL} + DB_TYPE: mariadb + DB_HOST: localhost + DB_PORT: 3306 + AUTH_SERVICE_URL: 'http://localhost:3000' + DEVICE_SERVICE_URL: 'http://localhost:3001' + EXPERIMENT_SERVICE_URL: 'http://localhost:3002' + FEDERATION_SERVICE_URL: 'http://localhost:3003' + BOOKING_FRONTEND_URL: 'http://localhost:3004' + BOOKING_BACKEND_URL: 'http://localhost:3005' + SCHEDULE_SERVICE_URL: 'http://localhost:3006' + AUTH_SERVICE_DOMAIN: 'localhost:3000' + DEVICE_SERVICE_DOMAIN: 'localhost:3001' + EXPERIMENT_SERVICE_DOMAIN: 'localhost:3002' + FEDERATION_SERVICE_DOMAIN: 'localhost:3003' + BOOKING_FRONTEND_DOMAIN: 'localhost:3004' + BOOKING_BACKEND_DOMAIN: 'localhost:3005' + SCHEDULE_SERVICE_DOMAIN: 'localhost:3006' + AUTHORIZATION_SERVICE_DOMAIN: 'localhost:3010' + LTI_SERVICE_DOMAIN: '127.0.0.2:3004' services: - # Services + # Database + db: + image: mariadb:11.2.3 + network_mode: 'host' + volumes: + - './config/mariadb:/docker-entrypoint-initdb.d:ro' + environment: + MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:?} + healthcheck: + test: ['CMD', 'healthcheck.sh', '--su=mysql', '--connect', '--innodb_initialized'] + restart: on-failure + rabbitmq: + image: rabbitmq:3.13.4 + volumes: + - ./config/rabbitmq/definitions.json:/etc/rabbitmq/definitions.json:ro + - ./config/rabbitmq/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro + - ./config/rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins:ro + healthcheck: + test: ['CMD', 'rabbitmqctl', 'status'] + network_mode: 'host' gateway: - image: '${GATEWAY_IMAGE}' + image: ${GATEWAY_IMAGE:?} + ports: + - '${API_PORT}:80' environment: <<: *common-config - SERVER_NAME: 'localhost' - AUTH_SERVICE_DOMAIN: '127.0.0.1:3000' - DEVICE_SERVICE_DOMAIN: '127.0.0.1:3001' - EXPERIMENT_SERVICE_DOMAIN: '127.0.0.1:3002' - FEDERATION_SERVICE_DOMAIN: '127.0.0.1:3003' - AUTHORIZATION_SERVICE_DOMAIN: '127.0.0.1:3010' - LTI_SERVICE_DOMAIN: '127.0.0.2:3004' network_mode: 'host' + depends_on: + db: + condition: service_healthy + restart: on-failure + # Services authentication: - image: '${AUTHENTICATION_IMAGE}' + image: ${AUTHENTICATION_IMAGE:?} environment: <<: *common-config - ADMIN_USERNAME: 'admin' - ADMIN_PASSWORD: 'admin' - JWT_SECRET: 'secret' + DB_USERNAME: authentication + DB_DATABASE: authentication + ADMIN_USERNAME: admin + ADMIN_PASSWORD: ${ADMIN_PASSWORD:?} + JWT_SECRET: ${JWT_SECRET:?} network_mode: 'host' + depends_on: + db: + condition: service_healthy + restart: on-failure authorization: - image: '${AUTHORIZATION_IMAGE}' + image: ${AUTHORIZATION_IMAGE:?} + environment: + <<: *common-config + DB_USERNAME: authorization + DB_DATABASE: authorization + JWT_SECRET: ${JWT_SECRET:?} + network_mode: 'host' + depends_on: + db: + condition: service_healthy + restart: on-failure + booking-frontend: + image: ${BOOKING_FRONTEND_IMAGE:?} + environment: + <<: *common-config + BOOKING_DSN: mysql://booking@localhost:3306/booking?supportBigNumbers=true&bigNumberStrings=true + AMQP_URL: amqp://rabbitmq:${RABBITMQ_PASSWORD:?}@localhost:5672 + network_mode: 'host' + depends_on: + db: + condition: service_healthy + rabbitmq: + condition: service_healthy + restart: on-failure + booking-backend: + image: ${BOOKING_BACKEND_IMAGE:?} environment: <<: *common-config - JWT_SECRET: 'secret' + BOOKING_DSN: mysql://booking@localhost:3306/booking?supportBigNumbers=true&bigNumberStrings=true + AMQP_URL: amqp://rabbitmq:${RABBITMQ_PASSWORD:?}@localhost:5672 network_mode: 'host' + depends_on: + db: + condition: service_healthy + rabbitmq: + condition: service_healthy + restart: on-failure + schedule-service: + image: ${SCHEDULE_SERVICE_IMAGE:?} + environment: + <<: *common-config + BOOKING_DSN: mysql://booking@localhost:3306/booking?supportBigNumbers=true&bigNumberStrings=true + network_mode: 'host' + depends_on: + db: + condition: service_healthy + restart: on-failure + device-reservation: + image: ${DEVICE_RESERVATION_IMAGE:?} + environment: + <<: *common-config + BOOKING_DSN: mysql://booking@localhost:3306/booking?supportBigNumbers=true&bigNumberStrings=true + AMQP_URL: amqp://rabbitmq:${RABBITMQ_PASSWORD:?}@localhost:5672 + network_mode: 'host' + depends_on: + db: + condition: service_healthy + rabbitmq: + condition: service_healthy + restart: on-failure device: - image: '${DEVICE_IMAGE}' - environment: *common-config + image: ${DEVICE_IMAGE:?} + environment: + <<: *common-config + DB_USERNAME: device + DB_DATABASE: device network_mode: 'host' + depends_on: + db: + condition: service_healthy + restart: on-failure experiment: - image: '${EXPERIMENT_IMAGE}' - environment: *common-config + image: ${EXPERIMENT_IMAGE:?} + environment: + <<: *common-config + DB_USERNAME: experiment + DB_DATABASE: experiment network_mode: 'host' + depends_on: + db: + condition: service_healthy + restart: on-failure federation: - image: '${FEDERATION_IMAGE}' - environment: *common-config + image: ${FEDERATION_IMAGE:?} + environment: + <<: *common-config + DB_USERNAME: federation + DB_DATABASE: federation network_mode: 'host' + depends_on: + db: + condition: service_healthy + restart: on-failure diff --git a/integration-test/scripts/test.sh b/integration-test/scripts/test.sh index 34c5886a..52dddf06 100755 --- a/integration-test/scripts/test.sh +++ b/integration-test/scripts/test.sh @@ -9,15 +9,30 @@ export AUTHORIZATION_IMAGE=$(docker load -i ../services/authorization/dist/docke export DEVICE_IMAGE=$(docker load -i ../services/device/dist/docker-image.tar | tail -1 | grep -Eo "[^ ]+$") export EXPERIMENT_IMAGE=$(docker load -i ../services/experiment/dist/docker-image.tar | tail -1 | grep -Eo "[^ ]+$") export FEDERATION_IMAGE=$(docker load -i ../services/federation/dist/docker-image.tar | tail -1 | grep -Eo "[^ ]+$") +export BOOKING_FRONTEND_IMAGE=$(docker load -i ../services/booking/src/booking-frontend/dist/docker-image.tar | tail -1 | grep -Eo "[^ ]+$") +export BOOKING_BACKEND_IMAGE=$(docker load -i ../services/booking/src/booking-backend/dist/docker-image.tar | tail -1 | grep -Eo "[^ ]+$") +export SCHEDULE_SERVICE_IMAGE=$(docker load -i ../services/booking/src/schedule-service/dist/docker-image.tar | tail -1 | grep -Eo "[^ ]+$") +export DEVICE_RESERVATION_IMAGE=$(docker load -i ../services/booking/src/device-reservation/dist/docker-image.tar | tail -1 | grep -Eo "[^ ]+$") -COMPOSE_HTTP_TIMEOUT=600 docker-compose up --no-color > dist/server.log 2>&1 & +mkdir -p db +rm -rf db/* + +COMPOSE_HTTP_TIMEOUT=600 docker compose up --force-recreate --no-color > dist/server.log 2>&1 & end_time=$(($(date +%s) + 600)) # Set end time to 10 minutes from now +# trap ctrl-c and call ctrl_c() +trap ctrl_c INT + +ctrl_c () { + echo "Stopping containers and removing volumes!" + docker compose down --volumes > dist/server.log 2>&1 + exit 1 +} + #rm -rf venv virtualenv venv && venv/bin/pip install -r requirements.txt npm ci - for url in "http://localhost/auth/status" "http://localhost/device/status" "http://localhost/authorization/status" "http://localhost/federation/status" "http://localhost/experiment/status"; do while true; do if curl --output /dev/null --silent --head --fail "$url"; then @@ -39,4 +54,4 @@ export PASSWORD="admin" npm run test -docker-compose down +docker compose down --volumes > dist/server.log 2>&1 diff --git a/integration-test/src/fixtures/client.ts b/integration-test/src/fixtures/client.ts index 4940b8eb..ad027143 100644 --- a/integration-test/src/fixtures/client.ts +++ b/integration-test/src/fixtures/client.ts @@ -6,7 +6,7 @@ export interface ClientContext { export const mochaHooks = { async beforeAll(this: ClientContext & Mocha.Context) { - this.client = new APIClient(process.env['HOST'] ?? 'http://localhost'); + this.client = new APIClient(process.env['HOST'] ?? 'http://localhost:80'); const username = process.env['USERNAME']; const password = process.env['PASSWORD']; if (username && password) { diff --git a/integration-test/src/helper/experimentTest.ts b/integration-test/src/helper/experimentTest.ts index b9c10943..1ce8bfcd 100644 --- a/integration-test/src/helper/experimentTest.ts +++ b/integration-test/src/helper/experimentTest.ts @@ -86,12 +86,17 @@ export class ExperimentTest extends TypedEmitter { name: 'Internal Test Device', isPublic: true, }); + await client.addDeviceAvailabilityRules(device.url, [{ available: true }]); deviceMeta.devices.push(device); } const apiDevice = await client.createDevice({ ...deviceMeta, }); + if (apiDevice.type === 'device') { + await client.addDeviceAvailabilityRules(apiDevice.url, [{ available: true }]); + } + assert(apiDevice.url, 'Device URL is not defined'); this.apiDevices.push({ ...apiDevice }); diff --git a/services/authorization/policy/crosslab.rego b/services/authorization/policy/crosslab.rego index 3538d10a..c8a7f4fc 100644 --- a/services/authorization/policy/crosslab.rego +++ b/services/authorization/policy/crosslab.rego @@ -37,7 +37,7 @@ enc := openfga.encode_object(subject) # override authorization for root allow if { - subject in ["user:root", "user:experiment-service", "user:device-service"] + subject in ["user:root", "user:experiment-service", "user:device-service", "user:booking-service"] } # Check Scopes @@ -95,6 +95,13 @@ rebac_allow if { not subject in ["user:anonymous"] } +# Allow everyone to create a booking +rebac_allow if { + object in ["booking:~~~TYPE~~~"] + input.action in ["create"] + not subject in ["user:anonymous"] +} + # Allow everyone to create an experiment rebac_allow if { object in ["device:~~~TYPE~~~"] diff --git a/services/booking/api/types.yml b/services/booking/api/types.yml index cf811aa8..1eb66373 100644 --- a/services/booking/api/types.yml +++ b/services/booking/api/types.yml @@ -37,7 +37,11 @@ components: enum: - normal Status: - description: Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + description: > + Current status of the booking. While the booking is pending, it can not be used. + Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, + 'cancelled' when the booking was deleted / cancelled after it was once active. + The 'active-*' will be used when a device was added after the booking was locked. type: string enum: - pending @@ -81,7 +85,9 @@ components: $ref: '#/components/schemas/Device' Description: type: string - description: User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + description: > + User provided description, for example might be a reason for the booking (e.g. maintenance) + or a link to the experiment. Might be empty or missing. Timeslot: title: Timeslot description: A time slot represents a slice of time used for bookings. diff --git a/services/booking/create_devcontainer_test_environment.bash b/services/booking/create_devcontainer_test_environment.bash new file mode 100755 index 00000000..29506083 --- /dev/null +++ b/services/booking/create_devcontainer_test_environment.bash @@ -0,0 +1,9 @@ +#!/bin/bash +sudo service rabbitmq-server start +sudo service mariadb start +sudo mysql -e "DROP DATABASE IF EXISTS unittest;" +sudo mysql -e "CREATE DATABASE unittest DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;" +sudo mysql -e "DROP USER IF EXISTS 'test'@localhost;" +sudo mysql -e "CREATE USER 'test'@localhost IDENTIFIED BY 'test';" +sudo mysql -e "GRANT ALL PRIVILEGES ON unittest.* to 'test'@localhost;" +sudo mysql -e "FLUSH PRIVILEGES;" \ No newline at end of file diff --git a/services/booking/documentation-and-generation.bash b/services/booking/documentation-and-generation.bash old mode 100644 new mode 100755 diff --git a/services/booking/package-lock.json b/services/booking/package-lock.json index 739a315b..5efb031c 100644 --- a/services/booking/package-lock.json +++ b/services/booking/package-lock.json @@ -21,7 +21,6 @@ } }, "../../helper/openapi-codegeneration": { - "name": "@cross-lab-project/openapi-codegen", "dev": true, "license": "UNLICENSED", "dependencies": { @@ -57,50 +56,10 @@ "typescript-eslint": "^8.1.0" } }, - "../../helper/openapi-codegeneration/node_modules/@apidevtools/json-schema-ref-parser": { - "version": "9.0.6", - "dev": true, - "license": "MIT", - "dependencies": { - "@jsdevtools/ono": "^7.1.3", - "call-me-maybe": "^1.0.1", - "js-yaml": "^3.13.1" - } - }, - "../../helper/openapi-codegeneration/node_modules/@apidevtools/openapi-schemas": { - "version": "2.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "../../helper/openapi-codegeneration/node_modules/@apidevtools/swagger-methods": { - "version": "3.0.2", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/@apidevtools/swagger-parser": { - "version": "10.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@apidevtools/json-schema-ref-parser": "9.0.6", - "@apidevtools/openapi-schemas": "^2.1.0", - "@apidevtools/swagger-methods": "^3.0.2", - "@jsdevtools/ono": "^7.1.3", - "ajv": "^8.6.3", - "ajv-draft-04": "^1.0.0", - "call-me-maybe": "^1.0.1" - }, - "peerDependencies": { - "openapi-types": ">=7" - } - }, - "../../helper/openapi-codegeneration/node_modules/@babel/code-frame": { + "node_modules/@babel/code-frame": { "version": "7.24.7", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "dependencies": { "@babel/highlight": "^7.24.7", "picocolors": "^1.0.0" @@ -109,10 +68,10 @@ "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/generator": { + "node_modules/@babel/generator": { "version": "7.17.7", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", + "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", "dependencies": { "@babel/types": "^7.17.0", "jsesc": "^2.5.1", @@ -122,10 +81,10 @@ "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/helper-environment-visitor": { + "node_modules/@babel/helper-environment-visitor": { "version": "7.24.7", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", + "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", "dependencies": { "@babel/types": "^7.24.7" }, @@ -133,12 +92,12 @@ "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/helper-environment-visitor/node_modules/@babel/types": { - "version": "7.25.2", - "dev": true, - "license": "MIT", + "node_modules/@babel/helper-environment-visitor/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", "dependencies": { - "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-string-parser": "^7.24.7", "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, @@ -146,10 +105,10 @@ "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/helper-function-name": { + "node_modules/@babel/helper-function-name": { "version": "7.24.7", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", + "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", "dependencies": { "@babel/template": "^7.24.7", "@babel/types": "^7.24.7" @@ -158,12 +117,12 @@ "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/helper-function-name/node_modules/@babel/types": { - "version": "7.25.2", - "dev": true, - "license": "MIT", + "node_modules/@babel/helper-function-name/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", "dependencies": { - "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-string-parser": "^7.24.7", "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, @@ -171,10 +130,10 @@ "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/helper-hoist-variables": { + "node_modules/@babel/helper-hoist-variables": { "version": "7.24.7", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", + "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", "dependencies": { "@babel/types": "^7.24.7" }, @@ -182,12 +141,12 @@ "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": { - "version": "7.25.2", - "dev": true, - "license": "MIT", + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", "dependencies": { - "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-string-parser": "^7.24.7", "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, @@ -195,10 +154,10 @@ "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/helper-split-export-declaration": { + "node_modules/@babel/helper-split-export-declaration": { "version": "7.24.7", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", + "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", "dependencies": { "@babel/types": "^7.24.7" }, @@ -206,12 +165,12 @@ "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types": { - "version": "7.25.2", - "dev": true, - "license": "MIT", + "node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", "dependencies": { - "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-string-parser": "^7.24.7", "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, @@ -219,26 +178,26 @@ "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/helper-string-parser": { - "version": "7.24.8", - "dev": true, - "license": "MIT", + "node_modules/@babel/helper-string-parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", + "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", "engines": { "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/helper-validator-identifier": { + "node_modules/@babel/helper-validator-identifier": { "version": "7.24.7", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", "engines": { "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/highlight": { + "node_modules/@babel/highlight": { "version": "7.24.7", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", "dependencies": { "@babel/helper-validator-identifier": "^7.24.7", "chalk": "^2.4.2", @@ -249,13 +208,10 @@ "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/parser": { - "version": "7.25.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.25.2" - }, + "node_modules/@babel/parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", + "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", "bin": { "parser": "bin/babel-parser.js" }, @@ -263,38 +219,37 @@ "node": ">=6.0.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/parser/node_modules/@babel/types": { - "version": "7.25.2", + "node_modules/@babel/runtime": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", + "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" + "regenerator-runtime": "^0.14.0" }, "engines": { "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/template": { - "version": "7.25.0", - "dev": true, - "license": "MIT", + "node_modules/@babel/template": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", + "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", "dependencies": { "@babel/code-frame": "^7.24.7", - "@babel/parser": "^7.25.0", - "@babel/types": "^7.25.0" + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/template/node_modules/@babel/types": { - "version": "7.25.2", - "dev": true, - "license": "MIT", + "node_modules/@babel/template/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", "dependencies": { - "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-string-parser": "^7.24.7", "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, @@ -302,10 +257,10 @@ "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/traverse": { + "node_modules/@babel/traverse": { "version": "7.23.2", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", "dependencies": { "@babel/code-frame": "^7.22.13", "@babel/generator": "^7.23.0", @@ -322,12 +277,12 @@ "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/traverse/node_modules/@babel/generator": { - "version": "7.25.0", - "dev": true, - "license": "MIT", + "node_modules/@babel/traverse/node_modules/@babel/generator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", + "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==", "dependencies": { - "@babel/types": "^7.25.0", + "@babel/types": "^7.24.7", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" @@ -336,12 +291,12 @@ "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/traverse/node_modules/@babel/types": { - "version": "7.25.2", - "dev": true, - "license": "MIT", + "node_modules/@babel/traverse/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", "dependencies": { - "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-string-parser": "^7.24.7", "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, @@ -349,10 +304,10 @@ "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@babel/types": { + "node_modules/@babel/types": { "version": "7.17.0", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", + "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", "dependencies": { "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" @@ -361,211 +316,59 @@ "node": ">=6.9.0" } }, - "../../helper/openapi-codegeneration/node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", + "node_modules/@cfaester/enzyme-adapter-react-18": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cfaester/enzyme-adapter-react-18/-/enzyme-adapter-react-18-0.8.0.tgz", + "integrity": "sha512-3Z3ThTUouHwz8oIyhTYQljEMNRFtlVyc3VOOHCbxs47U6cnXs8K9ygi/c1tv49s7MBlTXeIcuN+Ttd9aPtILFQ==", "dev": true, - "license": "MIT", "dependencies": { - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "enzyme-shallow-equal": "^1.0.0", + "function.prototype.name": "^1.1.6", + "has": "^1.0.4", + "react-is": "^18.2.0", + "react-shallow-renderer": "^16.15.0" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "../../helper/openapi-codegeneration/node_modules/@eslint-community/regexpp": { - "version": "4.11.0", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/@eslint/config-array": { - "version": "0.17.1", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/object-schema": "^2.1.4", - "debug": "^4.3.1", - "minimatch": "^3.1.2" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/@eslint/eslintrc": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^10.0.1", - "globals": "^14.0.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "../../helper/openapi-codegeneration/node_modules/@eslint/eslintrc/node_modules/ajv": { - "version": "6.12.6", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "enzyme": "^3.11.0", + "react": ">=18", + "react-dom": ">=18" } }, - "../../helper/openapi-codegeneration/node_modules/@eslint/eslintrc/node_modules/argparse": { - "version": "2.0.1", - "dev": true, - "license": "Python-2.0" - }, - "../../helper/openapi-codegeneration/node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "14.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "node_modules/@cross-lab-project/openapi-codegen": { + "resolved": "../../helper/openapi-codegeneration", + "link": true }, - "../../helper/openapi-codegeneration/node_modules/@eslint/eslintrc/node_modules/js-yaml": { - "version": "4.1.0", + "node_modules/@emotion/is-prop-valid": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.2.tgz", + "integrity": "sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==", "dev": true, - "license": "MIT", "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "../../helper/openapi-codegeneration/node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { - "version": "0.4.1", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/@eslint/js": { - "version": "9.9.0", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/@eslint/object-schema": { - "version": "2.1.4", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/@glideapps/ts-necessities": { - "version": "2.2.3", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "../../helper/openapi-codegeneration/node_modules/@humanwhocodes/retry": { - "version": "0.3.0", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18.18" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" + "@emotion/memoize": "^0.8.1" } }, - "../../helper/openapi-codegeneration/node_modules/@isaacs/cliui": { - "version": "8.0.2", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } + "node_modules/@emotion/memoize": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", + "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==", + "dev": true }, - "../../helper/openapi-codegeneration/node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } + "node_modules/@emotion/unitless": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.1.tgz", + "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==", + "dev": true }, - "../../helper/openapi-codegeneration/node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } + "node_modules/@exodus/schemasafe": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@exodus/schemasafe/-/schemasafe-1.3.0.tgz", + "integrity": "sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw==", + "dev": true }, - "../../helper/openapi-codegeneration/node_modules/@jridgewell/gen-mapping": { + "node_modules/@jridgewell/gen-mapping": { "version": "0.3.5", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dependencies": { "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -575,3270 +378,41 @@ "node": ">=6.0.0" } }, - "../../helper/openapi-codegeneration/node_modules/@jridgewell/resolve-uri": { + "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "engines": { "node": ">=6.0.0" } }, - "../../helper/openapi-codegeneration/node_modules/@jridgewell/set-array": { + "node_modules/@jridgewell/set-array": { "version": "1.2.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "../../helper/openapi-codegeneration/node_modules/@jsdevtools/ono": { - "version": "7.1.3", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "../../helper/openapi-codegeneration/node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "../../helper/openapi-codegeneration/node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "../../helper/openapi-codegeneration/node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=14" - } - }, - "../../helper/openapi-codegeneration/node_modules/@trivago/prettier-plugin-sort-imports": { - "version": "4.3.0", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@babel/generator": "7.17.7", - "@babel/parser": "^7.20.5", - "@babel/traverse": "7.23.2", - "@babel/types": "7.17.0", - "javascript-natural-sort": "0.7.1", - "lodash": "^4.17.21" - }, - "peerDependencies": { - "@vue/compiler-sfc": "3.x", - "prettier": "2.x - 3.x" - }, - "peerDependenciesMeta": { - "@vue/compiler-sfc": { - "optional": true - } - } - }, - "../../helper/openapi-codegeneration/node_modules/@types/eslint": { - "version": "9.6.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "../../helper/openapi-codegeneration/node_modules/@types/eslint__js": { - "version": "8.42.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/eslint": "*" - } - }, - "../../helper/openapi-codegeneration/node_modules/@types/estree": { - "version": "1.0.5", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/@types/json-schema": { - "version": "7.0.15", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/@types/lodash": { - "version": "4.17.7", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/@types/node": { - "version": "22.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~6.13.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/@types/nunjucks": { - "version": "3.2.6", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/@types/seedrandom": { - "version": "3.0.8", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.1.0", - "@typescript-eslint/type-utils": "8.1.0", - "@typescript-eslint/utils": "8.1.0", - "@typescript-eslint/visitor-keys": "8.1.0", - "graphemer": "^1.4.0", - "ignore": "^5.3.1", - "natural-compare": "^1.4.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "../../helper/openapi-codegeneration/node_modules/@typescript-eslint/parser": { - "version": "8.1.0", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "@typescript-eslint/scope-manager": "8.1.0", - "@typescript-eslint/types": "8.1.0", - "@typescript-eslint/typescript-estree": "8.1.0", - "@typescript-eslint/visitor-keys": "8.1.0", - "debug": "^4.3.4" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "../../helper/openapi-codegeneration/node_modules/@typescript-eslint/scope-manager": { - "version": "8.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.1.0", - "@typescript-eslint/visitor-keys": "8.1.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "../../helper/openapi-codegeneration/node_modules/@typescript-eslint/type-utils": { - "version": "8.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/typescript-estree": "8.1.0", - "@typescript-eslint/utils": "8.1.0", - "debug": "^4.3.4", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "../../helper/openapi-codegeneration/node_modules/@typescript-eslint/types": { - "version": "8.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "../../helper/openapi-codegeneration/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.1.0", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "@typescript-eslint/types": "8.1.0", - "@typescript-eslint/visitor-keys": "8.1.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "../../helper/openapi-codegeneration/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "9.0.5", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "../../helper/openapi-codegeneration/node_modules/@typescript-eslint/utils": { - "version": "8.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.1.0", - "@typescript-eslint/types": "8.1.0", - "@typescript-eslint/typescript-estree": "8.1.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.1.0", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "../../helper/openapi-codegeneration/node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "../../helper/openapi-codegeneration/node_modules/a-sync-waterfall": { - "version": "1.0.1", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/abort-controller": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "event-target-shim": "^5.0.0" - }, - "engines": { - "node": ">=6.5" - } - }, - "../../helper/openapi-codegeneration/node_modules/acorn": { - "version": "8.12.1", - "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/acorn-jsx": { - "version": "5.3.2", - "dev": true, - "license": "MIT", - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/ajv": { - "version": "8.17.1", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "../../helper/openapi-codegeneration/node_modules/ajv-draft-04": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "peerDependencies": { - "ajv": "^8.5.0" - }, - "peerDependenciesMeta": { - "ajv": { - "optional": true - } - } - }, - "../../helper/openapi-codegeneration/node_modules/ajv-formats": { - "version": "3.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^8.0.0" - }, - "peerDependencies": { - "ajv": "^8.0.0" - }, - "peerDependenciesMeta": { - "ajv": { - "optional": true - } - } - }, - "../../helper/openapi-codegeneration/node_modules/ansi-regex": { - "version": "5.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/ansi-styles": { - "version": "3.2.1", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "../../helper/openapi-codegeneration/node_modules/argparse": { - "version": "1.0.10", - "dev": true, - "license": "MIT", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "../../helper/openapi-codegeneration/node_modules/array-union": { - "version": "2.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/asap": { - "version": "2.0.6", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/balanced-match": { - "version": "1.0.2", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/base64-js": { - "version": "1.5.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/brace-expansion": { - "version": "1.1.11", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "../../helper/openapi-codegeneration/node_modules/braces": { - "version": "3.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/browser-or-node": { - "version": "3.0.0", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/buffer": { - "version": "6.0.3", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "../../helper/openapi-codegeneration/node_modules/call-me-maybe": { - "version": "1.0.2", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/callsites": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "../../helper/openapi-codegeneration/node_modules/chalk": { - "version": "2.4.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "../../helper/openapi-codegeneration/node_modules/cli-color": { - "version": "2.0.4", - "dev": true, - "license": "ISC", - "dependencies": { - "d": "^1.0.1", - "es5-ext": "^0.10.64", - "es6-iterator": "^2.0.3", - "memoizee": "^0.4.15", - "timers-ext": "^0.1.7" - }, - "engines": { - "node": ">=0.10" - } - }, - "../../helper/openapi-codegeneration/node_modules/collection-utils": { - "version": "1.0.1", - "dev": true, - "license": "Apache-2.0" - }, - "../../helper/openapi-codegeneration/node_modules/color-convert": { - "version": "1.9.3", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "1.1.3" - } - }, - "../../helper/openapi-codegeneration/node_modules/color-name": { - "version": "1.1.3", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/commander": { - "version": "12.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "../../helper/openapi-codegeneration/node_modules/compute-gcd": { - "version": "1.2.1", - "dev": true, - "dependencies": { - "validate.io-array": "^1.0.3", - "validate.io-function": "^1.0.2", - "validate.io-integer-array": "^1.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/compute-lcm": { - "version": "1.1.2", - "dev": true, - "dependencies": { - "compute-gcd": "^1.2.1", - "validate.io-array": "^1.0.3", - "validate.io-function": "^1.0.2", - "validate.io-integer-array": "^1.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/concat-map": { - "version": "0.0.1", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/cross-fetch": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "node-fetch": "^2.6.12" - } - }, - "../../helper/openapi-codegeneration/node_modules/cross-fetch/node_modules/node-fetch": { - "version": "2.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "../../helper/openapi-codegeneration/node_modules/cross-spawn": { - "version": "7.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "../../helper/openapi-codegeneration/node_modules/d": { - "version": "1.0.2", - "dev": true, - "license": "ISC", - "dependencies": { - "es5-ext": "^0.10.64", - "type": "^2.7.2" - }, - "engines": { - "node": ">=0.12" - } - }, - "../../helper/openapi-codegeneration/node_modules/data-uri-to-buffer": { - "version": "4.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 12" - } - }, - "../../helper/openapi-codegeneration/node_modules/debug": { - "version": "4.3.6", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "../../helper/openapi-codegeneration/node_modules/deep-is": { - "version": "0.1.4", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/deterministic-json-schema-faker": { - "version": "0.5.0-rcv.46", - "dev": true, - "license": "MIT", - "dependencies": { - "json-schema-ref-parser": "^6.1.0", - "jsonpath-plus": "^5.1.0" - }, - "bin": { - "jsf": "bin/gen.cjs" - } - }, - "../../helper/openapi-codegeneration/node_modules/dir-glob": { - "version": "3.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/duplexer": { - "version": "0.1.2", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/eastasianwidth": { - "version": "0.2.0", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/emoji-regex": { - "version": "9.2.2", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/es5-ext": { - "version": "0.10.64", - "dev": true, - "hasInstallScript": true, - "license": "ISC", - "dependencies": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "esniff": "^2.0.1", - "next-tick": "^1.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "../../helper/openapi-codegeneration/node_modules/es6-iterator": { - "version": "2.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "../../helper/openapi-codegeneration/node_modules/es6-symbol": { - "version": "3.1.4", - "dev": true, - "license": "ISC", - "dependencies": { - "d": "^1.0.2", - "ext": "^1.7.0" - }, - "engines": { - "node": ">=0.12" - } - }, - "../../helper/openapi-codegeneration/node_modules/es6-weak-map": { - "version": "2.0.3", - "dev": true, - "license": "ISC", - "dependencies": { - "d": "1", - "es5-ext": "^0.10.46", - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.1" - } - }, - "../../helper/openapi-codegeneration/node_modules/escape-string-regexp": { - "version": "1.0.5", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/eslint": { - "version": "9.9.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.11.0", - "@eslint/config-array": "^0.17.1", - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.9.0", - "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.3.0", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.0.2", - "eslint-visitor-keys": "^4.0.0", - "espree": "^10.1.0", - "esquery": "^1.5.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^8.0.0", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://eslint.org/donate" - }, - "peerDependencies": { - "jiti": "*" - }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - } - } - }, - "../../helper/openapi-codegeneration/node_modules/eslint-scope": { - "version": "8.0.2", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "../../helper/openapi-codegeneration/node_modules/eslint-visitor-keys": { - "version": "4.0.0", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "../../helper/openapi-codegeneration/node_modules/eslint/node_modules/ajv": { - "version": "6.12.6", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "../../helper/openapi-codegeneration/node_modules/eslint/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "../../helper/openapi-codegeneration/node_modules/eslint/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "../../helper/openapi-codegeneration/node_modules/eslint/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/eslint/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/eslint/node_modules/escape-string-regexp": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "../../helper/openapi-codegeneration/node_modules/eslint/node_modules/has-flag": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/eslint/node_modules/json-schema-traverse": { - "version": "0.4.1", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/eslint/node_modules/supports-color": { - "version": "7.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/esniff": { - "version": "2.0.1", - "dev": true, - "license": "ISC", - "dependencies": { - "d": "^1.0.1", - "es5-ext": "^0.10.62", - "event-emitter": "^0.3.5", - "type": "^2.7.2" - }, - "engines": { - "node": ">=0.10" - } - }, - "../../helper/openapi-codegeneration/node_modules/espree": { - "version": "10.1.0", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.12.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.0.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "../../helper/openapi-codegeneration/node_modules/esprima": { - "version": "4.0.1", - "dev": true, - "license": "BSD-2-Clause", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "../../helper/openapi-codegeneration/node_modules/esquery": { - "version": "1.6.0", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "../../helper/openapi-codegeneration/node_modules/esrecurse": { - "version": "4.3.0", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/estraverse": { - "version": "5.3.0", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=4.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/esutils": { - "version": "2.0.3", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/event-emitter": { - "version": "0.3.5", - "dev": true, - "license": "MIT", - "dependencies": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "../../helper/openapi-codegeneration/node_modules/event-stream": { - "version": "3.3.4", - "dev": true, - "license": "MIT", - "dependencies": { - "duplexer": "~0.1.1", - "from": "~0", - "map-stream": "~0.1.0", - "pause-stream": "0.0.11", - "split": "0.3", - "stream-combiner": "~0.0.4", - "through": "~2.3.1" - } - }, - "../../helper/openapi-codegeneration/node_modules/event-target-shim": { - "version": "5.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "../../helper/openapi-codegeneration/node_modules/events": { - "version": "3.3.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.x" - } - }, - "../../helper/openapi-codegeneration/node_modules/ext": { - "version": "1.7.0", - "dev": true, - "license": "ISC", - "dependencies": { - "type": "^2.7.2" - } - }, - "../../helper/openapi-codegeneration/node_modules/fast-deep-equal": { - "version": "3.1.3", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/fast-glob": { - "version": "3.3.2", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "../../helper/openapi-codegeneration/node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/fast-levenshtein": { - "version": "2.0.6", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/fast-uri": { - "version": "3.0.1", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/fastq": { - "version": "1.17.1", - "dev": true, - "license": "ISC", - "dependencies": { - "reusify": "^1.0.4" - } - }, - "../../helper/openapi-codegeneration/node_modules/fetch-blob": { - "version": "3.2.0", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "paypal", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "dependencies": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - }, - "engines": { - "node": "^12.20 || >= 14.13" - } - }, - "../../helper/openapi-codegeneration/node_modules/file-entry-cache": { - "version": "8.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "flat-cache": "^4.0.0" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/fill-range": { - "version": "7.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/find-up": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "../../helper/openapi-codegeneration/node_modules/flat-cache": { - "version": "4.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.4" - }, - "engines": { - "node": ">=16" - } - }, - "../../helper/openapi-codegeneration/node_modules/flatted": { - "version": "3.3.1", - "dev": true, - "license": "ISC" - }, - "../../helper/openapi-codegeneration/node_modules/foreground-child": { - "version": "3.3.0", - "dev": true, - "license": "ISC", - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "../../helper/openapi-codegeneration/node_modules/format-util": { - "version": "1.0.5", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/formdata-polyfill": { - "version": "4.0.10", - "dev": true, - "license": "MIT", - "dependencies": { - "fetch-blob": "^3.1.2" - }, - "engines": { - "node": ">=12.20.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/from": { - "version": "0.1.7", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/glob": { - "version": "11.0.0", - "dev": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^4.0.1", - "minimatch": "^10.0.0", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^2.0.0" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "../../helper/openapi-codegeneration/node_modules/glob-parent": { - "version": "6.0.2", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/glob/node_modules/brace-expansion": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/glob/node_modules/minimatch": { - "version": "10.0.1", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "../../helper/openapi-codegeneration/node_modules/globals": { - "version": "11.12.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "../../helper/openapi-codegeneration/node_modules/globby": { - "version": "11.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "../../helper/openapi-codegeneration/node_modules/graphemer": { - "version": "1.4.0", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/has-flag": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "../../helper/openapi-codegeneration/node_modules/ieee754": { - "version": "1.2.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "BSD-3-Clause" - }, - "../../helper/openapi-codegeneration/node_modules/ignore": { - "version": "5.3.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "../../helper/openapi-codegeneration/node_modules/import-fresh": { - "version": "3.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "../../helper/openapi-codegeneration/node_modules/imurmurhash": { - "version": "0.1.4", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.19" - } - }, - "../../helper/openapi-codegeneration/node_modules/is-extglob": { - "version": "2.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/is-glob": { - "version": "4.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/is-number": { - "version": "7.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/is-path-inside": { - "version": "3.0.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/is-promise": { - "version": "2.2.2", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/is-url": { - "version": "1.2.4", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/isexe": { - "version": "2.0.0", - "dev": true, - "license": "ISC" - }, - "../../helper/openapi-codegeneration/node_modules/jackspeak": { - "version": "4.0.1", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/javascript-natural-sort": { - "version": "0.7.1", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/js-base64": { - "version": "3.7.7", - "dev": true, - "license": "BSD-3-Clause" - }, - "../../helper/openapi-codegeneration/node_modules/js-tokens": { - "version": "4.0.0", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/js-yaml": { - "version": "3.14.1", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "../../helper/openapi-codegeneration/node_modules/jsesc": { - "version": "2.5.2", - "dev": true, - "license": "MIT", - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=4" - } - }, - "../../helper/openapi-codegeneration/node_modules/json-buffer": { - "version": "3.0.1", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/json-schema-compare": { - "version": "0.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash": "^4.17.4" - } - }, - "../../helper/openapi-codegeneration/node_modules/json-schema-merge-allof": { - "version": "0.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "compute-lcm": "^1.1.2", - "json-schema-compare": "^0.2.2", - "lodash": "^4.17.20" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/json-schema-ref-parser": { - "version": "6.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "call-me-maybe": "^1.0.1", - "js-yaml": "^3.12.1", - "ono": "^4.0.11" - } - }, - "../../helper/openapi-codegeneration/node_modules/json-schema-to-typescript": { - "version": "15.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@apidevtools/json-schema-ref-parser": "^11.5.5", - "@types/json-schema": "^7.0.15", - "@types/lodash": "^4.17.0", - "cli-color": "^2.0.4", - "glob": "^10.3.12", - "is-glob": "^4.0.3", - "js-yaml": "^4.1.0", - "lodash": "^4.17.21", - "minimist": "^1.2.8", - "mkdirp": "^3.0.1", - "node-fetch": "^3.3.2", - "prettier": "^3.2.5" - }, - "bin": { - "json2ts": "dist/src/cli.js" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/json-schema-to-typescript/node_modules/@apidevtools/json-schema-ref-parser": { - "version": "11.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jsdevtools/ono": "^7.1.3", - "@types/json-schema": "^7.0.15", - "js-yaml": "^4.1.0" - }, - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://github.com/sponsors/philsturgeon" - } - }, - "../../helper/openapi-codegeneration/node_modules/json-schema-to-typescript/node_modules/argparse": { - "version": "2.0.1", - "dev": true, - "license": "Python-2.0" - }, - "../../helper/openapi-codegeneration/node_modules/json-schema-to-typescript/node_modules/brace-expansion": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/json-schema-to-typescript/node_modules/glob": { - "version": "10.4.5", - "dev": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "../../helper/openapi-codegeneration/node_modules/json-schema-to-typescript/node_modules/jackspeak": { - "version": "3.4.3", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/json-schema-to-typescript/node_modules/js-yaml": { - "version": "4.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "../../helper/openapi-codegeneration/node_modules/json-schema-to-typescript/node_modules/lru-cache": { - "version": "10.4.3", - "dev": true, - "license": "ISC" - }, - "../../helper/openapi-codegeneration/node_modules/json-schema-to-typescript/node_modules/minimatch": { - "version": "9.0.5", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "../../helper/openapi-codegeneration/node_modules/json-schema-to-typescript/node_modules/path-scurry": { - "version": "1.11.1", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "../../helper/openapi-codegeneration/node_modules/json-schema-traverse": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/jsonpath-plus": { - "version": "5.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/keyv": { - "version": "4.5.4", - "dev": true, - "license": "MIT", - "dependencies": { - "json-buffer": "3.0.1" - } - }, - "../../helper/openapi-codegeneration/node_modules/levn": { - "version": "0.4.1", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/locate-path": { - "version": "6.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "../../helper/openapi-codegeneration/node_modules/lodash": { - "version": "4.17.21", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/lodash.merge": { - "version": "4.6.2", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/lru-cache": { - "version": "11.0.0", - "dev": true, - "license": "ISC", - "engines": { - "node": "20 || >=22" - } - }, - "../../helper/openapi-codegeneration/node_modules/lru-queue": { - "version": "0.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "es5-ext": "~0.10.2" - } - }, - "../../helper/openapi-codegeneration/node_modules/map-stream": { - "version": "0.1.0", - "dev": true - }, - "../../helper/openapi-codegeneration/node_modules/memoizee": { - "version": "0.4.17", - "dev": true, - "license": "ISC", - "dependencies": { - "d": "^1.0.2", - "es5-ext": "^0.10.64", - "es6-weak-map": "^2.0.3", - "event-emitter": "^0.3.5", - "is-promise": "^2.2.2", - "lru-queue": "^0.1.0", - "next-tick": "^1.1.0", - "timers-ext": "^0.1.7" - }, - "engines": { - "node": ">=0.12" - } - }, - "../../helper/openapi-codegeneration/node_modules/merge2": { - "version": "1.4.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "../../helper/openapi-codegeneration/node_modules/micromatch": { - "version": "4.0.7", - "dev": true, - "license": "MIT", - "dependencies": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "../../helper/openapi-codegeneration/node_modules/minimatch": { - "version": "3.1.2", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "../../helper/openapi-codegeneration/node_modules/minimist": { - "version": "1.2.8", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "../../helper/openapi-codegeneration/node_modules/minipass": { - "version": "7.1.2", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "../../helper/openapi-codegeneration/node_modules/mkdirp": { - "version": "3.0.1", - "dev": true, - "license": "MIT", - "bin": { - "mkdirp": "dist/cjs/src/bin.js" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "../../helper/openapi-codegeneration/node_modules/ms": { - "version": "2.1.2", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/natural-compare": { - "version": "1.4.0", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/next-tick": { - "version": "1.1.0", - "dev": true, - "license": "ISC" - }, - "../../helper/openapi-codegeneration/node_modules/node-cleanup": { - "version": "2.1.2", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/node-domexception": { - "version": "1.0.0", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "engines": { - "node": ">=10.5.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/node-fetch": { - "version": "3.3.2", - "dev": true, - "license": "MIT", - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "../../helper/openapi-codegeneration/node_modules/nunjucks": { - "version": "3.2.4", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "a-sync-waterfall": "^1.0.0", - "asap": "^2.0.3", - "commander": "^5.1.0" - }, - "bin": { - "nunjucks-precompile": "bin/precompile" - }, - "engines": { - "node": ">= 6.9.0" - }, - "peerDependencies": { - "chokidar": "^3.3.0" - }, - "peerDependenciesMeta": { - "chokidar": { - "optional": true - } - } - }, - "../../helper/openapi-codegeneration/node_modules/nunjucks/node_modules/commander": { - "version": "5.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, - "../../helper/openapi-codegeneration/node_modules/ono": { - "version": "4.0.11", - "dev": true, - "license": "MIT", - "dependencies": { - "format-util": "^1.0.3" - } - }, - "../../helper/openapi-codegeneration/node_modules/openapi-types": { - "version": "12.1.3", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/optionator": { - "version": "0.9.4", - "dev": true, - "license": "MIT", - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.5" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/p-limit": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "../../helper/openapi-codegeneration/node_modules/p-locate": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "../../helper/openapi-codegeneration/node_modules/package-json-from-dist": { - "version": "1.0.0", - "dev": true, - "license": "BlueOak-1.0.0" - }, - "../../helper/openapi-codegeneration/node_modules/pako": { - "version": "1.0.11", - "dev": true, - "license": "(MIT AND Zlib)" - }, - "../../helper/openapi-codegeneration/node_modules/parent-module": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "../../helper/openapi-codegeneration/node_modules/path-exists": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/path-key": { - "version": "3.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/path-scurry": { - "version": "2.0.0", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "../../helper/openapi-codegeneration/node_modules/path-type": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/pause-stream": { - "version": "0.0.11", - "dev": true, - "license": [ - "MIT", - "Apache2" - ], - "dependencies": { - "through": "~2.3" - } - }, - "../../helper/openapi-codegeneration/node_modules/picocolors": { - "version": "1.0.1", - "dev": true, - "license": "ISC" - }, - "../../helper/openapi-codegeneration/node_modules/picomatch": { - "version": "2.3.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "../../helper/openapi-codegeneration/node_modules/pluralize": { - "version": "8.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "../../helper/openapi-codegeneration/node_modules/prelude-ls": { - "version": "1.2.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/prettier": { - "version": "3.3.3", - "dev": true, - "license": "MIT", - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "../../helper/openapi-codegeneration/node_modules/process": { - "version": "0.11.10", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/ps-tree": { - "version": "1.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "event-stream": "=3.3.4" - }, - "bin": { - "ps-tree": "bin/ps-tree.js" - }, - "engines": { - "node": ">= 0.10" - } - }, - "../../helper/openapi-codegeneration/node_modules/punycode": { - "version": "2.3.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "../../helper/openapi-codegeneration/node_modules/queue-microtask": { - "version": "1.2.3", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/quicktype-core": { - "version": "23.0.170", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@glideapps/ts-necessities": "2.2.3", - "browser-or-node": "^3.0.0", - "collection-utils": "^1.0.1", - "cross-fetch": "^4.0.0", - "is-url": "^1.2.4", - "js-base64": "^3.7.7", - "lodash": "^4.17.21", - "pako": "^1.0.6", - "pluralize": "^8.0.0", - "readable-stream": "4.5.2", - "unicode-properties": "^1.4.1", - "urijs": "^1.19.1", - "wordwrap": "^1.0.0", - "yaml": "^2.4.1" - } - }, - "../../helper/openapi-codegeneration/node_modules/readable-stream": { - "version": "4.5.2", - "dev": true, - "license": "MIT", - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/require-from-string": { - "version": "2.0.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/resolve-from": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "../../helper/openapi-codegeneration/node_modules/reusify": { - "version": "1.0.4", - "dev": true, - "license": "MIT", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/run-parallel": { - "version": "1.2.0", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "../../helper/openapi-codegeneration/node_modules/safe-buffer": { - "version": "5.2.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/seedrandom": { - "version": "3.0.5", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/semver": { - "version": "7.6.3", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "../../helper/openapi-codegeneration/node_modules/shebang-command": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/shebang-regex": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/signal-exit": { - "version": "4.1.0", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "../../helper/openapi-codegeneration/node_modules/slash": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/source-map": { - "version": "0.5.7", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/split": { - "version": "0.3.3", - "dev": true, - "license": "MIT", - "dependencies": { - "through": "2" - }, - "engines": { - "node": "*" - } - }, - "../../helper/openapi-codegeneration/node_modules/sprintf-js": { - "version": "1.0.3", - "dev": true, - "license": "BSD-3-Clause" - }, - "../../helper/openapi-codegeneration/node_modules/stream-combiner": { - "version": "0.0.4", - "dev": true, - "license": "MIT", - "dependencies": { - "duplexer": "~0.1.1" - } - }, - "../../helper/openapi-codegeneration/node_modules/string_decoder": { - "version": "1.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/string-argv": { - "version": "0.3.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.6.19" - } - }, - "../../helper/openapi-codegeneration/node_modules/string-width": { - "version": "5.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "../../helper/openapi-codegeneration/node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/string-width-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/string-width/node_modules/ansi-regex": { - "version": "6.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "../../helper/openapi-codegeneration/node_modules/string-width/node_modules/strip-ansi": { - "version": "7.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "../../helper/openapi-codegeneration/node_modules/strip-ansi": { - "version": "6.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/strip-json-comments": { - "version": "3.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "../../helper/openapi-codegeneration/node_modules/supports-color": { - "version": "5.5.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "../../helper/openapi-codegeneration/node_modules/text-table": { - "version": "0.2.0", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/through": { - "version": "2.3.8", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/timers-ext": { - "version": "0.1.8", - "dev": true, - "license": "ISC", - "dependencies": { - "es5-ext": "^0.10.64", - "next-tick": "^1.1.0" - }, - "engines": { - "node": ">=0.12" - } - }, - "../../helper/openapi-codegeneration/node_modules/tiny-inflate": { - "version": "1.0.3", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/tiny-typed-emitter": { - "version": "2.1.0", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/to-fast-properties": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "../../helper/openapi-codegeneration/node_modules/to-regex-range": { - "version": "5.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/tr46": { - "version": "0.0.3", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/ts-api-utils": { - "version": "1.3.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=16" - }, - "peerDependencies": { - "typescript": ">=4.2.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/tsc-watch": { - "version": "6.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "cross-spawn": "^7.0.3", - "node-cleanup": "^2.1.2", - "ps-tree": "^1.2.0", - "string-argv": "^0.3.1" - }, - "bin": { - "tsc-watch": "dist/lib/tsc-watch.js" - }, - "engines": { - "node": ">=12.12.0" - }, - "peerDependencies": { - "typescript": "*" - } - }, - "../../helper/openapi-codegeneration/node_modules/type": { - "version": "2.7.3", - "dev": true, - "license": "ISC" - }, - "../../helper/openapi-codegeneration/node_modules/type-check": { - "version": "0.4.0", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/typescript": { - "version": "5.5.4", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "../../helper/openapi-codegeneration/node_modules/typescript-eslint": { - "version": "8.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/eslint-plugin": "8.1.0", - "@typescript-eslint/parser": "8.1.0", - "@typescript-eslint/utils": "8.1.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "../../helper/openapi-codegeneration/node_modules/undici-types": { - "version": "6.13.0", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/unicode-properties": { - "version": "1.4.1", - "dev": true, - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.0", - "unicode-trie": "^2.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/unicode-trie": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "pako": "^0.2.5", - "tiny-inflate": "^1.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/unicode-trie/node_modules/pako": { - "version": "0.2.9", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/uri-js": { - "version": "4.4.1", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/urijs": { - "version": "1.19.11", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/validate.io-array": { - "version": "1.0.6", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/validate.io-function": { - "version": "1.0.2", - "dev": true - }, - "../../helper/openapi-codegeneration/node_modules/validate.io-integer": { - "version": "1.0.5", - "dev": true, - "dependencies": { - "validate.io-number": "^1.0.3" - } - }, - "../../helper/openapi-codegeneration/node_modules/validate.io-integer-array": { - "version": "1.0.0", - "dev": true, - "dependencies": { - "validate.io-array": "^1.0.3", - "validate.io-integer": "^1.0.4" - } - }, - "../../helper/openapi-codegeneration/node_modules/validate.io-number": { - "version": "1.0.3", - "dev": true - }, - "../../helper/openapi-codegeneration/node_modules/web-streams-polyfill": { - "version": "3.3.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "../../helper/openapi-codegeneration/node_modules/webidl-conversions": { - "version": "3.0.1", - "dev": true, - "license": "BSD-2-Clause" - }, - "../../helper/openapi-codegeneration/node_modules/whatwg-url": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/which": { - "version": "2.0.2", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "../../helper/openapi-codegeneration/node_modules/word-wrap": { - "version": "1.2.5", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/wordwrap": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/wrap-ansi": { - "version": "8.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "../../helper/openapi-codegeneration/node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "../../helper/openapi-codegeneration/node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "../../helper/openapi-codegeneration/node_modules/wrap-ansi-cjs/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "../../helper/openapi-codegeneration/node_modules/wrap-ansi-cjs/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "dev": true, - "license": "MIT" - }, - "../../helper/openapi-codegeneration/node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "../../helper/openapi-codegeneration/node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "6.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "../../helper/openapi-codegeneration/node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "../../helper/openapi-codegeneration/node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "7.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "../../helper/openapi-codegeneration/node_modules/yaml": { - "version": "2.5.0", - "dev": true, - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14" - } - }, - "../../helper/openapi-codegeneration/node_modules/yocto-queue": { - "version": "0.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.24.7", - "license": "MIT", - "dependencies": { - "@babel/highlight": "^7.24.7", - "picocolors": "^1.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/generator": { - "version": "7.25.0", - "license": "MIT", - "dependencies": { - "@babel/types": "^7.25.0", - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25", - "jsesc": "^2.5.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-environment-visitor": { - "version": "7.24.7", - "license": "MIT", - "dependencies": { - "@babel/types": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-function-name": { - "version": "7.24.7", - "license": "MIT", - "dependencies": { - "@babel/template": "^7.24.7", - "@babel/types": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.22.5", - "license": "MIT", - "dependencies": { - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.22.6", - "license": "MIT", - "dependencies": { - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-string-parser": { - "version": "7.24.8", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.7", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.24.7", - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.24.7", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/parser": { - "version": "7.25.3", - "license": "MIT", - "dependencies": { - "@babel/types": "^7.25.2" - }, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/runtime": { - "version": "7.25.0", - "dev": true, - "license": "MIT", - "dependencies": { - "regenerator-runtime": "^0.14.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/template": { - "version": "7.25.0", - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.24.7", - "@babel/parser": "^7.25.0", - "@babel/types": "^7.25.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse": { - "version": "7.23.2", - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.0", - "@babel/types": "^7.23.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/types": { - "version": "7.25.2", - "license": "MIT", - "dependencies": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@cfaester/enzyme-adapter-react-18": { - "version": "0.8.0", - "dev": true, - "license": "MIT", - "dependencies": { - "enzyme-shallow-equal": "^1.0.0", - "function.prototype.name": "^1.1.6", - "has": "^1.0.4", - "react-is": "^18.2.0", - "react-shallow-renderer": "^16.15.0" - }, - "peerDependencies": { - "enzyme": "^3.11.0", - "react": ">=18", - "react-dom": ">=18" - } - }, - "node_modules/@cross-lab-project/openapi-codegen": { - "resolved": "../../helper/openapi-codegeneration", - "link": true - }, - "node_modules/@emotion/is-prop-valid": { - "version": "1.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "@emotion/memoize": "^0.8.1" - } - }, - "node_modules/@emotion/memoize": { - "version": "0.8.1", - "dev": true, - "license": "MIT" - }, - "node_modules/@emotion/unitless": { - "version": "0.8.1", - "dev": true, - "license": "MIT" - }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "license": "MIT", - "dependencies": { - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@eslint-community/regexpp": { - "version": "4.11.0", - "license": "MIT", - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/@eslint/config-array": { - "version": "0.17.1", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@eslint/object-schema": "^2.1.4", - "debug": "^4.3.1", - "minimatch": "^3.1.2" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "3.1.0", - "license": "MIT", - "peer": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^10.0.1", - "globals": "^14.0.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "14.0.0", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@eslint/js": { - "version": "9.9.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.9.0.tgz", - "integrity": "sha512-hhetes6ZHP3BlXLxmd8K2SNgkhNSi+UcecbnwWKwpP7kyi/uC75DJ1lOOBO3xrC4jyojtGE3YxKZPHfk4yrgug==", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/object-schema": { - "version": "2.1.4", - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@exodus/schemasafe": { - "version": "1.3.0", - "dev": true, - "license": "MIT" - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/retry": { - "version": "0.3.0", - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": ">=18.18" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "license": "MIT", - "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "license": "MIT", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/@redocly/ajv": { "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@redocly/ajv/-/ajv-8.11.0.tgz", + "integrity": "sha512-9GWx27t7xWhDIR02PA18nzBdLcKQRgc46xNQvjFkrYk4UOmvKhJ/dawwiX0cCOeetN5LcaaiqQbVOWYK62SGHw==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -3851,11 +425,12 @@ } }, "node_modules/@redocly/cli": { - "version": "1.19.0", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@redocly/cli/-/cli-1.15.0.tgz", + "integrity": "sha512-+KZp86YpCEJoRxr/pa2UXYv0EdyvsvcK5ddr2g5cPFoCU9z6FVaVSKGW/9ipX1UsRX3sDQfFIZfEpeA5hybpuA==", "dev": true, - "license": "MIT", "dependencies": { - "@redocly/openapi-core": "1.19.0", + "@redocly/openapi-core": "1.15.0", "abort-controller": "^3.0.0", "chokidar": "^3.5.1", "colorette": "^1.2.0", @@ -3866,7 +441,6 @@ "handlebars": "^4.7.6", "mobx": "^6.0.4", "node-fetch": "^2.6.1", - "pluralize": "^8.0.0", "react": "^17.0.0 || ^18.2.0", "react-dom": "^17.0.0 || ^18.2.0", "redoc": "~2.1.5", @@ -3885,17 +459,19 @@ } }, "node_modules/@redocly/config": { - "version": "0.7.0", - "dev": true, - "license": "MIT" + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@redocly/config/-/config-0.6.0.tgz", + "integrity": "sha512-hNVN3eTxFj2nHYX0gGzZxxXwdE0DXWeWou1TIK3HYf0S9VKVxTxjO9EZbMB7iVUqaHkeqy4PSjlBQcEgD0Ftjg==", + "dev": true }, "node_modules/@redocly/openapi-core": { - "version": "1.19.0", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.15.0.tgz", + "integrity": "sha512-ac+3nn9y/dE+cgIVgIdq7eIisjZlBEJptLsCbOVLIsR2jb+O1SznXeyqy2MkTHMSs6zM/KHP4bMQy0DGmi7K0Q==", "dev": true, - "license": "MIT", "dependencies": { "@redocly/ajv": "^8.11.0", - "@redocly/config": "^0.7.0", + "@redocly/config": "^0.6.0", "colorette": "^1.2.0", "https-proxy-agent": "^7.0.4", "js-levenshtein": "^1.1.6", @@ -3911,28 +487,10 @@ "npm": ">=7.0.0" } }, - "node_modules/@redocly/openapi-core/node_modules/brace-expansion": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@redocly/openapi-core/node_modules/minimatch": { - "version": "5.1.6", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@trivago/prettier-plugin-sort-imports": { "version": "4.3.0", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.3.0.tgz", + "integrity": "sha512-r3n0onD3BTOVUNPhR4lhVK4/pABGpbA7bW3eumZnYdKaHkf1qEC+Mag6DPbGNuuh0eG8AaYj+YqmVHSiGslaTQ==", "dependencies": { "@babel/generator": "7.17.7", "@babel/parser": "^7.20.5", @@ -3951,267 +509,23 @@ } } }, - "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/generator": { - "version": "7.17.7", - "license": "MIT", - "dependencies": { - "@babel/types": "^7.17.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/types": { - "version": "7.17.0", - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/source-map": { - "version": "0.5.7", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@types/eslint": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.0.tgz", - "integrity": "sha512-gi6WQJ7cHRgZxtkQEoyHMppPjq9Kxo5Tjn2prSKDSmZrCz8TZ3jSRCeTJm+WoM+oB0WG37bRqLzaaU3q7JypGg==", - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint__js": { - "version": "8.42.3", - "resolved": "https://registry.npmjs.org/@types/eslint__js/-/eslint__js-8.42.3.tgz", - "integrity": "sha512-alfG737uhmPdnvkrLdZLcEKJ/B8s9Y4hrZ+YAdzUeoArBlSUERA2E87ROfOaS4jd/C45fzOoZzidLc1IPwLqOw==", - "dependencies": { - "@types/eslint": "*" - } - }, - "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" - }, "node_modules/@types/json-schema": { "version": "7.0.15", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true }, "node_modules/@types/stylis": { "version": "4.2.5", - "dev": true, - "license": "MIT" - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.1.0.tgz", - "integrity": "sha512-LlNBaHFCEBPHyD4pZXb35mzjGkuGKXU5eeCA1SxvHfiRES0E82dOounfVpL4DCqYvJEKab0bZIA0gCRpdLKkCw==", - "dependencies": { - "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.1.0", - "@typescript-eslint/type-utils": "8.1.0", - "@typescript-eslint/utils": "8.1.0", - "@typescript-eslint/visitor-keys": "8.1.0", - "graphemer": "^1.4.0", - "ignore": "^5.3.1", - "natural-compare": "^1.4.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.1.0.tgz", - "integrity": "sha512-U7iTAtGgJk6DPX9wIWPPOlt1gO57097G06gIcl0N0EEnNw8RGD62c+2/DiP/zL7KrkqnnqF7gtFGR7YgzPllTA==", - "dependencies": { - "@typescript-eslint/scope-manager": "8.1.0", - "@typescript-eslint/types": "8.1.0", - "@typescript-eslint/typescript-estree": "8.1.0", - "@typescript-eslint/visitor-keys": "8.1.0", - "debug": "^4.3.4" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.1.0.tgz", - "integrity": "sha512-DsuOZQji687sQUjm4N6c9xABJa7fjvfIdjqpSIIVOgaENf2jFXiM9hIBZOL3hb6DHK9Nvd2d7zZnoMLf9e0OtQ==", - "dependencies": { - "@typescript-eslint/types": "8.1.0", - "@typescript-eslint/visitor-keys": "8.1.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.1.0.tgz", - "integrity": "sha512-oLYvTxljVvsMnldfl6jIKxTaU7ok7km0KDrwOt1RHYu6nxlhN3TIx8k5Q52L6wR33nOwDgM7VwW1fT1qMNfFIA==", - "dependencies": { - "@typescript-eslint/typescript-estree": "8.1.0", - "@typescript-eslint/utils": "8.1.0", - "debug": "^4.3.4", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/types": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.1.0.tgz", - "integrity": "sha512-q2/Bxa0gMOu/2/AKALI0tCKbG2zppccnRIRCW6BaaTlRVaPKft4oVYPp7WOPpcnsgbr0qROAVCVKCvIQ0tbWog==", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.1.0.tgz", - "integrity": "sha512-NTHhmufocEkMiAord/g++gWKb0Fr34e9AExBRdqgWdVBaKoei2dIyYKD9Q0jBnvfbEA5zaf8plUFMUH6kQ0vGg==", - "dependencies": { - "@typescript-eslint/types": "8.1.0", - "@typescript-eslint/visitor-keys": "8.1.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.1.0.tgz", - "integrity": "sha512-ypRueFNKTIFwqPeJBfeIpxZ895PQhNyH4YID6js0UoBImWYoSjBsahUn9KMiJXh94uOjVBgHD9AmkyPsPnFwJA==", - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.1.0", - "@typescript-eslint/types": "8.1.0", - "@typescript-eslint/typescript-estree": "8.1.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.1.0.tgz", - "integrity": "sha512-ba0lNI19awqZ5ZNKh6wCModMwoZs457StTebQ0q1NP58zSi2F6MOZRXwfKZy+jB78JNJ/WH8GSh2IQNzXX8Nag==", - "dependencies": { - "@typescript-eslint/types": "8.1.0", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } + "resolved": "https://registry.npmjs.org/@types/stylis/-/stylis-4.2.5.tgz", + "integrity": "sha512-1Xve+NMN7FWjY14vLoY5tL3BVEQ/n42YLwaqJIPYhotZ9uBHt87VceMwWQpzmdEt2TNXIorIFG+YeCUUW7RInw==", + "dev": true }, "node_modules/abort-controller": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", "dev": true, - "license": "MIT", "dependencies": { "event-target-shim": "^5.0.0" }, @@ -4219,25 +533,6 @@ "node": ">=6.5" } }, - "node_modules/acorn": { - "version": "8.12.1", - "license": "MIT", - "peer": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "license": "MIT", - "peer": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, "node_modules/agent-base": { "version": "7.1.1", "dev": true, @@ -4271,14 +566,17 @@ }, "node_modules/ansi-regex": { "version": "5.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "engines": { "node": ">=8" } }, "node_modules/ansi-styles": { "version": "3.2.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dependencies": { "color-convert": "^1.9.0" }, @@ -4288,8 +586,9 @@ }, "node_modules/anymatch": { "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, - "license": "ISC", "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -4300,12 +599,15 @@ }, "node_modules/argparse": { "version": "2.0.1", - "license": "Python-2.0" + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "node_modules/array-buffer-byte-length": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.5", "is-array-buffer": "^3.0.4" @@ -4317,18 +619,11 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "engines": { - "node": ">=8" - } - }, "node_modules/array.prototype.filter": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/array.prototype.filter/-/array.prototype.filter-1.0.4.tgz", + "integrity": "sha512-r+mCJ7zXgXElgR4IRC+fkvNCeoaavWBs6EdCso5Tbcf+iEMKzBU/His60lt34WEZ9vlb8wDkZvQGcVI5GwkfoQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "call-bind": "^1.0.7", @@ -4347,8 +642,9 @@ }, "node_modules/array.prototype.flat": { "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "call-bind": "^1.0.2", @@ -4365,8 +661,9 @@ }, "node_modules/arraybuffer.prototype.slice": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", "dev": true, - "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.1", "call-bind": "^1.0.5", @@ -4386,13 +683,15 @@ }, "node_modules/asynckit": { "version": "0.4.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true }, "node_modules/available-typed-arrays": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", "dev": true, - "license": "MIT", "dependencies": { "possible-typed-array-names": "^1.0.0" }, @@ -4405,33 +704,43 @@ }, "node_modules/balanced-match": { "version": "1.0.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "node_modules/binary-extensions": { - "version": "2.2.0", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/boolbase": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", "dev": true, - "license": "ISC", "peer": true }, "node_modules/brace-expansion": { - "version": "1.1.11", - "license": "MIT", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/braces": { "version": "3.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, "dependencies": { "fill-range": "^7.1.1" }, @@ -4441,8 +750,9 @@ }, "node_modules/call-bind": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -4459,28 +769,23 @@ }, "node_modules/call-me-maybe": { "version": "1.0.2", - "dev": true, - "license": "MIT" - }, - "node_modules/callsites": { - "version": "3.1.0", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=6" - } + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", + "integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==", + "dev": true }, "node_modules/camelize": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz", + "integrity": "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/chalk": { "version": "2.4.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -4492,8 +797,9 @@ }, "node_modules/cheerio": { "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", + "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "cheerio-select": "^2.1.0", @@ -4513,8 +819,9 @@ }, "node_modules/cheerio-select": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", "dev": true, - "license": "BSD-2-Clause", "peer": true, "dependencies": { "boolbase": "^1.0.0", @@ -4529,15 +836,10 @@ } }, "node_modules/chokidar": { - "version": "3.5.3", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "license": "MIT", "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -4550,19 +852,24 @@ "engines": { "node": ">= 8.10.0" }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "node_modules/classnames": { "version": "2.5.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==", + "dev": true }, "node_modules/cliui": { "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, - "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -4571,32 +878,37 @@ }, "node_modules/clsx": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/color-convert": { "version": "1.9.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dependencies": { "color-name": "1.1.3" } }, "node_modules/color-name": { "version": "1.1.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "node_modules/colorette": { "version": "1.4.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", + "dev": true }, "node_modules/combined-stream": { "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, - "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -4606,19 +918,27 @@ }, "node_modules/commander": { "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, - "license": "MIT", "peer": true }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, "node_modules/concat-map": { "version": "0.0.1", "license": "MIT" }, "node_modules/core-js": { - "version": "3.38.0", + "version": "3.37.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.37.1.tgz", + "integrity": "sha512-Xn6qmxrQZyB0FFY8E3bgRXei3lWDJHhvI+u0q9TKIYM49G8pAr0FgnnrFRAmsbptZL1yxRADVXn+x5AGsbBfyw==", "dev": true, "hasInstallScript": true, - "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/core-js" @@ -4639,16 +959,18 @@ }, "node_modules/css-color-keywords": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", + "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==", "dev": true, - "license": "ISC", "engines": { "node": ">=4" } }, "node_modules/css-select": { "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", "dev": true, - "license": "BSD-2-Clause", "peer": true, "dependencies": { "boolbase": "^1.0.0", @@ -4663,8 +985,9 @@ }, "node_modules/css-to-react-native": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz", + "integrity": "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==", "dev": true, - "license": "MIT", "dependencies": { "camelize": "^1.0.0", "css-color-keywords": "^1.0.0", @@ -4673,8 +996,9 @@ }, "node_modules/css-what": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", "dev": true, - "license": "BSD-2-Clause", "peer": true, "engines": { "node": ">= 6" @@ -4685,13 +1009,15 @@ }, "node_modules/csstype": { "version": "3.1.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", + "dev": true }, "node_modules/data-view-buffer": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.6", "es-errors": "^1.3.0", @@ -4706,8 +1032,9 @@ }, "node_modules/data-view-byte-length": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", @@ -4722,8 +1049,9 @@ }, "node_modules/data-view-byte-offset": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.6", "es-errors": "^1.3.0", @@ -4737,8 +1065,9 @@ } }, "node_modules/debug": { - "version": "4.3.6", - "license": "MIT", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", "dependencies": { "ms": "2.1.2" }, @@ -4753,17 +1082,15 @@ }, "node_modules/decko": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decko/-/decko-1.2.0.tgz", + "integrity": "sha512-m8FnyHXV1QX+S1cl+KPFDIl6NMkxtKsy6+U/aYyjrOqWMuwAwYWu7ePqrsUHtDR5Y8Yk2pi/KIDSgF+vT4cPOQ==", "dev": true }, - "node_modules/deep-is": { - "version": "0.1.4", - "license": "MIT", - "peer": true - }, "node_modules/define-data-property": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dev": true, - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -4778,8 +1105,9 @@ }, "node_modules/define-properties": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, - "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", @@ -4794,33 +1122,25 @@ }, "node_modules/delayed-stream": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.4.0" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/discontinuous-range": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz", + "integrity": "sha512-c68LpLbO+7kP/b1Hr1qs8/BJ09F5khZGTxqxZuhzxpmwJKOgRFHJWIb9/KmqnqHhLdO55aOxFH/EGBvUQbL/RQ==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/dom-serializer": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "domelementtype": "^2.3.0", @@ -4833,6 +1153,8 @@ }, "node_modules/domelementtype": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", "dev": true, "funding": [ { @@ -4840,13 +1162,13 @@ "url": "https://github.com/sponsors/fb55" } ], - "license": "BSD-2-Clause", "peer": true }, "node_modules/domhandler": { "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", "dev": true, - "license": "BSD-2-Clause", "peer": true, "dependencies": { "domelementtype": "^2.3.0" @@ -4859,14 +1181,16 @@ } }, "node_modules/dompurify": { - "version": "3.1.6", - "dev": true, - "license": "(MPL-2.0 OR Apache-2.0)" + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.5.tgz", + "integrity": "sha512-lwG+n5h8QNpxtyrJW/gJWckL+1/DQiYMX8f7t8Z2AZTPw1esVrqjI63i7Zc2Gz0aKzLVMYC1V1PL/ky+aY/NgA==", + "dev": true }, "node_modules/domutils": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", "dev": true, - "license": "BSD-2-Clause", "peer": true, "dependencies": { "dom-serializer": "^2.0.0", @@ -4879,13 +1203,15 @@ }, "node_modules/emoji-regex": { "version": "8.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, "node_modules/entities": { "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true, - "license": "BSD-2-Clause", "peer": true, "engines": { "node": ">=0.12" @@ -4896,8 +1222,9 @@ }, "node_modules/enzyme": { "version": "3.11.0", + "resolved": "https://registry.npmjs.org/enzyme/-/enzyme-3.11.0.tgz", + "integrity": "sha512-Dw8/Gs4vRjxY6/6i9wU0V+utmQO9kvh9XLnz3LIudviOnVYDEe2ec+0k+NQoMamn1VrjKgCUOWj5jG/5M5M0Qw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "array.prototype.flat": "^1.2.3", @@ -4929,8 +1256,9 @@ }, "node_modules/enzyme-shallow-equal": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/enzyme-shallow-equal/-/enzyme-shallow-equal-1.0.7.tgz", + "integrity": "sha512-/um0GFqUXnpM9SvKtje+9Tjoz3f1fpBC3eXRFrNs8kpYn69JljciYP7KZTqM/YQbUY9KUjvKB4jo/q+L6WGGvg==", "dev": true, - "license": "MIT", "dependencies": { "hasown": "^2.0.0", "object-is": "^1.1.5" @@ -4941,8 +1269,9 @@ }, "node_modules/es-abstract": { "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", "dev": true, - "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.1", "arraybuffer.prototype.slice": "^1.0.3", @@ -5000,14 +1329,16 @@ }, "node_modules/es-array-method-boxes-properly": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", + "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/es-define-property": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", "dev": true, - "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.4" }, @@ -5017,16 +1348,18 @@ }, "node_modules/es-errors": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/es-object-atoms": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", "dev": true, - "license": "MIT", "dependencies": { "es-errors": "^1.3.0" }, @@ -5034,372 +1367,96 @@ "node": ">= 0.4" } }, - "node_modules/es-set-tostringtag": { - "version": "2.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.2.4", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-shim-unscopables": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "hasown": "^2.0.0" - } - }, - "node_modules/es-to-primitive": { - "version": "1.2.1", - "dev": true, - "license": "MIT", - "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es6-promise": { - "version": "3.3.1", - "dev": true, - "license": "MIT" - }, - "node_modules/escalade": { - "version": "3.1.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/eslint": { - "version": "9.8.0", - "license": "MIT", - "peer": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.11.0", - "@eslint/config-array": "^0.17.1", - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.8.0", - "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.3.0", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.0.2", - "eslint-visitor-keys": "^4.0.0", - "espree": "^10.1.0", - "esquery": "^1.5.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^8.0.0", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://eslint.org/donate" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "license": "Apache-2.0", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/@eslint/js": { - "version": "9.8.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.8.0.tgz", - "integrity": "sha512-MfluB7EUfxXtv3i/++oh89uzAr4PDI4nn201hsp+qaXqsjAWzinlZEHEfPgAX4doIlKvPG/i0A9dpKxOLII8yA==", - "peer": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/eslint/node_modules/ansi-styles": { - "version": "4.3.0", - "license": "MIT", - "peer": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/eslint/node_modules/chalk": { - "version": "4.1.2", - "license": "MIT", - "peer": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/eslint/node_modules/color-convert": { - "version": "2.0.1", - "license": "MIT", - "peer": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/eslint/node_modules/color-name": { - "version": "1.1.4", - "license": "MIT", - "peer": true - }, - "node_modules/eslint/node_modules/escape-string-regexp": { - "version": "4.0.0", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/eslint-scope": { - "version": "8.0.2", - "license": "BSD-2-Clause", - "peer": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/estraverse": { - "version": "5.3.0", - "license": "BSD-2-Clause", - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/eslint/node_modules/glob-parent": { - "version": "6.0.2", - "license": "ISC", - "peer": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/eslint/node_modules/has-flag": { - "version": "4.0.0", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/supports-color": { - "version": "7.2.0", - "license": "MIT", - "peer": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/espree": { - "version": "10.1.0", - "license": "BSD-2-Clause", - "peer": true, - "dependencies": { - "acorn": "^8.12.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.0.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "4.0.0", - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/esquery": { - "version": "1.6.0", - "license": "BSD-3-Clause", - "peer": true, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, "dependencies": { - "estraverse": "^5.1.0" + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" }, "engines": { - "node": ">=0.10" + "node": ">= 0.4" } }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "license": "BSD-2-Clause", + "node_modules/es-shim-unscopables": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "dev": true, "peer": true, - "engines": { - "node": ">=4.0" + "dependencies": { + "hasown": "^2.0.0" } }, - "node_modules/esrecurse": { - "version": "4.3.0", - "license": "BSD-2-Clause", - "peer": true, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, "dependencies": { - "estraverse": "^5.2.0" + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" }, "engines": { - "node": ">=4.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.3.0", - "license": "BSD-2-Clause", - "peer": true, + "node_modules/es6-promise": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", + "integrity": "sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==", + "dev": true + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true, "engines": { - "node": ">=4.0" + "node": ">=6" } }, - "node_modules/esutils": { - "version": "2.0.3", - "license": "BSD-2-Clause", - "peer": true, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "engines": { - "node": ">=0.10.0" + "node": ">=0.8.0" } }, "node_modules/event-target-shim": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/eventemitter3": { "version": "5.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true }, "node_modules/fast-deep-equal": { "version": "3.1.3", - "license": "MIT" - }, - "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "license": "MIT", - "peer": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "license": "MIT", - "peer": true + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true }, "node_modules/fast-safe-stringify": { "version": "2.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true }, "node_modules/fastq": { "version": "1.17.1", @@ -5421,7 +1478,9 @@ }, "node_modules/fill-range": { "version": "7.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -5429,50 +1488,34 @@ "node": ">=8" } }, - "node_modules/find-up": { - "version": "5.0.0", - "license": "MIT", - "peer": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat-cache": { - "version": "4.0.1", - "license": "MIT", - "peer": true, - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.4" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/flatted": { - "version": "3.3.1", - "license": "ISC", - "peer": true - }, "node_modules/for-each": { "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, - "license": "MIT", "dependencies": { "is-callable": "^1.1.3" } }, "node_modules/foreach": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.6.tgz", + "integrity": "sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg==", + "dev": true + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dev": true, - "license": "MIT" + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } }, "node_modules/form-data": { "version": "4.0.0", @@ -5489,21 +1532,38 @@ }, "node_modules/fs.realpath": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, - "license": "ISC" + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } }, "node_modules/function-bind": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/function.prototype.name": { "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -5519,24 +1579,27 @@ }, "node_modules/functions-have-names": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/get-caller-file": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, - "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-intrinsic": { "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, - "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2", @@ -5553,13 +1616,15 @@ }, "node_modules/get-port-please": { "version": "3.1.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/get-port-please/-/get-port-please-3.1.2.tgz", + "integrity": "sha512-Gxc29eLs1fbn6LQ4jSU4vXjlwyZhF5HsGuMAa7gqBP4Rw4yxxltyDUuF5MBclFzDTXO+ACchGQoeela4DSfzdQ==", + "dev": true }, "node_modules/get-symbol-description": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.5", "es-errors": "^1.3.0", @@ -5574,8 +1639,10 @@ }, "node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, - "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -5593,7 +1660,9 @@ }, "node_modules/glob-parent": { "version": "5.1.2", - "license": "ISC", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -5601,17 +1670,41 @@ "node": ">= 6" } }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/globals": { "version": "11.12.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "engines": { "node": ">=4" } }, "node_modules/globalthis": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "dev": true, - "license": "MIT", "dependencies": { "define-properties": "^1.2.1", "gopd": "^1.0.1" @@ -5623,29 +1716,11 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/gopd": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dev": true, - "license": "MIT", "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -5653,17 +1728,14 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/graphemer": { - "version": "1.4.0", - "license": "MIT" - }, "node_modules/handlebars": { - "version": "4.7.7", + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", "dev": true, - "license": "MIT", "dependencies": { "minimist": "^1.2.5", - "neo-async": "^2.6.0", + "neo-async": "^2.6.2", "source-map": "^0.6.1", "wordwrap": "^1.0.0" }, @@ -5677,33 +1749,46 @@ "uglify-js": "^3.1.4" } }, + "node_modules/handlebars/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/has": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4.0" } }, "node_modules/has-bigints": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-flag": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "engines": { "node": ">=4" } }, "node_modules/has-property-descriptors": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" }, @@ -5713,8 +1798,9 @@ }, "node_modules/has-proto": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -5724,8 +1810,9 @@ }, "node_modules/has-symbols": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -5735,8 +1822,9 @@ }, "node_modules/has-tostringtag": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, - "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" }, @@ -5749,8 +1837,9 @@ }, "node_modules/hasown": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, - "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -5760,8 +1849,9 @@ }, "node_modules/html-element-map": { "version": "1.3.1", + "resolved": "https://registry.npmjs.org/html-element-map/-/html-element-map-1.3.1.tgz", + "integrity": "sha512-6XMlxrAFX4UEEGxctfFnmrFaaZFNf9i5fNuV5wZ3WWQ4FVaNP1aX1LkX9j2mfEx1NpjeE/rL3nmgEn23GdFmrg==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "array.prototype.filter": "^1.0.0", @@ -5773,6 +1863,8 @@ }, "node_modules/htmlparser2": { "version": "8.0.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", + "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", "dev": true, "funding": [ "https://github.com/fb55/htmlparser2?sponsor=1", @@ -5781,7 +1873,6 @@ "url": "https://github.com/sponsors/fb55" } ], - "license": "MIT", "peer": true, "dependencies": { "domelementtype": "^2.3.0", @@ -5792,8 +1883,9 @@ }, "node_modules/http2-client": { "version": "1.3.5", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/http2-client/-/http2-client-1.3.5.tgz", + "integrity": "sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA==", + "dev": true }, "node_modules/https-proxy-agent": { "version": "7.0.5", @@ -5839,8 +1931,10 @@ }, "node_modules/inflight": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, - "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -5848,8 +1942,51 @@ }, "node_modules/inherits": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", "dev": true, - "license": "ISC" + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/internal-slot": { "version": "1.0.7", @@ -5892,8 +2029,9 @@ }, "node_modules/is-binary-path": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, - "license": "MIT", "dependencies": { "binary-extensions": "^2.0.0" }, @@ -5903,8 +2041,9 @@ }, "node_modules/is-boolean-object": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -5918,8 +2057,9 @@ }, "node_modules/is-callable": { "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -5929,8 +2069,9 @@ }, "node_modules/is-data-view": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", "dev": true, - "license": "MIT", "dependencies": { "is-typed-array": "^1.1.13" }, @@ -5943,8 +2084,9 @@ }, "node_modules/is-date-object": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", "dev": true, - "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -5957,22 +2099,27 @@ }, "node_modules/is-extglob": { "version": "2.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/is-glob": { "version": "4.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -5982,8 +2129,9 @@ }, "node_modules/is-negative-zero": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -5993,15 +2141,18 @@ }, "node_modules/is-number": { "version": "7.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "engines": { "node": ">=0.12.0" } }, "node_modules/is-number-object": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, - "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -6012,18 +2163,11 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/is-regex": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -6037,8 +2181,9 @@ }, "node_modules/is-shared-array-buffer": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.7" }, @@ -6051,8 +2196,9 @@ }, "node_modules/is-string": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", "dev": true, - "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -6065,14 +2211,16 @@ }, "node_modules/is-subset": { "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-subset/-/is-subset-0.1.1.tgz", + "integrity": "sha512-6Ybun0IkarhmEqxXCNw/C0bna6Zb/TkfUX9UbwJtK6ObwAVCxmAP308WWTHviM/zAqXk05cdhYsUsZeGQh99iw==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/is-symbol": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "dev": true, - "license": "MIT", "dependencies": { "has-symbols": "^1.0.2" }, @@ -6085,8 +2233,9 @@ }, "node_modules/is-typed-array": { "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", "dev": true, - "license": "MIT", "dependencies": { "which-typed-array": "^1.1.14" }, @@ -6099,8 +2248,9 @@ }, "node_modules/is-weakref": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2" }, @@ -6110,29 +2260,40 @@ }, "node_modules/isarray": { "version": "2.0.5", - "dev": true, - "license": "MIT" - }, - "node_modules/isexe": { - "version": "2.0.0", - "license": "ISC", - "peer": true + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true }, "node_modules/javascript-natural-sort": { "version": "0.7.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==" }, "node_modules/js-levenshtein": { "version": "1.1.6", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", + "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/js-tokens": { "version": "4.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } }, "node_modules/js-yaml": { "version": "4.1.0", @@ -6146,7 +2307,8 @@ }, "node_modules/jsesc": { "version": "2.5.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "bin": { "jsesc": "bin/jsesc" }, @@ -6154,66 +2316,39 @@ "node": ">=4" } }, - "node_modules/json-buffer": { - "version": "3.0.1", - "license": "MIT", - "peer": true - }, "node_modules/json-pointer": { "version": "0.6.2", + "resolved": "https://registry.npmjs.org/json-pointer/-/json-pointer-0.6.2.tgz", + "integrity": "sha512-vLWcKbOaXlO+jvRy4qNd+TI1QUPZzfJj1tpJ3vAXDych5XJf93ftpUKe5pKCrzyIIwgBJcOcCVRUfqQP25afBw==", "dev": true, - "license": "MIT", "dependencies": { "foreach": "^2.0.4" } }, "node_modules/json-schema-traverse": { "version": "1.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "license": "MIT", - "peer": true - }, - "node_modules/keyv": { - "version": "4.5.4", - "license": "MIT", - "peer": true, - "dependencies": { - "json-buffer": "3.0.1" - } - }, - "node_modules/levn": { - "version": "0.4.1", - "license": "MIT", - "peer": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "license": "MIT", - "peer": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true }, "node_modules/lodash": { "version": "4.17.21", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lodash.escape": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-4.0.1.tgz", + "integrity": "sha512-nXEOnb/jK9g0DYMr1/Xvq6l5xMD7GDG55+GSYIYmS0G4tBk/hURD4JR9WCavs04t33WmJx9kCyp9vJ+mr4BOUw==", + "dev": true, + "peer": true + }, + "node_modules/lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", + "dev": true, + "peer": true }, "node_modules/lodash.escape": { "version": "4.0.1", @@ -6229,8 +2364,9 @@ }, "node_modules/lodash.isequal": { "version": "4.5.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", + "dev": true }, "node_modules/lodash.merge": { "version": "4.6.2", @@ -6239,8 +2375,9 @@ }, "node_modules/loose-envify": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "dev": true, - "license": "MIT", "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, @@ -6250,18 +2387,21 @@ }, "node_modules/lunr": { "version": "2.3.9", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true }, "node_modules/mark.js": { "version": "8.11.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/mark.js/-/mark.js-8.11.1.tgz", + "integrity": "sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==", + "dev": true }, "node_modules/marked": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", "dev": true, - "license": "MIT", "bin": { "marked": "bin/marked.js" }, @@ -6269,38 +2409,20 @@ "node": ">= 12" } }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", - "dependencies": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/mime-db": { "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, - "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -6309,27 +2431,31 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "license": "ISC", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=10" } }, "node_modules/minimist": { - "version": "1.2.7", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/mobx": { - "version": "6.13.1", + "version": "6.12.4", + "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.12.4.tgz", + "integrity": "sha512-uIymg89x+HmItX1p3MG+d09irn2k63J6biftZ5Ok+UpNojS1I3NJPLfcmJT9ANnUltNlHi+HQqrVyxiAN8ISYg==", "dev": true, - "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/mobx" @@ -6337,8 +2463,9 @@ }, "node_modules/mobx-react": { "version": "9.1.1", + "resolved": "https://registry.npmjs.org/mobx-react/-/mobx-react-9.1.1.tgz", + "integrity": "sha512-gVV7AdSrAAxqXOJ2bAbGa5TkPqvITSzaPiiEkzpW4rRsMhSec7C2NBCJYILADHKp2tzOAIETGRsIY0UaCV5aEw==", "dev": true, - "license": "MIT", "dependencies": { "mobx-react-lite": "^4.0.7" }, @@ -6361,8 +2488,9 @@ }, "node_modules/mobx-react-lite": { "version": "4.0.7", + "resolved": "https://registry.npmjs.org/mobx-react-lite/-/mobx-react-lite-4.0.7.tgz", + "integrity": "sha512-RjwdseshK9Mg8On5tyJZHtGD+J78ZnCnRaxeQDSiciKVQDUbfZcXhmld0VMxAwvcTnPEHZySGGewm467Fcpreg==", "dev": true, - "license": "MIT", "dependencies": { "use-sync-external-store": "^1.2.0" }, @@ -6385,13 +2513,56 @@ }, "node_modules/moo": { "version": "0.5.2", + "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz", + "integrity": "sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==", "dev": true, - "license": "BSD-3-Clause", "peer": true }, "node_modules/ms": { "version": "2.1.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/nearley": { + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/nearley/-/nearley-2.20.1.tgz", + "integrity": "sha512-+Mc8UaAebFzgV+KpI5n7DasuuQCHA89dmwm7JXw3TV43ukfNQ9DnBH3Mdb2g/I4Fdxc26pwimBWvjIw0UAILSQ==", + "dev": true, + "peer": true, + "dependencies": { + "commander": "^2.19.0", + "moo": "^0.5.0", + "railroad-diagrams": "^1.0.0", + "randexp": "0.4.6" + }, + "bin": { + "nearley-railroad": "bin/nearley-railroad.js", + "nearley-test": "bin/nearley-test.js", + "nearley-unparse": "bin/nearley-unparse.js", + "nearleyc": "bin/nearleyc.js" + }, + "funding": { + "type": "individual", + "url": "https://nearley.js.org/#give-to-nearley" + } }, "node_modules/nanoid": { "version": "3.3.7", @@ -6438,13 +2609,15 @@ }, "node_modules/neo-async": { "version": "2.6.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true }, "node_modules/node-fetch": { "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dev": true, - "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -6462,8 +2635,9 @@ }, "node_modules/node-fetch-h2": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/node-fetch-h2/-/node-fetch-h2-2.3.0.tgz", + "integrity": "sha512-ofRW94Ab0T4AOh5Fk8t0h8OBWrmjb0SSB20xh1H8YnPV9EJ+f5AMoYSUQ2zgJ4Iq2HAK0I2l5/Nequ8YzFS3Hg==", "dev": true, - "license": "MIT", "dependencies": { "http2-client": "^1.2.5" }, @@ -6473,24 +2647,27 @@ }, "node_modules/node-readfiles": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/node-readfiles/-/node-readfiles-0.2.0.tgz", + "integrity": "sha512-SU00ZarexNlE4Rjdm83vglt5Y9yiQ+XI1XpflWlb7q7UTN1JUItm69xMeiQCTxtTfnzt+83T8Cx+vI2ED++VDA==", "dev": true, - "license": "MIT", "dependencies": { "es6-promise": "^3.2.1" } }, "node_modules/normalize-path": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/nth-check": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", "dev": true, - "license": "BSD-2-Clause", "peer": true, "dependencies": { "boolbase": "^1.0.0" @@ -6501,16 +2678,18 @@ }, "node_modules/oas-kit-common": { "version": "1.0.8", + "resolved": "https://registry.npmjs.org/oas-kit-common/-/oas-kit-common-1.0.8.tgz", + "integrity": "sha512-pJTS2+T0oGIwgjGpw7sIRU8RQMcUoKCDWFLdBqKB2BNmGpbBMH2sdqAaOXUg8OzonZHU0L7vfJu1mJFEiYDWOQ==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "fast-safe-stringify": "^2.0.7" } }, "node_modules/oas-linter": { "version": "3.2.2", + "resolved": "https://registry.npmjs.org/oas-linter/-/oas-linter-3.2.2.tgz", + "integrity": "sha512-KEGjPDVoU5K6swgo9hJVA/qYGlwfbFx+Kg2QB/kd7rzV5N8N5Mg6PlsoCMohVnQmo+pzJap/F610qTodKzecGQ==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "@exodus/schemasafe": "^1.0.0-rc.2", "should": "^13.2.1", @@ -6522,8 +2701,9 @@ }, "node_modules/oas-resolver": { "version": "2.5.6", + "resolved": "https://registry.npmjs.org/oas-resolver/-/oas-resolver-2.5.6.tgz", + "integrity": "sha512-Yx5PWQNZomfEhPPOphFbZKi9W93CocQj18NlD2Pa4GWZzdZpSJvYwoiuurRI7m3SpcChrnO08hkuQDL3FGsVFQ==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "node-fetch-h2": "^2.3.0", "oas-kit-common": "^1.0.8", @@ -6540,16 +2720,18 @@ }, "node_modules/oas-schema-walker": { "version": "1.1.5", + "resolved": "https://registry.npmjs.org/oas-schema-walker/-/oas-schema-walker-1.1.5.tgz", + "integrity": "sha512-2yucenq1a9YPmeNExoUa9Qwrt9RFkjqaMAA1X+U7sbb0AqBeTIdMHky9SQQ6iN94bO5NW0W4TRYXerG+BdAvAQ==", "dev": true, - "license": "BSD-3-Clause", "funding": { "url": "https://github.com/Mermade/oas-kit?sponsor=1" } }, "node_modules/oas-validator": { "version": "5.0.8", + "resolved": "https://registry.npmjs.org/oas-validator/-/oas-validator-5.0.8.tgz", + "integrity": "sha512-cu20/HE5N5HKqVygs3dt94eYJfBi0TsZvPVXDhbXQHiEityDN+RROTleefoKRKKJ9dFAF2JBkDHgvWj0sjKGmw==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "call-me-maybe": "^1.0.1", "oas-kit-common": "^1.0.8", @@ -6566,27 +2748,27 @@ }, "node_modules/object-assign": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/object-inspect": { - "version": "1.13.2", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object-is": { "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", + "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1" @@ -6600,16 +2782,18 @@ }, "node_modules/object-keys": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/object.assign": { "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.5", "define-properties": "^1.2.1", @@ -6625,8 +2809,9 @@ }, "node_modules/object.entries": { "version": "1.1.8", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", + "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "call-bind": "^1.0.7", @@ -6639,8 +2824,9 @@ }, "node_modules/object.values": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "call-bind": "^1.0.7", @@ -6656,80 +2842,28 @@ }, "node_modules/once": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, - "license": "ISC", "dependencies": { "wrappy": "1" } }, "node_modules/openapi-sampler": { "version": "1.5.1", + "resolved": "https://registry.npmjs.org/openapi-sampler/-/openapi-sampler-1.5.1.tgz", + "integrity": "sha512-tIWIrZUKNAsbqf3bd9U1oH6JEXo8LNYuDlXw26By67EygpjT+ArFnsxxyTMjFWRfbqo5ozkvgSQDK69Gd8CddA==", "dev": true, - "license": "MIT", "dependencies": { "@types/json-schema": "^7.0.7", "json-pointer": "0.6.2" } }, - "node_modules/optionator": { - "version": "0.9.4", - "license": "MIT", - "peer": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.5" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "license": "MIT", - "peer": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "license": "MIT", - "peer": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "license": "MIT", - "peer": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/parse5": { "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "entities": "^4.4.0" @@ -6740,8 +2874,9 @@ }, "node_modules/parse5-htmlparser2-tree-adapter": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", + "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "domhandler": "^5.0.2", @@ -6753,8 +2888,9 @@ }, "node_modules/path-browserify": { "version": "1.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true }, "node_modules/path-exists": { "version": "4.0.0", @@ -6766,8 +2902,9 @@ }, "node_modules/path-is-absolute": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -6790,8 +2927,16 @@ }, "node_modules/perfect-scrollbar": { "version": "1.5.5", + "resolved": "https://registry.npmjs.org/perfect-scrollbar/-/perfect-scrollbar-1.5.5.tgz", + "integrity": "sha512-dzalfutyP3e/FOpdlhVryN4AJ5XDVauVWxybSkLZmakFE2sS3y3pc4JnSprw8tGmHvkaG5Edr5T7LBTZ+WWU2g==", + "dev": true + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", "dev": true, - "license": "MIT" + "peer": true }, "node_modules/performance-now": { "version": "2.1.0", @@ -6800,12 +2945,15 @@ "peer": true }, "node_modules/picocolors": { - "version": "1.0.0", - "license": "ISC" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" }, "node_modules/picomatch": { "version": "2.3.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "engines": { "node": ">=8.6" }, @@ -6815,16 +2963,18 @@ }, "node_modules/pluralize": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/polished": { "version": "4.3.1", + "resolved": "https://registry.npmjs.org/polished/-/polished-4.3.1.tgz", + "integrity": "sha512-OBatVyC/N7SCW/FaDHrSd+vn0o5cS855TOmYi4OkdWUMSJCET/xip//ch8xGUvtr3i44X9LVyWwQlRMTN3pwSA==", "dev": true, - "license": "MIT", "dependencies": { "@babel/runtime": "^7.17.8" }, @@ -6834,14 +2984,17 @@ }, "node_modules/possible-typed-array-names": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/postcss": { "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", "dev": true, "funding": [ { @@ -6857,7 +3010,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.0.0", @@ -6869,8 +3021,9 @@ }, "node_modules/postcss-value-parser": { "version": "4.2.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true }, "node_modules/prelude-ls": { "version": "1.2.1", @@ -6881,8 +3034,9 @@ } }, "node_modules/prettier": { - "version": "3.3.3", - "license": "MIT", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", "bin": { "prettier": "bin/prettier.cjs" }, @@ -6895,16 +3049,18 @@ }, "node_modules/prismjs": { "version": "1.29.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", + "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/prop-types": { "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", "dev": true, - "license": "MIT", "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", @@ -6913,18 +3069,24 @@ }, "node_modules/prop-types/node_modules/react-is": { "version": "16.13.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true }, "node_modules/punycode": { - "version": "2.1.1", - "license": "MIT", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, "engines": { "node": ">=6" } }, "node_modules/queue-microtask": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, "funding": [ { "type": "github", @@ -6938,8 +3100,38 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] + }, + "node_modules/raf": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", + "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", + "dev": true, + "peer": true, + "dependencies": { + "performance-now": "^2.1.0" + } + }, + "node_modules/railroad-diagrams": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz", + "integrity": "sha512-cz93DjNeLY0idrCNOH6PviZGRN9GJhsdm9hpn1YCS879fj4W+x5IFJhhkRZcwVgMmFF7R82UA/7Oh+R8lLZg6A==", + "dev": true, + "peer": true + }, + "node_modules/randexp": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/randexp/-/randexp-0.4.6.tgz", + "integrity": "sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==", + "dev": true, + "peer": true, + "dependencies": { + "discontinuous-range": "1.0.0", + "ret": "~0.1.10" + }, + "engines": { + "node": ">=0.12" + } }, "node_modules/raf": { "version": "3.4.1", @@ -6971,16 +3163,18 @@ }, "node_modules/randombytes": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, - "license": "MIT", "dependencies": { "safe-buffer": "^5.1.0" } }, "node_modules/react": { "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "dev": true, - "license": "MIT", "dependencies": { "loose-envify": "^1.1.0" }, @@ -6990,8 +3184,9 @@ }, "node_modules/react-dom": { "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "dev": true, - "license": "MIT", "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -7001,14 +3196,16 @@ } }, "node_modules/react-is": { - "version": "18.3.1", - "dev": true, - "license": "MIT" + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true }, "node_modules/react-shallow-renderer": { "version": "16.15.0", + "resolved": "https://registry.npmjs.org/react-shallow-renderer/-/react-shallow-renderer-16.15.0.tgz", + "integrity": "sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA==", "dev": true, - "license": "MIT", "dependencies": { "object-assign": "^4.1.1", "react-is": "^16.12.0 || ^17.0.0 || ^18.0.0" @@ -7019,8 +3216,9 @@ }, "node_modules/react-tabs": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/react-tabs/-/react-tabs-6.0.2.tgz", + "integrity": "sha512-aQXTKolnM28k3KguGDBSAbJvcowOQr23A+CUJdzJtOSDOtTwzEaJA+1U4KwhNL9+Obe+jFS7geuvA7ICQPXOnQ==", "dev": true, - "license": "MIT", "dependencies": { "clsx": "^2.0.0", "prop-types": "^15.5.0" @@ -7031,8 +3229,9 @@ }, "node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, - "license": "MIT", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -7044,8 +3243,9 @@ }, "node_modules/readdirp": { "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, - "license": "MIT", "dependencies": { "picomatch": "^2.2.1" }, @@ -7055,8 +3255,9 @@ }, "node_modules/redoc": { "version": "2.1.5", + "resolved": "https://registry.npmjs.org/redoc/-/redoc-2.1.5.tgz", + "integrity": "sha512-POSbVg+7WLf+/5/c6GWLxL7+9t2D+1WlZdLN0a6qaCQc+ih3XYzteRBkXEN5kjrYrRNjdspfxTZkDLN5WV3Tzg==", "dev": true, - "license": "MIT", "dependencies": { "@cfaester/enzyme-adapter-react-18": "^0.8.0", "@redocly/openapi-core": "^1.4.0", @@ -7095,16 +3296,36 @@ }, "node_modules/reftools": { "version": "1.1.9", + "resolved": "https://registry.npmjs.org/reftools/-/reftools-1.1.9.tgz", + "integrity": "sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w==", "dev": true, - "license": "BSD-3-Clause", "funding": { "url": "https://github.com/Mermade/oas-kit?sponsor=1" } }, "node_modules/regenerator-runtime": { "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", "dev": true, - "license": "MIT" + "dependencies": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/regexp.prototype.flags": { "version": "1.5.2", @@ -7125,80 +3346,48 @@ }, "node_modules/require-directory": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/require-from-string": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, - "node_modules/resolve-from": { - "version": "4.0.0", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=4" - } - }, "node_modules/ret": { "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=0.12" } }, - "node_modules/reusify": { - "version": "1.0.4", - "license": "MIT", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, "node_modules/rst-selector-parser": { "version": "2.2.3", + "resolved": "https://registry.npmjs.org/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz", + "integrity": "sha512-nDG1rZeP6oFTLN6yNDV/uiAvs1+FS/KlrEwh7+y7dpuApDBy6bI2HTBcc0/V8lv9OTqfyD34eF7au2pm8aBbhA==", "dev": true, - "license": "BSD-3-Clause", "peer": true, "dependencies": { "lodash.flattendeep": "^4.4.0", "nearley": "^2.7.10" } }, - "node_modules/run-parallel": { - "version": "1.2.0", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/safe-array-concat": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "get-intrinsic": "^1.2.4", @@ -7214,6 +3403,8 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true, "funding": [ { @@ -7228,13 +3419,13 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/safe-regex-test": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.6", "es-errors": "^1.3.0", @@ -7249,15 +3440,18 @@ }, "node_modules/scheduler": { "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", "dev": true, - "license": "MIT", "dependencies": { "loose-envify": "^1.1.0" } }, "node_modules/semver": { - "version": "7.6.3", - "license": "ISC", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, "bin": { "semver": "bin/semver.js" }, @@ -7267,8 +3461,9 @@ }, "node_modules/set-function-length": { "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "dev": true, - "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -7283,8 +3478,9 @@ }, "node_modules/set-function-name": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", "dev": true, - "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -7297,8 +3493,9 @@ }, "node_modules/shallowequal": { "version": "1.1.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", + "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==", + "dev": true }, "node_modules/shebang-command": { "version": "2.0.0", @@ -7321,8 +3518,9 @@ }, "node_modules/should": { "version": "13.2.3", + "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", + "integrity": "sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==", "dev": true, - "license": "MIT", "dependencies": { "should-equal": "^2.0.0", "should-format": "^3.0.3", @@ -7333,16 +3531,18 @@ }, "node_modules/should-equal": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/should-equal/-/should-equal-2.0.0.tgz", + "integrity": "sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==", "dev": true, - "license": "MIT", "dependencies": { "should-type": "^1.4.0" } }, "node_modules/should-format": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/should-format/-/should-format-3.0.3.tgz", + "integrity": "sha512-hZ58adtulAk0gKtua7QxevgUaXTTXxIi8t41L3zo9AHvjXO1/7sdLECuHeIN2SRtYXpNkmhoUP2pdeWgricQ+Q==", "dev": true, - "license": "MIT", "dependencies": { "should-type": "^1.3.0", "should-type-adaptors": "^1.0.1" @@ -7350,13 +3550,15 @@ }, "node_modules/should-type": { "version": "1.4.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/should-type/-/should-type-1.4.0.tgz", + "integrity": "sha512-MdAsTu3n25yDbIe1NeN69G4n6mUnJGtSJHygX3+oN0ZbO3DTiATnf7XnYJdGT42JCXurTb1JI0qOBR65shvhPQ==", + "dev": true }, "node_modules/should-type-adaptors": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz", + "integrity": "sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==", "dev": true, - "license": "MIT", "dependencies": { "should-type": "^1.3.0", "should-util": "^1.0.0" @@ -7364,8 +3566,27 @@ }, "node_modules/should-util": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/should-util/-/should-util-1.0.1.tgz", + "integrity": "sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==", + "dev": true + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dev": true, - "license": "MIT" + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/side-channel": { "version": "1.0.6", @@ -7386,6 +3607,8 @@ }, "node_modules/simple-websocket": { "version": "9.1.0", + "resolved": "https://registry.npmjs.org/simple-websocket/-/simple-websocket-9.1.0.tgz", + "integrity": "sha512-8MJPnjRN6A8UCp1I+H/dSFyjwJhp6wta4hsVRhjf8w9qBHRzxYt14RaOcjvQnhD1N4yKOddEjflwMnQM4VtXjQ==", "dev": true, "funding": [ { @@ -7401,7 +3624,6 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "debug": "^4.3.1", "queue-microtask": "^1.2.2", @@ -7410,54 +3632,52 @@ "ws": "^7.4.2" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "engines": { - "node": ">=8" - } - }, "node_modules/slugify": { "version": "1.4.7", + "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.4.7.tgz", + "integrity": "sha512-tf+h5W1IrjNm/9rKKj0JU2MDMruiopx0jjVA5zCdBtcGjfp0+c5rHw/zADLC3IeKlGHtVbHtpfzvYA0OYT+HKg==", "dev": true, - "license": "MIT", "engines": { "node": ">=8.0.0" } }, "node_modules/source-map": { - "version": "0.6.1", - "dev": true, - "license": "BSD-3-Clause", + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "engines": { "node": ">=0.10.0" } }, "node_modules/source-map-js": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", "dev": true, - "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/stickyfill": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stickyfill/-/stickyfill-1.1.1.tgz", + "integrity": "sha512-GCp7vHAfpao+Qh/3Flh9DXEJ/qSi0KJwJw6zYlZOtRYXWUIpMM6mC2rIep/dK8RQqwW0KxGJIllmjPIBOGN8AA==", "dev": true }, "node_modules/string_decoder": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, - "license": "MIT", "dependencies": { "safe-buffer": "~5.2.0" } }, "node_modules/string-width": { "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, - "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -7469,8 +3689,9 @@ }, "node_modules/string.prototype.trim": { "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -7486,8 +3707,9 @@ }, "node_modules/string.prototype.trimend": { "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -7499,8 +3721,9 @@ }, "node_modules/string.prototype.trimstart": { "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -7515,7 +3738,9 @@ }, "node_modules/strip-ansi": { "version": "6.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -7523,21 +3748,11 @@ "node": ">=8" } }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/styled-components": { - "version": "6.1.12", + "version": "6.1.11", + "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.1.11.tgz", + "integrity": "sha512-Ui0jXPzbp1phYij90h12ksljKGqF8ncGx+pjrNPsSPhbUUjWT2tD1FwGo2LF6USCnbrsIhNngDfodhxbegfEOA==", "dev": true, - "license": "MIT", "dependencies": { "@emotion/is-prop-valid": "1.2.2", "@emotion/unitless": "0.8.1", @@ -7563,12 +3778,14 @@ }, "node_modules/stylis": { "version": "4.3.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.2.tgz", + "integrity": "sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==", + "dev": true }, "node_modules/supports-color": { "version": "5.5.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dependencies": { "has-flag": "^3.0.0" }, @@ -7578,8 +3795,9 @@ }, "node_modules/swagger2openapi": { "version": "7.0.8", + "resolved": "https://registry.npmjs.org/swagger2openapi/-/swagger2openapi-7.0.8.tgz", + "integrity": "sha512-upi/0ZGkYgEcLeGieoz8gT74oWHA0E7JivX7aN9mAf+Tc7BQoRBvnIGHoPDw+f9TXTW4s6kGYCZJtauP6OYp7g==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "call-me-maybe": "^1.0.1", "node-fetch": "^2.6.1", @@ -7602,21 +3820,19 @@ "url": "https://github.com/Mermade/oas-kit?sponsor=1" } }, - "node_modules/text-table": { - "version": "0.2.0", - "license": "MIT", - "peer": true - }, "node_modules/to-fast-properties": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "engines": { "node": ">=4" } }, "node_modules/to-regex-range": { "version": "5.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -7626,8 +3842,88 @@ }, "node_modules/tr46": { "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", "dev": true, - "license": "MIT" + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/ts-api-utils": { "version": "1.3.0", @@ -7759,9 +4055,10 @@ } }, "node_modules/uglify-js": { - "version": "3.17.4", + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.18.0.tgz", + "integrity": "sha512-SyVVbcNBCk0dzr9XL/R/ySrmYf0s372K6/hFklzgcp2lBFyXtw4I7BOdDjlLhE1aVqaI/SHWXWmYdlZxuyF38A==", "dev": true, - "license": "BSD-2-Clause", "optional": true, "bin": { "uglifyjs": "bin/uglifyjs" @@ -7772,8 +4069,9 @@ }, "node_modules/unbox-primitive": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-bigints": "^1.0.2", @@ -7786,15 +4084,27 @@ }, "node_modules/uri-js": { "version": "4.4.1", - "license": "BSD-2-Clause", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, "dependencies": { "punycode": "^2.1.0" } }, "node_modules/url-template": { "version": "2.0.8", + "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", + "integrity": "sha512-XdVKMF4SJ0nP/O7XIPB0JwAEuT9lDIYnNsK8yGVe43y0AWoKeJNdv3ZNWh7ksJ6KqQFjOO6ox/VEitLnaVNufw==", + "dev": true + }, + "node_modules/use-sync-external-store": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz", + "integrity": "sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==", "dev": true, - "license": "BSD" + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } }, "node_modules/use-sync-external-store": { "version": "1.2.2", @@ -7806,41 +4116,31 @@ }, "node_modules/util-deprecate": { "version": "1.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true }, "node_modules/webidl-conversions": { "version": "3.0.1", - "dev": true, - "license": "BSD-2-Clause" + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true }, "node_modules/whatwg-url": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "dev": true, - "license": "MIT", "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, - "node_modules/which": { - "version": "2.0.2", - "license": "ISC", - "peer": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/which-boxed-primitive": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", "dev": true, - "license": "MIT", "dependencies": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -7854,8 +4154,9 @@ }, "node_modules/which-typed-array": { "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", "dev": true, - "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.7", @@ -7870,23 +4171,17 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/word-wrap": { - "version": "1.2.5", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/wordwrap": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true }, "node_modules/wrap-ansi": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -7901,8 +4196,9 @@ }, "node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -7915,8 +4211,9 @@ }, "node_modules/wrap-ansi/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -7926,18 +4223,21 @@ }, "node_modules/wrap-ansi/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/wrappy": { "version": "1.0.2", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "node_modules/ws": { - "version": "7.5.10", + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=8.3.0" }, @@ -7956,29 +4256,33 @@ }, "node_modules/y18n": { "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, - "license": "ISC", "engines": { "node": ">=10" } }, "node_modules/yaml": { "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", "dev": true, - "license": "ISC", "engines": { "node": ">= 6" } }, "node_modules/yaml-ast-parser": { "version": "0.0.43", - "dev": true, - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz", + "integrity": "sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==", + "dev": true }, "node_modules/yargs": { "version": "17.0.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.0.1.tgz", + "integrity": "sha512-xBBulfCc8Y6gLFcrPvtqKz9hz8SO0l1Ni8GgDekvBX2ro0HRQImDGnikfc33cgzcYUSncapnNcZDjVFIH3f6KQ==", "dev": true, - "license": "MIT", "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -7994,8 +4298,9 @@ }, "node_modules/yargs-parser": { "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true, - "license": "ISC", "engines": { "node": ">=10" } diff --git a/services/booking/scripts/build-docker.sh b/services/booking/scripts/build-docker.sh new file mode 100755 index 00000000..ec0a1780 --- /dev/null +++ b/services/booking/scripts/build-docker.sh @@ -0,0 +1,20 @@ +#!/usr/bin/bash + +current=$(pwd) +result=0 + +cd "$current/src/device-reservation" +bash ./scripts/build-docker.sh +result=$(( $result == 0 ? ( $? == 0 ? 0 : 1 ) : 1 )) +cd "$current/src/schedule-service" +bash ./scripts/build-docker.sh +result=$(( $result == 0 ? ( $? == 0 ? 0 : 1 ) : 1 )) +cd "$current/src/booking-backend" +bash ./scripts/build-docker.sh +result=$(( $result == 0 ? ( $? == 0 ? 0 : 1 ) : 1 )) +cd "$current/src/booking-frontend" +bash ./scripts/build-docker.sh +result=$(( $result == 0 ? ( $? == 0 ? 0 : 1 ) : 1 )) + +cd $current +exit $result \ No newline at end of file diff --git a/services/booking/scripts/build-spec.sh b/services/booking/scripts/build-spec.sh deleted file mode 120000 index b1d0ad49..00000000 --- a/services/booking/scripts/build-spec.sh +++ /dev/null @@ -1 +0,0 @@ -../../../common/spec/scripts/build.sh \ No newline at end of file diff --git a/services/booking/scripts/build-spec.sh b/services/booking/scripts/build-spec.sh new file mode 100755 index 00000000..a97566c3 --- /dev/null +++ b/services/booking/scripts/build-spec.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +current=$(pwd) + +mkdir -p dist +mkdir -p src/booking-backend/dist +mkdir -p src/booking-frontend/dist +mkdir -p src/schedule-service/dist + +rm -f dist/openapi.yml +echo "# This file was automatically generated - all changes will be lost\n" > dist/openapi.yml + +cat api/openapi_start.yml >> dist/openapi.yml +cat src/schedule-service/api/component.yml >> dist/openapi.yml +cat src/booking-frontend/api/component.yml >> dist/openapi.yml +cat src/booking-backend/api/component.yml >> dist/openapi.yml +cat api/types.yml >> dist/openapi.yml + +npx @redocly/cli bundle dist/openapi.yml --output dist/openapi.json + +cd $current diff --git a/services/booking/scripts/test.sh b/services/booking/scripts/test.sh index eab0faa2..12b2fe72 100755 --- a/services/booking/scripts/test.sh +++ b/services/booking/scripts/test.sh @@ -2,25 +2,32 @@ sudo service rabbitmq-server start sudo service mariadb start +sudo mysql -e "DROP DATABASE IF EXISTS unittest;" sudo mysql -e "CREATE DATABASE unittest DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;" +sudo mysql -e "DROP USER IF EXISTS 'test'@localhost;" sudo mysql -e "CREATE USER 'test'@localhost IDENTIFIED BY 'test';" sudo mysql -e "GRANT ALL PRIVILEGES ON unittest.* to 'test'@localhost;" sudo mysql -e "FLUSH PRIVILEGES;" -rm -rf venv -rm -rf db - npm ci current=$(pwd) result=0 cd "$current/src/schedule-service" +npm ci +npm test +result=$(( $result == 0 ? ( $? == 0 ? 0 : 1 ) : 1 )) +cd "$current/src/booking-backend" +npm ci +npm test +result=$(( $result == 0 ? ( $? == 0 ? 0 : 1 ) : 1 )) +cd "$current/src/booking-frontend" +npm ci npm test result=$(( $result == 0 ? ( $? == 0 ? 0 : 1 ) : 1 )) -# cd "$current/src/booking-backend" -# npm test cd "$current/src/device-reservation" +npm ci npm test result=$(( $result == 0 ? ( $? == 0 ? 0 : 1 ) : 1 )) @@ -29,5 +36,5 @@ exit $result sudo mysql -e "DROP USER 'test'@localhost;" sudo mysql -e "DROP DATABASE unittest;" -sudo service mysql stop +sudo service mariadb stop sudo service rabbitmq-server stop \ No newline at end of file diff --git a/services/booking/sql/booking.sql b/services/booking/sql/booking.sql index 542edf14..702d5ddf 100644 --- a/services/booking/sql/booking.sql +++ b/services/booking/sql/booking.sql @@ -1,3 +1,3 @@ -CREATE TABLE booking (`id` BIGINT UNSIGNED AUTO_INCREMENT, `start` DATETIME NOT NULL, `end` DATETIME NOT NULL, `type` ENUM('normal'), `status` ENUM('pending', 'booked', 'rejected', 'cancelled', 'active', 'active-pending', 'active-rejected') NOT NULL, `user` TEXT NOT NULL, `message` LONGTEXT, PRIMARY KEY (`id`)); +CREATE TABLE booking (`id` BIGINT UNSIGNED AUTO_INCREMENT, `start` DATETIME(3) NOT NULL, `end` DATETIME(3) NOT NULL, `type` ENUM('normal'), `status` ENUM('pending', 'booked', 'rejected', 'cancelled', 'active', 'active-pending', 'active-rejected') NOT NULL, `user` TEXT NOT NULL, `message` LONGTEXT, PRIMARY KEY (`id`)); CREATE TABLE bookeddevices (`id` BIGINT UNSIGNED AUTO_INCREMENT, `booking` BIGINT UNSIGNED NOT NULL, `originaldevice` TEXT NOT NULL, `originalposition` INT NOT NULL, `bookeddevice` TEXT, `remotereference` TEXT, `local` BOOLEAN, PRIMARY KEY (`id`), `reservation` BIGINT UNSIGNED, FOREIGN KEY(`booking`) REFERENCES booking (`id`) ON DELETE CASCADE ON UPDATE RESTRICT); CREATE TABLE bookingcallbacks (`id` BIGINT UNSIGNED AUTO_INCREMENT, `booking` BIGINT UNSIGNED NOT NULL, `url` TEXT NOT NULL, PRIMARY KEY (`id`), FOREIGN KEY(`booking`) REFERENCES booking (`id`) ON DELETE CASCADE ON UPDATE RESTRICT); diff --git a/services/booking/sql/device-reservation.sql b/services/booking/sql/device-reservation.sql index 5d6712fe..de0aa648 100644 --- a/services/booking/sql/device-reservation.sql +++ b/services/booking/sql/device-reservation.sql @@ -1 +1 @@ -CREATE TABLE reservation (`id` BIGINT UNSIGNED AUTO_INCREMENT, `device` TEXT NOT NULL, `start` DATETIME NOT NULL, `end` DATETIME NOT NULL, `bookingreference` TEXT NOT NULL, PRIMARY KEY (`id`)); +CREATE TABLE reservation (`id` BIGINT UNSIGNED AUTO_INCREMENT, `device` TEXT NOT NULL, `start` DATETIME(3) NOT NULL, `end` DATETIME(3) NOT NULL, `bookingreference` TEXT NOT NULL, PRIMARY KEY (`id`)); diff --git a/services/booking/src/booking-backend/.env-cmdrc b/services/booking/src/booking-backend/.env-cmdrc index 88810370..8cbe4ab6 100644 --- a/services/booking/src/booking-backend/.env-cmdrc +++ b/services/booking/src/booking-backend/.env-cmdrc @@ -1,9 +1,8 @@ { - "development": { - "SECURITY_ISSUER": "http://localhost", - "SECURITY_AUDIENCE": "http://localhost", - "BASE_URL": "http://localhost", - "PORT": "3000", - "API_TOKEN": "booking-service-dev-token" - } -} \ No newline at end of file + "development": { + "BASE_URL": "http://localhost:10801", + "DEVICE_SERVICE_URL": "http://localhost:10801", + "SCHEDULE_SERVICE_URL": "http://localhost:10801", + "PORT": "10801" + } +} diff --git a/services/booking/src/booking-backend/Dockerfile b/services/booking/src/booking-backend/Dockerfile new file mode 100644 index 00000000..e0b3bd46 --- /dev/null +++ b/services/booking/src/booking-backend/Dockerfile @@ -0,0 +1,17 @@ +# Build Image +FROM node:lts-alpine AS build +WORKDIR /tmp +COPY .packages /tmp/packages +RUN npm install --global /tmp/packages/* +RUN rm -rf /tmp/packages + +RUN apk add dumb-init +WORKDIR /app +RUN mkdir db +RUN chown node:node /app/* +USER node + +ENV NODE_ENV production +ENV PORT 3005 +EXPOSE 3005/tcp +CMD ["dumb-init", "crosslab-booking-backend"] \ No newline at end of file diff --git a/services/booking/src/booking-backend/api/component.yml b/services/booking/src/booking-backend/api/component.yml index 9285bd9b..4e41ff70 100644 --- a/services/booking/src/booking-backend/api/component.yml +++ b/services/booking/src/booking-backend/api/component.yml @@ -1,123 +1,135 @@ -/booking/{ID}/lock: - put: - operationId: 'lockBooking' - security: - - JWT: [] - parameters: - - $ref: '#/components/parameters/ID' - name: ID - schema: - type: string - required: true - description: ID of Booking - tags: + /booking/{ID}/lock: + put: + operationId: 'lockBooking' + security: + - JWT: + - booking + - booking:use + parameters: + - $ref: '#/components/parameters/ID' + name: ID + schema: + type: string + required: true + description: ID of Booking + tags: - booking-backend - summary: >- - Locks the current booking so the devices can be used. This sets the status to "active" This means that the booking can not be cancelled or (currently not implemented) the end time can not be set to a prior time. If called multiple times, the booking will be locked only once. - responses: - '200': - description: All devices were booked by user. - content: - application/json: - schema: - type: array - description: The list of booked devices and selected real devices. Order is guaranteed to be the same as in the booking. - items: - type: object - required: - - Requested - - Selected - properties: - Requested: - type: string - format: uri - Selected: - type: string - format: uri - '401': - description: No authorisation header found. - '404': - description: Request contains unknown ID - '412': - description: The current booking status is not correct. - '500': - description: >- - Request could not be answered. An error string containing the reason - will be returned. - content: - application/json: - schema: - type: string - description: Error string - '503': - description: >- - Service is unable to respond in time, possibly overloaded. Try again in a few minutes. - delete: - operationId: 'unlockBooking' - security: - - JWT: [] - parameters: - - $ref: '#/components/parameters/ID' - name: ID - schema: - type: string - required: true - description: ID of Booking - tags: + summary: >- + Locks the current booking so the devices can be used. + This sets the status to "active" This means that the booking can not be cancelled or (currently not implemented) the end time can not be set to a prior time. + If called multiple times, the booking will be locked only once. + responses: + '200': + description: All devices were booked by user. + content: + application/json: + schema: + type: array + description: The list of booked devices and selected real devices. Order is guaranteed to be the same as in the booking. + items: + type: object + required: + - Requested + - Selected + properties: + Requested: + type: string + format: uri + Selected: + type: string + format: uri + '401': + description: No authorisation header found. + '403': + description: >- + Caller is not allowed to call this method. Usually, caller is missing required scopes. + '404': + description: Request contains unknown ID + '412': + description: The current booking status is not correct. + '500': + description: >- + Request could not be answered. An error string containing the reason + will be returned. + content: + application/json: + schema: + type: string + description: Error string + '503': + description: >- + Service is unable to respond in time, possibly overloaded. Try again in a few minutes. + delete: + operationId: 'unlockBooking' + security: + - JWT: + - booking + - booking:use + parameters: + - $ref: '#/components/parameters/ID' + name: ID + schema: + type: string + required: true + description: ID of Booking + tags: - booking-backend - summary: >- - Unlocks all devices belonging to a booking, status will be set to 'booked'. - responses: - '200': - description: Unlocking was successful. - '401': - description: No authorisation header found. - '404': - description: Request contains unknown ID - '412': - description: The current booking status is not correct. - '500': - description: >- - Request could not be answered. An error string containing the reason - will be returned. - content: - application/json: - schema: - type: string - description: Error description. - '503': - description: >- - Service is unable to respond in time, possibly overloaded. Try again in a few minutes. -/booking_callback/{ID}: - post: - operationId: 'bookingCallback' - security: - - JWT: [] - parameters: - - $ref: '#/components/parameters/ID' - name: ID - schema: - type: string - required: true - description: ID of Booking - tags: + summary: >- + Unlocks all devices belonging to a booking, status will be set to 'booked'. + responses: + '200': + description: Unlocking was successful. + '401': + description: No authorisation header found. + '403': + description: >- + Caller is not allowed to call this method. Usually, caller is missing required scopes. + '404': + description: Request contains unknown ID + '412': + description: The current booking status is not correct. + '500': + description: >- + Request could not be answered. An error string containing the reason + will be returned. + content: + application/json: + schema: + type: string + description: Error description. + '503': + description: >- + Service is unable to respond in time, possibly overloaded. Try again in a few minutes. + /booking_callback/{ID}: + post: + operationId: 'bookingCallback' + security: + - JWT: [] + parameters: + - $ref: '#/components/parameters/ID' + name: ID + schema: + type: string + required: true + description: ID of Booking + tags: - booking-backend - summary: >- - Callback used for updating device info / booking info. - responses: - '200': - description: Update was processed. - '404': - description: Callback is no longer needed. - '500': - description: >- - Request could not be answered. An error string containing the reason - will be returned. - content: - application/json: - schema: - type: string - description: Error description. - '503': - description: >- - Service is unable to respond in time, possibly overloaded. Try again in a few minutes. + summary: >- + Callback used for updating device info / booking info. + responses: + '200': + description: Update was processed. + '404': + description: Callback is no longer needed. + '500': + description: >- + Request could not be answered. An error string containing the reason + will be returned. + content: + application/json: + schema: + type: string + description: Error description. + '503': + description: >- + Service is unable to respond in time, possibly overloaded. Try again in a few minutes. diff --git a/services/booking/src/booking-backend/package-lock.json b/services/booking/src/booking-backend/package-lock.json new file mode 100644 index 00000000..b96fc10c --- /dev/null +++ b/services/booking/src/booking-backend/package-lock.json @@ -0,0 +1,4600 @@ +{ + "name": "@crosslab/service-booking-backend", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@crosslab/service-booking-backend", + "version": "0.0.1", + "license": "Apache-2.0", + "dependencies": { + "@cross-lab-project/api-client": "file:../../../../clients/api/js", + "@crosslab/booking-service-common": "file:../common", + "@crosslab/service-common": "file:../../../common", + "@crosslab/service-device-reservation": "file:../device-reservation", + "ajv-formats": "^3.0.1", + "amqplib": "^0.10.2", + "dayjs": "^1.11.5", + "express": "^4.18.1", + "lodash": "^4.17.21", + "mysql2": "^3.11.0" + }, + "bin": { + "crosslab-booking-backend": "app/index.js" + }, + "devDependencies": { + "@cross-lab-project/codegen-typescript-addon": "file:../../../../helper/crosslab-typescript-addon", + "@cross-lab-project/openapi-codegen": "file:../../../../helper/openapi-codegeneration", + "@crosslab/booking-service-test-common": "file:../test_common", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/amqplib": "^0.10.1", + "@types/express": "^4.17.13", + "@types/lodash": "^4.14.198", + "@types/mocha": "^10.0.0", + "c8": "^10.1.2", + "env-cmd": "^10.1.0", + "mocha": "^10.0.0", + "npm-run-all": "^4.1.5", + "prettier": "^3.0.3", + "typescript": "^5.5.4", + "why-is-node-running": "^2.2.2" + } + }, + "../../../../clients/api/js": { + "name": "@cross-lab-project/api-client", + "license": "ISC", + "dependencies": { + "ajv-formats": "^3.0.1", + "cross-fetch": "^4.0.0" + }, + "devDependencies": { + "@cross-lab-project/codegen-typescript-addon": "file:../../../helper/crosslab-typescript-addon", + "@cross-lab-project/openapi-codegen": "file:../../../helper/openapi-codegeneration", + "@eslint/js": "^9.9.0", + "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@types/eslint__js": "^8.42.3", + "@types/node": "^22.1.0", + "eslint": "^9.8.0", + "prettier": "^3.3.3", + "typedoc": "^0.26.5", + "typescript": "^5.5.4", + "typescript-eslint": "^8.1.0" + } + }, + "../../../../helper/crosslab-typescript-addon": { + "name": "@cross-lab-project/codegen-typescript-addon", + "dev": true, + "license": "UNLICENSED", + "dependencies": { + "@apidevtools/swagger-parser": "^10.1.0", + "nunjucks": "^3.2.3" + }, + "devDependencies": { + "@cross-lab-project/openapi-codegen": "file:../openapi-codegeneration", + "@eslint/js": "^9.9.0", + "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@types/eslint__js": "^8.42.3", + "@types/node": "^22.1.0", + "@types/nunjucks": "^3.2.6", + "@types/seedrandom": "^3.0.8", + "copyfiles": "^2.4.1", + "eslint": "^9.8.0", + "openapi-types": "^12.1.3", + "prettier": "^3.3.3", + "tsc-watch": "^6.2.0", + "typescript": "^5.5.4", + "typescript-eslint": "^8.1.0" + }, + "peerDependencies": { + "@cross-lab-project/openapi-codegen": "file:../openapi-codegeneration", + "ajv": "^8.11.0", + "ajv-formats": "^3.0.1" + } + }, + "../../../../helper/openapi-codegeneration": { + "name": "@cross-lab-project/openapi-codegen", + "dev": true, + "license": "UNLICENSED", + "dependencies": { + "@apidevtools/swagger-parser": "^10.1.0", + "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", + "commander": "^12.1.0", + "deterministic-json-schema-faker": "^0.5.0-rcv.46", + "glob": "^11.0.0", + "json-schema-merge-allof": "^0.8.1", + "json-schema-to-typescript": "^15.0.0", + "nunjucks": "^3.2.4", + "quicktype-core": "^23.0.170", + "seedrandom": "^3.0.5", + "tiny-typed-emitter": "^2.1.0", + "yaml": "^2.5.0" + }, + "bin": { + "openapi-codegen": "lib/cjs/index.js" + }, + "devDependencies": { + "@eslint/js": "^9.9.0", + "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@types/eslint__js": "^8.42.3", + "@types/node": "^22.1.0", + "@types/nunjucks": "^3.2.6", + "@types/seedrandom": "^3.0.8", + "eslint": "^9.8.0", + "openapi-types": "^12.1.3", + "prettier": "^3.0.3", + "tsc-watch": "^6.2.0", + "typescript": "^5.5.4", + "typescript-eslint": "^8.1.0" + } + }, + "../../../common": { + "name": "@crosslab/service-common", + "license": "UNLICENSED", + "dependencies": { + "express": "^4.18.1", + "express-winston": "^4.2.0", + "fetch-retry": "^6.0.0", + "jose": "^5.6.3", + "mysql": "^2.18.1", + "sqlite3": "^5.1.7", + "typeorm": "^0.3.20", + "uuid": "^10.0.0", + "winston": "^3.14.1", + "winston-loki": "^6.1.2" + }, + "devDependencies": { + "@eslint/js": "^9.9.0", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/eslint__js": "^8.42.3", + "@types/express": "^4.17.21", + "@types/mocha": "^10.0.7", + "@types/node": "^22.1.0", + "@types/uuid": "^10.0.0", + "eslint": "^9.8.0", + "mocha": "^10.7.0", + "prettier": "^3.3.3", + "typescript": "^5.5.4", + "typescript-eslint": "^8.1.0" + } + }, + "../common": { + "name": "@crosslab/booking-service-common", + "version": "0.0.1", + "license": "Apache-2.0", + "dependencies": { + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/express": "^4.17.13", + "ajv-formats": "^3.0.1", + "express": "^4.18.1", + "node-fetch": "^3.3.2" + }, + "devDependencies": { + "@cross-lab-project/codegen-typescript-addon": "file:../../../../helper/crosslab-typescript-addon", + "@cross-lab-project/openapi-codegen": "file:../../../../helper/openapi-codegeneration", + "@types/express": "^4.17.13", + "@types/node": "^20.5.9", + "@types/node-fetch": "^2.6.4", + "npm-run-all": "^4.1.5", + "prettier": "^3.0.3", + "typescript": "^5.2.2" + } + }, + "../device-reservation": { + "name": "@crosslab/service-device-reservation", + "version": "0.1.0", + "license": "Apache-2.0", + "dependencies": { + "@crosslab/booking-service-common": "file:../common", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/amqplib": "^0.10.1", + "amqplib": "^0.10.0", + "async-mutex": "^0.5.0", + "dayjs": "^1.11.5", + "mysql2": "^3.6.0", + "typescript": "^5.5.4" + }, + "bin": { + "crosslab-device-reservation": "app/index.js" + }, + "devDependencies": { + "@types/mocha": "^10.0.0", + "c8": "^10.1.0", + "mocha": "^10.0.0", + "mocha-suppress-logs": "^0.5.1", + "npm-run-all": "^4.1.5", + "prettier": "^3.0.3" + } + }, + "../test_common": { + "name": "@crosslab/booking-service-test-common", + "version": "0.0.1", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@crosslab/booking-service-common": "file:../common", + "@crosslab/service-device-reservation": "file:../device-reservation", + "amqplib": "^0.10.3", + "dayjs": "^1.11.5", + "express": "^4.18.1", + "mysql2": "^3.6.0", + "typescript": "^5.5.4" + }, + "devDependencies": { + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/amqplib": "^0.10.1", + "@types/express": "^4.17.13", + "node-mocks-http": "^1.14.1", + "prettier": "^3.0.3" + } + }, + "node_modules/@acuminous/bitsyntax": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@acuminous/bitsyntax/-/bitsyntax-0.1.2.tgz", + "integrity": "sha512-29lUK80d1muEQqiUsSo+3A0yP6CdspgC95EnKBMi22Xlwt79i/En4Vr67+cXhU+cZjbti3TgGGC5wy1stIywVQ==", + "dependencies": { + "buffer-more-ints": "~1.0.0", + "debug": "^4.3.4", + "safe-buffer": "~5.1.2" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/generator": { + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", + "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "dev": true, + "dependencies": { + "@babel/types": "^7.17.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", + "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-environment-visitor/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", + "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", + "dev": true, + "dependencies": { + "@babel/template": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", + "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", + "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", + "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", + "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", + "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/generator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", + "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.24.7", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", + "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@cross-lab-project/api-client": { + "resolved": "../../../../clients/api/js", + "link": true + }, + "node_modules/@cross-lab-project/codegen-typescript-addon": { + "resolved": "../../../../helper/crosslab-typescript-addon", + "link": true + }, + "node_modules/@cross-lab-project/openapi-codegen": { + "resolved": "../../../../helper/openapi-codegeneration", + "link": true + }, + "node_modules/@crosslab/booking-service-common": { + "resolved": "../common", + "link": true + }, + "node_modules/@crosslab/booking-service-test-common": { + "resolved": "../test_common", + "link": true + }, + "node_modules/@crosslab/service-common": { + "resolved": "../../../common", + "link": true + }, + "node_modules/@crosslab/service-device-reservation": { + "resolved": "../device-reservation", + "link": true + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.3.0.tgz", + "integrity": "sha512-r3n0onD3BTOVUNPhR4lhVK4/pABGpbA7bW3eumZnYdKaHkf1qEC+Mag6DPbGNuuh0eG8AaYj+YqmVHSiGslaTQ==", + "dev": true, + "dependencies": { + "@babel/generator": "7.17.7", + "@babel/parser": "^7.20.5", + "@babel/traverse": "7.23.2", + "@babel/types": "7.17.0", + "javascript-natural-sort": "0.7.1", + "lodash": "^4.17.21" + }, + "peerDependencies": { + "@vue/compiler-sfc": "3.x", + "prettier": "2.x - 3.x" + }, + "peerDependenciesMeta": { + "@vue/compiler-sfc": { + "optional": true + } + } + }, + "node_modules/@types/amqplib": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@types/amqplib/-/amqplib-0.10.5.tgz", + "integrity": "sha512-/cSykxROY7BWwDoi4Y4/jLAuZTshZxd8Ey1QYa/VaXriMotBDoou7V/twJiOSHzU6t1Kp1AHAUXGCgqq+6DNeg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/body-parser": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "dev": true, + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", + "dev": true, + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.19.5", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.5.tgz", + "integrity": "sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", + "dev": true + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true + }, + "node_modules/@types/lodash": { + "version": "4.17.6", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.6.tgz", + "integrity": "sha512-OpXEVoCKSS3lQqjx9GGGOapBeuW5eUboYHRlHP9urXPX25IKZ6AnP5ZRxtVf63iieUbsHxLn8NQ5Nlftc6yzAA==", + "dev": true + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true + }, + "node_modules/@types/mocha": { + "version": "10.0.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.7.tgz", + "integrity": "sha512-GN8yJ1mNTcFcah/wKEFIJckJx9iJLoMSzWcfRRuxz/Jk+U6KQNnml+etbtxFK8lPjzOw3zp4Ha/kjSst9fsHYw==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.14.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", + "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/qs": { + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", + "dev": true + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true + }, + "node_modules/@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", + "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", + "dev": true, + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ajv": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz", + "integrity": "sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.4.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/amqplib": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/amqplib/-/amqplib-0.10.4.tgz", + "integrity": "sha512-DMZ4eCEjAVdX1II2TfIUpJhfKAuoCeDIo/YyETbfAqehHTXxxs7WOOd+N1Xxr4cKhx12y23zk8/os98FxlZHrw==", + "dependencies": { + "@acuminous/bitsyntax": "^0.1.2", + "buffer-more-ints": "~1.0.0", + "readable-stream": "1.x >=1.1.9", + "url-parse": "~1.5.10" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/aws-ssl-profiles": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz", + "integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "node_modules/buffer-more-ints": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-more-ints/-/buffer-more-ints-1.0.0.tgz", + "integrity": "sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg==" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/c8": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/c8/-/c8-10.1.2.tgz", + "integrity": "sha512-Qr6rj76eSshu5CgRYvktW0uM0CFY0yi4Fd5D0duDXO6sYinyopmftUiJVuzBQxQcwQLor7JWDVRP+dUfCmzgJw==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.3", + "find-up": "^5.0.0", + "foreground-child": "^3.1.1", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.1.6", + "test-exclude": "^7.0.1", + "v8-to-istanbul": "^9.0.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1" + }, + "bin": { + "c8": "bin/c8.js" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "monocart-coverage-reports": "^2" + }, + "peerDependenciesMeta": { + "monocart-coverage-reports": { + "optional": true + } + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-disposition/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/dayjs": { + "version": "1.11.11", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.11.tgz", + "integrity": "sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==" + }, + "node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/env-cmd": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/env-cmd/-/env-cmd-10.1.0.tgz", + "integrity": "sha512-mMdWTT9XKN7yNth/6N6g2GuKuJTsKMDHlQFUDacb/heQRRWOTIZ42t1rMHnQu4jYxU1ajdTeJM+9eEETlqToMA==", + "dev": true, + "dependencies": { + "commander": "^4.0.0", + "cross-spawn": "^7.0.0" + }, + "bin": { + "env-cmd": "bin/env-cmd.js" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/express/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "bin": { + "flat": "cli.js" + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/foreground-child": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz", + "integrity": "sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "dependencies": { + "is-property": "^1.0.2" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", + "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", + "dev": true, + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/javascript-natural-sort": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/log-symbols/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "node_modules/lru.min": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.1.tgz", + "integrity": "sha512-FbAj6lXil6t8z4z3j0E5mfRlPzxkySotzUHwRXjlpRh10vc6AI6WN62ehZj82VG7M20rqogJ0GLwar2Xa05a8Q==", + "license": "MIT", + "engines": { + "bun": ">=1.0.0", + "deno": ">=1.30.0", + "node": ">=8.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wellwelwel" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mocha": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.6.0.tgz", + "integrity": "sha512-hxjt4+EEB0SA0ZDygSS015t65lJw/I2yRCS3Ae+SJ5FrbzrXgfYwJr96f0OvIXdj7h4lv/vLCrH3rkiuizFSvw==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^8.1.0", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/mocha/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/mocha/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/mysql2": { + "version": "3.11.3", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.11.3.tgz", + "integrity": "sha512-Qpu2ADfbKzyLdwC/5d4W7+5Yz7yBzCU05YWt5npWzACST37wJsB23wgOSo00qi043urkiRwXtEvJc9UnuLX/MQ==", + "license": "MIT", + "dependencies": { + "aws-ssl-profiles": "^1.1.1", + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.6.3", + "long": "^5.2.1", + "lru.min": "^1.0.0", + "named-placeholders": "^1.1.3", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/mysql2/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", + "dependencies": { + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/named-placeholders/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/npm-run-all/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/npm-run-all/node_modules/cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/npm-run-all/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/npm-run-all/node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/npm-run-all/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", + "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", + "dev": true + }, + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true, + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/prettier": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/seq-queue": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", + "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.18", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.18.tgz", + "integrity": "sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==", + "dev": true + }, + "node_modules/sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.padend": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.6.tgz", + "integrity": "sha512-XZpspuSB7vJWhvJc9DLSlrXl1mcA2BdoY5jjnS135ydXqLoqhs96JjDtCkjJEQHvfqZIp9hBuBMgI589peyx9Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/test-exclude": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.1.tgz", + "integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^10.4.1", + "minimatch": "^9.0.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/workerpool": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/services/booking/src/booking-backend/package.json b/services/booking/src/booking-backend/package.json index 41633577..6b2843b5 100644 --- a/services/booking/src/booking-backend/package.json +++ b/services/booking/src/booking-backend/package.json @@ -1,13 +1,22 @@ { + "type": "module", "name": "@crosslab/service-booking-backend", "version": "0.0.1", "description": "Part of booking service. Does most of the actual work and is horizontal scaleable.", - "main": "app/index.js", + "main": "app/lib.js", + "dockerName": "booking-backend", + "bin": { + "crosslab-booking-backend": "./app/index.js" + }, + "files": [ + "app" + ], "scripts": { - "test": "npm run build && env-cmd -e development nyc --include=\"app/messageDefinition.js\" --include=\"app/amqpHandle.js\" --include=\"app/internal.js\" --include=\"app/operations.js\" mocha app/*_test.js", + "test": "npm run build && env-cmd -e development c8 --include=\"app/messageDefinition.js\" --include=\"app/amqpHandle.js\" --include=\"app/internal.js\" --include=\"app/operations/index.js\" mocha app/*_test.js app/operations/*_test.js", "build:generate": "openapi-codegen -i dist/openapi.json -p @cross-lab-project/codegen-typescript-addon:preset:service -o src/generated", - "build:compile": "tsc", - "build": "npm run build:generate && npm run build:compile", + "build:compile": "tsc && cp src/generated/basicValidation.cjs app/generated/basicValidation.cjs", + "build:add-shebang": "bash scripts/add-shebang.sh", + "build": "npm-run-all build:*", "start": "npm run build && env-cmd -e development node app/index.js", "format": "prettier . --write", "lint": "eslint ." @@ -16,34 +25,31 @@ "license": "Apache-2.0", "dependencies": { "@cross-lab-project/api-client": "file:../../../../clients/api/js", - "@cross-lab-project/codegen-typescript-addon": "file:../../../../helper/crosslab-typescript-addon", - "@cross-lab-project/openapi-codegen": "file:../../../../helper/openapi-codegeneration", - "@cross-lab-project/service-common": "file:../../../common", + "@crosslab/service-common": "file:../../../common", "@crosslab/booking-service-common": "file:../common", - "@crosslab/booking-service-test-common": "file:../test_common", "@crosslab/service-device-reservation": "file:../device-reservation", - "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "@types/amqplib": "^0.10.5", - "@types/express": "^4.17.21", - "@types/lodash": "^4.17.7", - "@eslint/js": "^9.9.0", - "@types/eslint__js": "^8.42.3", - "typescript-eslint": "^8.1.0", "ajv-formats": "^3.0.1", - "amqplib": "^0.10.4", - "dayjs": "^1.11.12", - "express": "^4.19.2", + "amqplib": "^0.10.2", + "dayjs": "^1.11.5", + "express": "^4.18.1", "lodash": "^4.17.21", - "mysql2": "^3.11.0", - "typescript": "^5.5.4" + "mysql2": "^3.11.0" }, "devDependencies": { - "@types/mocha": "^10.0.7", - "async-mutex": "^0.5.0", + "@types/amqplib": "^0.10.1", + "@types/express": "^4.17.13", + "@types/lodash": "^4.14.198", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "typescript": "^5.5.4", + "@crosslab/booking-service-test-common": "file:../test_common", + "@cross-lab-project/codegen-typescript-addon": "file:../../../../helper/crosslab-typescript-addon", + "@cross-lab-project/openapi-codegen": "file:../../../../helper/openapi-codegeneration", + "@types/mocha": "^10.0.0", + "c8": "^10.1.2", "env-cmd": "^10.1.0", - "mocha": "^10.7.0", - "nyc": "^17.0.0", - "prettier": "^3.3.3", - "why-is-node-running": "^3.2.0" + "mocha": "^10.0.0", + "prettier": "^3.0.3", + "why-is-node-running": "^2.2.2", + "npm-run-all": "^4.1.5" } } diff --git a/services/booking/src/booking-backend/scripts/add-shebang.sh b/services/booking/src/booking-backend/scripts/add-shebang.sh new file mode 120000 index 00000000..1a5fdd47 --- /dev/null +++ b/services/booking/src/booking-backend/scripts/add-shebang.sh @@ -0,0 +1 @@ +../../../../../common/node/scripts/add-shebang.sh \ No newline at end of file diff --git a/services/booking/src/booking-backend/scripts/build-docker.sh b/services/booking/src/booking-backend/scripts/build-docker.sh new file mode 120000 index 00000000..31019032 --- /dev/null +++ b/services/booking/src/booking-backend/scripts/build-docker.sh @@ -0,0 +1 @@ +../../../../../common/docker/scripts/build-node.sh \ No newline at end of file diff --git a/services/booking/src/booking-backend/scripts/build-spec.sh b/services/booking/src/booking-backend/scripts/build-spec.sh new file mode 100755 index 00000000..e5b66475 --- /dev/null +++ b/services/booking/src/booking-backend/scripts/build-spec.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +mkdir -p dist + +rm -f dist/openapi.yml +echo "# This file was automatically generated - all changes will be lost\n" > dist/openapi.yml + +cat api/openapi_start.yml >> dist/openapi.yml +cat api/component.yml >> dist/openapi.yml +cat ../../api/types.yml >> dist/openapi.yml + +npx @redocly/cli bundle dist/openapi.yml --output dist/openapi.json diff --git a/services/booking/src/booking-backend/scripts/test.sh b/services/booking/src/booking-backend/scripts/test.sh new file mode 100755 index 00000000..3b22f459 --- /dev/null +++ b/services/booking/src/booking-backend/scripts/test.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +sudo service rabbitmq-server start +sudo service mariadb start +sudo mysql -e "DROP DATABASE IF EXISTS unittest;" +sudo mysql -e "CREATE DATABASE unittest DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;" +sudo mysql -e "DROP USER IF EXISTS 'test'@localhost;" +sudo mysql -e "CREATE USER 'test'@localhost IDENTIFIED BY 'test';" +sudo mysql -e "GRANT ALL PRIVILEGES ON unittest.* to 'test'@localhost;" +sudo mysql -e "FLUSH PRIVILEGES;" + +npm ci +npm test +result=$? + +sudo mysql -e "DROP USER 'test'@localhost;" +sudo mysql -e "DROP DATABASE unittest;" +sudo service mariadb stop +sudo service rabbitmq-server stop + +exit $result \ No newline at end of file diff --git a/services/booking/src/booking-backend/src/amqpHandle.ts b/services/booking/src/booking-backend/src/amqpHandle.ts index a29cb191..8e05b4c0 100644 --- a/services/booking/src/booking-backend/src/amqpHandle.ts +++ b/services/booking/src/booking-backend/src/amqpHandle.ts @@ -1,9 +1,13 @@ import { sleep } from '@crosslab/booking-service-common'; import * as amqplib from 'amqplib'; -import { config } from './config'; -import { freeDevice, reservateDevice } from './internal'; -import { DeviceBookingRequest } from './messageDefinition'; +import { config } from './config.js'; +import { freeDevice, reservateDevice } from './internal.js'; +import { DeviceBookingRequest } from './messageDefinition.js'; + +(BigInt.prototype as any).toJSON = function () { + return this.toString(); +}; export async function handleFreeDeviceRequest(): Promise { // freeDevice @@ -33,11 +37,11 @@ export async function handleFreeDeviceRequest(): Promise { try { data = BigInt(msg.content.toString()); } catch (error) { - console.log('Can not parse message:', error); + console.error('Can not parse message:', error); try { channel.ack(msg); } catch (error) { - console.log('Can not ack message:', error); + console.error('Can not ack message:', error); } continue; } @@ -45,13 +49,14 @@ export async function handleFreeDeviceRequest(): Promise { await freeDevice(data); channel.ack(msg); } catch (err) { - console.log('Error freeing device:' + err); - channel.nack(msg); + console.error('Error freeing device:' + err); + channel.ack(msg); } } } catch (err) { - console.log(err); + console.error('Got uncaught error in handleFreeDeviceRequest:', err); console.log('Reconnecting...'); + await sleep(1000); } } } @@ -84,11 +89,11 @@ export async function handleDeviceReservationRequest(): Promise { try { data = DeviceBookingRequest.fromString(msg.content.toString()); } catch (error) { - console.log('Can not parse message:', error); + console.error('Can not parse message:', error); try { channel.ack(msg); } catch (error) { - console.log('Can not ack message:', error); + console.error('Can not ack message:', error); } continue; } @@ -96,13 +101,14 @@ export async function handleDeviceReservationRequest(): Promise { await reservateDevice(data); channel.ack(msg); } catch (err) { - console.log('Error reservating device:' + err); + console.error('Error reservating device:' + err); channel.nack(msg); } } } catch (err) { - console.log(err); + console.error('Got uncaught error in handleFreeDeviceRequest:', err); console.log('Reconnecting...'); + await sleep(1000); } } } diff --git a/services/booking/src/booking-backend/src/config.ts b/services/booking/src/booking-backend/src/config.ts index 0d195d0c..a34eac9e 100644 --- a/services/booking/src/booking-backend/src/config.ts +++ b/services/booking/src/booking-backend/src/config.ts @@ -1,6 +1,6 @@ import { baseConfig, die } from '@crosslab/booking-service-common'; -const PORT = parseInt(process.env.PORT ?? '3000'); +const PORT = parseInt(process.env.PORT ?? '3005'); const DEFAULT_BASE_URL = 'http://localhost:' + PORT; export const config = { @@ -8,12 +8,10 @@ export const config = { PORT, BASE_URL: process.env.BASE_URL ?? DEFAULT_BASE_URL, JWKS_URL: process.env.JWKS_URL ?? 'http://localhost/.well-known/jwks.json', - SECURITY_ISSUER: - process.env.SECURITY_ISSUER ?? - die('the environment variable SECURITY_ISSUER is not defined!'), - SECURITY_AUDIENCE: - process.env.SECURITY_AUDIENCE ?? - die('the environment variable SECURITY_AUDIENCE is not defined!'), - API_TOKEN: - process.env.API_TOKEN ?? die('the environment variable API_TOKEN is not defined!'), + BookingDSN: process.env.BOOKING_DSN ?? baseConfig.BookingDSN, + ReservationDSN: process.env.BOOKING_DSN ?? baseConfig.BookingDSN, + CallbackDSN: process.env.BOOKING_DSN ?? baseConfig.BookingDSN, + OwnURL: process.env.BASE_URL ?? DEFAULT_BASE_URL, + InstitutePrefix: [process.env.BASE_URL ?? DEFAULT_BASE_URL], + AmqpUrl: process.env.AMQP_URL ?? baseConfig.AmqpUrl, }; diff --git a/services/booking/src/booking-backend/src/index.ts b/services/booking/src/booking-backend/src/index.ts index 1009d0c6..a1ab5c86 100644 --- a/services/booking/src/booking-backend/src/index.ts +++ b/services/booking/src/booking-backend/src/index.ts @@ -1,28 +1,29 @@ -import { - JWTVerify, - parseJwtFromRequestAuthenticationHeader, -} from '@cross-lab-project/service-common'; +import { authorization, error } from '@crosslab/service-common'; +import express, { Application, ErrorRequestHandler, RequestHandler } from 'express'; -import { handleDeviceReservationRequest, handleFreeDeviceRequest } from './amqpHandle'; -import { config } from './config'; -import { app } from './generated'; -import { isUserTypeJWT } from './generated/types'; +import { handleDeviceReservationRequest, handleFreeDeviceRequest } from './amqpHandle.js'; +import { config } from './config.js'; +import { app } from './generated/index.js'; -export * from './messageDefinition'; - -if (require.main === module) { - app.initService({ - security: { - JWT: JWTVerify( - { JWKS_URL: '', SECURITY_AUDIENCE: '', SECURITY_ISSUER: '' }, - isUserTypeJWT, - parseJwtFromRequestAuthenticationHeader, - ), +app.initService({ + preHandlers: [ + (application: Application) => { + application.use(express.json()); + application.use(express.urlencoded({ extended: false })); + application.use(authorization.middleware() as RequestHandler); + }, + ], + postHandlers: [ + (application: Application) => { + application.get('/federation/status', (_req, res) => { + res.send({ status: 'ok' }); + }); }, - }); + ], + errorHandler: error.middleware as ErrorRequestHandler, +}); - console.log('Starting booking-backend'); - app.listen(config.PORT); - handleDeviceReservationRequest(); - handleFreeDeviceRequest(); -} +console.log('Starting booking-backend'); +app.listen(config.PORT); +handleDeviceReservationRequest(); +handleFreeDeviceRequest(); diff --git a/services/booking/src/booking-backend/src/integration_test.ts b/services/booking/src/booking-backend/src/integration_test.ts index d672d642..20210fc2 100644 --- a/services/booking/src/booking-backend/src/integration_test.ts +++ b/services/booking/src/booking-backend/src/integration_test.ts @@ -1,5 +1,5 @@ //const why = require('why-is-node-running') -import { sleep } from '@crosslab/booking-service-common'; +import { baseConfig, sleep } from '@crosslab/booking-service-common'; import { fakeServerConfig, getFakeInstitutePrefix, @@ -14,23 +14,44 @@ import { tearDownDummySql, } from '@crosslab/booking-service-test-common'; import * as amqplib from 'amqplib'; -import dayjs from 'dayjs'; +import dayjs, { Dayjs } from 'dayjs'; import express from 'express'; import * as http from 'http'; import * as mocha from 'mocha'; import * as mysql from 'mysql2/promise'; -import { config } from './config'; -import { callbackType, handleCallback, randomID } from './internal'; +import { config } from './config.js'; +import { + MapToString, + ResetAMQPDeviceCount, + StartAMQPTestFree, + StopAMQPTestFree, + TestAMQPresults, +} from './integrationtest_helper_amqp.js'; +import { + DeleteBooking, + callbackType, + dispatchCallback, + freeDevice, + handleCallback, + randomID, + reservateDevice, +} from './internal.js'; +import { DeviceBookingRequest } from './messageDefinition.js'; -let connection: amqplib.Connection; -let channel: amqplib.Channel; +let connection: amqplib.Connection | undefined; +let channel: amqplib.Channel | undefined; mocha.describe('internal.ts', function () { this.timeout(10000); mocha.before(async function () { - // Config + // Config - use both global config and local config to ensure different application parts work with same config + baseConfig.OwnURL = getFakeOwnURL(); + baseConfig.InstitutePrefix = getFakeInstitutePrefix(); + baseConfig.ReservationDSN = getSQLDNS(); + baseConfig.BookingDSN = getSQLDNS(); + config.OwnURL = getFakeOwnURL(); config.InstitutePrefix = getFakeInstitutePrefix(); config.ReservationDSN = getSQLDNS(); @@ -41,7 +62,7 @@ mocha.describe('internal.ts', function () { mocha.after(async function () { await stopFakeServer(); - //setTimeout(function(){console.log("why?");why();console.log("WHY??");}, 10000); + //setTimeout(function(){console.log("why?");why();console.log("WHY??");}, 1000); }); mocha.beforeEach(async function () { @@ -52,38 +73,32 @@ mocha.describe('internal.ts', function () { await setupDummySql(); // Connect to amqp - connection = await amqplib.connect(config.AmqpUrl); + connection = await amqplib.connect(baseConfig.AmqpUrl); channel = await connection.createChannel(); await channel.assertQueue('device-booking', { durable: true, }); - await channel.assertQueue('device-reservation', { - durable: true, - }); - await channel.assertQueue('device-freeing', { durable: true, }); // Drain queues while (await channel.get('device-booking', { noAck: true })) {} - - while (await channel.get('device-reservation', { noAck: true })) {} - - while (await channel.get('device-freeing', { noAck: true })) {} + //while (await channel.get('device-freeing', { noAck: true })) { } await startDeviceReservation(); }); mocha.afterEach(async function () { await tearDownDummySql(); - await channel.deleteQueue('device-booking'); - await channel.deleteQueue('device-freeing'); + await channel?.deleteQueue('device-booking'); + await channel?.deleteQueue('device-freeing'); - await channel.close(); - await connection.close(); + await channel?.close(); + await sleep(250); + await connection?.close(); channel = undefined; connection = undefined; @@ -102,8 +117,8 @@ mocha.describe('internal.ts', function () { let [rows, fields] = await db.execute('SELECT `status` FROM booking WHERE id=?', [ BigInt(1), ]); - if (rows[0].status != 'booked') { - throw new Error('Booking should be booked, is ' + rows[0].status); + if ((rows as any[])[0].status != 'booked') { + throw new Error('Booking should be booked, is ' + (rows as any[])[0].status); } } catch (err) { throw err; @@ -126,8 +141,10 @@ mocha.describe('internal.ts', function () { let [rows, fields] = await db.execute('SELECT `status` FROM booking WHERE id=?', [ BigInt(1), ]); - if (rows[0].status == 'booked') { - throw new Error('Booking should not be booked, is ' + rows[0].status); + if ((rows as any[])[0].status == 'booked') { + throw new Error( + 'Booking should not be booked, is ' + (rows as any[])[0].status, + ); } } catch (err) { throw err; @@ -147,8 +164,8 @@ mocha.describe('internal.ts', function () { let [rows, fields] = await db.execute('SELECT `status` FROM booking WHERE id=?', [ BigInt(2), ]); - if (rows[0].status != 'booked') { - throw new Error('Booking should be booked, is ' + rows[0].status); + if ((rows as any[])[0].status != 'booked') { + throw new Error('Booking should be booked, is ' + (rows as any[])[0].status); } // device 2 @@ -157,8 +174,8 @@ mocha.describe('internal.ts', function () { [rows, fields] = await db.execute('SELECT `status` FROM booking WHERE id=?', [ BigInt(2), ]); - if (rows[0].status != 'booked') { - throw new Error('Booking should be booked, is ' + rows[0].status); + if ((rows as any[])[0].status != 'booked') { + throw new Error('Booking should be booked, is ' + (rows as any[])[0].status); } } catch (err) { throw err; @@ -181,8 +198,10 @@ mocha.describe('internal.ts', function () { let [rows, fields] = await db.execute('SELECT `status` FROM booking WHERE id=?', [ BigInt(2), ]); - if (rows[0].status == 'booked') { - throw new Error('Booking should not be booked, is ' + rows[0].status); + if ((rows as any[])[0].status == 'booked') { + throw new Error( + 'Booking should not be booked, is ' + (rows as any[])[0].status, + ); } } catch (err) { throw err; @@ -192,7 +211,7 @@ mocha.describe('internal.ts', function () { }, ); - mocha.it('handleCallback() BookingUpdate (group, available)', async () => { + mocha.it('handleCallback() BookingUpdate (local group, available)', async () => { let db = await mysql.createConnection(getSQLDNS()); db.connect(); try { @@ -201,8 +220,8 @@ mocha.describe('internal.ts', function () { let [rows, fields] = await db.execute('SELECT `status` FROM booking WHERE id=?', [ BigInt(3), ]); - if (rows[0].status != 'booked') { - throw new Error('Booking should be booked, is ' + rows[0].status); + if ((rows as any[])[0].status != 'booked') { + throw new Error('Booking should be booked, is ' + (rows as any[])[0].status); } } catch (err) { throw err; @@ -211,7 +230,7 @@ mocha.describe('internal.ts', function () { } }); - mocha.it('handleCallback() BookingUpdate (group, not available)', async () => { + mocha.it('handleCallback() BookingUpdate (local group, not available)', async () => { let db = await mysql.createConnection(getSQLDNS()); db.connect(); try { @@ -221,8 +240,8 @@ mocha.describe('internal.ts', function () { let [rows, fields] = await db.execute('SELECT `status` FROM booking WHERE id=?', [ BigInt(3), ]); - if (rows[0].status == 'booked') { - throw new Error('Booking should not be booked, is ' + rows[0].status); + if ((rows as any[])[0].status == 'booked') { + throw new Error('Booking should not be booked, is ' + (rows as any[])[0].status); } } catch (err) { throw err; @@ -231,113 +250,752 @@ mocha.describe('internal.ts', function () { } }); - mocha.it('handleCallback() BookingUpdate (remote, available)', async () => { + mocha.it('dispatchCallback()', async () => { + resetFakeServerVars(); + + await dispatchCallback(BigInt(1)); + await sleep(100); + let serverConfig = fakeServerConfig; // Workaround since TypeScript does not notice var changes in functions + if (serverConfig.callback_test_local_single_was_called === false) { + throw new Error( + 'http://localhost:10801/test_callbacks/test-local-single was not called', + ); + } + if (serverConfig.callback_test_local_two_first_was_called === true) { + throw new Error('wrong callback called'); + } + if (serverConfig.callback_test_local_two_second_was_called === true) { + throw new Error('wrong callback called'); + } + if (serverConfig.callback_test_local_group_was_called === true) { + throw new Error('wrong callback called'); + } + if (serverConfig.callback_test_remote_single_was_called === true) { + throw new Error('wrong callback called'); + } + resetFakeServerVars(); + + await dispatchCallback(BigInt(2)); + await sleep(100); + serverConfig = fakeServerConfig; // Workaround since TypeScript does not notice var changes in functions + if (serverConfig.callback_test_local_single_was_called === true) { + throw new Error('wrong callback called'); + } + if (serverConfig.callback_test_local_two_first_was_called === false) { + throw new Error( + 'http://localhost:10801/test_callbacks/test-local-single was not called', + ); + } + if (serverConfig.callback_test_local_two_second_was_called === false) { + throw new Error( + 'http://localhost:10801/test_callbacks/test-local-single was not called', + ); + } + if (serverConfig.callback_test_local_group_was_called === true) { + throw new Error('wrong callback called'); + } + if (serverConfig.callback_test_remote_single_was_called === true) { + throw new Error('wrong callback called'); + } + resetFakeServerVars(); + + await dispatchCallback(BigInt(3)); + await sleep(100); + serverConfig = fakeServerConfig; // Workaround since TypeScript does not notice var changes in functions + if (serverConfig.callback_test_local_single_was_called === true) { + throw new Error('wrong callback called'); + } + if (serverConfig.callback_test_local_two_first_was_called === true) { + throw new Error('wrong callback called'); + } + if (serverConfig.callback_test_local_two_second_was_called === true) { + throw new Error('wrong callback called'); + } + if (serverConfig.callback_test_local_group_was_called === false) { + throw new Error( + 'http://localhost:10801/test_callbacks/test-local-group was not called', + ); + } + if (serverConfig.callback_test_remote_single_was_called === true) { + throw new Error('wrong callback called'); + } + resetFakeServerVars(); + }); + + mocha.it('reservateDevice() - local single device', async () => { + await reservateDevice( + new DeviceBookingRequest( + BigInt(5), + new URL('http://localhost:10801/devices/10000000-0000-0000-0000-000000000000'), + 0, + dayjs('1999-01-10T08:00:00Z'), + dayjs('1999-01-10T09:00:00Z'), + ), + ); + await sleep(1000); + + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + try { - let db = await mysql.createConnection(getSQLDNS()); - db.connect(); - try { - await handleCallback(callbackType.BookingUpdate, BigInt(4), { - Position: 0, - }); - await sleep(1000); - let [rows, fields] = await db.execute('SELECT `status` FROM booking WHERE id=?', [ - BigInt(3), - ]); - if (rows[0].status != 'booked') { - throw new Error('Booking should be booked, is ' + rows[0].status); - } - } catch (err) { - throw err; - } finally { - db.end(); + // Test booking + let [rows, fields]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(5)], + ); + if (rows.length === 0) { + throw new Error('booking not found'); } - } catch (err) { - console.log(err); - throw err; + + if ((rows as any[])[0].status !== 'booked') { + throw new Error('wrong status ' + (rows as any[])[0].status); + } + + // Test bookeddevice + [rows, fields] = await db.execute( + 'SELECT `bookeddevice`, `originaldevice`, `remotereference`, `local`, `reservation` FROM bookeddevices WHERE `booking`=? AND `originalposition`=?', + [5, 0], + ); + if (rows.length === 0) { + throw new Error('booked device not found'); + } + + if ( + (rows as any[])[0].originaldevice !== + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong original device ' + (rows as any[])[0].originaldevice); + } + + if ( + (rows as any[])[0].bookeddevice !== + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong booked device ' + (rows as any[])[0].bookeddevice); + } + + if ((rows as any[])[0].remotereference !== null) { + throw new Error('wrong remote reference ' + (rows as any[])[0].remotereference); + } + + if ((rows as any[])[0].local != true) { + // Unfortunate, type conversion + throw new Error('wrong local ' + (rows as any[])[0].local); + } + + if ( + (rows as any[])[0].reservation < 0 || + (rows as any[])[0].reservation === undefined || + (rows as any[])[0].reservation === null + ) { + throw new Error('bad reservation ' + (rows as any[])[0].reservation); + } + + let bookingID = (rows as any[])[0].reservation; + + // Test reservation + [rows, fields] = await db.execute( + 'SELECT `device`, `start`, `end` FROM reservation WHERE `id`=?', + [bookingID], + ); + + if (rows.length === 0) { + throw new Error('reservation not found'); + } + + if ( + (rows as any[])[0].device !== + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong device ' + (rows as any[])[0].device); + } + + if (!dayjs((rows as any[])[0].start).isSame(dayjs('1999-01-10T08:00:00Z'))) { + throw new Error('wrong start ' + (rows as any[])[0].start); + } + + if (!dayjs((rows as any[])[0].end).isSame(dayjs('1999-01-10T09:00:00Z'))) { + throw new Error('wrong end ' + (rows as any[])[0].end); + } + } finally { + await db.end(); } }); - mocha.it('handleCallback() BookingUpdate (remote, not available)', async () => { - let db = await mysql.createConnection(getSQLDNS()); - db.connect(); + mocha.it('reservateDevice() - local two devices', async () => { + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + try { - fakeServerConfig.device_not_available = true; - fakeServerConfig.proxy_schedule_empty = true; - fakeServerConfig.booking_status = 'rejected'; - await handleCallback(callbackType.BookingUpdate, BigInt(4), { Position: 0 }); + // Test booking 1st half + + await reservateDevice( + new DeviceBookingRequest( + BigInt(6), + new URL('http://localhost:10801/devices/10000000-0000-0000-0000-000000000000'), + 0, + dayjs('1999-02-10T08:00:00Z'), + dayjs('1999-02-10T09:00:00Z'), + ), + ); await sleep(1000); - let [rows, fields] = await db.execute('SELECT `status` FROM booking WHERE id=?', [ - BigInt(3), + + let [rows, fields]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(6)], + ); + if (rows.length === 0) { + throw new Error('booking not found'); + } + + if ((rows as any[])[0].status !== 'pending') { + // not yet complete + throw new Error('wrong status ' + (rows as any[])[0].status); + } + + // Test other device + [rows, fields] = await db.execute( + 'SELECT `bookeddevice`, `originaldevice`, `remotereference`, `local`, `reservation` FROM bookeddevices WHERE `booking`=? AND `originalposition`=?', + [6, 1], + ); + if (rows.length === 0) { + throw new Error('booked device not found'); + } + + if ( + (rows as any[])[0].originaldevice !== + 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong original device ' + (rows as any[])[0].originaldevice); + } + + if ((rows as any[])[0].bookeddevice !== null) { + throw new Error('wrong booked device ' + (rows as any[])[0].bookeddevice); + } + + // Test bookeddevice + [rows, fields] = await db.execute( + 'SELECT `bookeddevice`, `originaldevice`, `remotereference`, `local`, `reservation` FROM bookeddevices WHERE `booking`=? AND `originalposition`=?', + [6, 0], + ); + if (rows.length === 0) { + throw new Error('booked device not found'); + } + + if ( + (rows as any[])[0].originaldevice !== + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong original device ' + (rows as any[])[0].originaldevice); + } + + if ( + (rows as any[])[0].bookeddevice !== + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong booked device ' + (rows as any[])[0].bookeddevice); + } + + if ((rows as any[])[0].remotereference !== null) { + throw new Error('wrong remote reference ' + (rows as any[])[0].remotereference); + } + + if ((rows as any[])[0].local != true) { + // Unfortunate, type conversion + throw new Error('wrong local ' + (rows as any[])[0].local); + } + + if ( + (rows as any[])[0].reservation < 0 || + (rows as any[])[0].reservation === undefined || + (rows as any[])[0].reservation === null + ) { + throw new Error('bad reservation ' + (rows as any[])[0].reservation); + } + + let bookingID = (rows as any[])[0].reservation; + + // Test reservation + [rows, fields] = await db.execute( + 'SELECT `device`, `start`, `end` FROM reservation WHERE `id`=?', + [bookingID], + ); + + if (rows.length === 0) { + throw new Error('reservation not found'); + } + + if ( + (rows as any[])[0].device !== + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong device ' + (rows as any[])[0].device); + } + + if (!dayjs((rows as any[])[0].start).isSame(dayjs('1999-02-10T08:00:00Z'))) { + throw new Error('wrong start ' + (rows as any[])[0].start); + } + + if (!dayjs((rows as any[])[0].end).isSame(dayjs('1999-02-10T09:00:00Z'))) { + throw new Error('wrong end ' + (rows as any[])[0].end); + } + + // Test booking 2nd half + await reservateDevice( + new DeviceBookingRequest( + BigInt(6), + new URL('http://localhost:10801/devices/20000000-0000-0000-0000-000000000000'), + 1, + dayjs('1999-02-10T08:00:00Z'), + dayjs('1999-02-10T09:00:00Z'), + ), + ); + await sleep(1000); + + [rows, fields] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(6), ]); - if (rows[0].status == 'booked') { - let [rowsinner, fieldsinner] = await db.execute( - 'SELECT `bookeddevice` FROM bookeddevices WHERE booking=? AND originalposition=?', - [BigInt(4), 0], - ); - throw new Error( - 'Booking should not be booked, is ' + - rows[0].status + - ', booked device is ' + - rowsinner[0].bookeddevice, - ); + if (rows.length === 0) { + throw new Error('booking not found'); + } + + if ((rows as any[])[0].status !== 'booked') { + // complete + throw new Error('wrong status ' + (rows as any[])[0].status); + } + + // Test other device + [rows, fields] = await db.execute( + 'SELECT `bookeddevice`, `originaldevice`, `remotereference`, `local`, `reservation` FROM bookeddevices WHERE `booking`=? AND `originalposition`=?', + [6, 0], + ); + if (rows.length === 0) { + throw new Error('booked device not found'); + } + + if ( + (rows as any[])[0].originaldevice !== + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong original device ' + (rows as any[])[0].originaldevice); + } + + if ( + (rows as any[])[0].bookeddevice !== + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong booked device ' + (rows as any[])[0].bookeddevice); + } + + // Test bookeddevice + [rows, fields] = await db.execute( + 'SELECT `bookeddevice`, `originaldevice`, `remotereference`, `local`, `reservation` FROM bookeddevices WHERE `booking`=? AND `originalposition`=?', + [6, 1], + ); + if (rows.length === 0) { + throw new Error('booked device not found'); + } + + if ( + (rows as any[])[0].originaldevice !== + 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong original device ' + (rows as any[])[0].originaldevice); + } + + if ( + (rows as any[])[0].bookeddevice !== + 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong booked device ' + (rows as any[])[0].bookeddevice); + } + + if ((rows as any[])[0].remotereference !== null) { + throw new Error('wrong remote reference ' + (rows as any[])[0].remotereference); + } + + if ((rows as any[])[0].local != true) { + // Unfortunate, type conversion + throw new Error('wrong local ' + (rows as any[])[0].local); + } + + if ( + (rows as any[])[0].reservation < 0 || + (rows as any[])[0].reservation === undefined || + (rows as any[])[0].reservation === null + ) { + throw new Error('bad reservation ' + (rows as any[])[0].reservation); + } + + bookingID = (rows as any[])[0].reservation; + + // Test reservation + [rows, fields] = await db.execute( + 'SELECT `device`, `start`, `end` FROM reservation WHERE `id`=?', + [bookingID], + ); + + if (rows.length === 0) { + throw new Error('reservation not found'); + } + + if ( + (rows as any[])[0].device !== + 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong device ' + (rows as any[])[0].device); + } + + if (!dayjs((rows as any[])[0].start).isSame(dayjs('1999-02-10T08:00:00Z'))) { + throw new Error('wrong start ' + (rows as any[])[0].start); + } + + if (!dayjs((rows as any[])[0].end).isSame(dayjs('1999-02-10T09:00:00Z'))) { + throw new Error('wrong end ' + (rows as any[])[0].end); } - } catch (err) { - throw err; } finally { - db.end(); + await db.end(); } }); - mocha.it('dispatchCallback()', async () => { - throw Error('TODO implement'); - }); + mocha.it('reservateDevice() - local group', async () => { + await reservateDevice( + new DeviceBookingRequest( + BigInt(7), + new URL('http://localhost:10801/devices/00000000-0000-0000-0000-000000000010'), + 0, + dayjs('1999-03-10T08:00:00Z'), + dayjs('1999-03-10T09:00:00Z'), + ), + ); + await sleep(1000); - mocha.it('reservateDevice() - remote', async () => { - throw Error('TODO implement'); - }); + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); - mocha.it('reservateDevice() - local single device', async () => { - throw Error('TODO implement'); - }); + try { + // Test booking + let [rows, fields]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(7)], + ); + if (rows.length === 0) { + throw new Error('booking not found'); + } - mocha.it('reservateDevice() - local two devices', async () => { - throw Error('TODO implement'); - }); + if ((rows as any[])[0].status !== 'booked') { + throw new Error('wrong status ' + (rows as any[])[0].status); + } - mocha.it('reservateDevice() - local group', async () => { - throw Error('TODO implement'); - }); + // Test bookeddevice + [rows, fields] = await db.execute( + 'SELECT `bookeddevice`, `originaldevice`, `remotereference`, `local`, `reservation` FROM bookeddevices WHERE `booking`=? AND `originalposition`=?', + [7, 0], + ); + if (rows.length === 0) { + throw new Error('booked device not found'); + } - mocha.it('reservateDevice() - remote not available', async () => { - throw Error('TODO implement'); + if ( + (rows as any[])[0].originaldevice !== + 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000010' + ) { + throw new Error('wrong original device ' + (rows as any[])[0].originaldevice); + } + + if ( + (rows as any[])[0].bookeddevice !== + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' && + (rows as any[])[0].bookeddevice !== + 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' + ) { + // Group: one of those, selection is not deterministic + throw new Error('wrong booked device ' + (rows as any[])[0].bookeddevice); + } + let selected = (rows as any[])[0].bookeddevice; + + if ((rows as any[])[0].remotereference !== null) { + throw new Error('wrong remote reference ' + (rows as any[])[0].remotereference); + } + + if ((rows as any[])[0].local != true) { + // Unfortunate, type conversion + throw new Error('wrong local ' + (rows as any[])[0].local); + } + + if ( + (rows as any[])[0].reservation < 0 || + (rows as any[])[0].reservation === undefined || + (rows as any[])[0].reservation === null + ) { + throw new Error('bad reservation ' + (rows as any[])[0].reservation); + } + + let bookingID = (rows as any[])[0].reservation; + + // Test reservation + [rows, fields] = await db.execute( + 'SELECT `device`, `start`, `end` FROM reservation WHERE `id`=?', + [bookingID], + ); + + if (rows.length === 0) { + throw new Error('reservation not found'); + } + + if ((rows as any[])[0].device !== selected) { + throw new Error('wrong device ' + (rows as any[])[0].device); + } + + if (!dayjs((rows as any[])[0].start).isSame(dayjs('1999-03-10T08:00:00Z'))) { + throw new Error('wrong start ' + (rows as any[])[0].start); + } + + if (!dayjs((rows as any[])[0].end).isSame(dayjs('1999-03-10T09:00:00Z'))) { + throw new Error('wrong end ' + (rows as any[])[0].end); + } + } finally { + await db.end(); + } }); mocha.it('reservateDevice() - local single device not available', async () => { - throw Error('TODO implement'); + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + await StartAMQPTestFree(); + + try { + // Create fake reservation + await db.execute( + 'INSERT INTO reservation (`id`,`device`, `start`, `end`, `bookingreference`) VALUES (?,?,?,?,?)', + [ + BigInt(100), + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', + dayjs('1999-01-10T08:00:00Z').toDate(), + dayjs('1999-01-10T09:00:00Z').toDate(), + 'block reservation', + ], + ); + + // Try booking + await reservateDevice( + new DeviceBookingRequest( + BigInt(5), + new URL('http://localhost:10801/devices/10000000-0000-0000-0000-000000000000'), + 0, + dayjs('1999-01-10T08:00:00Z'), + dayjs('1999-01-10T09:00:00Z'), + ), + ); + await sleep(1000); + + // Test booking + let [rows, fields]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(5)], + ); + if (rows.length === 0) { + throw new Error('booking not found'); + } + + if ((rows as any[])[0].status !== 'rejected') { + throw new Error('wrong status ' + (rows as any[])[0].status); + } + + // Check request for freeing + if (TestAMQPresults.size != 1) { + throw new Error('wrong number of free devices ' + MapToString(TestAMQPresults)); + } + + if (!TestAMQPresults.has(6n)) { + throw new Error('wrong devices freed ' + MapToString(TestAMQPresults)); + } + } finally { + ResetAMQPDeviceCount(); + await StopAMQPTestFree(); + await db.end(); + } }); mocha.it('reservateDevice() - local two devices not available', async () => { - throw Error('TODO implement'); + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + await StartAMQPTestFree(); + + try { + // Create successful reservation + // Create fake reservation + await db.execute( + 'INSERT INTO reservation (`id`,`device`, `start`, `end`, `bookingreference`) VALUES (?,?,?,?,?)', + [ + BigInt(99), + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', + dayjs('1999-02-10T08:00:00Z').toDate(), + dayjs('1999-02-10T09:00:00Z').toDate(), + 'successful reservation', + ], + ); + + await db.execute( + 'UPDATE bookeddevices SET bookeddevice=?, reservation=? WHERE id=?', + [ + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', + BigInt(99), + BigInt(7), + ], + ); + + // Create fake reservation + await db.execute( + 'INSERT INTO reservation (`id`,`device`, `start`, `end`, `bookingreference`) VALUES (?,?,?,?,?)', + [ + BigInt(100), + 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000', + dayjs('1999-02-10T08:15:00Z').toDate(), + dayjs('1999-02-10T08:30:00Z').toDate(), + 'block reservation', + ], + ); + + // Try booking + await reservateDevice( + new DeviceBookingRequest( + BigInt(6), + new URL('http://localhost:10801/devices/20000000-0000-0000-0000-000000000000'), + 1, + dayjs('1999-02-10T08:00:00Z'), + dayjs('1999-02-10T09:00:00Z'), + ), + ); + await sleep(1000); + + // Test booking + let [rows, fields]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(6)], + ); + if (rows.length === 0) { + throw new Error('booking not found'); + } + + if ((rows as any[])[0].status !== 'rejected') { + throw new Error('wrong status ' + (rows as any[])[0].status); + } + + // Check request for freeing + if (TestAMQPresults.size != 2) { + throw new Error('wrong number of free devices ' + MapToString(TestAMQPresults)); + } + + if (!TestAMQPresults.has(7n)) { + throw new Error('wrong devices freed ' + MapToString(TestAMQPresults)); + } + + if (!TestAMQPresults.has(8n)) { + throw new Error('wrong devices freed ' + MapToString(TestAMQPresults)); + } + } finally { + ResetAMQPDeviceCount(); + await StopAMQPTestFree(); + await db.end(); + } }); mocha.it('reservateDevice() - local group not available', async () => { - throw Error('TODO implement'); - }); + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + await StartAMQPTestFree(); - mocha.it('freeDevice() - remote', async () => { - throw Error('TODO implement'); - }); + try { + // Create fake reservation + await db.execute( + 'INSERT INTO reservation (`id`,`device`, `start`, `end`, `bookingreference`) VALUES (?,?,?,?,?)', + [ + BigInt(100), + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', + dayjs('1999-03-10T08:10:00Z').toDate(), + dayjs('1999-03-10T09:20:00Z').toDate(), + 'block reservation', + ], + ); - mocha.it('freeDevice() - local single device', async () => { - throw Error('TODO implement'); - }); + await db.execute( + 'INSERT INTO reservation (`id`,`device`, `start`, `end`, `bookingreference`) VALUES (?,?,?,?,?)', + [ + BigInt(101), + 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000', + dayjs('1999-03-10T08:40:00Z').toDate(), + dayjs('1999-03-10T09:50:00Z').toDate(), + 'block reservation', + ], + ); - mocha.it('freeDevice() - local multiple devices', async () => { - throw Error('TODO implement'); + // Try booking + await reservateDevice( + new DeviceBookingRequest( + BigInt(7), + new URL('http://localhost:10801/devices/00000000-0000-0000-0000-000000000010'), + 0, + dayjs('1999-03-10T08:00:00Z'), + dayjs('1999-03-10T09:00:00Z'), + ), + ); + await sleep(1000); + + // Test booking + let [rows, fields]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(7)], + ); + if (rows.length === 0) { + throw new Error('booking not found'); + } + + if ((rows as any[])[0].status !== 'rejected') { + throw new Error('wrong status ' + (rows as any[])[0].status); + } + + // Check request for freeing + if (TestAMQPresults.size != 1) { + throw new Error('wrong number of free devices ' + MapToString(TestAMQPresults)); + } + + if (!TestAMQPresults.has(9n)) { + throw new Error('wrong devices freed ' + MapToString(TestAMQPresults)); + } + } finally { + ResetAMQPDeviceCount(); + await StopAMQPTestFree(); + await db.end(); + } }); - mocha.it('freeDevice() - local group', async () => { - throw Error('TODO implement'); + mocha.it('reservateDevice() - booking not existing', async () => { + let errFound = false; + try { + await reservateDevice( + new DeviceBookingRequest( + BigInt(5000), + new URL('http://localhost:10801/devices/10000000-0000-0000-0000-000000000000'), + 0, + dayjs('1999-01-10T08:00:00Z'), + dayjs('1999-01-10T09:00:00Z'), + ), + ); + await sleep(1000); + } catch (err) { + if ( + (err as Error).toString() != new Error('Booking 5000 does not exist').toString() + ) { + console.log('Unknown err ' + err); + throw err; + } + errFound = true; + } + + if (!errFound) { + throw new Error('No error on unknown booking'); + } }); mocha.it('randomID()', async () => { @@ -353,19 +1011,225 @@ mocha.describe('internal.ts', function () { } }); - mocha.it('DeleteBooking()', async () => { - throw Error('TODO implement'); + mocha.it('DeleteBooking() local single device', async () => { + await StartAMQPTestFree(); + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + try { + await DeleteBooking(BigInt(1)); + + sleep(1000); + + // Check booking + let [rows, fields]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(1)], + ); + if (rows.length === 0) { + throw new Error('booking not found'); + } + + if ((rows as any[])[0].status !== 'cancelled') { + throw new Error('wrong status ' + (rows as any[])[0].status); + } + + // Check request for freeing + if (TestAMQPresults.size != 1) { + throw new Error('wrong number of free devices ' + MapToString(TestAMQPresults)); + } + + if (!TestAMQPresults.has(1n)) { + throw new Error('wrong devices freed ' + MapToString(TestAMQPresults)); + } + + if (TestAMQPresults.get(1n) != 1) { + throw new Error('wrong number of devices freed ' + MapToString(TestAMQPresults)); + } + } finally { + db.end(); + await StopAMQPTestFree(); + ResetAMQPDeviceCount(); + } + }); + + mocha.it('DeleteBooking() local multiple devices', async () => { + await StartAMQPTestFree(); + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + try { + await DeleteBooking(BigInt(2), 'rejected', 'test message'); + + sleep(1000); + + // Check booking + let [rows, fields]: [any, any] = await db.execute( + 'SELECT `status`, `message` FROM booking WHERE `id`=?', + [BigInt(2)], + ); + if (rows.length === 0) { + throw new Error('booking not found'); + } + + if ((rows as any[])[0].status !== 'rejected') { + throw new Error('wrong status ' + (rows as any[])[0].status); + } + + if ((rows as any[])[0].message !== 'test message') { + throw new Error('wrong message ' + (rows as any[])[0].message); + } + + // Check request for freeing + if (TestAMQPresults.size != 2) { + throw new Error('wrong number of free devices ' + MapToString(TestAMQPresults)); + } + + if (!TestAMQPresults.has(2n)) { + throw new Error('wrong devices freed ' + MapToString(TestAMQPresults)); + } + + if (TestAMQPresults.get(2n) != 1) { + throw new Error('wrong number of devices freed ' + MapToString(TestAMQPresults)); + } + + if (!TestAMQPresults.has(3n)) { + throw new Error('wrong devices freed ' + MapToString(TestAMQPresults)); + } + + if (TestAMQPresults.get(3n) != 1) { + throw new Error('wrong number of devices freed ' + MapToString(TestAMQPresults)); + } + } finally { + db.end(); + await StopAMQPTestFree(); + ResetAMQPDeviceCount(); + } + }); + + mocha.it('DeleteBooking() local group', async () => { + await StartAMQPTestFree(); + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + try { + await DeleteBooking(BigInt(3)); + + sleep(1000); + + // Check booking + let [rows, fields]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(3)], + ); + if (rows.length === 0) { + throw new Error('booking not found'); + } + + if ((rows as any[])[0].status !== 'cancelled') { + throw new Error('wrong status ' + (rows as any[])[0].status); + } + + // Check request for freeing + if (TestAMQPresults.size != 1) { + throw new Error('wrong number of free devices ' + MapToString(TestAMQPresults)); + } + + if (!TestAMQPresults.has(4n)) { + throw new Error('wrong devices freed ' + MapToString(TestAMQPresults)); + } + + if (TestAMQPresults.get(4n) != 1) { + throw new Error('wrong number of devices freed ' + MapToString(TestAMQPresults)); + } + } finally { + db.end(); + await StopAMQPTestFree(); + ResetAMQPDeviceCount(); + } + }); + + mocha.it('DeleteBooking() non-existing', async () => { + await StartAMQPTestFree(); + try { + let error_thrown = false; + try { + await DeleteBooking(BigInt(1111)); + } catch (err) { + if ((err as Error).message != 'Booking 1111 does not exist') { + throw new Error('unknown error' + err); + } + error_thrown = true; + } + sleep(100); + + if (!error_thrown) { + throw new Error('No error thrown'); + } + } finally { + await StopAMQPTestFree(); + ResetAMQPDeviceCount(); + } }); - mocha.it('putBookingByIDLock', async () => { - throw Error('TODO implement'); + mocha.it('freeDevice() - local single device', async () => { + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + try { + await freeDevice(BigInt(1)); + await sleep(1000); + + let [rows, fields]: [any, any] = await db.execute( + 'SELECT * FROM reservation WHERE `id`=?', + [BigInt(4)], + ); + if (rows.length !== 0) { + throw new Error('reservation 4 still exists'); + } + } finally { + db.end(); + } }); - mocha.it('deleteBookingByIDLock', async () => { - throw Error('TODO implement'); + mocha.it('freeDevice() - local multiple devices', async () => { + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + try { + freeDevice(BigInt(2)); + freeDevice(BigInt(3)); + await sleep(1000); + + let [rows, fields]: [any, any] = await db.execute( + 'SELECT * FROM reservation WHERE `id`=?', + [BigInt(5)], + ); + if (rows.length !== 0) { + throw new Error('reservation 5 still exists'); + } + [rows, fields] = await db.execute('SELECT * FROM reservation WHERE `id`=?', [ + BigInt(6), + ]); + if (rows.length !== 0) { + throw new Error('reservation 6 still exists'); + } + } finally { + db.end(); + } }); - mocha.it('postBookingCallbackByID', async () => { - throw Error('TODO implement'); + mocha.it('freeDevice() - local group', async () => { + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + try { + await freeDevice(BigInt(4)); + await sleep(1000); + + let [rows, fields]: [any, any] = await db.execute( + 'SELECT * FROM reservation WHERE `id`=?', + [BigInt(7)], + ); + if (rows.length !== 0) { + throw new Error('reservation 7 still exists'); + } + } finally { + db.end(); + } }); }); diff --git a/services/booking/src/booking-backend/src/integrationtest_helper_amqp.ts b/services/booking/src/booking-backend/src/integrationtest_helper_amqp.ts new file mode 100644 index 00000000..5f6c66a8 --- /dev/null +++ b/services/booking/src/booking-backend/src/integrationtest_helper_amqp.ts @@ -0,0 +1,105 @@ +import { sleep } from '@crosslab/booking-service-common'; +import * as amqplib from 'amqplib'; + +import { config } from './config.js'; + +let connection: amqplib.Connection | null; +let channel: amqplib.Channel | null; + +let amqpTestStarted = false; + +export let TestAMQPresults = new Map(); + +export function MapToString(map: Map): string { + return JSON.stringify(Object.fromEntries(map)); +} + +export function ResetAMQPDeviceCount(): void { + TestAMQPresults = new Map(); +} + +async function helperLoop(): Promise { + while (true) { + if (!channel) continue; + let msg = await channel.get('device-freeing', { noAck: false }); + + if (typeof msg === 'boolean') { + await sleep(20); + continue; + } + + if (msg === null) { + continue; + } + + // Parse data + let data: bigint; + try { + data = BigInt(msg.content.toString()); + } catch (error) { + console.error('Can not parse message:', error); + try { + channel.ack(msg); + } catch (error) { + console.error('Can not ack message:', error); + } + continue; + } + try { + if (data === -9999n) { + amqpTestStarted = false; + return; + } + if (TestAMQPresults.has(data)) { + TestAMQPresults.set(data, TestAMQPresults.get(data) + 1); + } + TestAMQPresults.set(data, 1); + channel.ack(msg); + } catch (err) { + console.error('Error at helperLoop:', err); + } + } +} + +export async function StartAMQPTestFree(): Promise { + if (amqpTestStarted) { + throw new Error('amqp mockup alreay started'); + } + + connection = await amqplib.connect(config.AmqpUrl); + channel = await connection.createChannel(); + + await channel.assertQueue('device-freeing', { + durable: true, + }); + + while (await channel.get('device-freeing', { noAck: true })) {} + + helperLoop(); + amqpTestStarted = true; + + return; +} + +export async function StopAMQPTestFree(): Promise { + if (!amqpTestStarted) { + throw new Error('amqp mockup alreay stopped'); + } + + if ( + !channel?.sendToQueue('device-freeing', Buffer.from((-9999n).toString()), { + persistent: true, + }) + ) { + throw new Error('amqp queue full'); + } + + await sleep(1000); + await channel.close(); + channel = null; + await sleep(250); + await connection?.close(); + connection = null; + + return; +} diff --git a/services/booking/src/booking-backend/src/internal.ts b/services/booking/src/booking-backend/src/internal.ts index da655aa9..6999946a 100644 --- a/services/booking/src/booking-backend/src/internal.ts +++ b/services/booking/src/booking-backend/src/internal.ts @@ -1,5 +1,5 @@ -import { APIClient, BookingServiceSignatures } from '@cross-lab-project/api-client'; -import { BelongsToUs, sleep } from '@crosslab/booking-service-common'; +import { BookingServiceSignatures } from '@cross-lab-project/api-client'; +import { BelongsToUs, clients, sleep } from '@crosslab/booking-service-common'; import { ReservationAnswer, ReservationMessage, @@ -8,17 +8,21 @@ import { import * as amqplib from 'amqplib'; import * as crypto from 'crypto'; import dayjs from 'dayjs'; -import isSameOrAfter from 'dayjs/plugin/isSameOrAfter'; -import isSameOrBefore from 'dayjs/plugin/isSameOrBefore'; +import isSameOrAfter from 'dayjs/plugin/isSameOrAfter.js'; +import isSameOrBefore from 'dayjs/plugin/isSameOrBefore.js'; import lodash from 'lodash'; import * as mysql from 'mysql2/promise'; -import { config } from './config'; -import { DeviceBookingRequest } from './messageDefinition'; +import { config } from './config.js'; +import { DeviceBookingRequest } from './messageDefinition.js'; dayjs.extend(isSameOrBefore); dayjs.extend(isSameOrAfter); +(BigInt.prototype as any).toJSON = function () { + return this.toString(); +}; + export enum callbackType { DeviceUpdate, BookingUpdate, @@ -30,8 +34,6 @@ export async function handleCallback( targetBooking: bigint, parameters: any, ) { - let api: APIClient = new APIClient(config.OwnURL, config.API_TOKEN); - let db = await mysql.createConnection(config.BookingDSN); await db.connect(); @@ -44,7 +46,7 @@ export async function handleCallback( await db.beginTransaction(); // Lock booking let [bookingRow, bookingFields]: [any, any] = await db.execute( - 'SELECT `start`,`end`,`type`,`status` FROM booking WHERE `id`=? FOR UPDATE', + 'SELECT `start`,`end`,`type`,`status`,`user` FROM booking WHERE `id`=? FOR UPDATE', [targetBooking], ); if (bookingRow.length == 0) { @@ -64,12 +66,18 @@ export async function handleCallback( if (rows.length == 0) { throw Error( 'Booking, Position (' + - targetBooking + - ',' + - parameters.Position + - ') not known', + targetBooking + + ',' + + parameters.Position + + ') not known', ); } + + // Check if device is actually booked -- if not, just jump out + if (rows[0].bookeddevice == null && rows[0].remotereference == null) { + return; + } + let bookedDeviceId: bigint = BigInt(rows[0].id); let originalDevice: string = rows[0].originaldevice; @@ -84,24 +92,23 @@ export async function handleCallback( throw Error('Booking must be local for device update'); } - let device = await api.getDevice(rows[0].bookeddevice); + let device = await clients.device.getDevice(rows[0].bookeddevice); if (device.type == 'group') { throw Error('Booked device ' + rows[0].bookeddevice + ' is group'); } // If not available: request new device if (device.type == 'device') { // Other devices are always available - available = device.connected; + available = !!device.connected; // Check availability if needed if (available) { available = false; - for (let i = 0; i < device.announcedAvailability.length; i++) { + const announcedAvailability = device.announcedAvailability!; + for (let i = 0; i < announcedAvailability.length; i++) { if ( - dayjs(device.announcedAvailability[i].start).isSameOrBefore( - start, - ) && - dayjs(device.announcedAvailability[i].end).isSameOrAfter(end) + dayjs(announcedAvailability[i].start).isSameOrBefore(start) && + dayjs(announcedAvailability[i].end).isSameOrAfter(end) ) { available = true; break; @@ -116,7 +123,9 @@ export async function handleCallback( throw Error('Booking must be remote for device update'); } - let getReturn = await api.getBooking(rows[0].remotereference); + let getReturn = await clients.booking.frontend.getBooking( + rows[0].remotereference, + ); if ( getReturn.Booking.Status == 'cancelled' || getReturn.Booking.Status == 'rejected' @@ -134,8 +143,8 @@ export async function handleCallback( await freeDevice(bookedDeviceId); // Now ask for new device - let connection: amqplib.Connection; - let channel: amqplib.Channel; + let connection: amqplib.Connection | undefined; + let channel: amqplib.Channel | undefined; try { connection = await amqplib.connect(config.AmqpUrl); channel = await connection.createChannel(); @@ -161,15 +170,16 @@ export async function handleCallback( throw new Error('amqp queue full'); } } finally { - channel.close(); - connection.close(); + if (channel) await channel.close(); + await sleep(250); + if (connection) await connection.close(); } } // In the end - commit - db.commit(); + await db.commit(); } catch (err) { - db.rollback(); + await db.rollback(); throw err; } @@ -200,8 +210,10 @@ async function addDeviceCallback( [id, callbackType.DeviceUpdate, targetbooking, data], ); - let api: APIClient = new APIClient(config.OwnURL, config.API_TOKEN); - await api.updateDevice(device.toString(), undefined, { + // TODO: For now get the type first since it is required. Remove this once the type is no longer needed + let deviceData = await clients.device.getDevice(device.toString()); + + await clients.device.updateDevice(device.toString(), { type: deviceData.type }, { changedUrl: config.OwnURL + '/booking_callback/' + id, }); } catch (e) { @@ -230,8 +242,7 @@ async function addBookingCallback( [id, callbackType.BookingUpdate, targetbooking, data], ); - let api: APIClient = new APIClient(config.OwnURL, config.API_TOKEN); - await api.updateBooking(booking.toString(), { + await clients.booking.frontend.updateBooking(booking.toString(), { Callback: config.OwnURL + '/booking_callback/' + id, }); } catch (e) { @@ -252,15 +263,31 @@ export async function dispatchCallback(bookingID: bigint) { let db = await mysql.createConnection(config.BookingDSN); await db.connect(); + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [bookingID], + ); + if (rows.length == 0) { + throw new Error('booking' + bookingID + ' does not exist'); + } + let status: string = rows[0].status; try { - let [rows, fields]: [any, any] = await db.execute( + [rows, _] = await db.execute( 'SELECT `id`, `url` FROM bookingcallbacks WHERE booking=? FOR UPDATE', [bookingID], ); for (let i = 0; i < rows.length; i++) { try { - let response = await fetch(rows[i].url, { method: 'GET' }); + let response = await fetch(rows[i].url, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + status: status, + url: config.OwnURL + '/booking/' + bookingID.toString(), + id: bookingID.toString(), + }), + }); if (response.status == 404 || response.status == 410) { // Code depends on service // Callback no longer needed @@ -268,6 +295,10 @@ export async function dispatchCallback(bookingID: bigint) { } } catch (err) { // Something went wrong here - just continue for now + console.error( + 'error', + 'Unknown error in dispatchCallback:', err, + ); continue; } } @@ -300,7 +331,7 @@ async function reservationCheckStatus(bookingID: bigint) { } [rows, fields] = await db.execute( - 'SELECT count(*) AS n FROM bookeddevices WHERE booking=? AND bookeddevice=NULL', + 'SELECT count(*) AS n FROM bookeddevices WHERE booking=? AND bookeddevice IS NULL', [bookingID], ); @@ -338,231 +369,251 @@ export async function reservateDevice(r: DeviceBookingRequest) { let db = await mysql.createConnection(config.BookingDSN); await db.connect(); - let [rows, fields]: [any, any] = await db.execute( - 'SELECT `status` FROM booking WHERE id=?', - [r.BookingID], - ); - if (rows.length == 0) { - throw new Error('Booking ' + r.BookingID + ' does not exist'); - } - - if ( - rows[0].status === 'rejected' || - rows[0].status === 'cancelled' || - rows[0].status === 'active-rejected' - ) { - // Get early out - this booking will not success anyway - return; - } - await db.end(); - - let api: APIClient = new APIClient(config.OwnURL, config.API_TOKEN); - - let deviceListResponse = await api.getDevice(r.Device.toString(), { - flat_group: true, - }); - let possibleDevices: string[] = []; - - if ( - deviceListResponse.type === 'device' || - deviceListResponse.type === 'cloud instantiable' || - deviceListResponse.type === 'edge instantiable' - ) { - possibleDevices.push(deviceListResponse.url); - } else if (deviceListResponse.type === 'group') { - // group - for (let i = 0; i < deviceListResponse.devices.length; i++) { - possibleDevices.push(deviceListResponse.devices[i].url); + try { + let [rows, fields]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE id=?', + [r.BookingID], + ); + if (rows.length == 0) { + throw new Error('Booking ' + r.BookingID + ' does not exist'); } - } else { - throw new Error('BUG: Unknown device type for' + r.Device.toString()); - } - { - // Sort devices - // This has two goals - // * Randomise the order of devices, so not everyone wants to book the same device first - // * Prefer own devices over remote devices - let own: string[] = []; - let other: string[] = []; + if ( + rows[0].status === 'rejected' || + rows[0].status === 'cancelled' || + rows[0].status === 'active-rejected' + ) { + // Get early out - this booking will not success anyway + return; + } - for (let i = 0; i < possibleDevices.length; i++) { - if (BelongsToUs(new URL(possibleDevices[i]))) { - own.push(possibleDevices[i]); - } else { - other.push(possibleDevices[i]); + let deviceListResponse = await clients.device.getDevice(r.Device.toString(), { + flat_group: true, + }); + let possibleDevices: string[] = []; + + if ( + deviceListResponse.type === 'device' || + deviceListResponse.type === 'cloud instantiable' || + deviceListResponse.type === 'edge instantiable' + ) { + possibleDevices.push(deviceListResponse.url); + } else if (deviceListResponse.type === 'group') { + // group + for (let i = 0; i < deviceListResponse.devices.length; i++) { + possibleDevices.push(deviceListResponse.devices[i].url); } + } else { + throw new Error('BUG: Unknown device type for' + r.Device.toString()); } - lodash.shuffle(own); - lodash.shuffle(other); - own.push(...other); - possibleDevices = own; - } + { + // Sort devices + // This has two goals + // * Randomise the order of devices, so not everyone wants to book the same device first + // * Prefer own devices over remote devices + let own: string[] = []; + let other: string[] = []; + + for (let i = 0; i < possibleDevices.length; i++) { + if (BelongsToUs(new URL(possibleDevices[i]))) { + own.push(possibleDevices[i]); + } else { + other.push(possibleDevices[i]); + } + } - nextDevice: for (let i = 0; i < possibleDevices.length; i++) { - let schedule: BookingServiceSignatures.ScheduleSuccessResponse['body']; - try { - schedule = await api.schedule({ - Experiment: { Devices: [{ ID: possibleDevices[i] }] }, - Time: { Start: r.Start.toISOString(), End: r.End.toISOString() }, - Combined: false, - onlyOwn: true, - }); - } catch (e) { - continue; - } - if (schedule.length !== 1) { - // Should only be one device - continue; - } - if (schedule[0].Booked.length !== 0) { - // Device is booked - continue; + lodash.shuffle(own); + lodash.shuffle(other); + own.push(...other); + possibleDevices = own; } - // Book device - if (BelongsToUs(new URL(possibleDevices[i]))) { - let connection: amqplib.Connection; - let channel: amqplib.Channel; - let returnChannel = randomID(); - let queueCreated = false; + nextDevice: for (let i = 0; i < possibleDevices.length; i++) { + let schedule: BookingServiceSignatures.ScheduleSuccessResponse['body']; try { - connection = await amqplib.connect(config.AmqpUrl); - channel = await connection.createChannel(); - - await channel.assertQueue('device-reservation', { - durable: true, + schedule = await clients.booking.schedule.schedule({ + Experiment: { Devices: [{ ID: possibleDevices[i] }] }, + Time: { Start: r.Start.toISOString(), End: r.End.toISOString() }, + Combined: false, + onlyOwn: true, }); + } catch (e) { + console.error( + 'Error while getting schedule in reservateDevice (using next device):', + e, + ); + continue; + } + if (schedule.length !== 1) { + // Should only be one device + continue; + } + if (schedule[0].Booked.length !== 0) { + // Device is booked + continue; + } - await channel.assertQueue(returnChannel, { - durable: false, - }); + // Book device + if (BelongsToUs(new URL(possibleDevices[i]))) { + let connection: amqplib.Connection | undefined; + let channel: amqplib.Channel | undefined; + let returnChannel = randomID(); + let queueCreated = false; + try { + connection = await amqplib.connect(config.AmqpUrl); + channel = await connection.createChannel(); - queueCreated = true; + await channel.assertQueue('device-reservation', { + durable: true, + }); - let m = new ReservationMessage(ReservationRequest.New, returnChannel); - let url = config.OwnURL; - if (!url.endsWith('/')) { - url = url + '/'; + await channel.assertQueue(returnChannel, { + durable: false, + }); + + queueCreated = true; + + let m = new ReservationMessage(ReservationRequest.New, returnChannel); + let url = config.OwnURL; + if (!url.endsWith('/')) { + url = url + '/'; + } + url = url + 'booking/' + r.BookingID; + m.BookingReference = new URL(url); + m.Start = r.Start; + m.End = r.End; + m.Device = new URL(possibleDevices[i]); + + channel.sendToQueue('device-reservation', Buffer.from(JSON.stringify(m))); + + let aUnknown: any; + let counter = 0; + while (true) { + aUnknown = await channel.get(returnChannel, { noAck: true }); + if (typeof aUnknown !== 'boolean' && aUnknown !== null) { + break; + } + counter++; + if (counter >= 50) { + continue nextDevice; + } + await sleep(100); + } + + let a: amqplib.GetMessage = aUnknown as amqplib.GetMessage; + let data = ReservationAnswer.fromString(a.content.toString()); + if ( + data.Type === ReservationRequest.New && + data.Successful && + data.Device?.toString() === new URL(possibleDevices[i]).toString() && + data.Start?.isSame(r.Start) && + data.End?.isSame(r.End) + ) { + await db.execute( + 'UPDATE bookeddevices SET `bookeddevice`=?, `reservation`=?, `local`=? WHERE `booking`=? AND `originalposition`=?', + [ + data.Device.toString(), + data.ReservationID.toString(), + true, + r.BookingID, + r.Position, + ], + ); + addDeviceCallback(data.Device, r.BookingID, { Position: r.Position }); + await reservationCheckStatus(r.BookingID); + return; + } + continue; + } catch (err) { + console.error('Unknown error while booking device:', err); + continue; + } finally { + if (channel !== undefined) { + await channel.close(); + await sleep(250); + } + if (connection !== undefined) { + await connection.close(); + } } - url = url + 'booking/manage/' + r.BookingID; - m.BookingReference = new URL(url); - m.Start = r.Start; - m.End = r.End; - m.Device = new URL(possibleDevices[i]); + } else { + let institution = new URL(possibleDevices[i]).origin; + let putReturn = await clients.booking.frontend.newBooking( + { + Devices: [{ ID: possibleDevices[i] }], + Time: { Start: r.Start.toISOString(), End: r.End.toISOString() }, + BookingReference: r.BookingID.toString(), + }, + { url: institution + '/booking/manage' }, + ); - channel.sendToQueue('device-reservation', Buffer.from(JSON.stringify(m))); + let ID = putReturn.ReservationID; - let aUnknown: any; - let counter = 0; + let counter = -1; while (true) { - aUnknown = await channel.get(returnChannel, { noAck: true }); - if (typeof aUnknown !== 'boolean' && aUnknown !== null) { - break; - } counter++; if (counter >= 50) { continue nextDevice; } - await sleep(100); - } + await sleep(1000); - let a: amqplib.GetMessage = aUnknown as amqplib.GetMessage; - let data = ReservationAnswer.fromString(a.content.toString()); - if ( - data.Type === ReservationRequest.New && - data.Device.toString() === possibleDevices[i] && - data.Start.isSame(r.Start) && - data.End.isSame(r.End) && - data.Successful - ) { - await db.execute( - 'UPDATE bookeddevices SET `bookeddevice`=?, `remotereference`=?, `local`=? WHERE `booking`=? AND `originalposition`=?', - [data.Device, data.ReservationID.toString(), true, r.BookingID, r.Position], + let getReturn = await clients.booking.frontend.getBooking( + institution + '/booking/' + ID, ); - addDeviceCallback(data.Device, r.BookingID, { Position: r.Position }); - await reservationCheckStatus(r.BookingID); - return; - } - continue; - } catch (err) { - continue; - } finally { - if (channel !== undefined) { - await channel.close(); - } - if (connection !== undefined) { - await connection.close(); - } - } - } else { - let institution = new URL(possibleDevices[i]).origin; - let putReturn = await api.newBooking( - { - Devices: [{ ID: possibleDevices[i] }], - Time: { Start: r.Start.toISOString(), End: r.End.toISOString() }, - BookingReference: r.BookingID.toString(), - }, - { url: institution + '/booking/manage' }, - ); - - let ID = putReturn.ReservationID; - - let counter = -1; - while (true) { - counter++; - if (counter >= 50) { - continue nextDevice; - } - await sleep(1000); - - let getReturn = await api.getBooking(institution + '/booking/manage/' + ID); - switch (getReturn.Booking.Status) { - case 'pending': - case 'active-pending': - // Still waiting - continue; - break; - case 'booked': - case 'active': - // Success - await db.execute( - 'UPDATE bookeddevices SET `bookeddevice`=?, `remotereference`=?, `local`=? WHERE `booking`=? AND `originalposition`=?', - [possibleDevices[i], getReturn.Booking.ID, false, r.BookingID, r.Position], - ); - addBookingCallback(new URL(possibleDevices[i]), r.BookingID, { - Position: r.Position, - }); - await reservationCheckStatus(r.BookingID); - return; - break; - case 'rejected': - case 'cancelled': - case 'active-rejected': - // Failure - continue nextDevice; - break; - case undefined: - counter += 10; - continue; - break; - default: - console.log( - 'Unknown API response for getBookingManageByID:', - getReturn.Booking.Status, - ); - counter += 10; - continue; - break; + switch (getReturn.Booking.Status) { + case 'pending': + case 'active-pending': + // Still waiting + continue; + break; + case 'booked': + case 'active': + // Success + await db.execute( + 'UPDATE bookeddevices SET `bookeddevice`=?, `remotereference`=?, `local`=? WHERE `booking`=? AND `originalposition`=?', + [ + possibleDevices[i], + getReturn.Booking.ID, + false, + r.BookingID, + r.Position, + ], + ); + addBookingCallback(new URL(possibleDevices[i]), r.BookingID, { + Position: r.Position, + }); + await reservationCheckStatus(r.BookingID); + return; + break; + case 'rejected': + case 'cancelled': + case 'active-rejected': + // Failure + continue nextDevice; + break; + case undefined: + counter += 10; + continue; + break; + default: + console.error( + 'Unknown API response for getBookingManageByID:', + getReturn.Booking.Status, + ); + counter += 10; + continue; + break; + } } } } + // Ok, we were not able to book a device... + DeleteBooking(r.BookingID, 'rejected', 'Can not book ' + r.Device.toString()); + } finally { + await db.end(); } - - // Ok, we were not able to book a device... - DeleteBooking(r.BookingID, 'rejected', 'Can not book ' + r.Device.toString()); } export async function freeDevice(internalreference: bigint) { @@ -587,10 +638,17 @@ export async function freeDevice(internalreference: bigint) { } // Free now + + // no device actually booked + if (rows[0].local === null) { + return; + } + + // device is booked if (rows[0].local) { // This is a local device - let connection: amqplib.Connection; - let channel: amqplib.Channel; + let connection: amqplib.Connection | undefined; + let channel: amqplib.Channel | undefined; let returnChannel = randomID(); let queueCreated = false; try { @@ -637,6 +695,7 @@ export async function freeDevice(internalreference: bigint) { await channel.deleteQueue(returnChannel); } await channel.close(); + await sleep(250); } if (connection !== undefined) { await connection.close(); @@ -644,8 +703,7 @@ export async function freeDevice(internalreference: bigint) { } } else { // This is a remote devices - let api: APIClient = new APIClient(config.OwnURL, config.API_TOKEN); - await api.deleteBooking(rows[0].remotereference); + await clients.booking.frontend.deleteBooking(rows[0].remotereference); } // Delete form DB @@ -679,9 +737,9 @@ export async function freeDevice(internalreference: bigint) { ); // Commit - db.commit(); + await db.commit(); } catch (err) { - db.rollback(); + await db.rollback(); throw err; } finally { db.end(); @@ -737,6 +795,7 @@ export async function DeleteBooking( ]); [rows, fields] = await db.execute( 'SELECT `id` FROM bookeddevices WHERE booking=?', + [bookingID], ); let connection = await amqplib.connect(config.AmqpUrl); let channel = await connection.createChannel(); @@ -756,12 +815,13 @@ export async function DeleteBooking( } catch (err) { // Don't jump out here, since some devices might already be freed console.error( - 'Got error while cancelling booking, devices might not be freed: ' + - err.toString(), + 'Got error while cancelling booking, devices might not be freed:', + err, ); } finally { - channel.close(); - connection.close(); + await channel.close(); + await sleep(250); + await connection.close(); } break; case 'cancelled': @@ -777,18 +837,25 @@ export async function DeleteBooking( bookingID, ]); let targetMessage: string = ''; - if (rows[0].message === undefined || rows[0].message === null) { + const firstRow = (Array.isArray(rows) ? rows[0] : undefined) as + | { message: string | null | undefined } + | undefined; + if ( + firstRow?.message === undefined || + firstRow?.message === null || + firstRow?.message == '' + ) { targetMessage = message; } else { - targetMessage = rows[0].message + '\n' + message; + targetMessage = firstRow?.message + '\n' + message; } await db.execute('UPDATE booking SET `message`=? WHERE id=?', [ targetMessage, bookingID, ]); } - dispatchCallback(bookingID); await db.commit(); + dispatchCallback(bookingID); } catch (err) { await db.rollback(); throw err; diff --git a/services/booking/src/booking-backend/src/lib.ts b/services/booking/src/booking-backend/src/lib.ts new file mode 100644 index 00000000..45e0ad3e --- /dev/null +++ b/services/booking/src/booking-backend/src/lib.ts @@ -0,0 +1 @@ +export * from './messageDefinition.js'; \ No newline at end of file diff --git a/services/booking/src/booking-backend/src/messageDefinition_test.ts b/services/booking/src/booking-backend/src/messageDefinition_test.ts index 9923c449..41e08c8c 100644 --- a/services/booking/src/booking-backend/src/messageDefinition_test.ts +++ b/services/booking/src/booking-backend/src/messageDefinition_test.ts @@ -1,7 +1,7 @@ import dayjs from 'dayjs'; import * as mocha from 'mocha'; -import { DeviceBookingRequest } from './messageDefinition'; +import { DeviceBookingRequest } from './messageDefinition.js'; (BigInt.prototype as any).toJSON = function () { return this.toString(); @@ -92,7 +92,7 @@ mocha.describe('messageDefinition.ts', function () { try { DeviceBookingRequest.fromString(bad[i]); } catch (err) { - // console.log(err); + console.log(err); fail = true; } if (!fail) { diff --git a/services/booking/src/booking-backend/src/operations.ts b/services/booking/src/booking-backend/src/operations/index.ts similarity index 80% rename from services/booking/src/booking-backend/src/operations.ts rename to services/booking/src/booking-backend/src/operations/index.ts index c01c354f..39e8aaf5 100644 --- a/services/booking/src/booking-backend/src/operations.ts +++ b/services/booking/src/booking-backend/src/operations/index.ts @@ -1,20 +1,27 @@ import * as mysql from 'mysql2/promise'; +import { hackURLWithPort } from '@crosslab/booking-service-common'; -import { config } from './config'; +import { config } from '../config.js'; import { deleteBookingByIDLockSignature, postBookingCallbackByIDSignature, putBookingByIDLock200ResponseType, putBookingByIDLockSignature, -} from './generated/signatures'; -import { dispatchCallback, handleCallback } from './internal'; +} from '../generated/signatures.js'; +import { dispatchCallback, handleCallback } from '../internal.js'; + +(BigInt.prototype as any).toJSON = function () { + return this.toString(); +}; export const putBookingByIDLock: putBookingByIDLockSignature = async ( + request, parameters, - user, ) => { let bookingID: bigint = BigInt(parameters.ID); + await request.authorization.check_authorization_or_fail('edit', `booking:${bookingID}`); + let db = await mysql.createConnection(config.BookingDSN); await db.connect(); await db.beginTransaction(); @@ -40,7 +47,7 @@ export const putBookingByIDLock: putBookingByIDLockSignature = async ( case 'pending': case 'rejected': case 'cancelled': - db.rollback(); + await db.rollback(); return { status: 412, }; @@ -74,8 +81,8 @@ export const putBookingByIDLock: putBookingByIDLockSignature = async ( ); for (let i = 0; i < deviceRows.length; i++) { deviceList.push({ - Requested: deviceRows[i].originaldevice, - Selected: deviceRows[i].bookeddevice, + Requested: hackURLWithPort(deviceRows[i].originaldevice), + Selected: hackURLWithPort(deviceRows[i].bookeddevice), }); } @@ -83,14 +90,12 @@ export const putBookingByIDLock: putBookingByIDLockSignature = async ( status: 200, body: deviceList, }; - } catch (err) { - throw err; } finally { dispatchCallback(bookingID); - db.commit(); + await db.commit(); } } catch (err) { - db.rollback(); + await db.rollback(); throw err; } finally { db.end(); @@ -98,11 +103,13 @@ export const putBookingByIDLock: putBookingByIDLockSignature = async ( }; export const deleteBookingByIDLock: deleteBookingByIDLockSignature = async ( + request, parameters, - user, ) => { let bookingID: bigint = BigInt(parameters.ID); + await request.authorization.check_authorization_or_fail('edit', `booking:${bookingID}`); + let db = await mysql.createConnection(config.BookingDSN); await db.connect(); @@ -120,17 +127,23 @@ export const deleteBookingByIDLock: deleteBookingByIDLockSignature = async ( switch (rows[0].status) { case 'active-rejected': case 'active': - case 'active-pending': await db.execute("UPDATE booking SET `status`='booked' WHERE `id`=?", [ bookingID, ]); dispatchCallback(bookingID); break; + case 'active-pending': + await db.execute("UPDATE booking SET `status`='pending' WHERE `id`=?", [ + bookingID, + ]); + dispatchCallback(bookingID); + break; + case 'pending': case 'rejected': case 'cancelled': - db.rollback(); + await db.rollback(); return { status: 412, }; @@ -143,12 +156,12 @@ export const deleteBookingByIDLock: deleteBookingByIDLockSignature = async ( throw Error('BUG: Unknown booking status ' + rows[0].status); } - db.commit(); + await db.commit(); return { status: 200, }; } catch (err) { - db.rollback(); + await db.rollback(); throw err; } finally { db.end(); @@ -156,8 +169,8 @@ export const deleteBookingByIDLock: deleteBookingByIDLockSignature = async ( }; export const postBookingCallbackByID: postBookingCallbackByIDSignature = async ( + _, parameters, - user, ) => { let db = await mysql.createConnection(config.BookingDSN); await db.connect(); @@ -172,6 +185,7 @@ export const postBookingCallbackByID: postBookingCallbackByIDSignature = async ( status: 404, }; } + await handleCallback( rows[0].type, rows[0].targetbooking, diff --git a/services/booking/src/booking-backend/src/operations/index_test.ts b/services/booking/src/booking-backend/src/operations/index_test.ts new file mode 100644 index 00000000..eb3e0adf --- /dev/null +++ b/services/booking/src/booking-backend/src/operations/index_test.ts @@ -0,0 +1,534 @@ +import { baseConfig, sleep } from '@crosslab/booking-service-common'; +import { + fakeServerConfig, + getFakeInstitutePrefix, + getFakeOwnURL, + getFakeRequest, + getSQLDNS, + resetFakeServerVars, + setupDummySql, + startFakeServer, + stopFakeServer, + tearDownDummySql, +} from '@crosslab/booking-service-test-common'; +import * as mocha from 'mocha'; +import * as mysql from 'mysql2/promise'; + +import { config } from '../config.js'; +import { + deleteBookingByIDLock, + postBookingCallbackByID, + putBookingByIDLock, +} from './index.js'; + +mocha.describe('operations.ts', function () { + this.timeout(10000); + + mocha.before(function () { + // Config - use both global config and local config to ensure different application parts work with same config + baseConfig.OwnURL = getFakeOwnURL(); + baseConfig.InstitutePrefix = getFakeInstitutePrefix(); + baseConfig.ReservationDSN = getSQLDNS(); + baseConfig.BookingDSN = getSQLDNS(); + + config.OwnURL = getFakeOwnURL(); + config.InstitutePrefix = getFakeInstitutePrefix(); + config.ReservationDSN = getSQLDNS(); + config.BookingDSN = getSQLDNS(); + + startFakeServer(); + }); + + mocha.after(function () { + stopFakeServer(); + }); + + mocha.beforeEach(async function () { + // Reset server status + resetFakeServerVars(); + + // Setup database + await setupDummySql(); + }); + + mocha.afterEach(async function () { + await tearDownDummySql(); + }); + + mocha.it('putBookingByIDLock no authorization', async function () { + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + + try { + let isError = false; + try { + await putBookingByIDLock( + getFakeRequest({ user: 'badActor', isAuthorized: false }), + { ID: '1' }, + ); + await sleep(250); + } catch (err) { + if ((err as Error).message == 'test authorization failed') { + isError = true; + } else { + console.log((err as Error).message); + throw err; + } + } + if (!isError) { + throw new Error('no access violation detected'); + } + + // Check if booking still unchanged + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(1)], + ); + if (rows.length == 0) { + throw Error('booking not found'); + } + if (rows[0].status !== 'booked') { + throw new Error('Wrong status ' + rows[0].status); + } + } finally { + db.end(); + } + }); + + mocha.it('putBookingByIDLock lock success', async function () { + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + + try { + let result = await putBookingByIDLock(getFakeRequest(), { ID: '1' }); + await sleep(250); + + if (result.status != 200) { + throw new Error('wrong status ' + result.status); + } + + if (result.body.length != 1) { + throw new Error('number of devices wrong ' + result.body.length); + } + + if ( + result.body[0].Requested != + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong requested devive 0 ' + result.body[0].Requested); + } + + if ( + result.body[0].Selected != + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong selected devive 0 ' + result.body[0].Selected); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(1)], + ); + if (rows.length == 0) { + throw Error('booking not found'); + } + if (rows[0].status !== 'active') { + throw new Error('Wrong status ' + rows[0].status); + } + + if (!fakeServerConfig.callback_test_local_single_was_called) { + throw new Error('callback not called'); + } + } finally { + db.end(); + } + }); + + mocha.it('putBookingByIDLock lock success multiple', async function () { + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + + try { + let result = await putBookingByIDLock(getFakeRequest(), { ID: '2' }); + await sleep(250); + + if (result.status != 200) { + throw new Error('wrong status ' + result.status); + } + + if (result.body.length != 2) { + throw new Error('number of devices wrong ' + result.body.length); + } + + if ( + result.body[0].Requested != + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong requested devive 0 ' + result.body[0].Requested); + } + + if ( + result.body[0].Selected != + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong selected devive 0 ' + result.body[0].Selected); + } + + if ( + result.body[1].Requested != + 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong requested devive 0 ' + result.body[1].Requested); + } + + if ( + result.body[1].Selected != + 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong selected devive 0 ' + result.body[1].Selected); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(2)], + ); + if (rows.length == 0) { + throw Error('booking not found'); + } + if (rows[0].status !== 'active') { + throw new Error('Wrong status ' + rows[0].status); + } + + if (!fakeServerConfig.callback_test_local_two_first_was_called) { + throw new Error('callback not called'); + } + if (!fakeServerConfig.callback_test_local_two_second_was_called) { + throw new Error('callback not called'); + } + } finally { + db.end(); + } + }); + + mocha.it('putBookingByIDLock lock success group', async function () { + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + + try { + let result = await putBookingByIDLock(getFakeRequest(), { ID: '3' }); + await sleep(250); + + if (result.status != 200) { + throw new Error('wrong status ' + result.status); + } + + if (result.body.length != 1) { + throw new Error('number of devices wrong ' + result.body.length); + } + + if ( + result.body[0].Requested != + 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000010' + ) { + throw new Error('wrong requested devive 0 ' + result.body[0].Requested); + } + + if ( + result.body[0].Selected != + 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong selected devive 0 ' + result.body[0].Selected); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(3)], + ); + if (rows.length == 0) { + throw Error('booking not found'); + } + if (rows[0].status !== 'active') { + throw new Error('Wrong status ' + rows[0].status); + } + + if (!fakeServerConfig.callback_test_local_group_was_called) { + throw new Error('callback not called'); + } + } finally { + db.end(); + } + }); + + mocha.it('putBookingByIDLock already locked', async function () { + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + + try { + await db.execute('UPDATE booking SET `status`=? WHERE `id`=?', [ + 'active', + BigInt(1), + ]); + let result = await putBookingByIDLock(getFakeRequest(), { ID: '1' }); + await sleep(250); + + if (result.status != 200) { + throw new Error('wrong status ' + result.status); + } + + if (result.body.length != 1) { + throw new Error('number of devices wrong ' + result.body.length); + } + + if ( + result.body[0].Requested != + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong requested devive 0 ' + result.body[0].Requested); + } + + if ( + result.body[0].Selected != + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong selected devive 0 ' + result.body[0].Selected); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(1)], + ); + if (rows.length == 0) { + throw Error('booking not found'); + } + if (rows[0].status !== 'active') { + throw new Error('Wrong status ' + rows[0].status); + } + } finally { + db.end(); + } + }); + + mocha.it('putBookingByIDLock wrong status', async function () { + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + + try { + await db.execute('UPDATE booking SET `status`=? WHERE `id`=?', [ + 'pending', + BigInt(1), + ]); + let result = await putBookingByIDLock(getFakeRequest(), { ID: '1' }); + await sleep(250); + + if (result.status != 412) { + throw new Error('wrong status ' + result.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(1)], + ); + if (rows.length == 0) { + throw Error('booking not found'); + } + if (rows[0].status !== 'pending') { + throw new Error('Wrong status ' + rows[0].status); + } + } finally { + db.end(); + } + }); + + mocha.it('putBookingByIDLock no booking', async function () { + try { + let res = await putBookingByIDLock( + getFakeRequest({ user: 'unittest.user', isAuthorized: true }), + { ID: '999999999999999' }, + ); + await sleep(250); + if (res.status != 404) { + throw new Error('wrong status ' + res.status); + } + } finally { + } + }); + + mocha.it('deleteBookingByIDLock no authorization', async function () { + let isError = false; + try { + await deleteBookingByIDLock( + getFakeRequest({ user: 'badActor', isAuthorized: false }), + { ID: '' }, + ); + await sleep(250); + } catch (err) { + if ((err as Error).message == 'test authorization failed') { + isError = true; + } else { + console.log((err as Error).message); + throw err; + } + } + if (!isError) { + throw new Error('no access violation detected'); + } + }); + + mocha.it('deleteBookingByIDLock unlock success', async function () { + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + + try { + await db.execute('UPDATE booking SET `status`=? WHERE `id`=?', [ + 'active', + BigInt(1), + ]); + let result = await deleteBookingByIDLock(getFakeRequest(), { ID: '1' }); + await sleep(250); + + if (result.status != 200) { + throw new Error('wrong status ' + result.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(1)], + ); + if (rows.length == 0) { + throw Error('booking not found'); + } + if (rows[0].status !== 'booked') { + throw new Error('Wrong status ' + rows[0].status); + } + + if (!fakeServerConfig.callback_test_local_single_was_called) { + throw new Error('callback not called'); + } + } finally { + db.end(); + } + }); + + mocha.it('deleteBookingByIDLock already unlocked', async function () { + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + + try { + let result = await deleteBookingByIDLock(getFakeRequest(), { ID: '1' }); + await sleep(250); + + if (result.status != 200) { + throw new Error('wrong status ' + result.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(1)], + ); + if (rows.length == 0) { + throw Error('booking not found'); + } + if (rows[0].status !== 'booked') { + throw new Error('Wrong status ' + rows[0].status); + } + } finally { + db.end(); + } + }); + + mocha.it('deleteBookingByIDLock wrong status', async function () { + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + + try { + await db.execute('UPDATE booking SET `status`=? WHERE `id`=?', [ + 'pending', + BigInt(1), + ]); + let result = await deleteBookingByIDLock(getFakeRequest(), { ID: '1' }); + await sleep(250); + + if (result.status != 412) { + throw new Error('wrong status ' + result.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(1)], + ); + if (rows.length == 0) { + throw Error('booking not found'); + } + if (rows[0].status !== 'pending') { + throw new Error('Wrong status ' + rows[0].status); + } + } finally { + db.end(); + } + }); + + mocha.it('deleteBookingByIDLock edge case active-pending', async function () { + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + + try { + await db.execute('UPDATE booking SET `status`=? WHERE `id`=?', [ + 'active-pending', + BigInt(1), + ]); + let result = await deleteBookingByIDLock(getFakeRequest(), { ID: '1' }); + await sleep(250); + + if (result.status != 200) { + throw new Error('wrong status ' + result.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(1)], + ); + if (rows.length == 0) { + throw Error('booking not found'); + } + if (rows[0].status !== 'pending') { + throw new Error('Wrong status ' + rows[0].status); + } + } finally { + db.end(); + } + }); + + mocha.it('deleteBookingByIDLock no booking', async function () { + try { + let res = await deleteBookingByIDLock( + getFakeRequest({ user: 'unittest.user', isAuthorized: true }), + { ID: '999999999999999' }, + ); + await sleep(250); + if (res.status != 404) { + throw new Error('wrong status ' + res.status); + } + } finally { + } + }); + + mocha.it('postBookingCallbackByID success', async function () { + await postBookingCallbackByID(getFakeRequest(), { ID: '1' }); + await sleep(250); + }); + + mocha.it('putBookingByIDLock no booking', async function () { + try { + let res = await postBookingCallbackByID( + getFakeRequest({ user: 'unittest.user', isAuthorized: true }), + { ID: '999999999999999' }, + ); + await sleep(250); + if (res.status != 404) { + throw new Error('wrong status ' + res.status); + } + } finally { + } + }); +}); diff --git a/services/booking/src/booking-backend/tsconfig.json b/services/booking/src/booking-backend/tsconfig.json index 61b5acc3..22df9194 100644 --- a/services/booking/src/booking-backend/tsconfig.json +++ b/services/booking/src/booking-backend/tsconfig.json @@ -1,13 +1,25 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "Node", - "target": "ES2020", + "module": "Node16", + "moduleResolution": "Node16", + "allowSyntheticDefaultImports": true, + "target": "ES2022", + "lib": ["ES2022"], + "esModuleInterop": true, "outDir": "app", "rootDir": "src", - "declaration": true, - "declarationMap": true, + "strict": true, + "noImplicitAny": true, + // "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + // "noFallthroughCasesInSwitch": true, "sourceMap": true, - "esModuleInterop": true - } + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "skipLibCheck": true, + "declaration": true, + "declarationMap": true + }, + "include": ["src"] } diff --git a/services/booking/src/booking-frontend/.env-cmdrc b/services/booking/src/booking-frontend/.env-cmdrc index 88810370..f26f6c9b 100644 --- a/services/booking/src/booking-frontend/.env-cmdrc +++ b/services/booking/src/booking-frontend/.env-cmdrc @@ -1,9 +1,6 @@ { - "development": { - "SECURITY_ISSUER": "http://localhost", - "SECURITY_AUDIENCE": "http://localhost", - "BASE_URL": "http://localhost", - "PORT": "3000", - "API_TOKEN": "booking-service-dev-token" - } -} \ No newline at end of file + "development": { + "BASE_URL": "http://localhost:10801", + "PORT": "10801" + } +} diff --git a/services/booking/src/booking-frontend/Dockerfile b/services/booking/src/booking-frontend/Dockerfile new file mode 100644 index 00000000..68f4f9c0 --- /dev/null +++ b/services/booking/src/booking-frontend/Dockerfile @@ -0,0 +1,17 @@ +# Build Image +FROM node:lts-alpine AS build +WORKDIR /tmp +COPY .packages /tmp/packages +RUN npm install --global /tmp/packages/* +RUN rm -rf /tmp/packages + +RUN apk add dumb-init +WORKDIR /app +RUN mkdir db +RUN chown node:node /app/* +USER node + +ENV NODE_ENV production +ENV PORT 3004 +EXPOSE 3004/tcp +CMD ["dumb-init", "crosslab-booking-frontend"] \ No newline at end of file diff --git a/services/booking/src/booking-frontend/api/component.yml b/services/booking/src/booking-frontend/api/component.yml index 73ea924f..bdbbb3a9 100644 --- a/services/booking/src/booking-frontend/api/component.yml +++ b/services/booking/src/booking-frontend/api/component.yml @@ -1,91 +1,99 @@ -/booking: - post: - operationId: 'newBooking' - security: - - JWT: [] - tags: - - booking-frontend - summary: Books an experiment. - x-optional-url: true - requestBody: - content: - application/json: - schema: - type: object - required: - - Devices - - Time - properties: - Devices: - type: array - description: List of devices which should be added. - items: - $ref: '#/components/schemas/Device' - Time: - $ref: '#/components/schemas/Timeslot' - Type: - description: Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. - type: string - enum: - - normal - responses: - '200': - description: The booking was accepted. The booking status will display whether the booking of all devices was successful. + /booking: + post: + operationId: 'newBooking' + security: + - JWT: + - booking + - booking:use + tags: + - booking-frontend + summary: Books an experiment. + x-optional-url: true + requestBody: + required: true content: application/json: schema: type: object required: - - BookingID + - Devices + - Time properties: - BookingID: + Devices: + type: array + description: List of devices which should be added. + items: + $ref: '#/components/schemas/Device' + Time: + $ref: '#/components/schemas/Timeslot' + Type: + description: Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. type: string - format: uri - description: ID at which the booking can be managed. - '401': - description: No authorisation header found. - '500': - description: >- - Request could not be answered. An error string containing the reason - will be returned. + enum: + - normal + responses: + '200': + description: The booking was accepted. The booking status will display whether the booking of all devices was successful. + content: + application/json: + schema: + type: object + required: + - BookingID + properties: + BookingID: + type: string + format: uri + description: ID at which the booking can be managed. + '401': + description: No authorisation header found. + '403': + description: >- + Caller is not allowed to call this method. Usually, caller is missing required scopes. + '500': + description: >- + Request could not be answered. An error string containing the reason + will be returned. + content: + application/json: + schema: + description: Error description + type: string + '503': + description: >- + Service is unable to respond in time, possibly overloaded. Try again in a few minutes. + /booking/{ID}: + patch: + operationId: 'updateBooking' + security: + - JWT: [] + parameters: + - $ref: '#/components/parameters/ID' + name: ID + schema: + type: string + required: true + description: ID of Booking + tags: + - booking-frontend + summary: > + Allows the addition of devices to a booking (removing of devices is not supportet) or the registration of callbacks. + For adding devices, the scope 'booking:use' is required. + requestBody: content: application/json: schema: - description: Error description - type: string - '503': - description: >- - Service is unable to respond in time, possibly overloaded. Try again in a few minutes. -/booking/{ID}: - patch: - operationId: 'updateBooking' - security: - - JWT: [] - parameters: - - $ref: '#/components/parameters/ID' - name: ID - schema: - type: string - required: true - description: ID of Booking - tags: - - booking-frontend - summary: Allows the addition of devices to a booking (removing of devices is not supportet) or the registration of callbacks. - requestBody: - content: - application/json: - schema: - anyOf: - - type: object - description: Use this request for adding devices. - properties: - Locked: - type: boolean - description: Expresses whether the devices should be locked. Must match current status of booking. - Devices: - type: array - description: List of devices which should be added. - items: + anyOf: + - type: object + description: Use this request for adding devices. + properties: + Locked: + type: boolean + description: Expresses whether the devices should be locked. Must match current status of booking. Is assumed to be false if not set. + Devices: + type: array + description: List of devices which should be added. + items: $ref: '#/components/schemas/Device' - type: object description: Use this request for adding callbacks. @@ -94,160 +102,185 @@ type: string format: uri description: Callback which should be called at changes. - required: true - responses: - '200': - description: The booking change was accepted. The booking status will display whether the booking of all devices was successful. - content: - application/json: - schema: - type: object - required: - - BookingID - properties: - BookingID: - type: string - format: uri - '401': - description: No authorisation header found. - '404': - description: Request contains unknown booking ID. - '423': - description: >- - The booking 'locked' status and the requested locked status do not match. - '500': - description: >- - Request could not be answered. An error string containing the reason - will be returned. - content: - application/json: - schema: - type: string - description: Error description - '503': - description: >- - Service is unable to respond in time, possibly overloaded. Try again in a few minutes. - delete: - operationId: 'deleteBooking' - security: - - JWT: [] - parameters: - - $ref: '#/components/parameters/ID' - name: ID - schema: - type: string required: true - description: ID of Booking - tags: - - booking-frontend - summary: Cancels a booking, as long as the booking was originally done by you. - responses: - '200': - description: >- - The booking was cancelled. All associated devices were released. - '401': - description: No authorisation header found. - '404': - description: Request contains unknown booking ID. - '423': - description: >- - The booking is currently locked, deletion not possible. - '500': - description: >- - Request could not be answered. An error string containing the reason - will be returned. - content: - application/json: - schema: - type: string - description: Error description - '503': - description: >- - Service is unable to respond in time, possibly overloaded. Try again in a few minutes. - get: - operationId: 'getBooking' - security: - - JWT: [] - parameters: - - $ref: '#/components/parameters/ID' - name: ID - schema: - type: string - required: true - description: ID of Booking - tags: - - booking-frontend - summary: >- - Returns whether a list of devices is currently booked for a user - responses: - '200': - description: Returns the current booking. - content: - application/json: - schema: - type: object - required: - - Booking - - Locked - properties: - Booking: - $ref: '#/components/schemas/Booking' - Locked: - type: boolean - description: Shows if the booking is in a locked status. - '401': - description: No authorisation header found. - '404': - description: Request contains unknown ID - '500': - description: >- - Request could not be answered. An error string containing the reason - will be returned. - content: - application/json: - schema: - type: string - description: Error code - '503': - description: >- - Service is unable to respond in time, possibly overloaded. Try again in a few minutes. -/booking/{ID}/destroy: - delete: - operationId: 'destroyBooking' - security: - - JWT: [] - parameters: - - $ref: '#/components/parameters/ID' - name: ID - schema: - type: string - required: true - description: ID of Booking - tags: + responses: + '200': + description: The booking change was accepted. The booking status will display whether the booking of all devices was successful. + content: + application/json: + schema: + type: object + required: + - BookingID + properties: + BookingID: + type: string + format: uri + '400': + description: >- + The request was not build correctly (e.g. both Devices and Callback are requested). + See error returned for more details + content: + application/json: + schema: + type: string + description: Error description + '401': + description: No authorisation header found. + '403': + description: >- + Caller is not allowed to call this method. Usually, caller is missing required scopes. + '404': + description: Request contains unknown booking ID. + '423': + description: >- + The booking 'locked' status and the requested locked status do not match. + '500': + description: >- + Request could not be answered. An error string containing the reason + will be returned. + content: + application/json: + schema: + type: string + description: Error description + '503': + description: >- + Service is unable to respond in time, possibly overloaded. Try again in a few minutes. + delete: + operationId: 'deleteBooking' + security: + - JWT: + - booking + - booking:use + parameters: + - $ref: '#/components/parameters/ID' + name: ID + schema: + type: string + required: true + description: ID of Booking + tags: + - booking-frontend + summary: Cancels a booking, as long as the booking was originally done by you. + responses: + '200': + description: >- + The booking was cancelled. All associated devices were released. + '401': + description: No authorisation header found. + '403': + description: >- + Caller is not allowed to call this method. Usually, caller is missing required scopes. + '404': + description: Request contains unknown booking ID. + '423': + description: >- + The booking is currently locked, deletion not possible. + '500': + description: >- + Request could not be answered. An error string containing the reason + will be returned. + content: + application/json: + schema: + type: string + description: Error description + '503': + description: >- + Service is unable to respond in time, possibly overloaded. Try again in a few minutes. + get: + operationId: 'getBooking' + security: + - JWT: + - booking + - booking:use + parameters: + - $ref: '#/components/parameters/ID' + name: ID + schema: + type: string + required: true + description: ID of Booking + tags: - booking-frontend - summary: Allows selected persons (like lab manager) to remove a user booking. To avoid mistakes, this is a different path than normal delete. - responses: - '200': - description: >- - The booking was cancelled. All associated devices were released. - '401': - description: No authorisation header found. - '403': - description: User is not allowed to destroy bookings. - '404': - description: Request contains unknown booking ID. - '423': - description: >- - The booking is currently locked, deletion not possible. - '500': - description: >- - Request could not be answered. An error string containing the reason - will be returned. - content: - application/json: - schema: - type: string - description: Error description - '503': - description: >- - Service is unable to respond in time, possibly overloaded. Try again in a few minutes. + summary: >- + Returns whether a list of devices is currently booked for a user. + responses: + '200': + description: Returns the current booking. + content: + application/json: + schema: + type: object + required: + - Booking + - Locked + properties: + Booking: + $ref: '#/components/schemas/Booking' + Locked: + type: boolean + description: Shows if the booking is in a locked status. + '401': + description: No authorisation header found. + '403': + description: >- + Caller is not allowed to call this method. Usually, caller is missing required scopes. + '404': + description: Request contains unknown ID + '500': + description: >- + Request could not be answered. An error string containing the reason + will be returned. + content: + application/json: + schema: + type: string + description: Error code + '503': + description: >- + Service is unable to respond in time, possibly overloaded. Try again in a few minutes. + /booking/{ID}/destroy: + delete: + operationId: 'destroyBooking' + security: + - JWT: + - booking + - booking:destroy + parameters: + - $ref: '#/components/parameters/ID' + name: ID + schema: + type: string + required: true + description: ID of Booking + tags: + - booking-frontend + summary: Allows selected persons (like lab manager) to remove a user booking. To avoid mistakes, this is a different path than normal delete. + responses: + '200': + description: >- + The booking was cancelled. All associated devices were released. + '401': + description: No authorisation header found. + '403': + description: >- + Caller is not allowed to call this method. Usually, caller is missing required scopes. + '404': + description: Request contains unknown booking ID. + '423': + description: >- + The booking is currently locked, deletion not possible. + '500': + description: >- + Request could not be answered. An error string containing the reason + will be returned. + content: + application/json: + schema: + type: string + description: Error description + '503': + description: >- + Service is unable to respond in time, possibly overloaded. Try again in a few minutes. diff --git a/services/booking/src/booking-frontend/package-lock.json b/services/booking/src/booking-frontend/package-lock.json new file mode 100644 index 00000000..f9682092 --- /dev/null +++ b/services/booking/src/booking-frontend/package-lock.json @@ -0,0 +1,4531 @@ +{ + "name": "@crosslab/service-booking-frontend", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@crosslab/service-booking-frontend", + "version": "0.0.1", + "license": "Apache-2.0", + "dependencies": { + "@crosslab/booking-service-common": "file:../common", + "@crosslab/service-booking-backend": "file:../booking-backend", + "@crosslab/service-common": "file:../../../common", + "ajv-formats": "^3.0.1", + "amqplib": "^0.10.2", + "dayjs": "^1.11.7", + "express": "^4.18.1", + "mysql2": "^3.6.0" + }, + "bin": { + "crosslab-booking-frontend": "app/index.js" + }, + "devDependencies": { + "@cross-lab-project/codegen-typescript-addon": "file:../../../../helper/crosslab-typescript-addon", + "@cross-lab-project/openapi-codegen": "file:../../../../helper/openapi-codegeneration", + "@crosslab/booking-service-test-common": "file:../test_common", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/amqplib": "^0.10.1", + "@types/express": "^4.17.13", + "@types/mocha": "^10.0.6", + "c8": "^10.1.2", + "env-cmd": "^10.1.0", + "mocha": "^10.4.0", + "npm-run-all": "^4.1.5", + "prettier": "^3.0.3", + "typescript": "^5.5.4" + } + }, + "../../../../helper/crosslab-typescript-addon": { + "name": "@cross-lab-project/codegen-typescript-addon", + "dev": true, + "license": "UNLICENSED", + "dependencies": { + "@apidevtools/swagger-parser": "^10.1.0", + "nunjucks": "^3.2.3" + }, + "devDependencies": { + "@cross-lab-project/openapi-codegen": "file:../openapi-codegeneration", + "@eslint/js": "^9.9.0", + "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@types/eslint__js": "^8.42.3", + "@types/node": "^22.1.0", + "@types/nunjucks": "^3.2.6", + "@types/seedrandom": "^3.0.8", + "copyfiles": "^2.4.1", + "eslint": "^9.8.0", + "openapi-types": "^12.1.3", + "prettier": "^3.3.3", + "tsc-watch": "^6.2.0", + "typescript": "^5.5.4", + "typescript-eslint": "^8.1.0" + }, + "peerDependencies": { + "@cross-lab-project/openapi-codegen": "file:../openapi-codegeneration", + "ajv": "^8.11.0", + "ajv-formats": "^3.0.1" + } + }, + "../../../../helper/openapi-codegeneration": { + "name": "@cross-lab-project/openapi-codegen", + "dev": true, + "license": "UNLICENSED", + "dependencies": { + "@apidevtools/swagger-parser": "^10.1.0", + "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", + "commander": "^12.1.0", + "deterministic-json-schema-faker": "^0.5.0-rcv.46", + "glob": "^11.0.0", + "json-schema-merge-allof": "^0.8.1", + "json-schema-to-typescript": "^15.0.0", + "nunjucks": "^3.2.4", + "quicktype-core": "^23.0.170", + "seedrandom": "^3.0.5", + "tiny-typed-emitter": "^2.1.0", + "yaml": "^2.5.0" + }, + "bin": { + "openapi-codegen": "lib/cjs/index.js" + }, + "devDependencies": { + "@eslint/js": "^9.9.0", + "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@types/eslint__js": "^8.42.3", + "@types/node": "^22.1.0", + "@types/nunjucks": "^3.2.6", + "@types/seedrandom": "^3.0.8", + "eslint": "^9.8.0", + "openapi-types": "^12.1.3", + "prettier": "^3.0.3", + "tsc-watch": "^6.2.0", + "typescript": "^5.5.4", + "typescript-eslint": "^8.1.0" + } + }, + "../../../common": { + "name": "@crosslab/service-common", + "license": "UNLICENSED", + "dependencies": { + "express": "^4.18.1", + "express-winston": "^4.2.0", + "fetch-retry": "^6.0.0", + "jose": "^5.6.3", + "mysql": "^2.18.1", + "sqlite3": "^5.1.7", + "typeorm": "^0.3.20", + "uuid": "^10.0.0", + "winston": "^3.14.1", + "winston-loki": "^6.1.2" + }, + "devDependencies": { + "@eslint/js": "^9.9.0", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/eslint__js": "^8.42.3", + "@types/express": "^4.17.21", + "@types/mocha": "^10.0.7", + "@types/node": "^22.1.0", + "@types/uuid": "^10.0.0", + "eslint": "^9.8.0", + "mocha": "^10.7.0", + "prettier": "^3.3.3", + "typescript": "^5.5.4", + "typescript-eslint": "^8.1.0" + } + }, + "../booking-backend": { + "name": "@crosslab/service-booking-backend", + "version": "0.0.1", + "license": "Apache-2.0", + "dependencies": { + "@cross-lab-project/api-client": "file:../../../../clients/api/js", + "@crosslab/booking-service-common": "file:../common", + "@crosslab/service-common": "file:../../../common", + "@crosslab/service-device-reservation": "file:../device-reservation", + "ajv-formats": "^3.0.1", + "amqplib": "^0.10.2", + "dayjs": "^1.11.5", + "express": "^4.18.1", + "lodash": "^4.17.21", + "mysql2": "^3.11.0" + }, + "bin": { + "crosslab-booking-backend": "app/index.js" + }, + "devDependencies": { + "@cross-lab-project/codegen-typescript-addon": "file:../../../../helper/crosslab-typescript-addon", + "@cross-lab-project/openapi-codegen": "file:../../../../helper/openapi-codegeneration", + "@crosslab/booking-service-test-common": "file:../test_common", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/amqplib": "^0.10.1", + "@types/express": "^4.17.13", + "@types/lodash": "^4.14.198", + "@types/mocha": "^10.0.0", + "c8": "^10.1.2", + "env-cmd": "^10.1.0", + "mocha": "^10.0.0", + "npm-run-all": "^4.1.5", + "prettier": "^3.0.3", + "typescript": "^5.5.4", + "why-is-node-running": "^2.2.2" + } + }, + "../common": { + "name": "@crosslab/booking-service-common", + "version": "0.0.1", + "license": "Apache-2.0", + "dependencies": { + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/express": "^4.17.13", + "ajv-formats": "^3.0.1", + "express": "^4.18.1", + "node-fetch": "^3.3.2" + }, + "devDependencies": { + "@cross-lab-project/codegen-typescript-addon": "file:../../../../helper/crosslab-typescript-addon", + "@cross-lab-project/openapi-codegen": "file:../../../../helper/openapi-codegeneration", + "@types/express": "^4.17.13", + "@types/node": "^20.5.9", + "@types/node-fetch": "^2.6.4", + "npm-run-all": "^4.1.5", + "prettier": "^3.0.3", + "typescript": "^5.2.2" + } + }, + "../test_common": { + "name": "@crosslab/booking-service-test-common", + "version": "0.0.1", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@crosslab/booking-service-common": "file:../common", + "@crosslab/service-device-reservation": "file:../device-reservation", + "amqplib": "^0.10.3", + "dayjs": "^1.11.5", + "express": "^4.18.1", + "mysql2": "^3.6.0", + "typescript": "^5.5.4" + }, + "devDependencies": { + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/amqplib": "^0.10.1", + "@types/express": "^4.17.13", + "node-mocks-http": "^1.14.1", + "prettier": "^3.0.3" + } + }, + "node_modules/@acuminous/bitsyntax": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@acuminous/bitsyntax/-/bitsyntax-0.1.2.tgz", + "integrity": "sha512-29lUK80d1muEQqiUsSo+3A0yP6CdspgC95EnKBMi22Xlwt79i/En4Vr67+cXhU+cZjbti3TgGGC5wy1stIywVQ==", + "dependencies": { + "buffer-more-ints": "~1.0.0", + "debug": "^4.3.4", + "safe-buffer": "~5.1.2" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/generator": { + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", + "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "dev": true, + "dependencies": { + "@babel/types": "^7.17.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", + "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-environment-visitor/node_modules/@babel/types": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.8.tgz", + "integrity": "sha512-SkSBEHwwJRU52QEVZBmMBnE5Ux2/6WU1grdYyOhpbCNxbmJrDuDCphBzKZSO3taf0zztp+qkWlymE5tVL5l0TA==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", + "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", + "dev": true, + "dependencies": { + "@babel/template": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name/node_modules/@babel/types": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.8.tgz", + "integrity": "sha512-SkSBEHwwJRU52QEVZBmMBnE5Ux2/6WU1grdYyOhpbCNxbmJrDuDCphBzKZSO3taf0zztp+qkWlymE5tVL5l0TA==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", + "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.8.tgz", + "integrity": "sha512-SkSBEHwwJRU52QEVZBmMBnE5Ux2/6WU1grdYyOhpbCNxbmJrDuDCphBzKZSO3taf0zztp+qkWlymE5tVL5l0TA==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", + "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.8.tgz", + "integrity": "sha512-SkSBEHwwJRU52QEVZBmMBnE5Ux2/6WU1grdYyOhpbCNxbmJrDuDCphBzKZSO3taf0zztp+qkWlymE5tVL5l0TA==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", + "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.8.tgz", + "integrity": "sha512-WzfbgXOkGzZiXXCqk43kKwZjzwx4oulxZi3nq2TYL9mOjQv6kYwul9mz6ID36njuL7Xkp6nJEfok848Zj10j/w==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", + "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template/node_modules/@babel/types": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.8.tgz", + "integrity": "sha512-SkSBEHwwJRU52QEVZBmMBnE5Ux2/6WU1grdYyOhpbCNxbmJrDuDCphBzKZSO3taf0zztp+qkWlymE5tVL5l0TA==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/generator": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.8.tgz", + "integrity": "sha512-47DG+6F5SzOi0uEvK4wMShmn5yY0mVjVJoWTphdY2B4Rx9wHgjK7Yhtr0ru6nE+sn0v38mzrWOlah0p/YlHHOQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.24.8", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/types": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.8.tgz", + "integrity": "sha512-SkSBEHwwJRU52QEVZBmMBnE5Ux2/6WU1grdYyOhpbCNxbmJrDuDCphBzKZSO3taf0zztp+qkWlymE5tVL5l0TA==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", + "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@cross-lab-project/codegen-typescript-addon": { + "resolved": "../../../../helper/crosslab-typescript-addon", + "link": true + }, + "node_modules/@cross-lab-project/openapi-codegen": { + "resolved": "../../../../helper/openapi-codegeneration", + "link": true + }, + "node_modules/@crosslab/booking-service-common": { + "resolved": "../common", + "link": true + }, + "node_modules/@crosslab/booking-service-test-common": { + "resolved": "../test_common", + "link": true + }, + "node_modules/@crosslab/service-booking-backend": { + "resolved": "../booking-backend", + "link": true + }, + "node_modules/@crosslab/service-common": { + "resolved": "../../../common", + "link": true + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.3.0.tgz", + "integrity": "sha512-r3n0onD3BTOVUNPhR4lhVK4/pABGpbA7bW3eumZnYdKaHkf1qEC+Mag6DPbGNuuh0eG8AaYj+YqmVHSiGslaTQ==", + "dev": true, + "dependencies": { + "@babel/generator": "7.17.7", + "@babel/parser": "^7.20.5", + "@babel/traverse": "7.23.2", + "@babel/types": "7.17.0", + "javascript-natural-sort": "0.7.1", + "lodash": "^4.17.21" + }, + "peerDependencies": { + "@vue/compiler-sfc": "3.x", + "prettier": "2.x - 3.x" + }, + "peerDependenciesMeta": { + "@vue/compiler-sfc": { + "optional": true + } + } + }, + "node_modules/@types/amqplib": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@types/amqplib/-/amqplib-0.10.5.tgz", + "integrity": "sha512-/cSykxROY7BWwDoi4Y4/jLAuZTshZxd8Ey1QYa/VaXriMotBDoou7V/twJiOSHzU6t1Kp1AHAUXGCgqq+6DNeg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/body-parser": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "dev": true, + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", + "dev": true, + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.19.5", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.5.tgz", + "integrity": "sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", + "dev": true + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true + }, + "node_modules/@types/mocha": { + "version": "10.0.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.7.tgz", + "integrity": "sha512-GN8yJ1mNTcFcah/wKEFIJckJx9iJLoMSzWcfRRuxz/Jk+U6KQNnml+etbtxFK8lPjzOw3zp4Ha/kjSst9fsHYw==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.14.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", + "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/qs": { + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", + "dev": true + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true + }, + "node_modules/@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", + "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", + "dev": true, + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ajv": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz", + "integrity": "sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.4.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/amqplib": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/amqplib/-/amqplib-0.10.4.tgz", + "integrity": "sha512-DMZ4eCEjAVdX1II2TfIUpJhfKAuoCeDIo/YyETbfAqehHTXxxs7WOOd+N1Xxr4cKhx12y23zk8/os98FxlZHrw==", + "dependencies": { + "@acuminous/bitsyntax": "^0.1.2", + "buffer-more-ints": "~1.0.0", + "readable-stream": "1.x >=1.1.9", + "url-parse": "~1.5.10" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "node_modules/buffer-more-ints": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-more-ints/-/buffer-more-ints-1.0.0.tgz", + "integrity": "sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg==" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/c8": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/c8/-/c8-10.1.2.tgz", + "integrity": "sha512-Qr6rj76eSshu5CgRYvktW0uM0CFY0yi4Fd5D0duDXO6sYinyopmftUiJVuzBQxQcwQLor7JWDVRP+dUfCmzgJw==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.3", + "find-up": "^5.0.0", + "foreground-child": "^3.1.1", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.1.6", + "test-exclude": "^7.0.1", + "v8-to-istanbul": "^9.0.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1" + }, + "bin": { + "c8": "bin/c8.js" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "monocart-coverage-reports": "^2" + }, + "peerDependenciesMeta": { + "monocart-coverage-reports": { + "optional": true + } + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-disposition/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/dayjs": { + "version": "1.11.11", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.11.tgz", + "integrity": "sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==" + }, + "node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/env-cmd": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/env-cmd/-/env-cmd-10.1.0.tgz", + "integrity": "sha512-mMdWTT9XKN7yNth/6N6g2GuKuJTsKMDHlQFUDacb/heQRRWOTIZ42t1rMHnQu4jYxU1ajdTeJM+9eEETlqToMA==", + "dev": true, + "dependencies": { + "commander": "^4.0.0", + "cross-spawn": "^7.0.0" + }, + "bin": { + "env-cmd": "bin/env-cmd.js" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/express/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "bin": { + "flat": "cli.js" + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/foreground-child": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz", + "integrity": "sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "dependencies": { + "is-property": "^1.0.2" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", + "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", + "dev": true, + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/javascript-natural-sort": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/log-symbols/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "node_modules/lru-cache": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz", + "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==", + "engines": { + "node": ">=16.14" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mocha": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.6.0.tgz", + "integrity": "sha512-hxjt4+EEB0SA0ZDygSS015t65lJw/I2yRCS3Ae+SJ5FrbzrXgfYwJr96f0OvIXdj7h4lv/vLCrH3rkiuizFSvw==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^8.1.0", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/mocha/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/mocha/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/mysql2": { + "version": "3.10.2", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.10.2.tgz", + "integrity": "sha512-KCXPEvAkO0RcHPr362O5N8tFY2fXvbjfkPvRY/wGumh4EOemo9Hm5FjQZqv/pCmrnuxGu5OxnSENG0gTXqKMgQ==", + "dependencies": { + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.6.3", + "long": "^5.2.1", + "lru-cache": "^8.0.0", + "named-placeholders": "^1.1.3", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/mysql2/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", + "dependencies": { + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/named-placeholders/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/npm-run-all/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/npm-run-all/node_modules/cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/npm-run-all/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/npm-run-all/node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/npm-run-all/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", + "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", + "dev": true + }, + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true, + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/prettier": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/seq-queue": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", + "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.18", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.18.tgz", + "integrity": "sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==", + "dev": true + }, + "node_modules/sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.padend": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.6.tgz", + "integrity": "sha512-XZpspuSB7vJWhvJc9DLSlrXl1mcA2BdoY5jjnS135ydXqLoqhs96JjDtCkjJEQHvfqZIp9hBuBMgI589peyx9Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/test-exclude": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.1.tgz", + "integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^10.4.1", + "minimatch": "^9.0.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/workerpool": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/services/booking/src/booking-frontend/package.json b/services/booking/src/booking-frontend/package.json index 6c721563..75fd1a9f 100644 --- a/services/booking/src/booking-frontend/package.json +++ b/services/booking/src/booking-frontend/package.json @@ -1,13 +1,22 @@ { + "type": "module", "name": "@crosslab/service-booking-frontend", "version": "0.0.1", "description": "Part of booking service. Main service with which a user interacts.", "main": "app/index.js", + "dockerName": "booking-frontend", + "bin": { + "crosslab-booking-frontend": "./app/index.js" + }, + "files": [ + "app" + ], "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", + "test": "npm run build && env-cmd -e development c8 --include=\"app/operations/index.js\" mocha app/operations/*_test.js", "build:generate": "openapi-codegen -i dist/openapi.json -p @cross-lab-project/codegen-typescript-addon:preset:service -o src/generated", - "build:compile": "tsc", - "build": "npm run build:generate && npm run build:compile", + "build:compile": "tsc && cp src/generated/basicValidation.cjs app/generated/basicValidation.cjs", + "build:add-shebang": "bash scripts/add-shebang.sh", + "build": "npm-run-all build:*", "start": "npm run build && env-cmd -e development node app/index.js", "format": "prettier . --write", "lint": "eslint ." @@ -15,23 +24,28 @@ "author": "Marcus Soll", "license": "Apache-2.0", "dependencies": { - "@cross-lab-project/codegen-typescript-addon": "file:../../../../helper/crosslab-typescript-addon", - "@cross-lab-project/openapi-codegen": "file:../../../../helper/openapi-codegeneration", - "@cross-lab-project/service-common": "file:../../../common", + "@crosslab/service-common": "file:../../../common", "@crosslab/booking-service-common": "file:../common", "@crosslab/service-booking-backend": "file:../booking-backend", - "@trivago/prettier-plugin-sort-imports": "^4.2.0", - "@types/amqplib": "^0.10.5", - "@types/express": "^4.17.21", "ajv-formats": "^3.0.1", - "amqplib": "^0.10.4", - "dayjs": "^1.11.12", - "env-cmd": "^10.1.0", + "amqplib": "^0.10.2", + "dayjs": "^1.11.7", "express": "^4.18.1", - "mysql2": "^3.6.0", - "typescript": "^5.5.4" + "mysql2": "^3.6.0" }, "devDependencies": { - "prettier": "^3.3.3" + "typescript": "^5.5.4", + "@cross-lab-project/codegen-typescript-addon": "file:../../../../helper/crosslab-typescript-addon", + "@cross-lab-project/openapi-codegen": "file:../../../../helper/openapi-codegeneration", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/amqplib": "^0.10.1", + "@types/express": "^4.17.13", + "@crosslab/booking-service-test-common": "file:../test_common", + "@types/mocha": "^10.0.6", + "c8": "^10.1.2", + "env-cmd": "^10.1.0", + "mocha": "^10.4.0", + "prettier": "^3.0.3", + "npm-run-all": "^4.1.5" } } diff --git a/services/booking/src/booking-frontend/scripts/add-shebang.sh b/services/booking/src/booking-frontend/scripts/add-shebang.sh new file mode 120000 index 00000000..1a5fdd47 --- /dev/null +++ b/services/booking/src/booking-frontend/scripts/add-shebang.sh @@ -0,0 +1 @@ +../../../../../common/node/scripts/add-shebang.sh \ No newline at end of file diff --git a/services/booking/src/booking-frontend/scripts/build-docker.sh b/services/booking/src/booking-frontend/scripts/build-docker.sh new file mode 120000 index 00000000..31019032 --- /dev/null +++ b/services/booking/src/booking-frontend/scripts/build-docker.sh @@ -0,0 +1 @@ +../../../../../common/docker/scripts/build-node.sh \ No newline at end of file diff --git a/services/booking/src/booking-frontend/scripts/build-spec.sh b/services/booking/src/booking-frontend/scripts/build-spec.sh new file mode 100755 index 00000000..e5b66475 --- /dev/null +++ b/services/booking/src/booking-frontend/scripts/build-spec.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +mkdir -p dist + +rm -f dist/openapi.yml +echo "# This file was automatically generated - all changes will be lost\n" > dist/openapi.yml + +cat api/openapi_start.yml >> dist/openapi.yml +cat api/component.yml >> dist/openapi.yml +cat ../../api/types.yml >> dist/openapi.yml + +npx @redocly/cli bundle dist/openapi.yml --output dist/openapi.json diff --git a/services/booking/src/booking-frontend/scripts/test.sh b/services/booking/src/booking-frontend/scripts/test.sh new file mode 100755 index 00000000..3b22f459 --- /dev/null +++ b/services/booking/src/booking-frontend/scripts/test.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +sudo service rabbitmq-server start +sudo service mariadb start +sudo mysql -e "DROP DATABASE IF EXISTS unittest;" +sudo mysql -e "CREATE DATABASE unittest DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;" +sudo mysql -e "DROP USER IF EXISTS 'test'@localhost;" +sudo mysql -e "CREATE USER 'test'@localhost IDENTIFIED BY 'test';" +sudo mysql -e "GRANT ALL PRIVILEGES ON unittest.* to 'test'@localhost;" +sudo mysql -e "FLUSH PRIVILEGES;" + +npm ci +npm test +result=$? + +sudo mysql -e "DROP USER 'test'@localhost;" +sudo mysql -e "DROP DATABASE unittest;" +sudo service mariadb stop +sudo service rabbitmq-server stop + +exit $result \ No newline at end of file diff --git a/services/booking/src/booking-frontend/src/config.ts b/services/booking/src/booking-frontend/src/config.ts index 5e319897..f36dcde9 100644 --- a/services/booking/src/booking-frontend/src/config.ts +++ b/services/booking/src/booking-frontend/src/config.ts @@ -1,6 +1,6 @@ -import { baseConfig, die } from '@crosslab/booking-service-common'; +import { baseConfig } from '@crosslab/booking-service-common'; -const PORT = parseInt(process.env.PORT ?? '3000'); +const PORT = parseInt(process.env.PORT ?? '3004'); const DEFAULT_BASE_URL = 'http://localhost:' + PORT; export const config = { @@ -8,10 +8,10 @@ export const config = { PORT, BASE_URL: process.env.BASE_URL ?? DEFAULT_BASE_URL, JWKS_URL: process.env.JWKS_URL ?? 'http://localhost/.well-known/jwks.json', - SECURITY_ISSUER: - process.env.SECURITY_ISSUER ?? - die('the environment variable SECURITY_ISSUER is not defined!'), - SECURITY_AUDIENCE: - process.env.SECURITY_AUDIENCE ?? - die('the environment variable SECURITY_AUDIENCE is not defined!'), + BookingDSN: process.env.BOOKING_DSN ?? baseConfig.BookingDSN, + ReservationDSN: process.env.BOOKING_DSN ?? baseConfig.BookingDSN, + CallbackDSN: process.env.BOOKING_DSN ?? baseConfig.BookingDSN, + OwnURL: process.env.BASE_URL ?? DEFAULT_BASE_URL, + InstitutePrefix: [process.env.BASE_URL ?? DEFAULT_BASE_URL], + AmqpUrl: process.env.AMQP_URL ?? baseConfig.AmqpUrl, }; diff --git a/services/booking/src/booking-frontend/src/index.ts b/services/booking/src/booking-frontend/src/index.ts index 576d5c79..ad66a6cf 100644 --- a/services/booking/src/booking-frontend/src/index.ts +++ b/services/booking/src/booking-frontend/src/index.ts @@ -1,27 +1,26 @@ -import { - JWTVerify, - parseJwtFromRequestAuthenticationHeader, -} from '@cross-lab-project/service-common'; +import { authorization, error } from '@crosslab/service-common'; +import express from 'express'; -import { config } from './config'; -import { app } from './generated'; -import { isUserTypeJWT } from './generated/types'; +import { config } from './config.js'; +import { app } from './generated/index.js'; -if (require.main === module) { - app.initService({ - security: { - JWT: JWTVerify( - { - JWKS_URL: config.JWKS_URL, - SECURITY_AUDIENCE: config.SECURITY_AUDIENCE, - SECURITY_ISSUER: config.SECURITY_ISSUER, - }, - isUserTypeJWT, - parseJwtFromRequestAuthenticationHeader, - ), +app.initService({ + preHandlers: [ + application => { + application.use(express.json()); + application.use(express.urlencoded({ extended: false })); + application.use(authorization.middleware() as express.RequestHandler); }, - }); + ], + postHandlers: [ + application => { + application.get('/federation/status', (_req, res) => { + res.send({ status: 'ok' }); + }); + }, + ], + errorHandler: error.middleware, +}); - console.log('Starting booking-frontend'); - app.listen(config.PORT); -} +console.log('Starting booking-frontend'); +app.listen(config.PORT); diff --git a/services/booking/src/booking-frontend/src/operations.ts b/services/booking/src/booking-frontend/src/operations.ts deleted file mode 100644 index 9c0000b0..00000000 --- a/services/booking/src/booking-frontend/src/operations.ts +++ /dev/null @@ -1,472 +0,0 @@ -import { BelongsToUs } from '@crosslab/booking-service-common'; -import { DeviceBookingRequest } from '@crosslab/service-booking-backend'; -import * as amqplib from 'amqplib'; -import dayjs from 'dayjs'; -import * as mysql from 'mysql2/promise'; - -import { config } from './config'; -import { - deleteBookingByIDDestroySignature, - deleteBookingByIDSignature, - getBookingByID200ResponseType, - getBookingByIDSignature, - patchBookingByIDSignature, - postBookingRequestBodyType, - postBookingSignature, -} from './generated/signatures'; -import { Booking, Device, Experiment, Timeslot } from './generated/types'; - -export const postBooking: postBookingSignature = async (body, user) => { - if (user.JWT === undefined) { - return { - status: 401, - }; - } - - let connection = await amqplib.connect(config.AmqpUrl); - let channel = await connection.createChannel(); - - // Set default booking type if none was sent - if (body.Type === undefined) { - body.Type = 'normal'; - } - - await channel.assertQueue('device-booking', { - durable: true, - }); - - let db = await mysql.createConnection(config.BookingDSN); - await db.connect(); - await db.beginTransaction(); - - try { - // Create booking - let [rows, fields]: [any, any] = await db.execute( - 'INSERT INTO booking (`start`, `end`, `type`, `status`, `user`) VALUES (?,?,?,?,?)', - [new Date(body.Time.Start), new Date(body.Time.End), body.Time, 'pending', user], - ); - let bookingID: bigint = BigInt(rows.insertId); - - for (let i = 0; i < body.Devices.length; i++) { - await db.execute( - 'INSERT INTO bookeddevices (`booking`, `originaldevice`, `originalposition`) VALUES (?,?,?)', - [bookingID, body.Devices[i].ID, i], - ); - } - await db.commit(); - - // Send devices to backend - for (let i = 0; i < body.Devices.length; i++) { - let s = JSON.stringify( - new DeviceBookingRequest( - bookingID, - new URL(body.Devices[i].ID), - i, - dayjs(body.Time.Start), - dayjs(body.Time.End), - ), - ); - if ( - !channel.sendToQueue('device-booking', Buffer.from(s), { - persistent: true, - }) - ) { - throw new Error('amqp queue full'); - } - } - - let r = new URL(config.OwnURL); - - return { - status: 200, - body: { - BookingID: r.origin + '/booking/manage/' + bookingID.toString(), - }, - }; - } catch (err) { - db.rollback(); - - return { - status: 500, - body: err.toString(), - }; - } finally { - channel.close(); - connection.close(); - db.end(); - } - - return { - status: 500, - body: 'BUG: method reached end', - }; -}; - -export const getBookingByID: getBookingByIDSignature = async (parameters, user) => { - let db = await mysql.createConnection(config.BookingDSN); - await db.connect(); - await db.beginTransaction(); - - let requestID: bigint = BigInt(parameters.ID); - - try { - let body: getBookingByID200ResponseType['body'] = { - Booking: { - ID: parameters.ID, - Time: { Start: '', End: '' }, - Devices: [], - Type: 'normal', - You: false, - External: false, - Status: 'pending', - Message: '', - }, - Locked: false, - }; - // TODO Remove External - - // Read basic information - let [rows, fields]: [any, any] = await db.execute( - 'SELECT `start`, `end`, `type`, `status`, `user`, `message` FROM booking WHERE id=?', - [requestID], - ); - if (rows.length == 0) { - return { - status: 404, - }; - } - body.Booking.Time.Start = rows[0].start; - body.Booking.Time.End = rows[0].end; - body.Booking.Type = rows[0].type; - body.Booking.Status = rows[0].status; - body.Booking.You = rows[0].user == user; - body.Message = rows[0].message; - if ( - body.Booking.Status === 'active' || - body.Booking.Status === 'active-pending' || - body.Booking.Status == 'active-rejected' - ) { - body.Locked = true; - } - - // Read devices - [rows, fields] = await db.execute( - 'SELECT `originaldevice` FROM bookeddevices WHERE booking=? ORDER BY `originalposition` ASC', - [requestID], - ); - for (let i = 0; i < rows.length; i++) { - body.Booking.Devices.push(rows[i].originaldevice); - } - - return { - status: 200, - body: body, - }; - } catch (err) { - db.rollback(); - db.end(); - - return { - status: 500, - body: err.toString(), - }; - } finally { - db.commit(); - db.end(); - } - - return { - status: 500, - body: 'BUG: method reached end', - }; -}; - -export const deleteBookingByID: deleteBookingByIDSignature = async (parameters, user) => { - let requestID: bigint = BigInt(parameters.ID); - let success: boolean = false; - - let db = await mysql.createConnection(config.BookingDSN); - await db.connect(); - await db.beginTransaction(); - - try { - let [rows, fields]: [any, any] = await db.execute( - 'SELECT `status`, `user` FROM booking WHERE `id`=? FOR UPDATE', - [requestID], - ); - if (rows.length === 0) { - return { - status: 404, - }; - } - - switch (rows[0].status) { - case 'pending': - case 'booked': - // Everything ok - break; - case 'active-pending': - case 'active': - case 'active-rejected': - return { - status: 423, - }; - - case 'rejected': - case 'cancelled': - return { - status: 200, - }; - - default: - throw Error('BUG: unknown status ' + rows[0].status); - break; - } - - if (user.JWT === undefined || rows[0].user != user.JWT.username) { - return { - status: 401, - }; - } - - // delete booking - let connection = await amqplib.connect(config.AmqpUrl); - let channel = await connection.createChannel(); - - try { - await channel.assertQueue('device-freeing', { - durable: true, - }); - - let [devicesRows, devicesFields]: [any, any] = await db.execute( - 'SELECT `id` FROM bookeddevices WHERE `booking`=? FOR UPDATE', - [requestID], - ); - for (let i = 0; i < devicesRows.length; i++) { - if ( - !channel.sendToQueue( - 'device-freeing', - Buffer.from(devicesRows[i].id.toString()), - { persistent: true }, - ) - ) { - throw new Error('amqp queue full'); - } - } - } finally { - channel.close(); - connection.close(); - } - - await db.execute('UPDATE booking SET `status`=?, `message`=? WHERE id=?', [ - 'cancelled', - 'Cancelled by user', - requestID, - ]); - - success = true; - } catch (err) { - return { - status: 500, - body: err.toString(), - }; - } finally { - if (success) { - db.commit(); - } else { - db.rollback(); - } - db.end(); - } - - return { - status: 200, - }; -}; - -export const patchBookingByID: patchBookingByIDSignature = async ( - parameters, - body, - user, -) => { - let requestID: bigint = BigInt(parameters.ID); - let success: boolean = false; - - let db = await mysql.createConnection(config.BookingDSN); - await db.connect(); - await db.beginTransaction(); - - try { - let [rows, fields]: [any, any] = await db.execute( - 'SELECT `status`, `user`,`start`,`end` FROM booking WHERE `id`=? FOR UPDATE', - [requestID], - ); - if (rows.length === 0) { - return { - status: 404, - }; - } - - if (typeof body.Callback === 'string') { - // this is adding a callback - await db.execute('INSERT INTO bookingcallbacks (`booking`, `url`) VALUES (?,?)', [ - requestID, - body.Callback, - ]); - } else if (typeof body.Devices !== undefined) { - let Devices: Device[] = body.Devices as Device[]; - if (user.JWT === undefined || rows[0].user != user.JWT.username) { - return { - status: 401, - }; - } - - switch (body.Locked) { - case true: - if ( - rows[0].status !== 'active' && - rows[0].status !== 'active-rejected' && - rows[0].status !== 'active-pending' - ) { - return { - status: 423, - }; - } - await db.execute('UPDATE booking SET `status`=? WHERE id=?', [ - 'active-pending', - requestID, - ]); - break; - case false: - if (rows[0].status !== 'booked' && rows[0].status !== 'pending') { - return { - status: 423, - }; - } - await db.execute('UPDATE booking SET `status`=? WHERE id=?', [ - 'pending', - requestID, - ]); - break; - case undefined: - return { - status: 500, - body: "BUG: 'Locked' is missing", - }; - break; - default: - throw Error('BUG: unknown status body.Locked: ' + body.Locked); - break; - } - - let [deviceRows, deviceFields]: [any, any] = await db.execute( - 'SELECT MAX(`originalposition`) as max FROM bookeddevices WHERE `booking`=?', - [requestID], - ); - - let toadd: number = 0; - if (deviceRows.length != 0) { - toadd = deviceRows[0].max + 1; - } - - let start: string = rows[0].start; - let end: string = rows[0].end; - - let connection = await amqplib.connect(config.AmqpUrl); - let channel = await connection.createChannel(); - - try { - for (let i = 0; i < Devices.length; i++) { - await db.execute( - 'INSERT INTO bookeddevices (`booking`, `originaldevice`, `originalposition`) VALUES (?,?,?)', - [requestID, Devices[i].ID, i + toadd], - ); - } - await db.commit(); - db.beginTransaction(); - - // Send devices to backend - for (let i = 0; i < Devices.length; i++) { - let s = JSON.stringify( - new DeviceBookingRequest( - requestID, - new URL(Devices[i].ID), - i + toadd, - dayjs(start), - dayjs(end), - ), - ); - if ( - !channel.sendToQueue('device-booking', Buffer.from(s), { - persistent: true, - }) - ) { - throw new Error('amqp queue full'); - } - } - } finally { - channel.close(); - connection.close(); - } - } else { - throw Error('Unknown request type'); - } - - success = true; - } catch (err) { - return { - status: 500, - body: err.toString(), - }; - } finally { - if (success) { - db.commit(); - } else { - db.rollback(); - } - db.end(); - } - - let url = config.OwnURL; - if (!url.endsWith('/')) { - url = url + '/'; - } - url = url + 'booking/manage/' + requestID; - - return { - status: 200, - body: { - BookingID: url, - }, - }; -}; - -export const deleteBookingByIDDestroy: deleteBookingByIDDestroySignature = async ( - parameters, - user, -) => { - // add your implementation here - if ( - user.JWT !== undefined && - user.JWT.scopes.includes('booking:destroy') && - BelongsToUs(new URL(user.JWT.url)) - ) { - } else { - return { - status: 401, // TODO: Use 403 - }; - } - - return { - status: 500, - body: 'TODO: Method not implemented', - }; -}; - -export default { - postBooking, - getBookingByID, - deleteBookingByID, - patchBookingByID, - deleteBookingByIDDestroy, -}; diff --git a/services/booking/src/booking-frontend/src/operations/index.ts b/services/booking/src/booking-frontend/src/operations/index.ts new file mode 100644 index 00000000..d843bfa1 --- /dev/null +++ b/services/booking/src/booking-frontend/src/operations/index.ts @@ -0,0 +1,541 @@ +import { BelongsToUs, sleep } from '@crosslab/booking-service-common'; +import { DeviceBookingRequest } from '@crosslab/service-booking-backend'; +import * as amqplib from 'amqplib'; +import dayjs from 'dayjs'; +import * as mysql from 'mysql2/promise'; +import { hackURLWithPort } from '@crosslab/booking-service-common'; + +import { config } from '../config.js'; +import { + deleteBookingByIDDestroySignature, + deleteBookingByIDSignature, + getBookingByID200ResponseType, + getBookingByIDSignature, + patchBookingByIDSignature, + postBookingSignature, +} from '../generated/signatures.js'; +import { Booking, Device, Experiment, Timeslot } from '../generated/types.js'; + +(BigInt.prototype as any).toJSON = function () { + return this.toString(); +}; + +export const postBooking: postBookingSignature = async (request, body) => { + await request.authorization.check_authorization_or_fail('create', `booking`); + + let connection = await amqplib.connect(config.AmqpUrl); + let channel = await connection.createChannel(); + + // Set default booking type if none was sent + if (body.Type === undefined) { + body.Type = 'normal'; + } + + await channel.assertQueue('device-booking', { + durable: true, + }); + + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + await db.beginTransaction(); + + try { + // Create booking + let [rows, fields]: [any, any] = await db.execute( + 'INSERT INTO booking (`start`, `end`, `type`, `status`, `user`) VALUES (?,?,?,?,?)', + [ + dayjs(body.Time.Start).toDate(), + dayjs(body.Time.End).toDate(), + body.Type, + 'pending', + request.authorization.user, + ], + ); + let bookingID: bigint = BigInt(rows.insertId); + + for (let i = 0; i < body.Devices.length; i++) { + await db.execute( + 'INSERT INTO bookeddevices (`booking`, `originaldevice`, `originalposition`) VALUES (?,?,?)', + [bookingID, body.Devices[i].ID, i], + ); + } + await db.commit(); + + await request.authorization.relate( + `user:${request.authorization.user}`, + 'owner', + `booking:${bookingID}`, + ); + + // Send devices to backend + for (let i = 0; i < body.Devices.length; i++) { + let s = JSON.stringify( + new DeviceBookingRequest( + bookingID, + new URL(body.Devices[i].ID), + i, + dayjs(body.Time.Start), + dayjs(body.Time.End), + ), + ); + if (!channel.sendToQueue('device-booking', Buffer.from(s), { persistent: true })) { + throw new Error('amqp queue full'); + } + } + + let r = new URL(config.OwnURL); + + return { + status: 200, + body: { + BookingID: r.origin + '/booking/' + bookingID.toString(), + }, + }; + } catch (err) { + await db.rollback(); + + console.error('error', 'Error creating booking: ' + (err as Error).toString()); + + return { + status: 500, + body: err.toString(), + }; + } finally { + await channel.close(); + await sleep(250); + await connection.close(); + db.end(); + } + + return { + status: 500, + body: 'BUG: method reached end', + }; +}; + +export const getBookingByID: getBookingByIDSignature = async (request, parameters) => { + let requestID: bigint = BigInt(parameters.ID); + + await request.authorization.check_authorization_or_fail('view', `booking:${requestID}`); + + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + await db.beginTransaction(); + + try { + let body: getBookingByID200ResponseType['body'] = { + Booking: { + ID: config.OwnURL.endsWith('/') + ? config.OwnURL + 'booking/' + requestID + : config.OwnURL + '/booking/' + requestID, + Time: { Start: '', End: '' }, + Devices: [], + Type: 'normal', + You: false, + External: false, + Status: 'pending', + Message: '', + }, + Locked: false, + }; + + // Read basic information + let [rows, fields]: [any, any] = await db.execute( + 'SELECT `start`, `end`, `type`, `status`, `user`, `message` FROM booking WHERE id=?', + [requestID], + ); + if (rows.length == 0) { + return { + status: 404, + }; + } + body.Booking.Time.Start = dayjs(rows[0].start).toISOString(); + body.Booking.Time.End = dayjs(rows[0].end).toISOString(); + body.Booking.Type = rows[0].type; + body.Booking.Status = rows[0].status; + body.Booking.You = rows[0].user == request.authorization.user; + body.Message = rows[0].message; + body.Locked = false; + if ( + body.Booking.Status === 'active' || + body.Booking.Status === 'active-pending' || + body.Booking.Status == 'active-rejected' + ) { + body.Locked = true; + } + + // Read devices + [rows, fields] = await db.execute( + 'SELECT `originaldevice` FROM bookeddevices WHERE booking=? ORDER BY `originalposition` ASC', + [requestID], + ); + for (let i = 0; i < rows.length; i++) { + body.Booking.Devices.push(hackURLWithPort(rows[i].originaldevice)); + } + + return { + status: 200, + body: body, + }; + } catch (err) { + await db.rollback(); + db.end(); + console.error('error', 'Error getting Booking by ID: ' + (err as Error).toString()); + + return { + status: 500, + body: err.toString(), + }; + } finally { + await db.commit(); + db.end(); + } + + return { + status: 500, + body: 'BUG: method reached end', + }; +}; + +export const deleteBookingByID: deleteBookingByIDSignature = async ( + request, + parameters, +) => { + let requestID: bigint = BigInt(parameters.ID); + + await request.authorization.check_authorization_or_fail( + 'delete', + `booking:${requestID}`, + ); + + let [code, err] = await commonRemoveBooking(requestID); + + if (err != '') { + console.error('error', 'Error deleting booking by ID: ' + err); + } + if (code != 200) { + console.error('warn', 'Delete booking by ID returned not 200: ' + code); + } + + // Typescript seems to have problems to infer body correctly with case 500. + // Therefore, the solution here is more complicated + if (code === 500) { + return { + status: code, + body: err ?? 'No error', + }; + } + + // Since we keep the booking in the database, there is no need to unrelate the booking here. + // Students might check it later if someone else deleted it. + + return { + status: code, + }; +}; + +export const patchBookingByID: patchBookingByIDSignature = async ( + request, + parameters, + body, +) => { + let requestID: bigint = BigInt(parameters.ID); + + await request.authorization.check_authorization_or_fail('edit', `booking:${requestID}`); + + let success: boolean = false; + + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + await db.beginTransaction(); + + try { + let [rows, fields]: [any, any] = await db.execute( + 'SELECT `status`, `user`,`start`,`end` FROM booking WHERE `id`=? FOR UPDATE', + [requestID], + ); + if (rows.length === 0) { + return { + status: 404, + }; + } + + // if both are set, the request is invalid + if (typeof body.Callback === 'string' && typeof body.Devices !== 'undefined' && (body.Devices as Device[]).length !== 0) { + return { + status: 400, + body: 'can not add callback and devices in one request', + }; + } else if (typeof body.Callback === 'string') { + // this is adding a callback + await db.execute('INSERT INTO bookingcallbacks (`booking`, `url`) VALUES (?,?)', [ + requestID, + body.Callback, + ]); + } else if (typeof body.Devices !== 'undefined') { + let Devices: Device[] = body.Devices as Device[]; + + if (Devices.length !== 0) { + + // Set locked to default if not given + if (body.Locked == undefined) { + body.Locked = false; + } + + switch (body.Locked) { + case true: + if ( + rows[0].status !== 'active' && + rows[0].status !== 'active-rejected' && + rows[0].status !== 'active-pending' + ) { + return { + status: 423, + }; + } + await db.execute('UPDATE booking SET `status`=? WHERE id=?', [ + 'active-pending', + requestID, + ]); + break; + case false: + if (rows[0].status !== 'booked' && rows[0].status !== 'pending') { + return { + status: 423, + }; + } + await db.execute('UPDATE booking SET `status`=? WHERE id=?', [ + 'pending', + requestID, + ]); + break; + default: + throw Error('BUG: unknown status body.Locked: ' + body.Locked); + break; + } + + let [deviceRows, deviceFields]: [any, any] = await db.execute( + 'SELECT MAX(`originalposition`) as max FROM bookeddevices WHERE `booking`=?', + [requestID], + ); + + let toadd: number = 0; + if (deviceRows.length != 0) { + toadd = deviceRows[0].max + 1; + } + + let start: string = rows[0].start; + let end: string = rows[0].end; + + let connection = await amqplib.connect(config.AmqpUrl); + let channel = await connection.createChannel(); + + await channel.assertQueue('device-booking', { + durable: true, + }); + + try { + for (let i = 0; i < Devices.length; i++) { + await db.execute( + 'INSERT INTO bookeddevices (`booking`, `originaldevice`, `originalposition`) VALUES (?,?,?)', + [requestID, Devices[i].ID, i + toadd], + ); + } + await db.commit(); + db.beginTransaction(); + + // Send devices to backend + for (let i = 0; i < Devices.length; i++) { + let s = JSON.stringify( + new DeviceBookingRequest( + requestID, + new URL(Devices[i].ID), + i + toadd, + dayjs(start), + dayjs(end), + ), + ); + if ( + !channel.sendToQueue('device-booking', Buffer.from(s), { persistent: true }) + ) { + throw new Error('amqp queue full'); + } + } + } finally { + await channel.close(); + await await sleep(250); + await connection.close(); + } + } + } else { + return { + status: 500, + body: "Unknown request type or wrong/missing parameter", + }; + } + + success = true; + } catch (err) { + console.error('error', 'Error patching booking in DB: ' + (err as Error).toString()); + return { + status: 500, + body: err.toString(), + }; + } finally { + if (success) { + await db.commit(); + } else { + await db.rollback(); + } + db.end(); + } + + let url = config.OwnURL; + if (!url.endsWith('/')) { + url = url + '/'; + } + url = url + 'booking/' + requestID; + + return { + status: 200, + body: { + BookingID: url, + }, + }; +}; + +export const deleteBookingByIDDestroy: deleteBookingByIDDestroySignature = async ( + request, + parameters, +) => { + let requestID: bigint = BigInt(parameters.ID); + + await request.authorization.check_authorization_or_fail( + 'delete', + `booking:${requestID}`, + ); + + let [code, err] = await commonRemoveBooking(requestID); + + if (err != '') { + console.error('error', 'Error deleting booking by ID destroying signature: ' + err); + } + if (code != 200) { + console.error( + 'warn', + 'Delete booking by ID destroying signature returned not 200: ' + code, + ); + } + // Typescript seems to have problems to infer body correctly with case 500. + // Therefore, the solution here is more complicated + if (code === 500) { + return { + status: code, + body: err ?? 'No error', + }; + } + + // Since we keep the booking in the database, there is no need to unrelate the booking here. + // Students might check it later if someone else deleted it. + + return { + status: code, + }; +}; + +export default { + postBooking, + getBookingByID, + deleteBookingByID, + patchBookingByID, + deleteBookingByIDDestroy, +}; + +async function commonRemoveBooking( + requestID: bigint, +): Promise<[404 | 200 | 423 | 500, string | null]> { + let success: boolean = false; + + let db = await mysql.createConnection(config.BookingDSN); + await db.connect(); + await db.beginTransaction(); + + try { + let [rows, fields]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=? FOR UPDATE', + [requestID], + ); + if (rows.length === 0) { + return [404, null]; + } + + switch (rows[0].status) { + case 'pending': + case 'booked': + // Everything ok + break; + case 'active-pending': + case 'active': + case 'active-rejected': + return [423, null]; + + case 'rejected': + case 'cancelled': + return [200, null]; + + default: + throw Error('BUG: unknown status ' + rows[0].status); + break; + } + + // delete booking + let connection = await amqplib.connect(config.AmqpUrl); + let channel = await connection.createChannel(); + + try { + await channel.assertQueue('device-freeing', { + durable: true, + }); + + let [devicesRows, devicesFields]: [any, any] = await db.execute( + 'SELECT `id` FROM bookeddevices WHERE `booking`=? FOR UPDATE', + [requestID], + ); + for (let i = 0; i < devicesRows.length; i++) { + if ( + !channel.sendToQueue( + 'device-freeing', + Buffer.from(devicesRows[i].id.toString()), + { persistent: true }, + ) + ) { + throw new Error('amqp queue full'); + } + } + } finally { + await channel.close(); + await sleep(250); + await connection.close(); + } + + await db.execute('UPDATE booking SET `status`=?, `message`=? WHERE id=?', [ + 'cancelled', + 'Cancelled by user', + requestID, + ]); + + success = true; + } catch (err) { + console.error('error', 'Error commonRemoveBooking: ' + (err as Error).toString()); + return [500, err.toString()]; + } finally { + if (success) { + await db.commit(); + } else { + await db.rollback(); + } + db.end(); + } + + return [200, null]; +} diff --git a/services/booking/src/booking-frontend/src/operations/index_test.ts b/services/booking/src/booking-frontend/src/operations/index_test.ts new file mode 100644 index 00000000..ddb3c970 --- /dev/null +++ b/services/booking/src/booking-frontend/src/operations/index_test.ts @@ -0,0 +1,2964 @@ +import { baseConfig, sleep } from '@crosslab/booking-service-common'; +import { + fakeServerConfig, + getFakeInstitutePrefix, + getFakeOwnURL, + getFakeRequest, + getSQLDNS, + resetFakeServerVars, + setupDummySql, + startFakeServer, + stopFakeServer, + tearDownDummySql, +} from '@crosslab/booking-service-test-common'; +import * as amqplib from 'amqplib'; +import dayjs, { Dayjs } from 'dayjs'; +import * as mocha from 'mocha'; +import * as mysql from 'mysql2/promise'; + +import { config } from '../config.js'; +import { + deleteBookingByID, + deleteBookingByIDDestroy, + getBookingByID, + patchBookingByID, + postBooking, +} from './index.js'; +import { + MapToString, + ResetAMQPBookingDeviceCount, + StartAMQPTestBooking, + StopAMQPTestBooking, + TestAMQPresultsBooking, +} from './indextest_helper_amqp_booking.js'; +import { + ResetAMQPDeviceCount, + StartAMQPTestFree, + StopAMQPTestFree, + TestAMQPresults, +} from './indextest_helper_amqp_free.js'; +import { logging } from '@crosslab/service-common'; + +let connection: amqplib.Connection; +let channel: amqplib.Channel; + +mocha.describe('operations.ts', function () { + this.timeout(10000); + + mocha.before(function () { + // Config - use both global config and local config to ensure different application parts work with same config + baseConfig.OwnURL = getFakeOwnURL(); + baseConfig.InstitutePrefix = getFakeInstitutePrefix(); + baseConfig.ReservationDSN = getSQLDNS(); + baseConfig.BookingDSN = getSQLDNS(); + + config.OwnURL = getFakeOwnURL(); + config.InstitutePrefix = getFakeInstitutePrefix(); + config.ReservationDSN = getSQLDNS(); + config.BookingDSN = getSQLDNS(); + + startFakeServer(); + }); + + mocha.before(function () { + logging.init(); + }) + + mocha.after(function () { + stopFakeServer(); + }); + + mocha.beforeEach(async function () { + // Reset server status + resetFakeServerVars(); + + // Setup database + await setupDummySql(); + + // Connect to amqp + connection = await amqplib.connect(baseConfig.AmqpUrl); + channel = await connection.createChannel(); + + await channel.assertQueue('device-booking', { + durable: true, + }); + + await channel.assertQueue('device-freeing', { + durable: true, + }); + + // Drain queues + while (await channel.get('device-booking', { noAck: true })) { } + while (await channel.get('device-freeing', { noAck: true })) { } + }); + + mocha.afterEach(async function () { + await tearDownDummySql(); + + await channel.deleteQueue('device-booking'); + await channel.deleteQueue('device-freeing'); + + await channel.close(); + await sleep(250); + await connection.close(); + + channel = undefined; + connection = undefined; + }); + + mocha.it('postBooking authorization failed', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + // Count number of bookings + let [rows, _]: [any, any] = await db.execute('SELECT count(*) AS n FROM booking'); + if (rows.length !== 1) { + throw new Error('internal error: wrong number of rows' + rows.length); + } + let before: number = rows[0].n; + + // Try booking + let isError: boolean = false; + + let req = getFakeRequest({ user: 'badactor', isAuthorized: false }); + + try { + await postBooking(req, { + Time: { + Start: dayjs('2000-01-01T07:00Z').toISOString(), + End: dayjs('2000-01-01T08:00Z').toISOString(), + }, + Devices: [ + { ID: 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' }, + ], + }); + } catch (err) { + if (err.message == 'test authorization failed') { + isError = true; + } else { + console.log(err.message); + throw err; + } + } + await sleep(250); + + if (!isError) { + throw new Error('no access violation detected'); + } + + // Ensure number has not changed + [rows, _] = await db.execute('SELECT count(*) AS n FROM booking'); + if (rows.length !== 1) { + throw new Error('internal error: wrong number of rows' + rows.length); + } + if (Number(rows[0].n) != Number(before)) { + throw new Error( + 'authorization failed but number of bookings was changed from ' + + before + + ' to ' + + rows[0].n, + ); + } + if ((req as any).related.length != 0) { + throw new Error('related not empty:' + (req as any).related.toString()); + } + if (TestAMQPresultsBooking.size != 0) { + throw new Error( + 'device reservation messages found ' + MapToString(TestAMQPresultsBooking), + ); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('postBooking single device', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + // Count number of bookings + let [rows, _]: [any, any] = await db.execute('SELECT count(*) AS n FROM booking'); + if (rows.length !== 1) { + throw new Error('internal error: wrong number of rows' + rows.length); + } + let before: number = rows[0].n; + + // Try booking + let req = getFakeRequest({ user: 'unittest.user', isAuthorized: true }); + let result = await postBooking(req, { + Time: { + Start: dayjs('2000-01-01T07:00Z').toISOString(), + End: dayjs('2000-01-01T08:00Z').toISOString(), + }, + Devices: [ + { ID: 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' }, + ], + }); + await sleep(250); + + if (result.status != 200) { + throw new Error( + 'Booking failed with status ' + result.status + ' ' + result.body, + ); + } + + // Ensure number has increased by one + [rows, _] = await db.execute('SELECT count(*) AS n FROM booking'); + if (rows.length !== 1) { + throw new Error('internal error: wrong number of rows' + rows.length); + } + + if (Number(rows[0].n) != Number(before) + 1) { + throw new Error( + 'number of bookings was changed from ' + before + ' to ' + rows[0].n, + ); + } + + let split = result.body.BookingID.split('/'); + let bookingID: bigint = BigInt(split[split.length - 1]); + + [rows, _] = await db.execute( + 'SELECT `start`,`end`,`type`,`user` FROM booking WHERE `id`=?', + [bookingID], + ); + if (rows.length !== 1) { + throw new Error('wrong number of rows: ' + rows.length); + } + + if (!dayjs(rows[0].start).isSame(dayjs('2000-01-01T07:00Z'))) { + throw new Error('wrong start ' + rows[0].start); + } + + if (!dayjs(rows[0].end).isSame(dayjs('2000-01-01T08:00Z'))) { + throw new Error('wrong end ' + rows[0].end); + } + + if (rows[0].type != 'normal') { + throw new Error('wrong type ' + rows[0].type); + } + + if (rows[0].user != 'unittest.user') { + throw new Error('wrong user ' + rows[0].user); + } + + if ((req as any).related.length != 1) { + throw new Error('wrong number of related' + (req as any).related); + } + + if ((req as any).related[0][0] != 'user:unittest.user') { + throw new Error('wrong related user ' + (req as any).related); + } + + if ((req as any).related[0][1] != 'owner') { + throw new Error('wrong related relationship ' + (req as any).related); + } + + if ((req as any).related[0][2] != `booking:${bookingID}`) { + throw new Error('wrong related user ' + (req as any).related); + } + + if ((req as any).unrelated.length != 0) { + throw new Error('wrong number of related' + (req as any).unrelated); + } + + // bookeddevices + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE booking=?', + [bookingID], + ); + if (rows.length !== 1) { + throw new Error('internal error: wrong number of rows' + rows.length); + } + + if (Number(rows[0].n) != 1) { + throw new Error('number of booked devices is wrong: ' + rows[0].n); + } + + [rows, _] = await db.execute( + 'SELECT originaldevice FROM bookeddevices WHERE booking=? AND originalposition=?', + [bookingID, 0], + ); + if (rows.length !== 1) { + throw new Error('found ' + rows.length + ' devices for position 0'); + } + + if ( + rows[0].originaldevice !== + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong original device ' + rows[0].originaldevice); + } + + // AMQP + if (TestAMQPresultsBooking.size != 1) { + throw new Error( + 'wrong number of device reservation messages found ' + + MapToString(TestAMQPresultsBooking), + ); + } + if ( + !TestAMQPresultsBooking.has( + bookingID.toString() + + '-0-http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', + ) + ) { + throw new Error( + 'wrong device reservation messages found' + MapToString(TestAMQPresultsBooking), + ); + } + if ( + TestAMQPresultsBooking.get( + bookingID.toString() + + '-0-http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', + ) !== 1 + ) { + throw new Error( + 'wrong device reservation message number found' + + MapToString(TestAMQPresultsBooking), + ); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('postBooking single device with milliseconds', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + // Count number of bookings + let [rows, _]: [any, any] = await db.execute('SELECT count(*) AS n FROM booking'); + if (rows.length !== 1) { + throw new Error('internal error: wrong number of rows' + rows.length); + } + let before: number = rows[0].n; + + // Try booking + let req = getFakeRequest({ user: 'unittest.user', isAuthorized: true }); + let result = await postBooking(req, { + Time: { + Start: dayjs('2000-01-01T07:00:00.444Z').toISOString(), + End: dayjs('2000-01-01T08:00:00.555Z').toISOString(), + }, + Devices: [ + { ID: 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' }, + ], + }); + await sleep(250); + + if (result.status != 200) { + throw new Error( + 'Booking failed with status ' + result.status + ' ' + result.body, + ); + } + + // Ensure number has increased by one + [rows, _] = await db.execute('SELECT count(*) AS n FROM booking'); + if (rows.length !== 1) { + throw new Error('internal error: wrong number of rows' + rows.length); + } + + if (Number(rows[0].n) != Number(before) + 1) { + throw new Error( + 'number of bookings was changed from ' + before + ' to ' + rows[0].n, + ); + } + + let split = result.body.BookingID.split('/'); + let bookingID: bigint = BigInt(split[split.length - 1]); + + [rows, _] = await db.execute( + 'SELECT `start`,`end`,`type`,`user` FROM booking WHERE `id`=?', + [bookingID], + ); + if (rows.length !== 1) { + throw new Error('wrong number of rows: ' + rows.length); + } + + if (!dayjs(rows[0].start).isSame(dayjs('2000-01-01T07:00:00.444Z'))) { + throw new Error('wrong start ' + rows[0].start); + } + + if (!dayjs(rows[0].end).isSame(dayjs('2000-01-01T08:00:00.555Z'))) { + throw new Error('wrong end ' + rows[0].end); + } + + if (rows[0].type != 'normal') { + throw new Error('wrong type ' + rows[0].type); + } + + if (rows[0].user != 'unittest.user') { + throw new Error('wrong user ' + rows[0].user); + } + + if ((req as any).related.length != 1) { + throw new Error('wrong number of related' + (req as any).related); + } + + if ((req as any).related[0][0] != 'user:unittest.user') { + throw new Error('wrong related user ' + (req as any).related); + } + + if ((req as any).related[0][1] != 'owner') { + throw new Error('wrong related relationship ' + (req as any).related); + } + + if ((req as any).related[0][2] != `booking:${bookingID}`) { + throw new Error('wrong related user ' + (req as any).related); + } + + if ((req as any).unrelated.length != 0) { + throw new Error('wrong number of related' + (req as any).unrelated); + } + + // bookeddevices + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE booking=?', + [bookingID], + ); + if (rows.length !== 1) { + throw new Error('internal error: wrong number of rows' + rows.length); + } + + if (Number(rows[0].n) != 1) { + throw new Error('number of booked devices is wrong: ' + rows[0].n); + } + + [rows, _] = await db.execute( + 'SELECT originaldevice FROM bookeddevices WHERE booking=? AND originalposition=?', + [bookingID, 0], + ); + if (rows.length !== 1) { + throw new Error('found ' + rows.length + ' devices for position 0'); + } + + if ( + rows[0].originaldevice !== + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong original device ' + rows[0].originaldevice); + } + + // AMQP + if (TestAMQPresultsBooking.size != 1) { + throw new Error( + 'wrong number of device reservation messages found ' + + MapToString(TestAMQPresultsBooking), + ); + } + if ( + !TestAMQPresultsBooking.has( + bookingID.toString() + + '-0-http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', + ) + ) { + throw new Error( + 'wrong device reservation messages found' + MapToString(TestAMQPresultsBooking), + ); + } + if ( + TestAMQPresultsBooking.get( + bookingID.toString() + + '-0-http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', + ) !== 1 + ) { + throw new Error( + 'wrong device reservation message number found' + + MapToString(TestAMQPresultsBooking), + ); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('postBooking multiple devices', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + // Count number of bookings + let [rows, _]: [any, any] = await db.execute('SELECT count(*) AS n FROM booking'); + if (rows.length !== 1) { + throw new Error('internal error: wrong number of rows' + rows.length); + } + let before: number = rows[0].n; + + // Try booking + let req = getFakeRequest({ user: 'unittest.user', isAuthorized: true }); + let result = await postBooking(req, { + Time: { + Start: dayjs('2000-01-01T07:00Z').toISOString(), + End: dayjs('2000-01-01T08:00Z').toISOString(), + }, + Devices: [ + { ID: 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' }, + { ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000010' }, + ], + }); + await sleep(250); + + if (result.status != 200) { + throw new Error( + 'Booking failed with status ' + result.status + ' ' + result.body, + ); + } + + // Ensure number has increased by one + [rows, _] = await db.execute('SELECT count(*) AS n FROM booking'); + if (rows.length !== 1) { + throw new Error('internal error: wrong number of rows' + rows.length); + } + + if (Number(rows[0].n) != Number(before) + 1) { + throw new Error( + 'number of bookings was changed from ' + before + ' to ' + rows[0].n, + ); + } + + let split = result.body.BookingID.split('/'); + let bookingID: bigint = BigInt(split[split.length - 1]); + + [rows, _] = await db.execute( + 'SELECT `start`,`end`,`type`,`user` FROM booking WHERE `id`=?', + [bookingID], + ); + if (rows.length !== 1) { + throw new Error('wrong number of rows: ' + rows.length); + } + + if (!dayjs(rows[0].start).isSame(dayjs('2000-01-01T07:00Z'))) { + throw new Error('wrong start ' + rows[0].start); + } + + if (!dayjs(rows[0].end).isSame(dayjs('2000-01-01T08:00Z'))) { + throw new Error('wrong end ' + rows[0].end); + } + + if (rows[0].type != 'normal') { + throw new Error('wrong type ' + rows[0].type); + } + + if (rows[0].user != 'unittest.user') { + throw new Error('wrong user ' + rows[0].user); + } + + if ((req as any).related.length != 1) { + throw new Error('wrong number of related' + (req as any).related); + } + + if ((req as any).related[0][0] != 'user:unittest.user') { + throw new Error('wrong related user ' + (req as any).related); + } + + if ((req as any).related[0][1] != 'owner') { + throw new Error('wrong related relationship ' + (req as any).related); + } + + if ((req as any).related[0][2] != `booking:${bookingID}`) { + throw new Error('wrong related user ' + (req as any).related); + } + + if ((req as any).unrelated.length != 0) { + throw new Error('wrong number of related' + (req as any).unrelated); + } + + // bookeddevices + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE booking=?', + [bookingID], + ); + if (rows.length !== 1) { + throw new Error('internal error: wrong number of rows' + rows.length); + } + + if (Number(rows[0].n) != 2) { + throw new Error('number of booked devices is wrong: ' + rows[0].n); + } + + [rows, _] = await db.execute( + 'SELECT originaldevice FROM bookeddevices WHERE booking=? AND originalposition=?', + [bookingID, 0], + ); + if (rows.length !== 1) { + throw new Error('found ' + rows.length + ' devices for position 0'); + } + + if ( + rows[0].originaldevice !== + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong original device ' + rows[0].originaldevice); + } + + [rows, _] = await db.execute( + 'SELECT originaldevice FROM bookeddevices WHERE booking=? AND originalposition=?', + [bookingID, 1], + ); + if (rows.length !== 1) { + throw new Error('found ' + rows.length + ' devices for position 0'); + } + + if ( + rows[0].originaldevice !== + 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000010' + ) { + throw new Error('wrong original device ' + rows[0].originaldevice); + } + + // AMQP + if (TestAMQPresultsBooking.size != 2) { + throw new Error( + 'wrong number of device reservation messages found ' + + MapToString(TestAMQPresultsBooking), + ); + } + if ( + !TestAMQPresultsBooking.has( + bookingID.toString() + + '-0-http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', + ) + ) { + throw new Error( + 'wrong device reservation messages found' + MapToString(TestAMQPresultsBooking), + ); + } + if ( + TestAMQPresultsBooking.get( + bookingID.toString() + + '-0-http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', + ) !== 1 + ) { + throw new Error( + 'wrong device reservation message number found' + + MapToString(TestAMQPresultsBooking), + ); + } + if ( + !TestAMQPresultsBooking.has( + bookingID.toString() + + '-1-http://localhost:10801/devices/00000000-0000-0000-0000-000000000010', + ) + ) { + throw new Error( + 'wrong device reservation messages found' + MapToString(TestAMQPresultsBooking), + ); + } + if ( + TestAMQPresultsBooking.get( + bookingID.toString() + + '-1-http://localhost:10801/devices/00000000-0000-0000-0000-000000000010', + ) !== 1 + ) { + throw new Error( + 'wrong device reservation message number found' + + MapToString(TestAMQPresultsBooking), + ); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('getBookingByID authorization failed', async function () { + try { + let isError: boolean = false; + + let req = getFakeRequest({ user: 'badactor', isAuthorized: false }); + + try { + await getBookingByID(req, { ID: '1' }); + } catch (err) { + if (err.message == 'test authorization failed') { + isError = true; + } else { + console.log(err.message); + throw err; + } + } + await sleep(250); + + if (!isError) { + throw new Error('no access violation detected'); + } + } finally { + } + }); + + mocha.it('getBookingByID success single (creator)', async function () { + try { + let req = getFakeRequest({ user: 'test', isAuthorized: true }); + let b = await getBookingByID(req, { ID: '1' }); + + if (b.status !== 200) { + throw new Error('bad status code' + b.status); + } + + if (b.body.Locked) { + throw new Error('booking is locked'); + } + + if (b.body.Booking.ID != 'http://localhost:10801/booking/1') { + throw new Error('bad id' + b.body.Booking.ID); + } + + if (!b.body.Booking.You) { + throw new Error('you is not set'); + } + + if (b.body.Booking.External) { + throw new Error('booking is external'); + } + + if (b.body.Booking.Status != 'booked') { + throw new Error('wrong status' + b.body.Booking.Status); + } + + if (b.body.Booking.Devices.length != 1) { + throw new Error('wrong number of devices ' + b.body.Booking.Devices.length); + } + + if ( + b.body.Booking.Devices[0] != + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong device 0 ' + b.body.Booking.Devices[0]); + } + + if (!dayjs('1999-01-10T06:00:00Z').isSame(dayjs(b.body.Booking.Time.Start))) { + throw new Error('wrong start ' + b.body.Booking.Time.Start); + } + + if (dayjs(b.body.Booking.Time.Start).toISOString() != b.body.Booking.Time.Start) { + throw new Error('start is no iso ' + b.body.Booking.Time.Start); + } + + if (!dayjs('1999-01-10T07:00:00Z').isSame(dayjs(b.body.Booking.Time.End))) { + throw new Error('wrong end ' + b.body.Booking.Time.End); + } + + if (dayjs(b.body.Booking.Time.End).toISOString() != b.body.Booking.Time.End) { + throw new Error('end is no iso ' + b.body.Booking.Time.End); + } + } finally { + } + }); + + mocha.it('getBookingByID success single (not creator)', async function () { + try { + let req = getFakeRequest({ user: 'not_test', isAuthorized: true }); + let b = await getBookingByID(req, { ID: '1' }); + + if (b.status !== 200) { + throw new Error('bad status code' + b.status); + } + + if (b.body.Locked) { + throw new Error('booking is locked'); + } + + if (b.body.Booking.ID != 'http://localhost:10801/booking/1') { + throw new Error('bad id' + b.body.Booking.ID); + } + + if (b.body.Booking.You) { + throw new Error('you is set'); + } + + if (b.body.Booking.External) { + throw new Error('booking is external'); + } + + if (b.body.Booking.Status != 'booked') { + throw new Error('wrong status' + b.body.Booking.Status); + } + + if (b.body.Booking.Devices.length != 1) { + throw new Error('wrong number of devices ' + b.body.Booking.Devices.length); + } + + if ( + b.body.Booking.Devices[0] != + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong device 0 ' + b.body.Booking.Devices[0]); + } + + if (!dayjs('1999-01-10T06:00:00Z').isSame(dayjs(b.body.Booking.Time.Start))) { + throw new Error('wrong start ' + b.body.Booking.Time.Start); + } + + if (dayjs(b.body.Booking.Time.Start).toISOString() != b.body.Booking.Time.Start) { + throw new Error('start is no iso ' + b.body.Booking.Time.Start); + } + + if (!dayjs('1999-01-10T07:00:00Z').isSame(dayjs(b.body.Booking.Time.End))) { + throw new Error('wrong end ' + b.body.Booking.Time.End); + } + + if (dayjs(b.body.Booking.Time.End).toISOString() != b.body.Booking.Time.End) { + throw new Error('end is no iso ' + b.body.Booking.Time.End); + } + } finally { + } + }); + + mocha.it('getBookingByID success multiple (creator)', async function () { + try { + let req = getFakeRequest({ user: 'test', isAuthorized: true }); + let b = await getBookingByID(req, { ID: '2' }); + + if (b.status !== 200) { + throw new Error('bad status code' + b.status); + } + + if (b.body.Locked) { + throw new Error('booking is locked'); + } + + if (b.body.Booking.ID != 'http://localhost:10801/booking/2') { + throw new Error('bad id' + b.body.Booking.ID); + } + + if (!b.body.Booking.You) { + throw new Error('you is not set'); + } + + if (b.body.Booking.External) { + throw new Error('booking is external'); + } + + if (b.body.Booking.Status != 'booked') { + throw new Error('wrong status' + b.body.Booking.Status); + } + + if (b.body.Booking.Devices.length != 2) { + throw new Error('wrong number of devices ' + b.body.Booking.Devices.length); + } + + if ( + b.body.Booking.Devices[0] != + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong device 0 ' + b.body.Booking.Devices[0]); + } + + if ( + b.body.Booking.Devices[1] != + 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong device 1 ' + b.body.Booking.Devices[1]); + } + + if (!dayjs('1999-02-10T06:00:00Z').isSame(dayjs(b.body.Booking.Time.Start))) { + throw new Error('wrong start ' + b.body.Booking.Time.Start); + } + + if (dayjs(b.body.Booking.Time.Start).toISOString() != b.body.Booking.Time.Start) { + throw new Error('start is no iso ' + b.body.Booking.Time.Start); + } + + if (!dayjs('1999-02-10T07:00:00Z').isSame(dayjs(b.body.Booking.Time.End))) { + throw new Error('wrong end ' + b.body.Booking.Time.End); + } + + if (dayjs(b.body.Booking.Time.End).toISOString() != b.body.Booking.Time.End) { + throw new Error('end is no iso ' + b.body.Booking.Time.End); + } + } finally { + } + }); + + mocha.it('getBookingByID success group (creator)', async function () { + try { + let req = getFakeRequest({ user: 'test', isAuthorized: true }); + let b = await getBookingByID(req, { ID: '3' }); + + if (b.status !== 200) { + throw new Error('bad status code' + b.status); + } + + if (b.body.Locked) { + throw new Error('booking is locked'); + } + + if (b.body.Booking.ID != 'http://localhost:10801/booking/3') { + throw new Error('bad id' + b.body.Booking.ID); + } + + if (!b.body.Booking.You) { + throw new Error('you is not set'); + } + + if (b.body.Booking.External) { + throw new Error('booking is external'); + } + + if (b.body.Booking.Status != 'booked') { + throw new Error('wrong status' + b.body.Booking.Status); + } + + if (b.body.Booking.Devices.length != 1) { + throw new Error('wrong number of devices ' + b.body.Booking.Devices.length); + } + + if ( + b.body.Booking.Devices[0] != + 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000010' + ) { + throw new Error('wrong device 0 ' + b.body.Booking.Devices[0]); + } + + if (!dayjs('1999-03-10T06:00:00Z').isSame(dayjs(b.body.Booking.Time.Start))) { + throw new Error('wrong start ' + b.body.Booking.Time.Start); + } + + if (dayjs(b.body.Booking.Time.Start).toISOString() != b.body.Booking.Time.Start) { + throw new Error('start is no iso ' + b.body.Booking.Time.Start); + } + + if (!dayjs('1999-03-10T07:00:00Z').isSame(dayjs(b.body.Booking.Time.End))) { + throw new Error('wrong end ' + b.body.Booking.Time.End); + } + + if (dayjs(b.body.Booking.Time.End).toISOString() != b.body.Booking.Time.End) { + throw new Error('end is no iso ' + b.body.Booking.Time.End); + } + } finally { + } + }); + + mocha.it('getBookingByID success single locked (creator)', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + try { + await db.execute('UPDATE booking SET `status`=? WHERE `id`=?', [ + 'active', + BigInt(1), + ]); + + let req = getFakeRequest({ user: 'test', isAuthorized: true }); + let b = await getBookingByID(req, { ID: '1' }); + + if (b.status !== 200) { + throw new Error('bad status code' + b.status); + } + + if (!b.body.Locked) { + throw new Error('booking is not locked'); + } + + if (b.body.Booking.ID != 'http://localhost:10801/booking/1') { + throw new Error('bad id' + b.body.Booking.ID); + } + + if (!b.body.Booking.You) { + throw new Error('you is not set'); + } + + if (b.body.Booking.External) { + throw new Error('booking is external'); + } + + if (b.body.Booking.Status != 'active') { + throw new Error('wrong status' + b.body.Booking.Status); + } + + if (b.body.Booking.Devices.length != 1) { + throw new Error('wrong number of devices ' + b.body.Booking.Devices.length); + } + + if ( + b.body.Booking.Devices[0] != + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong device 0 ' + b.body.Booking.Devices[0]); + } + + if (!dayjs('1999-01-10T06:00:00Z').isSame(dayjs(b.body.Booking.Time.Start))) { + throw new Error('wrong start ' + b.body.Booking.Time.Start); + } + + if (dayjs(b.body.Booking.Time.Start).toISOString() != b.body.Booking.Time.Start) { + throw new Error('start is no iso ' + b.body.Booking.Time.Start); + } + + if (!dayjs('1999-01-10T07:00:00Z').isSame(dayjs(b.body.Booking.Time.End))) { + throw new Error('wrong end ' + b.body.Booking.Time.End); + } + + if (dayjs(b.body.Booking.Time.End).toISOString() != b.body.Booking.Time.End) { + throw new Error('end is no iso ' + b.body.Booking.Time.End); + } + } finally { + db.end(); + } + }); + + mocha.it('getBookingByID booking not available', async function () { + let req = getFakeRequest({ user: 'test', isAuthorized: true }); + let b = await getBookingByID(req, { ID: '99999999' }); + + if (b.status !== 404) { + throw new Error('bad status code' + b.status); + } + }); + + mocha.it('deleteBookingByID authorization failed', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestFree(); + try { + let isError: boolean = false; + + let req = getFakeRequest({ user: 'badactor', isAuthorized: false }); + + try { + await deleteBookingByID(req, { ID: '1' }); + } catch (err) { + if (err.message == 'test authorization failed') { + isError = true; + } else { + console.log(err.message); + throw err; + } + } + await sleep(250); + + if (!isError) { + throw new Error('no access violation detected'); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'booked') { + throw new Error('booking was deleted (status=' + rows[0].status + ')'); + } + + if (TestAMQPresults.size != 0) { + throw new Error('freed devices found ' + MapToString(TestAMQPresults)); + } + } finally { + db.end(); + await StopAMQPTestFree(); + ResetAMQPDeviceCount(); + } + }); + + mocha.it('deleteBookingByID success single', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestFree(); + try { + let req = getFakeRequest({ user: 'unittest.user', isAuthorized: true }); + + let res = await deleteBookingByID(req, { ID: '1' }); + await sleep(250); + + if (res.status != 200) { + if (res.status == 500) { + throw new Error(res.body); + } + throw new Error('wrong status ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'cancelled') { + throw new Error('booking was not deleted (status=' + rows[0].status + ')'); + } + + if (TestAMQPresults.size != 1) { + throw new Error( + 'wrong number of freed devices found ' + MapToString(TestAMQPresults), + ); + } + + if (!TestAMQPresults.has(BigInt(1))) { + throw new Error('device not freed ' + MapToString(TestAMQPresults)); + } + + if (Number(TestAMQPresults.get(BigInt(1))) != 1) { + throw new Error('wrong number of free messages ' + MapToString(TestAMQPresults)); + } + } finally { + db.end(); + await StopAMQPTestFree(); + ResetAMQPDeviceCount(); + } + }); + + mocha.it('deleteBookingByID success multiple', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestFree(); + try { + let req = getFakeRequest({ user: 'unittest.user', isAuthorized: true }); + + let res = await deleteBookingByID(req, { ID: '2' }); + await sleep(250); + + if (res.status != 200) { + if (res.status == 500) { + throw new Error(res.body); + } + throw new Error('wrong status ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(2)], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'cancelled') { + throw new Error('booking was not deleted (status=' + rows[0].status + ')'); + } + + if (TestAMQPresults.size != 2) { + throw new Error( + 'wrong number of freed devices found ' + MapToString(TestAMQPresults), + ); + } + + if (!TestAMQPresults.has(BigInt(2))) { + throw new Error('device not freed ' + MapToString(TestAMQPresults)); + } + + if (Number(TestAMQPresults.get(BigInt(2))) != 1) { + throw new Error('wrong number of free messages ' + MapToString(TestAMQPresults)); + } + + if (!TestAMQPresults.has(BigInt(3))) { + throw new Error('device not freed ' + MapToString(TestAMQPresults)); + } + + if (Number(TestAMQPresults.get(BigInt(3))) != 1) { + throw new Error('wrong number of free messages ' + MapToString(TestAMQPresults)); + } + } finally { + db.end(); + await StopAMQPTestFree(); + ResetAMQPDeviceCount(); + } + }); + + mocha.it('deleteBookingByID booking not available', async function () { + let req = getFakeRequest({ user: 'test', isAuthorized: true }); + let b = await deleteBookingByID(req, { ID: '99999999' }); + + if (b.status !== 404) { + throw new Error('bad status code' + b.status); + } + }); + + mocha.it('deleteBookingByID wrong status', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestFree(); + try { + await db.execute('UPDATE booking SET `status`=? WHERE `id`=?', [ + 'active', + BigInt(1), + ]); + + let req = getFakeRequest({ user: 'unittest.user', isAuthorized: true }); + let res = await deleteBookingByID(req, { ID: '1' }); + await sleep(250); + + if (res.status != 423) { + throw new Error('wrong status ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'active') { + throw new Error('booking was deleted (status=' + rows[0].status + ')'); + } + + if (TestAMQPresults.size != 0) { + throw new Error('freed devices found ' + MapToString(TestAMQPresults)); + } + } finally { + db.end(); + await StopAMQPTestFree(); + ResetAMQPDeviceCount(); + } + }); + + mocha.it('patchBookingByID authorization failed callback', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + let isError: boolean = false; + + let req = getFakeRequest({ user: 'badactor', isAuthorized: false }); + + try { + await patchBookingByID( + req, + { ID: '1' }, + { Callback: 'http://localhost:10801/test_callbacks/callback-test-new' }, + ); + } catch (err) { + if (err.message == 'test authorization failed') { + isError = true; + } else { + console.log(err.message); + throw err; + } + } + await sleep(250); + + if (!isError) { + throw new Error('no access violation detected'); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT count(*) AS n FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].n != 0) { + throw new Error('found ' + rows[0].status + ' new callbacks'); + } + + if (TestAMQPresultsBooking.size != 0) { + throw new Error('devices were requested ' + MapToString(TestAMQPresultsBooking)); + } + + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE `booking`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if (rows[0].n != 1) { + throw new Error('found ' + rows[0].status + ' bookeddevices'); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'booked') { + throw new Error('wrong status ' + rows[0].status); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('patchBookingByID success unlocked callback', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + let req = getFakeRequest({ user: 'unittest.user', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '1' }, + { Callback: 'http://localhost:10801/test_callbacks/callback-test-new' }, + ); + await sleep(250); + + if (res.status != 200) { + throw new Error('bad status code ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `booking` FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length == 0) { + throw new Error('can not find booking'); + } + + if (rows.length > 1) { + throw new Error('number of rows too many ' + rows.length); + } + + if (rows[0].booking != 1n) { + throw new Error('wrong booking id ' + rows[0].bookingcallbacks); + } + + // Check devices haven't changed + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE `booking`=?', + [BigInt(1)], + ); + if (rows.length == 0) { + throw new Error('can not find bookeddevices'); + } + + if (rows[0].n > 1) { + throw new Error('number of bookeddevices wrong ' + rows[0].n); + } + + if (TestAMQPresultsBooking.size != 0) { + throw new Error('devices were requested ' + MapToString(TestAMQPresultsBooking)); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'booked') { + throw new Error('wrong status ' + rows[0].status); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('patchBookingByID success locked callback', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + await db.execute('UPDATE booking SET `status`=? WHERE `id`=?', [ + 'active', + BigInt(1), + ]); + + let req = getFakeRequest({ user: 'unittest.user', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '1' }, + { + Callback: 'http://localhost:10801/test_callbacks/callback-test-new', + Locked: true, + }, + ); + await sleep(250); + + if (res.status != 200) { + throw new Error('bad status code ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `booking` FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length == 0) { + throw new Error('can not find booking'); + } + + if (rows.length > 1) { + throw new Error('number of rows too many ' + rows.length); + } + + if (rows[0].booking != 1n) { + throw new Error('wrong booking id ' + rows[0].bookingcallbacks); + } + + // Check devices haven't changed + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE `booking`=?', + [BigInt(1)], + ); + if (rows.length == 0) { + throw new Error('can not find bookeddevices'); + } + + if (rows[0].n > 1) { + throw new Error('number of bookeddevices wrong ' + rows[0].n); + } + + if (TestAMQPresultsBooking.size != 0) { + throw new Error('devices were requested ' + MapToString(TestAMQPresultsBooking)); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'active') { + throw new Error('wrong status ' + rows[0].status); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('patchBookingByID empty device list does not change anything', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + await db.execute('UPDATE booking SET `status`=? WHERE `id`=?', [ + 'active', + BigInt(1), + ]); + + let req = getFakeRequest({ user: 'unittest.user', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '1' }, + { + Devices: [], + Locked: true, + }, + ); + await sleep(250); + + if (res.status != 200) { + throw new Error('bad status code ' + res.status); + } + + if (TestAMQPresultsBooking.size != 0) { + throw new Error('devices were requested ' + MapToString(TestAMQPresultsBooking)); + } + + let [rows, _]: [any, any] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'active') { + throw new Error('wrong status ' + rows[0].status); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('patchBookingByID booking not available callback', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + let req = getFakeRequest({ user: 'user.unittest.', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '999999999999' }, + { Callback: 'http://localhost:10801/test_callbacks/callback-test-new' }, + ); + await sleep(250); + + if (res.status != 404) { + throw new Error('bad status code ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT count(*) AS n FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].n != 0) { + throw new Error('found ' + rows[0].status + ' new callbacks'); + } + + if (TestAMQPresultsBooking.size != 0) { + throw new Error('devices were requested ' + MapToString(TestAMQPresultsBooking)); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'booked') { + throw new Error('wrong status ' + rows[0].status); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('patchBookingByID success unlocked devices', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + let req = getFakeRequest({ user: 'unittest.user', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '1' }, + { + Devices: [ + { ID: 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' }, + ], + }, + ); + await sleep(250); + + if (res.status != 200) { + throw new Error('bad status code ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE `booking`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if (rows[0].n != 2) { + throw new Error('found ' + rows[0].status + ' bookeddevices'); + } + + [rows, _] = await db.execute( + 'SELECT `originaldevice` FROM bookeddevices WHERE `booking` = ? AND `originalposition`=?', + [BigInt(1), 0], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if ( + rows[0].originaldevice != + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong originaldevice ' + rows[0].originaldevice); + } + + [rows, _] = await db.execute( + 'SELECT `originaldevice` FROM bookeddevices WHERE `booking` = ? AND `originalposition`=?', + [BigInt(1), 1], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if ( + rows[0].originaldevice != + 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong originaldevice ' + rows[0].originaldevice); + } + + if (TestAMQPresultsBooking.size != 1) { + throw new Error( + 'wrong number devices were requested ' + MapToString(TestAMQPresultsBooking), + ); + } + + if ( + !TestAMQPresultsBooking.has( + '1-1-http://localhost:10801/devices/20000000-0000-0000-0000-000000000000', + ) + ) { + throw new Error( + 'wrong devices were requested ' + MapToString(TestAMQPresultsBooking), + ); + } + + if ( + Number( + TestAMQPresultsBooking.has( + '1-1-http://localhost:10801/devices/20000000-0000-0000-0000-000000000000', + ), + ) != 1 + ) { + throw new Error( + 'wrong device number were requested ' + MapToString(TestAMQPresultsBooking), + ); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'pending') { + throw new Error('wrong status ' + rows[0].status); + } + + // No new callbacks + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].n != 0) { + throw new Error('found ' + rows[0].status + ' new callbacks'); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('patchBookingByID success unlocked devices multiple', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + let req = getFakeRequest({ user: 'unittest.user', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '1' }, + { + Devices: [ + { ID: 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' }, + { ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000010' }, + ], + }, + ); + await sleep(250); + + if (res.status != 200) { + throw new Error('bad status code ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE `booking`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if (rows[0].n != 3) { + throw new Error('found ' + rows[0].status + ' bookeddevices'); + } + + [rows, _] = await db.execute( + 'SELECT `originaldevice` FROM bookeddevices WHERE `booking` = ? AND `originalposition`=?', + [BigInt(1), 0], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if ( + rows[0].originaldevice != + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong originaldevice ' + rows[0].originaldevice); + } + + [rows, _] = await db.execute( + 'SELECT `originaldevice` FROM bookeddevices WHERE `booking` = ? AND `originalposition`=?', + [BigInt(1), 1], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if ( + rows[0].originaldevice != + 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong originaldevice ' + rows[0].originaldevice); + } + + [rows, _] = await db.execute( + 'SELECT `originaldevice` FROM bookeddevices WHERE `booking` = ? AND `originalposition`=?', + [BigInt(1), 2], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if ( + rows[0].originaldevice != + 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000010' + ) { + throw new Error('wrong originaldevice ' + rows[0].originaldevice); + } + + if (TestAMQPresultsBooking.size != 2) { + throw new Error( + 'wrong number devices were requested ' + MapToString(TestAMQPresultsBooking), + ); + } + + if ( + !TestAMQPresultsBooking.has( + '1-1-http://localhost:10801/devices/20000000-0000-0000-0000-000000000000', + ) + ) { + throw new Error( + 'wrong devices were requested ' + MapToString(TestAMQPresultsBooking), + ); + } + + if ( + Number( + TestAMQPresultsBooking.has( + '1-1-http://localhost:10801/devices/20000000-0000-0000-0000-000000000000', + ), + ) != 1 + ) { + throw new Error( + 'wrong device number were requested ' + MapToString(TestAMQPresultsBooking), + ); + } + + if ( + !TestAMQPresultsBooking.has( + '1-2-http://localhost:10801/devices/00000000-0000-0000-0000-000000000010', + ) + ) { + throw new Error( + 'wrong devices were requested ' + MapToString(TestAMQPresultsBooking), + ); + } + + if ( + Number( + TestAMQPresultsBooking.has( + '1-2-http://localhost:10801/devices/00000000-0000-0000-0000-000000000010', + ), + ) != 1 + ) { + throw new Error( + 'wrong device number were requested ' + MapToString(TestAMQPresultsBooking), + ); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'pending') { + throw new Error('wrong status ' + rows[0].status); + } + // No new callbacks + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].n != 0) { + throw new Error('found ' + rows[0].status + ' new callbacks'); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('patchBookingByID unlocked devices set locked', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + let req = getFakeRequest({ user: 'user.unittest', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '1' }, + { + Devices: [ + { ID: 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' }, + ], + Locked: true, + }, + ); + await sleep(250); + + if (res.status != 423) { + throw new Error('wrong status ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT count(*) AS n FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].n != 0) { + throw new Error('found ' + rows[0].status + ' new callbacks'); + } + + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE `booking`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if (rows[0].n != 1) { + throw new Error('found ' + rows[0].status + ' bookeddevices'); + } + + if (TestAMQPresultsBooking.size != 0) { + throw new Error('devices were requested ' + MapToString(TestAMQPresultsBooking)); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'booked') { + throw new Error('wrong status ' + rows[0].status); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('patchBookingByID success locked devices', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + await db.execute('UPDATE `booking` SET `status`=? WHERE `id`=?', [ + 'active', + BigInt(1), + ]); + + let req = getFakeRequest({ user: 'unittest.user', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '1' }, + { + Devices: [ + { ID: 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' }, + ], + Locked: true, + }, + ); + await sleep(250); + + if (res.status != 200) { + throw new Error('bad status code ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE `booking`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if (rows[0].n != 2) { + throw new Error('found ' + rows[0].status + ' bookeddevices'); + } + + [rows, _] = await db.execute( + 'SELECT `originaldevice` FROM bookeddevices WHERE `booking` = ? AND `originalposition`=?', + [BigInt(1), 0], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if ( + rows[0].originaldevice != + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong originaldevice ' + rows[0].originaldevice); + } + + [rows, _] = await db.execute( + 'SELECT `originaldevice` FROM bookeddevices WHERE `booking` = ? AND `originalposition`=?', + [BigInt(1), 1], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if ( + rows[0].originaldevice != + 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' + ) { + throw new Error('wrong originaldevice ' + rows[0].originaldevice); + } + + if (TestAMQPresultsBooking.size != 1) { + throw new Error( + 'wrong number devices were requested ' + MapToString(TestAMQPresultsBooking), + ); + } + + if ( + !TestAMQPresultsBooking.has( + '1-1-http://localhost:10801/devices/20000000-0000-0000-0000-000000000000', + ) + ) { + throw new Error( + 'wrong devices were requested ' + MapToString(TestAMQPresultsBooking), + ); + } + + if ( + Number( + TestAMQPresultsBooking.has( + '1-1-http://localhost:10801/devices/20000000-0000-0000-0000-000000000000', + ), + ) != 1 + ) { + throw new Error( + 'wrong device number were requested ' + MapToString(TestAMQPresultsBooking), + ); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'active-pending') { + throw new Error('wrong status ' + rows[0].status); + } + + // No new callbacks + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].n != 0) { + throw new Error('found ' + rows[0].status + ' new callbacks'); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('patchBookingByID locked devices forgot locked', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + await db.execute('UPDATE `booking` SET `status`=? WHERE `id`=?', [ + 'active', + BigInt(1), + ]); + + let req = getFakeRequest({ user: 'user.unittest', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '1' }, + { + Devices: [ + { ID: 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' }, + ], + }, + ); // no Locked here + await sleep(250); + + if (res.status != 423) { + throw new Error('wrong status ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT count(*) AS n FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].n != 0) { + throw new Error('found ' + rows[0].status + ' new callbacks'); + } + + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE `booking`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if (rows[0].n != 1) { + throw new Error('found ' + rows[0].status + ' bookeddevices'); + } + + if (TestAMQPresultsBooking.size != 0) { + throw new Error('devices were requested ' + MapToString(TestAMQPresultsBooking)); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'active') { + throw new Error('wrong status ' + rows[0].status); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('patchBookingByID booking not available devices', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + let req = getFakeRequest({ user: 'user.unittest.', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '999999999999' }, + { + Devices: [ + { ID: 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' }, + ], + }, + ); + await sleep(250); + + if (res.status != 404) { + throw new Error('bad status code ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT count(*) AS n FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].n != 0) { + throw new Error('found ' + rows[0].status + ' new callbacks'); + } + + if (TestAMQPresultsBooking.size != 0) { + throw new Error('devices were requested ' + MapToString(TestAMQPresultsBooking)); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'booked') { + throw new Error('wrong status ' + rows[0].status); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it( + 'patchBookingByID wrong status unlocked devices (cancelled)', + async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + await db.execute('UPDATE `booking` SET `status`=? WHERE `id`=?', [ + 'cancelled', + BigInt(1), + ]); + + let req = getFakeRequest({ user: 'user.unittest', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '1' }, + { + Devices: [ + { + ID: 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000', + }, + ], + }, + ); + await sleep(250); + + if (res.status != 423) { + throw new Error('wrong status ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT count(*) AS n FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].n != 0) { + throw new Error('found ' + rows[0].status + ' new callbacks'); + } + + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE `booking`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if (rows[0].n != 1) { + throw new Error('found ' + rows[0].status + ' bookeddevices'); + } + + if (TestAMQPresultsBooking.size != 0) { + throw new Error( + 'devices were requested ' + MapToString(TestAMQPresultsBooking), + ); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'cancelled') { + throw new Error('wrong status ' + rows[0].status); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }, + ); + + mocha.it( + 'patchBookingByID wrong status unlocked devices (rejected)', + async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + await db.execute('UPDATE `booking` SET `status`=? WHERE `id`=?', [ + 'rejected', + BigInt(1), + ]); + + let req = getFakeRequest({ user: 'user.unittest', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '1' }, + { + Devices: [ + { + ID: 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000', + }, + ], + }, + ); + await sleep(250); + + if (res.status != 423) { + throw new Error('wrong status ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT count(*) AS n FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].n != 0) { + throw new Error('found ' + rows[0].status + ' new callbacks'); + } + + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE `booking`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if (rows[0].n != 1) { + throw new Error('found ' + rows[0].status + ' bookeddevices'); + } + + if (TestAMQPresultsBooking.size != 0) { + throw new Error( + 'devices were requested ' + MapToString(TestAMQPresultsBooking), + ); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'rejected') { + throw new Error('wrong status ' + rows[0].status); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }, + ); + + mocha.it( + 'patchBookingByID wrong status unlocked devices (active-pending)', + async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + await db.execute('UPDATE `booking` SET `status`=? WHERE `id`=?', [ + 'active-pending', + BigInt(1), + ]); + + let req = getFakeRequest({ user: 'user.unittest', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '1' }, + { + Devices: [ + { + ID: 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000', + }, + ], + }, + ); + await sleep(250); + + if (res.status != 423) { + throw new Error('wrong status ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT count(*) AS n FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].n != 0) { + throw new Error('found ' + rows[0].status + ' new callbacks'); + } + + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE `booking`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if (rows[0].n != 1) { + throw new Error('found ' + rows[0].status + ' bookeddevices'); + } + + if (TestAMQPresultsBooking.size != 0) { + throw new Error( + 'devices were requested ' + MapToString(TestAMQPresultsBooking), + ); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'active-pending') { + throw new Error('wrong status ' + rows[0].status); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }, + ); + mocha.it( + 'patchBookingByID wrong status unlocked devices (active-rejected)', + async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + await db.execute('UPDATE `booking` SET `status`=? WHERE `id`=?', [ + 'active-rejected', + BigInt(1), + ]); + + let req = getFakeRequest({ user: 'user.unittest', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '1' }, + { + Devices: [ + { + ID: 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000', + }, + ], + }, + ); + await sleep(250); + + if (res.status != 423) { + throw new Error('wrong status ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT count(*) AS n FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].n != 0) { + throw new Error('found ' + rows[0].status + ' new callbacks'); + } + + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE `booking`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if (rows[0].n != 1) { + throw new Error('found ' + rows[0].status + ' bookeddevices'); + } + + if (TestAMQPresultsBooking.size != 0) { + throw new Error( + 'devices were requested ' + MapToString(TestAMQPresultsBooking), + ); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'active-rejected') { + throw new Error('wrong status ' + rows[0].status); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }, + ); + + mocha.it('patchBookingByID wrong status locked devices (cancelled)', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + await db.execute('UPDATE `booking` SET `status`=? WHERE `id`=?', [ + 'cancelled', + BigInt(1), + ]); + + let req = getFakeRequest({ user: 'user.unittest', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '1' }, + { + Devices: [ + { ID: 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' }, + ], + Locked: true, + }, + ); + await sleep(250); + + if (res.status != 423) { + throw new Error('wrong status ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT count(*) AS n FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].n != 0) { + throw new Error('found ' + rows[0].status + ' new callbacks'); + } + + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE `booking`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if (rows[0].n != 1) { + throw new Error('found ' + rows[0].status + ' bookeddevices'); + } + + if (TestAMQPresultsBooking.size != 0) { + throw new Error('devices were requested ' + MapToString(TestAMQPresultsBooking)); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'cancelled') { + throw new Error('wrong status ' + rows[0].status); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('patchBookingByID wrong status locked devices (rejected)', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + await db.execute('UPDATE `booking` SET `status`=? WHERE `id`=?', [ + 'rejected', + BigInt(1), + ]); + + let req = getFakeRequest({ user: 'user.unittest', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '1' }, + { + Devices: [ + { ID: 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' }, + ], + Locked: true, + }, + ); + await sleep(250); + + if (res.status != 423) { + throw new Error('wrong status ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT count(*) AS n FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].n != 0) { + throw new Error('found ' + rows[0].status + ' new callbacks'); + } + + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE `booking`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if (rows[0].n != 1) { + throw new Error('found ' + rows[0].status + ' bookeddevices'); + } + + if (TestAMQPresultsBooking.size != 0) { + throw new Error('devices were requested ' + MapToString(TestAMQPresultsBooking)); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'rejected') { + throw new Error('wrong status ' + rows[0].status); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('patchBookingByID wrong status locked devices (pending)', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + await db.execute('UPDATE `booking` SET `status`=? WHERE `id`=?', [ + 'pending', + BigInt(1), + ]); + + let req = getFakeRequest({ user: 'user.unittest', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '1' }, + { + Devices: [ + { ID: 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' }, + ], + Locked: true, + }, + ); + await sleep(250); + + if (res.status != 423) { + throw new Error('wrong status ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT count(*) AS n FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].n != 0) { + throw new Error('found ' + rows[0].status + ' new callbacks'); + } + + [rows, _] = await db.execute( + 'SELECT count(*) AS n FROM bookeddevices WHERE `booking`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find bookeddevices'); + } + + if (rows[0].n != 1) { + throw new Error('found ' + rows[0].status + ' bookeddevices'); + } + + if (TestAMQPresultsBooking.size != 0) { + throw new Error('devices were requested ' + MapToString(TestAMQPresultsBooking)); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'pending') { + throw new Error('wrong status ' + rows[0].status); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('patchBookingByID both callback and devices', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestBooking(); + try { + let req = getFakeRequest({ user: 'user.unittest.', isAuthorized: true }); + + let res = await patchBookingByID( + req, + { ID: '1' }, + { + Callback: 'http://localhost:10801/test_callbacks/callback-test-new', + Devices: [ + { ID: 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000' }, + ], + }, + ); + await sleep(250); + + if (res.status != 400) { + throw new Error('bad status code ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT count(*) AS n FROM bookingcallbacks WHERE `url`=?', + ['http://localhost:10801/test_callbacks/callback-test-new'], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].n != 0) { + throw new Error('found ' + rows[0].status + ' new callbacks'); + } + + if (TestAMQPresultsBooking.size != 0) { + throw new Error('devices were requested ' + MapToString(TestAMQPresultsBooking)); + } + + [rows, _] = await db.execute('SELECT `status` FROM booking WHERE `id`=?', [ + BigInt(1), + ]); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'booked') { + throw new Error('wrong status ' + rows[0].status); + } + } finally { + db.end(); + await StopAMQPTestBooking(); + ResetAMQPBookingDeviceCount(); + } + }); + + mocha.it('deleteBookingByIDDestroy authorization failed', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestFree(); + try { + let isError: boolean = false; + + let req = getFakeRequest({ user: 'badactor', isAuthorized: false }); + + try { + await deleteBookingByIDDestroy(req, { ID: '1' }); + } catch (err) { + if (err.message == 'test authorization failed') { + isError = true; + } else { + console.log(err.message); + throw err; + } + } + await sleep(250); + + if (!isError) { + throw new Error('no access violation detected'); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'booked') { + throw new Error('booking was deleted (status=' + rows[0].status + ')'); + } + + if (TestAMQPresults.size != 0) { + throw new Error('freed devices found ' + MapToString(TestAMQPresults)); + } + } finally { + db.end(); + await StopAMQPTestFree(); + ResetAMQPDeviceCount(); + } + }); + + mocha.it('deleteBookingByIDDestroy success single', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestFree(); + try { + let req = getFakeRequest({ user: 'unittest.user', isAuthorized: true }); + + let res = await deleteBookingByIDDestroy(req, { ID: '1' }); + await sleep(250); + + if (res.status != 200) { + if (res.status == 500) { + throw new Error(res.body); + } + throw new Error('wrong status ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'cancelled') { + throw new Error('booking was not deleted (status=' + rows[0].status + ')'); + } + + if (TestAMQPresults.size != 1) { + throw new Error( + 'wrong number of freed devices found ' + MapToString(TestAMQPresults), + ); + } + + if (!TestAMQPresults.has(BigInt(1))) { + throw new Error('device not freed ' + MapToString(TestAMQPresults)); + } + + if (Number(TestAMQPresults.get(BigInt(1))) != 1) { + throw new Error('wrong number of free messages ' + MapToString(TestAMQPresults)); + } + } finally { + db.end(); + await StopAMQPTestFree(); + ResetAMQPDeviceCount(); + } + }); + + mocha.it('deleteBookingByIDDestroy success multiple', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestFree(); + try { + let req = getFakeRequest({ user: 'unittest.user', isAuthorized: true }); + + let res = await deleteBookingByIDDestroy(req, { ID: '2' }); + await sleep(250); + + if (res.status != 200) { + if (res.status == 500) { + throw new Error(res.body); + } + throw new Error('wrong status ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(2)], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'cancelled') { + throw new Error('booking was not deleted (status=' + rows[0].status + ')'); + } + + if (TestAMQPresults.size != 2) { + throw new Error( + 'wrong number of freed devices found ' + MapToString(TestAMQPresults), + ); + } + + if (!TestAMQPresults.has(BigInt(2))) { + throw new Error('device not freed ' + MapToString(TestAMQPresults)); + } + + if (Number(TestAMQPresults.get(BigInt(2))) != 1) { + throw new Error('wrong number of free messages ' + MapToString(TestAMQPresults)); + } + + if (!TestAMQPresults.has(BigInt(3))) { + throw new Error('device not freed ' + MapToString(TestAMQPresults)); + } + + if (Number(TestAMQPresults.get(BigInt(3))) != 1) { + throw new Error('wrong number of free messages ' + MapToString(TestAMQPresults)); + } + } finally { + db.end(); + await StopAMQPTestFree(); + ResetAMQPDeviceCount(); + } + }); + + mocha.it('deleteBookingByIDDestroy booking not available', async function () { + let req = getFakeRequest({ user: 'test', isAuthorized: true }); + let b = await deleteBookingByIDDestroy(req, { ID: '99999999' }); + + if (b.status !== 404) { + throw new Error('bad status code' + b.status); + } + }); + + mocha.it('deleteBookingByIDDestroy wrong status', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + await StartAMQPTestFree(); + try { + await db.execute('UPDATE booking SET `status`=? WHERE `id`=?', [ + 'active', + BigInt(1), + ]); + + let req = getFakeRequest({ user: 'unittest.user', isAuthorized: true }); + let res = await deleteBookingByIDDestroy(req, { ID: '1' }); + await sleep(250); + + if (res.status != 423) { + throw new Error('wrong status ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'active') { + throw new Error('booking was deleted (status=' + rows[0].status + ')'); + } + + if (TestAMQPresults.size != 0) { + throw new Error('freed devices found ' + MapToString(TestAMQPresults)); + } + } finally { + db.end(); + await StopAMQPTestFree(); + ResetAMQPDeviceCount(); + } + }); + + mocha.it('deleteBookingByIDDestroy double delete does nothing', async function () { + let db = await mysql.createConnection(getSQLDNS()); + await db.connect(); + try { + await db.execute('UPDATE booking SET `status`=? WHERE `id`=?', [ + 'cancelled', + BigInt(1), + ]); + + let req = getFakeRequest({ user: 'unittest.user', isAuthorized: true }); + let res = await deleteBookingByIDDestroy(req, { ID: '1' }); + await sleep(250); + + if (res.status != 200) { + throw new Error('wrong status ' + res.status); + } + + let [rows, _]: [any, any] = await db.execute( + 'SELECT `status` FROM booking WHERE `id`=?', + [BigInt(1)], + ); + if (rows.length !== 1) { + throw new Error('can not find booking'); + } + + if (rows[0].status != 'cancelled') { + throw new Error('booking status was deleted (status=' + rows[0].status + ')'); + } + } finally { + db.end(); + } + }); +}); diff --git a/services/booking/src/booking-frontend/src/operations/indextest_helper_amqp_booking.ts b/services/booking/src/booking-frontend/src/operations/indextest_helper_amqp_booking.ts new file mode 100644 index 00000000..6e0c2315 --- /dev/null +++ b/services/booking/src/booking-frontend/src/operations/indextest_helper_amqp_booking.ts @@ -0,0 +1,109 @@ +import { sleep } from '@crosslab/booking-service-common'; +import { DeviceBookingRequest } from '@crosslab/service-booking-backend'; +import * as amqplib from 'amqplib'; + +import { config } from '../config.js'; + +let connection: amqplib.Connection; +let channel: amqplib.Channel; + +let amqpTestStarted = false; + +export let TestAMQPresultsBooking = new Map(); + +export function MapToString(map: Map): string { + return JSON.stringify(Object.fromEntries(map)); +} + +export function ResetAMQPBookingDeviceCount(): void { + TestAMQPresultsBooking = new Map(); +} + +async function helperLoop(): Promise { + while (true) { + let msg = await channel.get('device-booking', { noAck: false }); + + if (typeof msg === 'boolean') { + await sleep(20); + continue; + } + + if (msg === null) { + continue; + } + let data: string; + let message: DeviceBookingRequest; + // Parse data + try { + data = msg.content.toString(); + + if (data === 'end amqp test') { + amqpTestStarted = false; + return; + } + + message = DeviceBookingRequest.fromString(data); + } catch (error) { + console.error('Can not parse message:', error); + try { + channel.ack(msg); + } catch (error) { + console.error('Can not ack message:', error); + } + continue; + } + try { + let key = '' + message.BookingID + '-' + message.Position + '-' + message.Device; + if (TestAMQPresultsBooking.has(key)) { + TestAMQPresultsBooking.set(key, TestAMQPresultsBooking.get(key) + 1); + } + TestAMQPresultsBooking.set(key, 1); + channel.ack(msg); + } catch (err) { + console.error('Error at helperLoop: ' + err); + } + } +} + +export async function StartAMQPTestBooking(): Promise { + if (amqpTestStarted) { + throw new Error('amqp mockup alreay started'); + } + + connection = await amqplib.connect(config.AmqpUrl); + channel = await connection.createChannel(); + + await channel.assertQueue('device-booking', { + durable: true, + }); + + while (await channel.get('device-booking', { noAck: true })) {} + + helperLoop(); + amqpTestStarted = true; + + return; +} + +export async function StopAMQPTestBooking(): Promise { + if (!amqpTestStarted) { + throw new Error('amqp mockup alreay stopped'); + } + + if ( + !channel.sendToQueue('device-booking', Buffer.from('end amqp test'), { + persistent: true, + }) + ) { + throw new Error('amqp queue full'); + } + + await sleep(1000); + await channel.close(); + channel = null; + await sleep(250); + await connection.close(); + connection = null; + + return; +} diff --git a/services/booking/src/booking-frontend/src/operations/indextest_helper_amqp_free.ts b/services/booking/src/booking-frontend/src/operations/indextest_helper_amqp_free.ts new file mode 100644 index 00000000..421e9ee3 --- /dev/null +++ b/services/booking/src/booking-frontend/src/operations/indextest_helper_amqp_free.ts @@ -0,0 +1,104 @@ +import { sleep } from '@crosslab/booking-service-common'; +import * as amqplib from 'amqplib'; + +import { config } from '../config.js'; + +let connection: amqplib.Connection; +let channel: amqplib.Channel; + +let amqpTestStarted = false; + +export let TestAMQPresults = new Map(); + +export function MapToString(map: Map): string { + return JSON.stringify(Object.fromEntries(map)); +} + +export function ResetAMQPDeviceCount(): void { + TestAMQPresults = new Map(); +} + +async function helperLoop(): Promise { + while (true) { + let msg = await channel.get('device-freeing', { noAck: false }); + + if (typeof msg === 'boolean') { + await sleep(20); + continue; + } + + if (msg === null) { + continue; + } + + // Parse data + let data: bigint; + try { + data = BigInt(msg.content.toString()); + } catch (error) { + console.error('Can not parse message:', error); + try { + channel.ack(msg); + } catch (error) { + console.error('Can not ack message:', error); + } + continue; + } + try { + if (data === -9999n) { + amqpTestStarted = false; + return; + } + if (TestAMQPresults.has(data)) { + TestAMQPresults.set(data, TestAMQPresults.get(data) + 1); + } + TestAMQPresults.set(data, 1); + channel.ack(msg); + } catch (err) { + console.error('Error at helperLoop: ' + err); + } + } +} + +export async function StartAMQPTestFree(): Promise { + if (amqpTestStarted) { + throw new Error('amqp mockup alreay started'); + } + + connection = await amqplib.connect(config.AmqpUrl); + channel = await connection.createChannel(); + + await channel.assertQueue('device-freeing', { + durable: true, + }); + + while (await channel.get('device-freeing', { noAck: true })) {} + + helperLoop(); + amqpTestStarted = true; + + return; +} + +export async function StopAMQPTestFree(): Promise { + if (!amqpTestStarted) { + throw new Error('amqp mockup alreay stopped'); + } + + if ( + !channel.sendToQueue('device-freeing', Buffer.from((-9999n).toString()), { + persistent: true, + }) + ) { + throw new Error('amqp queue full'); + } + + await sleep(1000); + await channel.close(); + channel = null; + await sleep(250); + await connection.close(); + connection = null; + + return; +} diff --git a/services/booking/src/booking-frontend/tsconfig.json b/services/booking/src/booking-frontend/tsconfig.json index 03bf091a..30425935 100644 --- a/services/booking/src/booking-frontend/tsconfig.json +++ b/services/booking/src/booking-frontend/tsconfig.json @@ -1,11 +1,23 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "Node", - "target": "ES2020", + "module": "Node16", + "moduleResolution": "Node16", + "allowSyntheticDefaultImports": true, + "target": "ES2022", + "lib": ["ES2022"], + "esModuleInterop": true, "outDir": "app", "rootDir": "src", + // "strict": true, + "noImplicitAny": true, + // "noUnusedLocals": true, + "noUnusedParameters": true, + // "noImplicitReturns": true, + // "noFallthroughCasesInSwitch": true, "sourceMap": true, - "esModuleInterop": true - } + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "skipLibCheck": true + }, + "include": ["src"] } diff --git a/services/booking/src/common/package-lock.json b/services/booking/src/common/package-lock.json index be296d95..edbf1c91 100644 --- a/services/booking/src/common/package-lock.json +++ b/services/booking/src/common/package-lock.json @@ -1,532 +1,2821 @@ { - "name": "@crosslab/booking-service-common", - "version": "0.0.1", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@crosslab/booking-service-common", - "version": "0.0.1", - "license": "Apache-2.0", - "dependencies": { - "@trivago/prettier-plugin-sort-imports": "^4.2.0" - }, - "devDependencies": { - "@types/node": "^22.1.0", - "prettier": "^3.3.3", - "typescript": "^5.5.4" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", - "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", - "dependencies": { - "@babel/highlight": "^7.24.7", - "picocolors": "^1.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/generator": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", - "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", - "dependencies": { - "@babel/types": "^7.17.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-environment-visitor": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", - "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", - "dependencies": { - "@babel/types": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-environment-visitor/node_modules/@babel/types": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", - "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", - "dependencies": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-function-name": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", - "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", - "dependencies": { - "@babel/template": "^7.24.7", - "@babel/types": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-function-name/node_modules/@babel/types": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", - "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", - "dependencies": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", - "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", - "dependencies": { - "@babel/types": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", - "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", - "dependencies": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", - "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", - "dependencies": { - "@babel/types": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", - "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", - "dependencies": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-string-parser": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", - "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", - "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", - "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", - "dependencies": { - "@babel/helper-validator-identifier": "^7.24.7", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/parser": { - "version": "7.25.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.3.tgz", - "integrity": "sha512-iLTJKDbJ4hMvFPgQwwsVoxtHyWpKKPBrxkANrSYewDPaPpT5py5yeVkgPIJ7XYXhndxJpaA3PyALSXQ7u8e/Dw==", - "dependencies": { - "@babel/types": "^7.25.2" - }, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/parser/node_modules/@babel/types": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", - "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", - "dependencies": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/template": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", - "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", - "dependencies": { - "@babel/code-frame": "^7.24.7", - "@babel/parser": "^7.25.0", - "@babel/types": "^7.25.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/template/node_modules/@babel/types": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", - "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", - "dependencies": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", - "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", - "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.0", - "@babel/types": "^7.23.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse/node_modules/@babel/generator": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.0.tgz", - "integrity": "sha512-3LEEcj3PVW8pW2R1SR1M89g/qrYk/m/mB/tLqn7dn4sbBUQyTqnlod+II2U4dqiGtUmkcnAmkMDralTFZttRiw==", - "dependencies": { - "@babel/types": "^7.25.0", - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25", - "jsesc": "^2.5.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse/node_modules/@babel/types": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", - "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", - "dependencies": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", - "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", - "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@trivago/prettier-plugin-sort-imports": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.3.0.tgz", - "integrity": "sha512-r3n0onD3BTOVUNPhR4lhVK4/pABGpbA7bW3eumZnYdKaHkf1qEC+Mag6DPbGNuuh0eG8AaYj+YqmVHSiGslaTQ==", - "dependencies": { - "@babel/generator": "7.17.7", - "@babel/parser": "^7.20.5", - "@babel/traverse": "7.23.2", - "@babel/types": "7.17.0", - "javascript-natural-sort": "0.7.1", - "lodash": "^4.17.21" - }, - "peerDependencies": { - "@vue/compiler-sfc": "3.x", - "prettier": "2.x - 3.x" - }, - "peerDependenciesMeta": { - "@vue/compiler-sfc": { - "optional": true + "name": "@crosslab/booking-service-common", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@crosslab/booking-service-common", + "version": "0.0.1", + "license": "Apache-2.0", + "dependencies": { + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/express": "^4.17.13", + "ajv-formats": "^3.0.1", + "express": "^4.18.1", + "node-fetch": "^3.3.2" + }, + "devDependencies": { + "@cross-lab-project/codegen-typescript-addon": "file:../../../../helper/crosslab-typescript-addon", + "@cross-lab-project/openapi-codegen": "file:../../../../helper/openapi-codegeneration", + "@types/express": "^4.17.13", + "@types/node": "^20.5.9", + "@types/node-fetch": "^2.6.4", + "npm-run-all": "^4.1.5", + "prettier": "^3.0.3", + "typescript": "^5.2.2" + } + }, + "../../../../helper/crosslab-typescript-addon": { + "name": "@cross-lab-project/codegen-typescript-addon", + "dev": true, + "license": "UNLICENSED", + "dependencies": { + "@apidevtools/swagger-parser": "^10.1.0", + "nunjucks": "^3.2.3" + }, + "devDependencies": { + "@cross-lab-project/openapi-codegen": "file:../openapi-codegeneration", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/node": "^20.5.9", + "@types/nunjucks": "^3.2.3", + "@types/seedrandom": "^3.0.5", + "@typescript-eslint/eslint-plugin": "^6.6.0", + "@typescript-eslint/parser": "^6.6.0", + "copyfiles": "^2.4.1", + "eslint": "^8.48.0", + "openapi-types": "^12.1.3", + "prettier": "^3.0.3", + "tsc-watch": "^6.0.4", + "typescript": "^5.2.2" + }, + "peerDependencies": { + "@cross-lab-project/openapi-codegen": "file:../openapi-codegeneration", + "ajv": "^8.11.0", + "ajv-formats": "^2.1.1" + } + }, + "../../../../helper/openapi-codegeneration": { + "name": "@cross-lab-project/openapi-codegen", + "dev": true, + "license": "UNLICENSED", + "dependencies": { + "@apidevtools/swagger-parser": "^10.1.0", + "ajv": "^8.12.0", + "ajv-formats": "^2.1.1", + "commander": "^11.0.0", + "deterministic-json-schema-faker": "^0.5.0-rcv.46", + "glob": "^10.3.4", + "json-schema-merge-allof": "^0.8.1", + "json-schema-to-typescript": "^13.1.1", + "nunjucks": "^3.2.4", + "quicktype-core": "^23.0.75", + "seedrandom": "^3.0.5", + "tiny-typed-emitter": "^2.1.0", + "yaml": "^2.3.2" + }, + "bin": { + "openapi-codegen": "lib/cjs/index.js" + }, + "devDependencies": { + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/node": "^20.5.9", + "@types/nunjucks": "^3.2.3", + "@types/seedrandom": "^3.0.5", + "@typescript-eslint/eslint-plugin": "^6.6.0", + "@typescript-eslint/parser": "^6.6.0", + "eslint": "^8.48.0", + "openapi-types": "^12.1.3", + "prettier": "^3.0.3", + "tsc-watch": "^6.0.4", + "typescript": "^5.2.2" + } + }, + "../../helper/crosslab-typescript-addon": { + "extraneous": true + }, + "../../helper/openapi-codegeneration": { + "extraneous": true + }, + "node_modules/@babel/code-frame": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "dependencies": { + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/generator": { + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", + "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "dependencies": { + "@babel/types": "^7.17.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", + "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-environment-visitor/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", + "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", + "dependencies": { + "@babel/template": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", + "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", + "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", + "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", + "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", + "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/generator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", + "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==", + "dependencies": { + "@babel/types": "^7.24.7", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", + "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@cross-lab-project/codegen-typescript-addon": { + "resolved": "../../../../helper/crosslab-typescript-addon", + "link": true + }, + "node_modules/@cross-lab-project/openapi-codegen": { + "resolved": "../../../../helper/openapi-codegeneration", + "link": true + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.3.0.tgz", + "integrity": "sha512-r3n0onD3BTOVUNPhR4lhVK4/pABGpbA7bW3eumZnYdKaHkf1qEC+Mag6DPbGNuuh0eG8AaYj+YqmVHSiGslaTQ==", + "dependencies": { + "@babel/generator": "7.17.7", + "@babel/parser": "^7.20.5", + "@babel/traverse": "7.23.2", + "@babel/types": "7.17.0", + "javascript-natural-sort": "0.7.1", + "lodash": "^4.17.21" + }, + "peerDependencies": { + "@vue/compiler-sfc": "3.x", + "prettier": "2.x - 3.x" + }, + "peerDependenciesMeta": { + "@vue/compiler-sfc": { + "optional": true + } + } + }, + "node_modules/@types/body-parser": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "dev": true, + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", + "dev": true, + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.19.5", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.5.tgz", + "integrity": "sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", + "dev": true + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.14.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", + "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/node-fetch": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==", + "dev": true, + "dependencies": { + "@types/node": "*", + "form-data": "^4.0.0" + } + }, + "node_modules/@types/qs": { + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", + "dev": true + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true + }, + "node_modules/@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", + "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", + "dev": true, + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ajv": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz", + "integrity": "sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.4.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "engines": { + "node": ">= 12" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", + "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", + "dev": true, + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/javascript-natural-sort": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" + }, + "node_modules/pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true, + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/prettier": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.18", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.18.tgz", + "integrity": "sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==", + "dev": true + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/string.prototype.padend": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.6.tgz", + "integrity": "sha512-XZpspuSB7vJWhvJc9DLSlrXl1mcA2BdoY5jjnS135ydXqLoqhs96JjDtCkjJEQHvfqZIp9hBuBMgI589peyx9Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "engines": { + "node": ">=4" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } } - } - }, - "node_modules/@types/node": { - "version": "22.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.1.0.tgz", - "integrity": "sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==", - "dev": true, - "dependencies": { - "undici-types": "~6.13.0" - } - }, - "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, - "node_modules/debug": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "engines": { - "node": ">=4" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/javascript-natural-sort": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", - "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==" - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" - }, - "node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" - }, - "node_modules/prettier": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "engines": { - "node": ">=4" - } - }, - "node_modules/typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/undici-types": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.13.0.tgz", - "integrity": "sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==", - "dev": true } - } } diff --git a/services/booking/src/common/package.json b/services/booking/src/common/package.json index 04eb58ab..b0b6fefd 100644 --- a/services/booking/src/common/package.json +++ b/services/booking/src/common/package.json @@ -1,10 +1,22 @@ { + "type": "module", "name": "@crosslab/booking-service-common", "version": "0.0.1", "description": "Common resources for booking-service sub-services.", "main": "lib/index.js", + "files": [ + "lib" + ], "scripts": { - "build": "tsc", + "copy:clients": "cp src/clients/device/basicValidation.cjs lib/clients/device/ && cp src/clients/booking-backend/basicValidation.cjs lib/clients/booking-backend/ && cp src/clients/booking-frontend/basicValidation.cjs lib/clients/booking-frontend/ && cp src/clients/schedule-service/basicValidation.cjs lib/clients/schedule-service/", + "build:generate": "npm-run-all build:generate:*", + "build:generate:device": "npx openapi-codegen -i ../../../device/dist/openapi.json -p @cross-lab-project/codegen-typescript-addon:preset:service-client -o ./src/clients/device && prettier ./src/clients/device --write", + "build:generate:booking-backend": "npx openapi-codegen -i ../booking-backend/dist/openapi.json -p @cross-lab-project/codegen-typescript-addon:preset:service-client -o ./src/clients/booking-backend && prettier ./src/clients/booking-backend --write", + "build:generate:booking-frontend": "npx openapi-codegen -i ../booking-frontend/dist/openapi.json -p @cross-lab-project/codegen-typescript-addon:preset:service-client -o ./src/clients/booking-frontend && prettier ./src/clients/booking-frontend --write", + "build:generate:schedule-service": "npx openapi-codegen -i ../schedule-service/dist/openapi.json -p @cross-lab-project/codegen-typescript-addon:preset:service-client -o ./src/clients/schedule-service && prettier ./src/clients/schedule-service --write", + "build:compile": "tsc", + "build:copy": "npm run copy:clients", + "build": "npm-run-all build:*", "test": "echo \"Error: no test specified\" && exit 1", "format": "prettier . --write", "lint": "eslint ." @@ -12,11 +24,20 @@ "author": "", "license": "Apache-2.0", "devDependencies": { - "@types/node": "^22.1.0", - "prettier": "^3.3.3", - "typescript": "^5.5.4" + "@types/node": "^20.5.9", + "@types/express": "^4.17.13", + "@types/node-fetch": "^2.6.4", + "prettier": "^3.0.3", + "typescript": "^5.2.2", + "npm-run-all": "^4.1.5", + "@cross-lab-project/codegen-typescript-addon": "file:../../../../helper/crosslab-typescript-addon", + "@cross-lab-project/openapi-codegen": "file:../../../../helper/openapi-codegeneration" }, "dependencies": { - "@trivago/prettier-plugin-sort-imports": "^4.2.0" + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/express": "^4.17.13", + "express": "^4.18.1", + "node-fetch": "^3.3.2", + "ajv-formats": "^3.0.1" } } diff --git a/services/booking/src/common/scripts/set-scene.sh b/services/booking/src/common/scripts/set-scene.sh new file mode 120000 index 00000000..d41e06af --- /dev/null +++ b/services/booking/src/common/scripts/set-scene.sh @@ -0,0 +1 @@ +../../../../../common/node/scripts/set-scene.sh \ No newline at end of file diff --git a/services/booking/src/common/src/auth.ts b/services/booking/src/common/src/auth.ts index 31bf84d5..a0d3bf22 100644 --- a/services/booking/src/common/src/auth.ts +++ b/services/booking/src/common/src/auth.ts @@ -1,12 +1,7 @@ -import { baseConfig } from './config'; +import { baseConfig } from './config.js'; let institutePrefixURL: URL[]; -export function CheckAuth(token: string): [URL, boolean] { - throw new Error('TODO'); - return [new URL(''), false]; -} - function convertInstitutionPrefix(): void { if (!institutePrefixURL) { institutePrefixURL = []; diff --git a/services/booking/src/common/src/clients/booking-backend/basicValidation.cjs b/services/booking/src/common/src/clients/booking-backend/basicValidation.cjs new file mode 100644 index 00000000..83d82620 --- /dev/null +++ b/services/booking/src/common/src/clients/booking-backend/basicValidation.cjs @@ -0,0 +1,3937 @@ +/* eslint-disable */ +//@ts-nocheck +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +'use strict'; +exports.validateBooking = validate21; +const schema6 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'Booking', + 'x-location': '#/components/schemas/Booking', + 'x-schema-type': 'all', +}; +const formats0 = require('ajv-formats/dist/formats').fullFormats.uri; +const formats2 = require('ajv-formats/dist/formats').fullFormats['date-time']; +function validate21( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate21.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema6.required, + parentSchema: schema6, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate21.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema6.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.ID.type, + parentSchema: schema6.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate21.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema6.properties.Time.required, + parentSchema: schema6.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate21.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema6.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Time.properties.Start.type, + parentSchema: schema6.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate21.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema6.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Time.properties.End.type, + parentSchema: schema6.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema6.properties.Time.type, + parentSchema: schema6.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate21.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema6.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Devices.items.type, + parentSchema: schema6.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema6.properties.Devices.type, + parentSchema: schema6.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Type.type, + parentSchema: schema6.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate21.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema6.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema6.properties.Type.enum, + parentSchema: schema6.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Status.type, + parentSchema: schema6.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate21.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema6.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema6.properties.Status.enum, + parentSchema: schema6.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate21.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema6.properties.You.type, + parentSchema: schema6.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate21.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema6.properties.External.type, + parentSchema: schema6.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Message.type, + parentSchema: schema6.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate21.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema6.type, + parentSchema: schema6, + data, + }, + ]; + return false; + } + } + validate21.errors = vErrors; + return errors === 0; +} +exports.validateDevice = validate22; +const schema7 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'Device', + 'x-location': '#/components/schemas/Device', + 'x-schema-type': 'all', +}; +function validate22( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate22.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema7.required, + parentSchema: schema7, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate22.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema7.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate22.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema7.properties.ID.type, + parentSchema: schema7.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate22.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema7.type, + parentSchema: schema7, + data, + }, + ]; + return false; + } + } + validate22.errors = vErrors; + return errors === 0; +} +exports.validateExperiment = validate23; +const schema8 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'Experiment', + 'x-location': '#/components/schemas/Experiment', + 'x-schema-type': 'all', +}; +function validate23( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate23.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema8.required, + parentSchema: schema8, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema8.properties.Devices.items.required, + parentSchema: schema8.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema8.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema8.properties.Devices.items.properties.ID.type, + parentSchema: + schema8.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema8.properties.Devices.items.type, + parentSchema: schema8.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema8.properties.Devices.type, + parentSchema: schema8.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate23.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema8.properties.Description.type, + parentSchema: schema8.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate23.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema8.type, + parentSchema: schema8, + data, + }, + ]; + return false; + } + } + validate23.errors = vErrors; + return errors === 0; +} +exports.validateTimeslot = validate24; +const schema9 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'Timeslot', + 'x-location': '#/components/schemas/Timeslot', + 'x-schema-type': 'all', +}; +function validate24( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate24.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema9.required, + parentSchema: schema9, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate24.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema9.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate24.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema9.properties.Start.type, + parentSchema: schema9.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate24.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema9.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate24.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema9.properties.End.type, + parentSchema: schema9.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate24.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema9.type, + parentSchema: schema9, + data, + }, + ]; + return false; + } + } + validate24.errors = vErrors; + return errors === 0; +} +exports.validateID = validate25; +const schema10 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'ID', + 'x-location': '#/components/parameters/ID/schema', + 'x-schema-type': 'all', +}; +function validate25( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate25.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema10.type, + parentSchema: schema10, + data, + }, + ]; + return false; + } + validate25.errors = vErrors; + return errors === 0; +} +exports.validateLockBookingResponse200 = validate26; +const schema11 = { + type: 'array', + description: + 'The list of booked devices and selected real devices. Order is guaranteed to be the same as in the booking.', + items: { + type: 'object', + required: ['Requested', 'Selected'], + properties: { + Requested: { type: 'string', format: 'uri' }, + Selected: { type: 'string', format: 'uri' }, + }, + }, + 'x-standalone': false, + 'x-name': 'lockBookingResponse200', + 'x-location': + '#/paths//booking/{ID}/lock/put/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate26( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if ( + (data0.Requested === undefined && (missing0 = 'Requested')) || + (data0.Selected === undefined && (missing0 = 'Selected')) + ) { + validate26.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema11.items.required, + parentSchema: schema11.items, + data: data0, + }, + ]; + return false; + } else { + if (data0.Requested !== undefined) { + let data1 = data0.Requested; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate26.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Requested', + schemaPath: '#/items/properties/Requested/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema11.items.properties.Requested, + data: data1, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Requested', + schemaPath: '#/items/properties/Requested/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.items.properties.Requested.type, + parentSchema: schema11.items.properties.Requested, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Selected !== undefined) { + let data2 = data0.Selected; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate26.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Selected', + schemaPath: '#/items/properties/Selected/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema11.items.properties.Selected, + data: data2, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Selected', + schemaPath: '#/items/properties/Selected/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.items.properties.Selected.type, + parentSchema: schema11.items.properties.Selected, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.items.type, + parentSchema: schema11.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate26.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema11.type, + parentSchema: schema11, + data, + }, + ]; + return false; + } + } + validate26.errors = vErrors; + return errors === 0; +} +exports.validateLockBookingResponse500 = validate27; +const schema12 = { + type: 'string', + description: 'Error string', + 'x-standalone': false, + 'x-name': 'lockBookingResponse500', + 'x-location': + '#/paths//booking/{ID}/lock/put/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate27( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate27.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema12.type, + parentSchema: schema12, + data, + }, + ]; + return false; + } + validate27.errors = vErrors; + return errors === 0; +} +exports.validateUnlockBookingResponse500 = validate28; +const schema13 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'unlockBookingResponse500', + 'x-location': + '#/paths//booking/{ID}/lock/delete/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate28( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate28.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema13.type, + parentSchema: schema13, + data, + }, + ]; + return false; + } + validate28.errors = vErrors; + return errors === 0; +} +exports.validateBookingCallbackResponse500 = validate29; +const schema14 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'bookingCallbackResponse500', + 'x-location': + '#/paths//booking_callback/{ID}/post/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate29( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate29.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema14.type, + parentSchema: schema14, + data, + }, + ]; + return false; + } + validate29.errors = vErrors; + return errors === 0; +} +exports.validateBookingRequest = validate30; +const schema15 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'BookingRequest', + 'x-location': '#/components/schemas/Booking_request', + 'x-schema-type': 'request', +}; +function validate30( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate30.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema15.required, + parentSchema: schema15, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate30.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema15.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.properties.ID.type, + parentSchema: schema15.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate30.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema15.properties.Time.required, + parentSchema: schema15.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate30.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema15.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.properties.Time.properties.Start.type, + parentSchema: schema15.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate30.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema15.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.properties.Time.properties.End.type, + parentSchema: schema15.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema15.properties.Time.type, + parentSchema: schema15.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate30.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema15.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.properties.Devices.items.type, + parentSchema: schema15.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema15.properties.Devices.type, + parentSchema: schema15.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate30.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.properties.Type.type, + parentSchema: schema15.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate30.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema15.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema15.properties.Type.enum, + parentSchema: schema15.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate30.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.properties.Status.type, + parentSchema: schema15.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate30.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema15.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema15.properties.Status.enum, + parentSchema: schema15.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate30.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema15.properties.You.type, + parentSchema: schema15.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate30.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema15.properties.External.type, + parentSchema: schema15.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate30.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.properties.Message.type, + parentSchema: schema15.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate30.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema15.type, + parentSchema: schema15, + data, + }, + ]; + return false; + } + } + validate30.errors = vErrors; + return errors === 0; +} +exports.validateBookingResponse = validate31; +const schema16 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'BookingResponse', + 'x-location': '#/components/schemas/Booking_response', + 'x-schema-type': 'response', +}; +function validate31( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate31.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema16.required, + parentSchema: schema16, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate31.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema16.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.ID.type, + parentSchema: schema16.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate31.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema16.properties.Time.required, + parentSchema: schema16.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate31.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema16.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Time.properties.Start.type, + parentSchema: schema16.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate31.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema16.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Time.properties.End.type, + parentSchema: schema16.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema16.properties.Time.type, + parentSchema: schema16.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate31.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema16.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Devices.items.type, + parentSchema: schema16.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema16.properties.Devices.type, + parentSchema: schema16.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate31.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Type.type, + parentSchema: schema16.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate31.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema16.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema16.properties.Type.enum, + parentSchema: schema16.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate31.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Status.type, + parentSchema: schema16.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate31.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema16.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema16.properties.Status.enum, + parentSchema: schema16.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate31.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema16.properties.You.type, + parentSchema: schema16.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate31.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema16.properties.External.type, + parentSchema: schema16.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate31.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Message.type, + parentSchema: schema16.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate31.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema16.type, + parentSchema: schema16, + data, + }, + ]; + return false; + } + } + validate31.errors = vErrors; + return errors === 0; +} +exports.validateDeviceRequest = validate32; +const schema17 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'DeviceRequest', + 'x-location': '#/components/schemas/Device_request', + 'x-schema-type': 'request', +}; +function validate32( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate32.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema17.required, + parentSchema: schema17, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate32.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema17.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.properties.ID.type, + parentSchema: schema17.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate32.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema17.type, + parentSchema: schema17, + data, + }, + ]; + return false; + } + } + validate32.errors = vErrors; + return errors === 0; +} +exports.validateDeviceResponse = validate33; +const schema18 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'DeviceResponse', + 'x-location': '#/components/schemas/Device_response', + 'x-schema-type': 'response', +}; +function validate33( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate33.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema18.required, + parentSchema: schema18, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate33.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema18.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate33.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.properties.ID.type, + parentSchema: schema18.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate33.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema18.type, + parentSchema: schema18, + data, + }, + ]; + return false; + } + } + validate33.errors = vErrors; + return errors === 0; +} +exports.validateExperimentRequest = validate34; +const schema19 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'ExperimentRequest', + 'x-location': '#/components/schemas/Experiment_request', + 'x-schema-type': 'request', +}; +function validate34( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate34.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema19.required, + parentSchema: schema19, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate34.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema19.properties.Devices.items.required, + parentSchema: schema19.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate34.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema19.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema19.properties.Devices.items.properties.ID.type, + parentSchema: + schema19.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema19.properties.Devices.items.type, + parentSchema: schema19.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema19.properties.Devices.type, + parentSchema: schema19.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate34.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema19.properties.Description.type, + parentSchema: schema19.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate34.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema19.type, + parentSchema: schema19, + data, + }, + ]; + return false; + } + } + validate34.errors = vErrors; + return errors === 0; +} +exports.validateExperimentResponse = validate35; +const schema20 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'ExperimentResponse', + 'x-location': '#/components/schemas/Experiment_response', + 'x-schema-type': 'response', +}; +function validate35( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate35.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema20.required, + parentSchema: schema20, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate35.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema20.properties.Devices.items.required, + parentSchema: schema20.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate35.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema20.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate35.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema20.properties.Devices.items.properties.ID.type, + parentSchema: + schema20.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate35.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema20.properties.Devices.items.type, + parentSchema: schema20.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate35.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema20.properties.Devices.type, + parentSchema: schema20.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate35.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema20.properties.Description.type, + parentSchema: schema20.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate35.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema20.type, + parentSchema: schema20, + data, + }, + ]; + return false; + } + } + validate35.errors = vErrors; + return errors === 0; +} +exports.validateTimeslotRequest = validate36; +const schema21 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'TimeslotRequest', + 'x-location': '#/components/schemas/Timeslot_request', + 'x-schema-type': 'request', +}; +function validate36( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate36.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema21.required, + parentSchema: schema21, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate36.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema21.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate36.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema21.properties.Start.type, + parentSchema: schema21.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate36.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema21.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate36.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema21.properties.End.type, + parentSchema: schema21.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate36.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema21.type, + parentSchema: schema21, + data, + }, + ]; + return false; + } + } + validate36.errors = vErrors; + return errors === 0; +} +exports.validateTimeslotResponse = validate37; +const schema22 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'TimeslotResponse', + 'x-location': '#/components/schemas/Timeslot_response', + 'x-schema-type': 'response', +}; +function validate37( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate37.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema22.required, + parentSchema: schema22, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate37.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema22.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.Start.type, + parentSchema: schema22.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate37.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema22.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.End.type, + parentSchema: schema22.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate37.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema22.type, + parentSchema: schema22, + data, + }, + ]; + return false; + } + } + validate37.errors = vErrors; + return errors === 0; +} +exports.validateIDRequest = validate38; +const schema23 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'IDRequest', + 'x-location': '#/components/parameters/ID/schema_request', + 'x-schema-type': 'request', +}; +function validate38( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate38.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.type, + parentSchema: schema23, + data, + }, + ]; + return false; + } + validate38.errors = vErrors; + return errors === 0; +} +exports.validateIDResponse = validate39; +const schema24 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'IDResponse', + 'x-location': '#/components/parameters/ID/schema_response', + 'x-schema-type': 'response', +}; +function validate39( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate39.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema24.type, + parentSchema: schema24, + data, + }, + ]; + return false; + } + validate39.errors = vErrors; + return errors === 0; +} +exports.validateLockBookingResponse200Request = validate40; +const schema25 = { + type: 'array', + description: + 'The list of booked devices and selected real devices. Order is guaranteed to be the same as in the booking.', + items: { + type: 'object', + required: ['Requested', 'Selected'], + properties: { + Requested: { type: 'string', format: 'uri' }, + Selected: { type: 'string', format: 'uri' }, + }, + }, + 'x-standalone': false, + 'x-name': 'lockBookingResponse200Request', + 'x-location': + '#/paths//booking/{ID}/lock/put/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate40( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if ( + (data0.Requested === undefined && (missing0 = 'Requested')) || + (data0.Selected === undefined && (missing0 = 'Selected')) + ) { + validate40.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema25.items.required, + parentSchema: schema25.items, + data: data0, + }, + ]; + return false; + } else { + if (data0.Requested !== undefined) { + let data1 = data0.Requested; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate40.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Requested', + schemaPath: '#/items/properties/Requested/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema25.items.properties.Requested, + data: data1, + }, + ]; + return false; + } + } else { + validate40.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Requested', + schemaPath: '#/items/properties/Requested/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema25.items.properties.Requested.type, + parentSchema: schema25.items.properties.Requested, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Selected !== undefined) { + let data2 = data0.Selected; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate40.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Selected', + schemaPath: '#/items/properties/Selected/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema25.items.properties.Selected, + data: data2, + }, + ]; + return false; + } + } else { + validate40.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Selected', + schemaPath: '#/items/properties/Selected/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema25.items.properties.Selected.type, + parentSchema: schema25.items.properties.Selected, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate40.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema25.items.type, + parentSchema: schema25.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate40.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema25.type, + parentSchema: schema25, + data, + }, + ]; + return false; + } + } + validate40.errors = vErrors; + return errors === 0; +} +exports.validateLockBookingResponse200Response = validate41; +const schema26 = { + type: 'array', + description: + 'The list of booked devices and selected real devices. Order is guaranteed to be the same as in the booking.', + items: { + type: 'object', + required: ['Requested', 'Selected'], + properties: { + Requested: { type: 'string', format: 'uri' }, + Selected: { type: 'string', format: 'uri' }, + }, + }, + 'x-standalone': false, + 'x-name': 'lockBookingResponse200Response', + 'x-location': + '#/paths//booking/{ID}/lock/put/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate41( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if ( + (data0.Requested === undefined && (missing0 = 'Requested')) || + (data0.Selected === undefined && (missing0 = 'Selected')) + ) { + validate41.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema26.items.required, + parentSchema: schema26.items, + data: data0, + }, + ]; + return false; + } else { + if (data0.Requested !== undefined) { + let data1 = data0.Requested; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate41.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Requested', + schemaPath: '#/items/properties/Requested/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema26.items.properties.Requested, + data: data1, + }, + ]; + return false; + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Requested', + schemaPath: '#/items/properties/Requested/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema26.items.properties.Requested.type, + parentSchema: schema26.items.properties.Requested, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Selected !== undefined) { + let data2 = data0.Selected; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate41.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Selected', + schemaPath: '#/items/properties/Selected/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema26.items.properties.Selected, + data: data2, + }, + ]; + return false; + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Selected', + schemaPath: '#/items/properties/Selected/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema26.items.properties.Selected.type, + parentSchema: schema26.items.properties.Selected, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema26.items.type, + parentSchema: schema26.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate41.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema26.type, + parentSchema: schema26, + data, + }, + ]; + return false; + } + } + validate41.errors = vErrors; + return errors === 0; +} +exports.validateLockBookingResponse500Request = validate42; +const schema27 = { + type: 'string', + description: 'Error string', + 'x-standalone': false, + 'x-name': 'lockBookingResponse500Request', + 'x-location': + '#/paths//booking/{ID}/lock/put/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate42( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate42.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.type, + parentSchema: schema27, + data, + }, + ]; + return false; + } + validate42.errors = vErrors; + return errors === 0; +} +exports.validateLockBookingResponse500Response = validate43; +const schema28 = { + type: 'string', + description: 'Error string', + 'x-standalone': false, + 'x-name': 'lockBookingResponse500Response', + 'x-location': + '#/paths//booking/{ID}/lock/put/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate43( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate43.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema28.type, + parentSchema: schema28, + data, + }, + ]; + return false; + } + validate43.errors = vErrors; + return errors === 0; +} +exports.validateUnlockBookingResponse500Request = validate44; +const schema29 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'unlockBookingResponse500Request', + 'x-location': + '#/paths//booking/{ID}/lock/delete/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate44( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate44.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema29.type, + parentSchema: schema29, + data, + }, + ]; + return false; + } + validate44.errors = vErrors; + return errors === 0; +} +exports.validateUnlockBookingResponse500Response = validate45; +const schema30 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'unlockBookingResponse500Response', + 'x-location': + '#/paths//booking/{ID}/lock/delete/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate45( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate45.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema30.type, + parentSchema: schema30, + data, + }, + ]; + return false; + } + validate45.errors = vErrors; + return errors === 0; +} +exports.validateBookingCallbackResponse500Request = validate46; +const schema31 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'bookingCallbackResponse500Request', + 'x-location': + '#/paths//booking_callback/{ID}/post/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate46( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate46.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema31.type, + parentSchema: schema31, + data, + }, + ]; + return false; + } + validate46.errors = vErrors; + return errors === 0; +} +exports.validateBookingCallbackResponse500Response = validate47; +const schema32 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'bookingCallbackResponse500Response', + 'x-location': + '#/paths//booking_callback/{ID}/post/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate47( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate47.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema32.type, + parentSchema: schema32, + data, + }, + ]; + return false; + } + validate47.errors = vErrors; + return errors === 0; +} diff --git a/services/booking/src/common/src/clients/booking-backend/basicValidation.d.cts b/services/booking/src/common/src/clients/booking-backend/basicValidation.d.cts new file mode 100644 index 00000000..51a62d7e --- /dev/null +++ b/services/booking/src/common/src/clients/booking-backend/basicValidation.d.cts @@ -0,0 +1,107 @@ +export declare function validateBooking( + object: unknown, +): Booking; + +export declare function validateDevice( + object: unknown, +): Device; + +export declare function validateExperiment( + object: unknown, +): Experiment; + +export declare function validateTimeslot( + object: unknown, +): Timeslot; + +export declare function validateID( + object: unknown, +): ID; + +export declare function validateLockBookingResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): lockBookingResponse200; + +export declare function validateLockBookingResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): lockBookingResponse500; + +export declare function validateUnlockBookingResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): unlockBookingResponse500; + +export declare function validateBookingCallbackResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): bookingCallbackResponse500; + +export declare function validateBookingRequest( + object: unknown, +): BookingRequest; + +export declare function validateBookingResponse( + object: unknown, +): BookingResponse; + +export declare function validateDeviceRequest( + object: unknown, +): DeviceRequest; + +export declare function validateDeviceResponse( + object: unknown, +): DeviceResponse; + +export declare function validateExperimentRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ExperimentRequest; + +export declare function validateExperimentResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ExperimentResponse; + +export declare function validateTimeslotRequest( + object: unknown, +): TimeslotRequest; + +export declare function validateTimeslotResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): TimeslotResponse; + +export declare function validateIDRequest( + object: unknown, +): IDRequest; + +export declare function validateIDResponse( + object: unknown, +): IDResponse; + +export declare function validateLockBookingResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): lockBookingResponse200Request; + +export declare function validateLockBookingResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): lockBookingResponse200Response; + +export declare function validateLockBookingResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): lockBookingResponse500Request; + +export declare function validateLockBookingResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): lockBookingResponse500Response; + +export declare function validateUnlockBookingResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): unlockBookingResponse500Request; + +export declare function validateUnlockBookingResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): unlockBookingResponse500Response; + +export declare function validateBookingCallbackResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): bookingCallbackResponse500Request; + +export declare function validateBookingCallbackResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): bookingCallbackResponse500Response; diff --git a/services/booking/src/common/src/clients/booking-backend/client.ts b/services/booking/src/common/src/clients/booking-backend/client.ts new file mode 100644 index 00000000..a7d1aee1 --- /dev/null +++ b/services/booking/src/common/src/clients/booking-backend/client.ts @@ -0,0 +1,428 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import fetch, { RequestInfo, RequestInit, Response } from 'node-fetch'; + +import * as RequestValidation from './requestValidation.js'; +import * as Signatures from './signatures.js'; +import * as Types from './types.js'; +// @ts-ignore +import { type Require } from './types.js'; + +/** + * This error class should be used if an error occurs during validation of a request/response. + * @category Errors + */ +export class ValidationError extends Error { + public errors: unknown; + + constructor(message: string, errors: unknown) { + super(message); + this.name = 'ValidationError'; + this.errors = errors; + } +} + +/** + * This error class should be used if an error occurs while fetching a request. + * @category Errors + */ +export class FetchError extends Error { + constructor(message: string) { + super(message); + this.name = 'FetchError'; + } +} + +/** + * This error class should be used if the response of the server has a status + * greater than or equal to 400. This error should contain the validated response. + * @category Errors + */ +export class UnsuccessfulRequestError extends Error { + public response: Types.ResponseData; + + constructor(message: string, response: Types.ResponseData) { + super(message); + this.response = response; + this.name = 'UnsuccessfulRequestError'; + } +} + +/** + * This error class should be used if the validation of an url fails. + * @category Errors + */ +export class InvalidUrlError extends Error { + constructor(message: string) { + super(message); + this.name = 'InvalidUrlError'; + } +} + +/** + * This function attempts to parse a Response as ResponseData. + */ +async function parseResponse(response: Response): Promise { + let text = null; + try { + text = await response.text(); + const json = JSON.parse(text); + return { status: response.status, body: json }; + } catch { + return { status: response.status, body: text }; + } +} + +/** + * This function checks if a string is a valid http url. + * @param string The string to be checked. + * @returns True if the string is a valid http url. + */ +function isValidHttpUrl(string: string) { + let url; + + try { + url = new URL(string); + } catch (_) { + return false; + } + + return url.protocol === 'http:' || url.protocol === 'https:'; +} + +/** + * This function takes an url and a pattern for the requested endpoint and parses the contained path parameters. + * @param url The url to be parsed. + * @param endpoint Pattern of the requested endpoint. + * @throws {InvalidUrlError} Thrown if the provided url does not end with the provided endpoint. + * @returns An array containing all parsed path parameters in order of appearance. + * @example + * // returns ["username", "role_name"] + * parsePathParameters("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") + */ +function parsePathParameters(url: string, endpoint: string): string[] { + const parameterRegex = '([^/]+)'; + const regex = new RegExp(endpoint.replaceAll('{}', parameterRegex) + '(?:.(?!\\\\))?$'); + const matches = url.match(regex); + + if (!matches) throw new InvalidUrlError('Url does not end with the provided endpoint'); + + return matches.slice(1); +} + +/** + * This function validates a given http url and parses its path parameters. + * @param url The url to be validated. + * @param endpoint Pattern of the requested endpoint. + * @throws {InvalidUrlError} Thrown if the validation of the provided url fails. + * @returns An array containing all parsed path parameters in order of appearance (see {@link parsePathParameters}). + * @example + * // returns ["username", "role_name"] + * validateUrl("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") + */ +function validateUrl(url: string, endpoint: string): string[] { + if (!isValidHttpUrl(url)) + throw new InvalidUrlError('Provided url is not a valid http url'); + return parsePathParameters(url, endpoint); +} + +/** + * This function appends a given endpoint to an url. + * @param url The url to append the endpoint to. + * @param endpoint The endpoint to be appended. + * @example + * // returns "https://api.example.com/devices/device_id/token" + * appendToUrl("https://api.example.com/devices/device_id", "/token") + * @example + * // returns "https://api.example.com/devices/device_id/token" + * appendToUrl("https://api.example.com/devices/device_id/", "/token") + * @returns The url with the appended endpoint. + */ +function appendToUrl(url: string, endpoint: string) { + return url.endsWith('/') ? `${url.slice(0, -1)}${endpoint}` : `${url}${endpoint}`; +} + +/** + * Client for the use of the Crosslab API + * @category Client + */ +export class Client { + public readonly baseUrl: string; + public readonly serviceUrl: string; + public accessToken: string; + private fixedHeaders: [string, string][]; + private fetch = async (url: RequestInfo | URL, init: RequestInit) => { + let raw_response; + const parsedUrl = new URL(url.toString()); + try { + if ( + parsedUrl.toString().startsWith(this.baseUrl) || + parsedUrl.toString().startsWith(this.serviceUrl) + ) { + raw_response = await fetch(url, init); + } else { + raw_response = await fetch( + appendToUrl( + this.baseUrl, + '/proxy?' + new URLSearchParams([['URL', url.toString()]]).toString(), + ), + init, + ); + } + } catch (error) { + if (error instanceof Error) { + throw new FetchError(error.message); + } else if (typeof error === 'string') { + throw new FetchError(error); + } else { + throw new FetchError('Something went wrong while trying to fetch the request'); + } + } + return await parseResponse(raw_response); + }; + + /** + * @category Constructors + */ + constructor( + baseUrl: string, + options: { + serviceUrl?: string; + accessToken?: string; + fixedHeaders?: [string, string][]; + }, + ) { + this.baseUrl = new URL(baseUrl).toString().slice(0, -1); + this.serviceUrl = new URL(options.serviceUrl ?? this.baseUrl).toString().slice(0, -1); + this.accessToken = options.accessToken ?? ''; + this.fixedHeaders = options.fixedHeaders ?? []; + } + + /** + * Locks the current booking so the devices can be used. This sets the status to "active" This means that the booking can not be cancelled or (currently not implemented) the end time can not be set to a prior time. If called multiple times, the booking will be locked only once. + * + * @param url + * Url of the resource to be accessed. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * All devices were booked by user. + */ + public async lockBooking( + url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/booking/{}/lock'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [ID] = validateUrl(new URL(url).toString(), '/booking/{}/lock'); + console.log('trying to fetch url:', url); + + const parameters = { + ID: ID, + }; + + if (!RequestValidation.validateLockBookingInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateLockBookingInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'PUT', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateLockBookingOutput(response)) + throw new ValidationError( + 'Response validation failed!', + (RequestValidation.validateLockBookingOutput as Types.FunctionWithErrors).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * Unlocks all devices belonging to a booking, status will be set to 'booked'. + * + * @param url + * Url of the resource to be accessed. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * Unlocking was successful. + */ + public async unlockBooking( + url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/booking/{}/lock'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [ID] = validateUrl(new URL(url).toString(), '/booking/{}/lock'); + console.log('trying to fetch url:', url); + + const parameters = { + ID: ID, + }; + + if (!RequestValidation.validateUnlockBookingInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateUnlockBookingInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'DELETE', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateUnlockBookingOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateUnlockBookingOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + } + + /** + * Callback used for updating device info / booking info. + * + * @param url + * Url of the resource to be accessed. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * Update was processed. + */ + public async bookingCallback( + url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/booking_callback/{}'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [ID] = validateUrl(new URL(url).toString(), '/booking_callback/{}'); + console.log('trying to fetch url:', url); + + const parameters = { + ID: ID, + }; + + if (!RequestValidation.validateBookingCallbackInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + ( + RequestValidation.validateBookingCallbackInput as Types.FunctionWithErrors + ).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateBookingCallbackOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateBookingCallbackOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + } +} diff --git a/services/booking/src/common/src/clients/booking-backend/requestValidation.ts b/services/booking/src/common/src/clients/booking-backend/requestValidation.ts new file mode 100644 index 00000000..b5921790 --- /dev/null +++ b/services/booking/src/common/src/clients/booking-backend/requestValidation.ts @@ -0,0 +1,208 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +import * as BasicValidation from './basicValidation.cjs'; +import * as Signatures from './signatures.js'; +import { FunctionWithErrors, ResponseData } from './types.js'; + +/** + * This function validates the inputs to lockBooking() + */ +export function validateLockBookingInput(parameters: Signatures.LockBookingParameters) { + if (parameters) { + if (!BasicValidation.validateIDRequest(parameters['ID'])) { + (validateLockBookingInput as FunctionWithErrors).errors = ( + BasicValidation.validateIDRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of lockBooking() + */ +export function validateLockBookingOutput( + response: ResponseData, +): response is Signatures.LockBookingResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if (!BasicValidation.validateLockBookingResponse200Response(response.body)) { + (validateLockBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateLockBookingResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 412) { + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateLockBookingResponse500Response(response.body)) { + (validateLockBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateLockBookingResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateLockBookingOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to unlockBooking() + */ +export function validateUnlockBookingInput( + parameters: Signatures.UnlockBookingParameters, +) { + if (parameters) { + if (!BasicValidation.validateIDRequest(parameters['ID'])) { + (validateUnlockBookingInput as FunctionWithErrors).errors = ( + BasicValidation.validateIDRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of unlockBooking() + */ +export function validateUnlockBookingOutput( + response: ResponseData, +): response is Signatures.UnlockBookingResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 412) { + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateUnlockBookingResponse500Response(response.body)) { + (validateUnlockBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateUnlockBookingResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateUnlockBookingOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to bookingCallback() + */ +export function validateBookingCallbackInput( + parameters: Signatures.BookingCallbackParameters, +) { + if (parameters) { + if (!BasicValidation.validateIDRequest(parameters['ID'])) { + (validateBookingCallbackInput as FunctionWithErrors).errors = ( + BasicValidation.validateIDRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of bookingCallback() + */ +export function validateBookingCallbackOutput( + response: ResponseData, +): response is Signatures.BookingCallbackResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateBookingCallbackResponse500Response(response.body)) { + (validateBookingCallbackOutput as FunctionWithErrors).errors = ( + BasicValidation.validateBookingCallbackResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateBookingCallbackOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} diff --git a/services/booking/src/common/src/clients/booking-backend/signatures.ts b/services/booking/src/common/src/clients/booking-backend/signatures.ts new file mode 100644 index 00000000..3569d504 --- /dev/null +++ b/services/booking/src/common/src/clients/booking-backend/signatures.ts @@ -0,0 +1,329 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import * as Types from './types.js'; +// @ts-ignore +import { type Require } from './types.js'; + +/** + * Typing for the parameters of the request made by lockBooking() + * @category lockBooking() + */ +export type LockBookingParameters = { + ID: string; +}; + +/** + * Typing for all possible responses to the request made by lockBooking() + * @category lockBooking() + */ +export type LockBookingResponse = LockBookingSuccessResponse | LockBookingErrorResponse; + +/** + * Typing for all successful responses to the request made by lockBooking() + * @category lockBooking() + */ +export type LockBookingSuccessResponse = LockBookingResponse200; + +/** + * Typing for all error responses to the request made by lockBooking() + * @category lockBooking() + */ +export type LockBookingErrorResponse = + | LockBookingResponse401 + | LockBookingResponse403 + | LockBookingResponse404 + | LockBookingResponse412 + | LockBookingResponse500 + | LockBookingResponse503; + +/** + * Typing for a response with status 200 to the request made by lockBooking() + * @category lockBooking() + */ +export interface LockBookingResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: { + Requested: string; + Selected: string; + [k: string]: unknown; + }[]; +} + +/** + * Typing for a response with status 401 to the request made by lockBooking() + * @category lockBooking() + */ +export interface LockBookingResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by lockBooking() + * @category lockBooking() + */ +export interface LockBookingResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by lockBooking() + * @category lockBooking() + */ +export interface LockBookingResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 412 to the request made by lockBooking() + * @category lockBooking() + */ +export interface LockBookingResponse412 extends Types.ErrorResponse { + status: 412; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by lockBooking() + * @category lockBooking() + */ +export interface LockBookingResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by lockBooking() + * @category lockBooking() + */ +export interface LockBookingResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by unlockBooking() + * @category unlockBooking() + */ +export type UnlockBookingParameters = { + ID: string; +}; + +/** + * Typing for all possible responses to the request made by unlockBooking() + * @category unlockBooking() + */ +export type UnlockBookingResponse = + | UnlockBookingSuccessResponse + | UnlockBookingErrorResponse; + +/** + * Typing for all successful responses to the request made by unlockBooking() + * @category unlockBooking() + */ +export type UnlockBookingSuccessResponse = UnlockBookingResponse200; + +/** + * Typing for all error responses to the request made by unlockBooking() + * @category unlockBooking() + */ +export type UnlockBookingErrorResponse = + | UnlockBookingResponse401 + | UnlockBookingResponse403 + | UnlockBookingResponse404 + | UnlockBookingResponse412 + | UnlockBookingResponse500 + | UnlockBookingResponse503; + +/** + * Typing for a response with status 200 to the request made by unlockBooking() + * @category unlockBooking() + */ +export interface UnlockBookingResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by unlockBooking() + * @category unlockBooking() + */ +export interface UnlockBookingResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by unlockBooking() + * @category unlockBooking() + */ +export interface UnlockBookingResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by unlockBooking() + * @category unlockBooking() + */ +export interface UnlockBookingResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 412 to the request made by unlockBooking() + * @category unlockBooking() + */ +export interface UnlockBookingResponse412 extends Types.ErrorResponse { + status: 412; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by unlockBooking() + * @category unlockBooking() + */ +export interface UnlockBookingResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by unlockBooking() + * @category unlockBooking() + */ +export interface UnlockBookingResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by bookingCallback() + * @category bookingCallback() + */ +export type BookingCallbackParameters = { + ID: string; +}; + +/** + * Typing for all possible responses to the request made by bookingCallback() + * @category bookingCallback() + */ +export type BookingCallbackResponse = + | BookingCallbackSuccessResponse + | BookingCallbackErrorResponse; + +/** + * Typing for all successful responses to the request made by bookingCallback() + * @category bookingCallback() + */ +export type BookingCallbackSuccessResponse = BookingCallbackResponse200; + +/** + * Typing for all error responses to the request made by bookingCallback() + * @category bookingCallback() + */ +export type BookingCallbackErrorResponse = + | BookingCallbackResponse404 + | BookingCallbackResponse500 + | BookingCallbackResponse503; + +/** + * Typing for a response with status 200 to the request made by bookingCallback() + * @category bookingCallback() + */ +export interface BookingCallbackResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by bookingCallback() + * @category bookingCallback() + */ +export interface BookingCallbackResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by bookingCallback() + * @category bookingCallback() + */ +export interface BookingCallbackResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by bookingCallback() + * @category bookingCallback() + */ +export interface BookingCallbackResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} diff --git a/services/booking/src/common/src/clients/booking-backend/types.ts b/services/booking/src/common/src/clients/booking-backend/types.ts new file mode 100644 index 00000000..8d0b0be8 --- /dev/null +++ b/services/booking/src/common/src/clients/booking-backend/types.ts @@ -0,0 +1,410 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +import * as _BasicValidation from './basicValidation.cjs'; + +/** + * @internal + */ +export interface FunctionWithErrors { + (...args: unknown[]): unknown; + errors?: unknown; +} + +/** + * @internal + */ +export interface RequestInfo { + method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'TRACE' | 'OPTIONS' | 'PATCH' | 'HEAD'; + body?: string; + headers?: [string, string][]; +} + +/** + * @internal + */ +export type FetchFunction = ( + url: string, + info?: RequestInfo, +) => Promise | ResponseData; + +export interface ResponseData { + status: number; + headers?: { + [key: string]: string | undefined; + }; + body?: unknown; +} + +export interface SuccessResponse extends ResponseData { + success?: true; +} + +export interface ErrorResponse extends ResponseData { + success?: false; +} + +/** + * @internal + */ +export function isSuccessResponse(response: ResponseData): response is SuccessResponse { + return response.status < 400; +} + +/** + * @internal + */ +export function isErrorResponse(response: ResponseData): response is ErrorResponse { + return response.status >= 400; +} + +/** + * This type allows to pick the required properties of another type. + */ +export type Require = Partial & { + [Property in Key]-?: Type[Property]; +}; + +export type SizedTuple< + T, + MIN extends number | undefined = undefined, + MAX extends number | undefined = undefined, +> = MIN extends number + ? MAX extends number + ? _SizedTuple> + : TupleObject> & T[] + : MAX extends number + ? _SizedTuple, true> + : T[]; + +type _SizedTuple = ARR extends [ + infer HEAD extends number, + ...infer TAIL extends number[], +] + ? Tuple | _SizedTuple + : never; + +type Tuple = _Tuple< + T, + NumericRangeTuple +>; + +type _Tuple = N extends [ + infer HEAD, + ...infer TAIL extends number[], +] + ? HEAD extends 0 + ? [] | _Tuple + : [T, ..._Tuple] + : []; + +type TupleObject = N extends [ + infer HEAD extends number, + ...infer TAIL extends number[], +] + ? TAIL extends [] + ? Record + : { [P in HEAD]: T } & TupleObject + : Record; + +export type NumericRange< + START extends number, + END extends number, + ARR extends unknown[] = [], + ACC extends number = never, +> = ARR['length'] extends END + ? ACC | START | END + : NumericRange< + START, + END, + [...ARR, 1], + ARR[START] extends undefined ? ACC : ACC | ARR['length'] + >; + +type NumericRangeTuple< + START extends number, + END extends number, + ARR extends unknown[] = [], + ACC extends number[] = [], +> = ARR['length'] extends END + ? [START, ...ACC, END] + : NumericRangeTuple< + START, + END, + [...ARR, 1], + ARR[START] extends undefined ? ACC : [...ACC, ARR['length']] + >; + +/** + * A booking in the booking system. + */ +export type Booking = T extends 'all' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : never; + +/** + * A device might either be a physical/virtual device or a group of device. + */ +export type Device = T extends 'all' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : never; + +/** + * An experiment describes a set of devices and how they should be connected (potentially among other metadata). + */ +export type Experiment = T extends 'all' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device<'request'>[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device<'response'>[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : never; + +/** + * A time slot represents a slice of time used for bookings. + */ +export type Timeslot = T extends 'all' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : never; diff --git a/services/booking/src/common/src/clients/booking-frontend/basicValidation.cjs b/services/booking/src/common/src/clients/booking-frontend/basicValidation.cjs new file mode 100644 index 00000000..25c648d5 --- /dev/null +++ b/services/booking/src/common/src/clients/booking-frontend/basicValidation.cjs @@ -0,0 +1,8434 @@ +/* eslint-disable */ +//@ts-nocheck +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +'use strict'; +exports.validateBooking = validate21; +const schema6 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'Booking', + 'x-location': '#/components/schemas/Booking', + 'x-schema-type': 'all', +}; +const formats0 = require('ajv-formats/dist/formats').fullFormats.uri; +const formats2 = require('ajv-formats/dist/formats').fullFormats['date-time']; +function validate21( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate21.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema6.required, + parentSchema: schema6, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate21.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema6.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.ID.type, + parentSchema: schema6.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate21.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema6.properties.Time.required, + parentSchema: schema6.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate21.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema6.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Time.properties.Start.type, + parentSchema: schema6.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate21.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema6.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Time.properties.End.type, + parentSchema: schema6.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema6.properties.Time.type, + parentSchema: schema6.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate21.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema6.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Devices.items.type, + parentSchema: schema6.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema6.properties.Devices.type, + parentSchema: schema6.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Type.type, + parentSchema: schema6.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate21.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema6.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema6.properties.Type.enum, + parentSchema: schema6.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Status.type, + parentSchema: schema6.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate21.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema6.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema6.properties.Status.enum, + parentSchema: schema6.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate21.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema6.properties.You.type, + parentSchema: schema6.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate21.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema6.properties.External.type, + parentSchema: schema6.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Message.type, + parentSchema: schema6.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate21.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema6.type, + parentSchema: schema6, + data, + }, + ]; + return false; + } + } + validate21.errors = vErrors; + return errors === 0; +} +exports.validateDevice = validate22; +const schema7 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'Device', + 'x-location': '#/components/schemas/Device', + 'x-schema-type': 'all', +}; +function validate22( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate22.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema7.required, + parentSchema: schema7, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate22.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema7.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate22.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema7.properties.ID.type, + parentSchema: schema7.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate22.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema7.type, + parentSchema: schema7, + data, + }, + ]; + return false; + } + } + validate22.errors = vErrors; + return errors === 0; +} +exports.validateExperiment = validate23; +const schema8 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'Experiment', + 'x-location': '#/components/schemas/Experiment', + 'x-schema-type': 'all', +}; +function validate23( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate23.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema8.required, + parentSchema: schema8, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema8.properties.Devices.items.required, + parentSchema: schema8.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema8.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema8.properties.Devices.items.properties.ID.type, + parentSchema: + schema8.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema8.properties.Devices.items.type, + parentSchema: schema8.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema8.properties.Devices.type, + parentSchema: schema8.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate23.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema8.properties.Description.type, + parentSchema: schema8.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate23.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema8.type, + parentSchema: schema8, + data, + }, + ]; + return false; + } + } + validate23.errors = vErrors; + return errors === 0; +} +exports.validateTimeslot = validate24; +const schema9 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'Timeslot', + 'x-location': '#/components/schemas/Timeslot', + 'x-schema-type': 'all', +}; +function validate24( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate24.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema9.required, + parentSchema: schema9, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate24.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema9.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate24.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema9.properties.Start.type, + parentSchema: schema9.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate24.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema9.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate24.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema9.properties.End.type, + parentSchema: schema9.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate24.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema9.type, + parentSchema: schema9, + data, + }, + ]; + return false; + } + } + validate24.errors = vErrors; + return errors === 0; +} +exports.validateID = validate25; +const schema10 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'ID', + 'x-location': '#/components/parameters/ID/schema', + 'x-schema-type': 'all', +}; +function validate25( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate25.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema10.type, + parentSchema: schema10, + data, + }, + ]; + return false; + } + validate25.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingBody = validate26; +const schema11 = { + type: 'object', + required: ['Devices', 'Time'], + properties: { + Devices: { + type: 'array', + description: 'List of devices which should be added.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + }, + 'x-standalone': false, + 'x-name': 'newBookingBody', + 'x-location': '#/paths//booking/post/requestBody/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate26( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Time === undefined && (missing0 = 'Time')) + ) { + validate26.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema11.required, + parentSchema: schema11, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate26.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema11.properties.Devices.items.required, + parentSchema: schema11.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate26.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema11.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema11.properties.Devices.items.properties.ID.type, + parentSchema: + schema11.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.properties.Devices.items.type, + parentSchema: schema11.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema11.properties.Devices.type, + parentSchema: schema11.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data3 = data.Time; + const _errs7 = errors; + if (errors === _errs7) { + if (data3 && typeof data3 == 'object' && !Array.isArray(data3)) { + let missing2; + if ( + (data3.Start === undefined && (missing2 = 'Start')) || + (data3.End === undefined && (missing2 = 'End')) + ) { + validate26.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema11.properties.Time.required, + parentSchema: schema11.properties.Time, + data: data3, + }, + ]; + return false; + } else { + if (data3.Start !== undefined) { + let data4 = data3.Start; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate26.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema11.properties.Time.properties.Start, + data: data4, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.properties.Time.properties.Start.type, + parentSchema: schema11.properties.Time.properties.Start, + data: data4, + }, + ]; + return false; + } + } + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.End !== undefined) { + let data5 = data3.End; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats2.validate(data5)) { + validate26.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema11.properties.Time.properties.End, + data: data5, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.properties.Time.properties.End.type, + parentSchema: schema11.properties.Time.properties.End, + data: data5, + }, + ]; + return false; + } + } + } + var valid3 = _errs11 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.properties.Time.type, + parentSchema: schema11.properties.Time, + data: data3, + }, + ]; + return false; + } + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate26.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.properties.Type.type, + parentSchema: schema11.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate26.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema11.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema11.properties.Type.enum, + parentSchema: schema11.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + } + } + } + } else { + validate26.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.type, + parentSchema: schema11, + data, + }, + ]; + return false; + } + } + validate26.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingResponse200 = validate27; +const schema12 = { + type: 'object', + required: ['BookingID'], + properties: { + BookingID: { + type: 'string', + format: 'uri', + description: 'ID at which the booking can be managed.', + }, + }, + 'x-standalone': false, + 'x-name': 'newBookingResponse200', + 'x-location': '#/paths//booking/post/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate27( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.BookingID === undefined && (missing0 = 'BookingID')) { + validate27.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema12.required, + parentSchema: schema12, + data, + }, + ]; + return false; + } else { + if (data.BookingID !== undefined) { + let data0 = data.BookingID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate27.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema12.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } else { + validate27.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema12.properties.BookingID.type, + parentSchema: schema12.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate27.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema12.type, + parentSchema: schema12, + data, + }, + ]; + return false; + } + } + validate27.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingResponse500 = validate28; +const schema13 = { + description: 'Error description', + type: 'string', + 'x-standalone': false, + 'x-name': 'newBookingResponse500', + 'x-location': '#/paths//booking/post/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate28( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate28.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema13.type, + parentSchema: schema13, + data, + }, + ]; + return false; + } + validate28.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingBody = validate29; +const schema14 = { + anyOf: [ + { + type: 'object', + description: 'Use this request for adding devices.', + properties: { + Locked: { + type: 'boolean', + description: + 'Expresses whether the devices should be locked. Must match current status of booking. Is assumed to be false if not set.', + }, + Devices: { + type: 'array', + description: 'List of devices which should be added.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + }, + }, + { + type: 'object', + description: 'Use this request for adding callbacks.', + properties: { + Callback: { + type: 'string', + format: 'uri', + description: 'Callback which should be called at changes.', + }, + }, + }, + ], + 'x-standalone': false, + 'x-name': 'updateBookingBody', + 'x-location': '#/paths//booking/{ID}/patch/requestBody/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate29( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.Locked !== undefined) { + let data0 = data.Locked; + const _errs3 = errors; + if (typeof data0 !== 'boolean') { + const err0 = { + instancePath: instancePath + '/Locked', + schemaPath: '#/anyOf/0/properties/Locked/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema14.anyOf[0].properties.Locked.type, + parentSchema: schema14.anyOf[0].properties.Locked, + data: data0, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.Devices !== undefined) { + let data1 = data.Devices; + const _errs5 = errors; + if (errors === _errs5) { + if (Array.isArray(data1)) { + var valid2 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs7 = errors; + if (errors === _errs7) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing0; + if (data2.ID === undefined && (missing0 = 'ID')) { + const err1 = { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/anyOf/0/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema14.anyOf[0].properties.Devices.items.required, + parentSchema: schema14.anyOf[0].properties.Devices.items, + data: data2, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } else { + if (data2.ID !== undefined) { + let data3 = data2.ID; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + const err2 = { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/anyOf/0/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema14.anyOf[0].properties.Devices.items.properties + .ID, + data: data3, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } else { + const err3 = { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/anyOf/0/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema14.anyOf[0].properties.Devices.items.properties.ID + .type, + parentSchema: + schema14.anyOf[0].properties.Devices.items.properties + .ID, + data: data3, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + } + } + } + } + } else { + const err4 = { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/anyOf/0/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema14.anyOf[0].properties.Devices.items.type, + parentSchema: schema14.anyOf[0].properties.Devices.items, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + } + var valid2 = _errs7 === errors; + if (!valid2) { + break; + } + } + } else { + const err5 = { + instancePath: instancePath + '/Devices', + schemaPath: '#/anyOf/0/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema14.anyOf[0].properties.Devices.type, + parentSchema: schema14.anyOf[0].properties.Devices, + data: data1, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + const err6 = { + instancePath, + schemaPath: '#/anyOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema14.anyOf[0].type, + parentSchema: schema14.anyOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.Callback !== undefined) { + let data4 = data.Callback; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data4 === 'string') { + if (!formats0(data4)) { + const err7 = { + instancePath: instancePath + '/Callback', + schemaPath: '#/anyOf/1/properties/Callback/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema14.anyOf[1].properties.Callback, + data: data4, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: instancePath + '/Callback', + schemaPath: '#/anyOf/1/properties/Callback/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema14.anyOf[1].properties.Callback.type, + parentSchema: schema14.anyOf[1].properties.Callback, + data: data4, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } else { + const err9 = { + instancePath, + schemaPath: '#/anyOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema14.anyOf[1].type, + parentSchema: schema14.anyOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var _valid0 = _errs11 === errors; + valid0 = valid0 || _valid0; + } + if (!valid0) { + const err10 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema14.anyOf, + parentSchema: schema14, + data, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + validate29.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate29.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse200 = validate30; +const schema15 = { + type: 'object', + required: ['BookingID'], + properties: { BookingID: { type: 'string', format: 'uri' } }, + 'x-standalone': false, + 'x-name': 'updateBookingResponse200', + 'x-location': + '#/paths//booking/{ID}/patch/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate30( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.BookingID === undefined && (missing0 = 'BookingID')) { + validate30.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema15.required, + parentSchema: schema15, + data, + }, + ]; + return false; + } else { + if (data.BookingID !== undefined) { + let data0 = data.BookingID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate30.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema15.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.properties.BookingID.type, + parentSchema: schema15.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate30.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema15.type, + parentSchema: schema15, + data, + }, + ]; + return false; + } + } + validate30.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse400 = validate31; +const schema16 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'updateBookingResponse400', + 'x-location': + '#/paths//booking/{ID}/patch/responses/400/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate31( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate31.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.type, + parentSchema: schema16, + data, + }, + ]; + return false; + } + validate31.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse500 = validate32; +const schema17 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'updateBookingResponse500', + 'x-location': + '#/paths//booking/{ID}/patch/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate32( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate32.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.type, + parentSchema: schema17, + data, + }, + ]; + return false; + } + validate32.errors = vErrors; + return errors === 0; +} +exports.validateDeleteBookingResponse500 = validate33; +const schema18 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'deleteBookingResponse500', + 'x-location': + '#/paths//booking/{ID}/delete/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate33( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate33.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.type, + parentSchema: schema18, + data, + }, + ]; + return false; + } + validate33.errors = vErrors; + return errors === 0; +} +exports.validateGetBookingResponse200 = validate34; +const schema19 = { + type: 'object', + required: ['Booking', 'Locked'], + properties: { + Booking: { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + }, + Locked: { + type: 'boolean', + description: 'Shows if the booking is in a locked status.', + }, + }, + 'x-standalone': false, + 'x-name': 'getBookingResponse200', + 'x-location': '#/paths//booking/{ID}/get/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate34( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Booking === undefined && (missing0 = 'Booking')) || + (data.Locked === undefined && (missing0 = 'Locked')) + ) { + validate34.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema19.required, + parentSchema: schema19, + data, + }, + ]; + return false; + } else { + if (data.Booking !== undefined) { + let data0 = data.Booking; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if ( + (data0.ID === undefined && (missing1 = 'ID')) || + (data0.Time === undefined && (missing1 = 'Time')) || + (data0.Devices === undefined && (missing1 = 'Devices')) || + (data0.Status === undefined && (missing1 = 'Status')) || + (data0.You === undefined && (missing1 = 'You')) || + (data0.External === undefined && (missing1 = 'External')) + ) { + validate34.errors = [ + { + instancePath: instancePath + '/Booking', + schemaPath: '#/properties/Booking/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema19.properties.Booking.required, + parentSchema: schema19.properties.Booking, + data: data0, + }, + ]; + return false; + } else { + if (data0.ID !== undefined) { + let data1 = data0.ID; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/ID', + schemaPath: '#/properties/Booking/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema19.properties.Booking.properties.ID, + data: data1, + }, + ]; + return false; + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/ID', + schemaPath: '#/properties/Booking/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema19.properties.Booking.properties.ID.type, + parentSchema: schema19.properties.Booking.properties.ID, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Time !== undefined) { + let data2 = data0.Time; + const _errs5 = errors; + if (errors === _errs5) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing2; + if ( + (data2.Start === undefined && (missing2 = 'Start')) || + (data2.End === undefined && (missing2 = 'End')) + ) { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Time', + schemaPath: '#/properties/Booking/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema19.properties.Booking.properties.Time.required, + parentSchema: schema19.properties.Booking.properties.Time, + data: data2, + }, + ]; + return false; + } else { + if (data2.Start !== undefined) { + let data3 = data2.Start; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate34.errors = [ + { + instancePath: + instancePath + '/Booking/Time/Start', + schemaPath: + '#/properties/Booking/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema19.properties.Booking.properties.Time + .properties.Start, + data: data3, + }, + ]; + return false; + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Time/Start', + schemaPath: + '#/properties/Booking/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema19.properties.Booking.properties.Time + .properties.Start.type, + parentSchema: + schema19.properties.Booking.properties.Time + .properties.Start, + data: data3, + }, + ]; + return false; + } + } + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data2.End !== undefined) { + let data4 = data2.End; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate34.errors = [ + { + instancePath: + instancePath + '/Booking/Time/End', + schemaPath: + '#/properties/Booking/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema19.properties.Booking.properties.Time + .properties.End, + data: data4, + }, + ]; + return false; + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Time/End', + schemaPath: + '#/properties/Booking/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema19.properties.Booking.properties.Time + .properties.End.type, + parentSchema: + schema19.properties.Booking.properties.Time + .properties.End, + data: data4, + }, + ]; + return false; + } + } + } + var valid2 = _errs9 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Time', + schemaPath: '#/properties/Booking/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema19.properties.Booking.properties.Time.type, + parentSchema: schema19.properties.Booking.properties.Time, + data: data2, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Devices !== undefined) { + let data5 = data0.Devices; + const _errs11 = errors; + if (errors === _errs11) { + if (Array.isArray(data5)) { + var valid3 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate34.errors = [ + { + instancePath: + instancePath + '/Booking/Devices/' + i0, + schemaPath: + '#/properties/Booking/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema19.properties.Booking.properties.Devices + .items, + data: data6, + }, + ]; + return false; + } + } else { + validate34.errors = [ + { + instancePath: + instancePath + '/Booking/Devices/' + i0, + schemaPath: + '#/properties/Booking/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema19.properties.Booking.properties.Devices + .items.type, + parentSchema: + schema19.properties.Booking.properties.Devices + .items, + data: data6, + }, + ]; + return false; + } + } + } + var valid3 = _errs13 === errors; + if (!valid3) { + break; + } + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Devices', + schemaPath: '#/properties/Booking/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema19.properties.Booking.properties.Devices.type, + parentSchema: + schema19.properties.Booking.properties.Devices, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs11 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Type !== undefined) { + let data7 = data0.Type; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Type', + schemaPath: '#/properties/Booking/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema19.properties.Booking.properties.Type.type, + parentSchema: schema19.properties.Booking.properties.Type, + data: data7, + }, + ]; + return false; + } + if (!(data7 === 'normal')) { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Type', + schemaPath: '#/properties/Booking/properties/Type/enum', + keyword: 'enum', + params: { + allowedValues: + schema19.properties.Booking.properties.Type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema19.properties.Booking.properties.Type.enum, + parentSchema: schema19.properties.Booking.properties.Type, + data: data7, + }, + ]; + return false; + } + var valid1 = _errs15 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Status !== undefined) { + let data8 = data0.Status; + const _errs17 = errors; + if (typeof data8 !== 'string') { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Status', + schemaPath: '#/properties/Booking/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema19.properties.Booking.properties.Status.type, + parentSchema: + schema19.properties.Booking.properties.Status, + data: data8, + }, + ]; + return false; + } + if ( + !( + data8 === 'pending' || + data8 === 'booked' || + data8 === 'rejected' || + data8 === 'cancelled' || + data8 === 'active' || + data8 === 'active-pending' || + data8 === 'active-rejected' + ) + ) { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Status', + schemaPath: '#/properties/Booking/properties/Status/enum', + keyword: 'enum', + params: { + allowedValues: + schema19.properties.Booking.properties.Status.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema19.properties.Booking.properties.Status.enum, + parentSchema: + schema19.properties.Booking.properties.Status, + data: data8, + }, + ]; + return false; + } + var valid1 = _errs17 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.You !== undefined) { + let data9 = data0.You; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/You', + schemaPath: '#/properties/Booking/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema19.properties.Booking.properties.You.type, + parentSchema: + schema19.properties.Booking.properties.You, + data: data9, + }, + ]; + return false; + } + var valid1 = _errs19 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.External !== undefined) { + let data10 = data0.External; + const _errs21 = errors; + if (typeof data10 !== 'boolean') { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/External', + schemaPath: + '#/properties/Booking/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema19.properties.Booking.properties.External + .type, + parentSchema: + schema19.properties.Booking.properties.External, + data: data10, + }, + ]; + return false; + } + var valid1 = _errs21 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Message !== undefined) { + let data11 = data0.Message; + const _errs23 = errors; + if (typeof data11 !== 'string') { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Message', + schemaPath: + '#/properties/Booking/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema19.properties.Booking.properties.Message + .type, + parentSchema: + schema19.properties.Booking.properties.Message, + data: data11, + }, + ]; + return false; + } + var valid1 = _errs23 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Booking', + schemaPath: '#/properties/Booking/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema19.properties.Booking.type, + parentSchema: schema19.properties.Booking, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Locked !== undefined) { + let data12 = data.Locked; + const _errs25 = errors; + if (typeof data12 !== 'boolean') { + validate34.errors = [ + { + instancePath: instancePath + '/Locked', + schemaPath: '#/properties/Locked/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema19.properties.Locked.type, + parentSchema: schema19.properties.Locked, + data: data12, + }, + ]; + return false; + } + var valid0 = _errs25 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate34.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema19.type, + parentSchema: schema19, + data, + }, + ]; + return false; + } + } + validate34.errors = vErrors; + return errors === 0; +} +exports.validateGetBookingResponse500 = validate35; +const schema20 = { + type: 'string', + description: 'Error code', + 'x-standalone': false, + 'x-name': 'getBookingResponse500', + 'x-location': '#/paths//booking/{ID}/get/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate35( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate35.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema20.type, + parentSchema: schema20, + data, + }, + ]; + return false; + } + validate35.errors = vErrors; + return errors === 0; +} +exports.validateDestroyBookingResponse500 = validate36; +const schema21 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'destroyBookingResponse500', + 'x-location': + '#/paths//booking/{ID}/destroy/delete/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate36( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate36.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema21.type, + parentSchema: schema21, + data, + }, + ]; + return false; + } + validate36.errors = vErrors; + return errors === 0; +} +exports.validateBookingRequest = validate37; +const schema22 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'BookingRequest', + 'x-location': '#/components/schemas/Booking_request', + 'x-schema-type': 'request', +}; +function validate37( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate37.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema22.required, + parentSchema: schema22, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate37.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema22.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.ID.type, + parentSchema: schema22.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate37.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema22.properties.Time.required, + parentSchema: schema22.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate37.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema22.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.Time.properties.Start.type, + parentSchema: schema22.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate37.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema22.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.Time.properties.End.type, + parentSchema: schema22.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema22.properties.Time.type, + parentSchema: schema22.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate37.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema22.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.Devices.items.type, + parentSchema: schema22.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema22.properties.Devices.type, + parentSchema: schema22.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate37.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.Type.type, + parentSchema: schema22.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate37.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema22.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema22.properties.Type.enum, + parentSchema: schema22.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate37.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.Status.type, + parentSchema: schema22.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate37.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema22.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema22.properties.Status.enum, + parentSchema: schema22.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate37.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema22.properties.You.type, + parentSchema: schema22.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate37.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema22.properties.External.type, + parentSchema: schema22.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate37.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.Message.type, + parentSchema: schema22.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate37.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema22.type, + parentSchema: schema22, + data, + }, + ]; + return false; + } + } + validate37.errors = vErrors; + return errors === 0; +} +exports.validateBookingResponse = validate38; +const schema23 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'BookingResponse', + 'x-location': '#/components/schemas/Booking_response', + 'x-schema-type': 'response', +}; +function validate38( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate38.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema23.required, + parentSchema: schema23, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate38.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema23.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.ID.type, + parentSchema: schema23.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate38.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema23.properties.Time.required, + parentSchema: schema23.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate38.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema23.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.Time.properties.Start.type, + parentSchema: schema23.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate38.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema23.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.Time.properties.End.type, + parentSchema: schema23.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema23.properties.Time.type, + parentSchema: schema23.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate38.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema23.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.Devices.items.type, + parentSchema: schema23.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema23.properties.Devices.type, + parentSchema: schema23.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate38.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.Type.type, + parentSchema: schema23.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate38.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema23.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema23.properties.Type.enum, + parentSchema: schema23.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate38.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.Status.type, + parentSchema: schema23.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate38.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema23.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema23.properties.Status.enum, + parentSchema: schema23.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate38.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema23.properties.You.type, + parentSchema: schema23.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate38.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema23.properties.External.type, + parentSchema: schema23.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate38.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.Message.type, + parentSchema: schema23.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate38.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema23.type, + parentSchema: schema23, + data, + }, + ]; + return false; + } + } + validate38.errors = vErrors; + return errors === 0; +} +exports.validateDeviceRequest = validate39; +const schema24 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'DeviceRequest', + 'x-location': '#/components/schemas/Device_request', + 'x-schema-type': 'request', +}; +function validate39( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate39.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema24.required, + parentSchema: schema24, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate39.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema24.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate39.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema24.properties.ID.type, + parentSchema: schema24.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate39.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema24.type, + parentSchema: schema24, + data, + }, + ]; + return false; + } + } + validate39.errors = vErrors; + return errors === 0; +} +exports.validateDeviceResponse = validate40; +const schema25 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'DeviceResponse', + 'x-location': '#/components/schemas/Device_response', + 'x-schema-type': 'response', +}; +function validate40( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate40.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema25.required, + parentSchema: schema25, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate40.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema25.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate40.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema25.properties.ID.type, + parentSchema: schema25.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate40.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema25.type, + parentSchema: schema25, + data, + }, + ]; + return false; + } + } + validate40.errors = vErrors; + return errors === 0; +} +exports.validateExperimentRequest = validate41; +const schema26 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'ExperimentRequest', + 'x-location': '#/components/schemas/Experiment_request', + 'x-schema-type': 'request', +}; +function validate41( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate41.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema26.required, + parentSchema: schema26, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate41.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema26.properties.Devices.items.required, + parentSchema: schema26.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate41.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema26.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema26.properties.Devices.items.properties.ID.type, + parentSchema: + schema26.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema26.properties.Devices.items.type, + parentSchema: schema26.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema26.properties.Devices.type, + parentSchema: schema26.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate41.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema26.properties.Description.type, + parentSchema: schema26.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate41.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema26.type, + parentSchema: schema26, + data, + }, + ]; + return false; + } + } + validate41.errors = vErrors; + return errors === 0; +} +exports.validateExperimentResponse = validate42; +const schema27 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'ExperimentResponse', + 'x-location': '#/components/schemas/Experiment_response', + 'x-schema-type': 'response', +}; +function validate42( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate42.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema27.required, + parentSchema: schema27, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate42.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema27.properties.Devices.items.required, + parentSchema: schema27.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate42.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema27.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.properties.Devices.items.properties.ID.type, + parentSchema: + schema27.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.properties.Devices.items.type, + parentSchema: schema27.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema27.properties.Devices.type, + parentSchema: schema27.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate42.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.properties.Description.type, + parentSchema: schema27.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate42.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.type, + parentSchema: schema27, + data, + }, + ]; + return false; + } + } + validate42.errors = vErrors; + return errors === 0; +} +exports.validateTimeslotRequest = validate43; +const schema28 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'TimeslotRequest', + 'x-location': '#/components/schemas/Timeslot_request', + 'x-schema-type': 'request', +}; +function validate43( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate43.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema28.required, + parentSchema: schema28, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate43.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema28.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema28.properties.Start.type, + parentSchema: schema28.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate43.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema28.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema28.properties.End.type, + parentSchema: schema28.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate43.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema28.type, + parentSchema: schema28, + data, + }, + ]; + return false; + } + } + validate43.errors = vErrors; + return errors === 0; +} +exports.validateTimeslotResponse = validate44; +const schema29 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'TimeslotResponse', + 'x-location': '#/components/schemas/Timeslot_response', + 'x-schema-type': 'response', +}; +function validate44( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate44.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema29.required, + parentSchema: schema29, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate44.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema29.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate44.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema29.properties.Start.type, + parentSchema: schema29.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate44.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema29.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate44.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema29.properties.End.type, + parentSchema: schema29.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate44.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema29.type, + parentSchema: schema29, + data, + }, + ]; + return false; + } + } + validate44.errors = vErrors; + return errors === 0; +} +exports.validateIDRequest = validate45; +const schema30 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'IDRequest', + 'x-location': '#/components/parameters/ID/schema_request', + 'x-schema-type': 'request', +}; +function validate45( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate45.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema30.type, + parentSchema: schema30, + data, + }, + ]; + return false; + } + validate45.errors = vErrors; + return errors === 0; +} +exports.validateIDResponse = validate46; +const schema31 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'IDResponse', + 'x-location': '#/components/parameters/ID/schema_response', + 'x-schema-type': 'response', +}; +function validate46( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate46.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema31.type, + parentSchema: schema31, + data, + }, + ]; + return false; + } + validate46.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingBodyRequest = validate47; +const schema32 = { + type: 'object', + required: ['Devices', 'Time'], + properties: { + Devices: { + type: 'array', + description: 'List of devices which should be added.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + }, + 'x-standalone': false, + 'x-name': 'newBookingBodyRequest', + 'x-location': + '#/paths//booking/post/requestBody/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate47( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Time === undefined && (missing0 = 'Time')) + ) { + validate47.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema32.required, + parentSchema: schema32, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate47.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema32.properties.Devices.items.required, + parentSchema: schema32.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate47.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema32.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate47.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema32.properties.Devices.items.properties.ID.type, + parentSchema: + schema32.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate47.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema32.properties.Devices.items.type, + parentSchema: schema32.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate47.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema32.properties.Devices.type, + parentSchema: schema32.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data3 = data.Time; + const _errs7 = errors; + if (errors === _errs7) { + if (data3 && typeof data3 == 'object' && !Array.isArray(data3)) { + let missing2; + if ( + (data3.Start === undefined && (missing2 = 'Start')) || + (data3.End === undefined && (missing2 = 'End')) + ) { + validate47.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema32.properties.Time.required, + parentSchema: schema32.properties.Time, + data: data3, + }, + ]; + return false; + } else { + if (data3.Start !== undefined) { + let data4 = data3.Start; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate47.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema32.properties.Time.properties.Start, + data: data4, + }, + ]; + return false; + } + } else { + validate47.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema32.properties.Time.properties.Start.type, + parentSchema: schema32.properties.Time.properties.Start, + data: data4, + }, + ]; + return false; + } + } + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.End !== undefined) { + let data5 = data3.End; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats2.validate(data5)) { + validate47.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema32.properties.Time.properties.End, + data: data5, + }, + ]; + return false; + } + } else { + validate47.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema32.properties.Time.properties.End.type, + parentSchema: schema32.properties.Time.properties.End, + data: data5, + }, + ]; + return false; + } + } + } + var valid3 = _errs11 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate47.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema32.properties.Time.type, + parentSchema: schema32.properties.Time, + data: data3, + }, + ]; + return false; + } + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate47.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema32.properties.Type.type, + parentSchema: schema32.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate47.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema32.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema32.properties.Type.enum, + parentSchema: schema32.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + } + } + } + } else { + validate47.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema32.type, + parentSchema: schema32, + data, + }, + ]; + return false; + } + } + validate47.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingBodyResponse = validate48; +const schema33 = { + type: 'object', + required: ['Devices', 'Time'], + properties: { + Devices: { + type: 'array', + description: 'List of devices which should be added.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + }, + 'x-standalone': false, + 'x-name': 'newBookingBodyResponse', + 'x-location': + '#/paths//booking/post/requestBody/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate48( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Time === undefined && (missing0 = 'Time')) + ) { + validate48.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema33.required, + parentSchema: schema33, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate48.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema33.properties.Devices.items.required, + parentSchema: schema33.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate48.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema33.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate48.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema33.properties.Devices.items.properties.ID.type, + parentSchema: + schema33.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate48.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema33.properties.Devices.items.type, + parentSchema: schema33.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate48.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema33.properties.Devices.type, + parentSchema: schema33.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data3 = data.Time; + const _errs7 = errors; + if (errors === _errs7) { + if (data3 && typeof data3 == 'object' && !Array.isArray(data3)) { + let missing2; + if ( + (data3.Start === undefined && (missing2 = 'Start')) || + (data3.End === undefined && (missing2 = 'End')) + ) { + validate48.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema33.properties.Time.required, + parentSchema: schema33.properties.Time, + data: data3, + }, + ]; + return false; + } else { + if (data3.Start !== undefined) { + let data4 = data3.Start; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate48.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema33.properties.Time.properties.Start, + data: data4, + }, + ]; + return false; + } + } else { + validate48.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema33.properties.Time.properties.Start.type, + parentSchema: schema33.properties.Time.properties.Start, + data: data4, + }, + ]; + return false; + } + } + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.End !== undefined) { + let data5 = data3.End; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats2.validate(data5)) { + validate48.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema33.properties.Time.properties.End, + data: data5, + }, + ]; + return false; + } + } else { + validate48.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema33.properties.Time.properties.End.type, + parentSchema: schema33.properties.Time.properties.End, + data: data5, + }, + ]; + return false; + } + } + } + var valid3 = _errs11 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate48.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema33.properties.Time.type, + parentSchema: schema33.properties.Time, + data: data3, + }, + ]; + return false; + } + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate48.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema33.properties.Type.type, + parentSchema: schema33.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate48.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema33.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema33.properties.Type.enum, + parentSchema: schema33.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + } + } + } + } else { + validate48.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema33.type, + parentSchema: schema33, + data, + }, + ]; + return false; + } + } + validate48.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingResponse200Request = validate49; +const schema34 = { + type: 'object', + required: ['BookingID'], + properties: { + BookingID: { + type: 'string', + format: 'uri', + description: 'ID at which the booking can be managed.', + }, + }, + 'x-standalone': false, + 'x-name': 'newBookingResponse200Request', + 'x-location': + '#/paths//booking/post/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate49( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.BookingID === undefined && (missing0 = 'BookingID')) { + validate49.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema34.required, + parentSchema: schema34, + data, + }, + ]; + return false; + } else { + if (data.BookingID !== undefined) { + let data0 = data.BookingID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate49.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema34.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } else { + validate49.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema34.properties.BookingID.type, + parentSchema: schema34.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate49.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema34.type, + parentSchema: schema34, + data, + }, + ]; + return false; + } + } + validate49.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingResponse200Response = validate50; +const schema35 = { + type: 'object', + required: ['BookingID'], + properties: { + BookingID: { + type: 'string', + format: 'uri', + description: 'ID at which the booking can be managed.', + }, + }, + 'x-standalone': false, + 'x-name': 'newBookingResponse200Response', + 'x-location': + '#/paths//booking/post/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate50( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.BookingID === undefined && (missing0 = 'BookingID')) { + validate50.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema35.required, + parentSchema: schema35, + data, + }, + ]; + return false; + } else { + if (data.BookingID !== undefined) { + let data0 = data.BookingID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate50.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema35.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } else { + validate50.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema35.properties.BookingID.type, + parentSchema: schema35.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate50.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema35.type, + parentSchema: schema35, + data, + }, + ]; + return false; + } + } + validate50.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingResponse500Request = validate51; +const schema36 = { + description: 'Error description', + type: 'string', + 'x-standalone': false, + 'x-name': 'newBookingResponse500Request', + 'x-location': + '#/paths//booking/post/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate51( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate51.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema36.type, + parentSchema: schema36, + data, + }, + ]; + return false; + } + validate51.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingResponse500Response = validate52; +const schema37 = { + description: 'Error description', + type: 'string', + 'x-standalone': false, + 'x-name': 'newBookingResponse500Response', + 'x-location': + '#/paths//booking/post/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate52( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate52.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema37.type, + parentSchema: schema37, + data, + }, + ]; + return false; + } + validate52.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingBodyRequest = validate53; +const schema38 = { + anyOf: [ + { + type: 'object', + description: 'Use this request for adding devices.', + properties: { + Locked: { + type: 'boolean', + description: + 'Expresses whether the devices should be locked. Must match current status of booking. Is assumed to be false if not set.', + }, + Devices: { + type: 'array', + description: 'List of devices which should be added.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + }, + }, + { + type: 'object', + description: 'Use this request for adding callbacks.', + properties: { + Callback: { + type: 'string', + format: 'uri', + description: 'Callback which should be called at changes.', + }, + }, + }, + ], + 'x-standalone': false, + 'x-name': 'updateBookingBodyRequest', + 'x-location': + '#/paths//booking/{ID}/patch/requestBody/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate53( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.Locked !== undefined) { + let data0 = data.Locked; + const _errs3 = errors; + if (typeof data0 !== 'boolean') { + const err0 = { + instancePath: instancePath + '/Locked', + schemaPath: '#/anyOf/0/properties/Locked/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema38.anyOf[0].properties.Locked.type, + parentSchema: schema38.anyOf[0].properties.Locked, + data: data0, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.Devices !== undefined) { + let data1 = data.Devices; + const _errs5 = errors; + if (errors === _errs5) { + if (Array.isArray(data1)) { + var valid2 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs7 = errors; + if (errors === _errs7) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing0; + if (data2.ID === undefined && (missing0 = 'ID')) { + const err1 = { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/anyOf/0/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema38.anyOf[0].properties.Devices.items.required, + parentSchema: schema38.anyOf[0].properties.Devices.items, + data: data2, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } else { + if (data2.ID !== undefined) { + let data3 = data2.ID; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + const err2 = { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/anyOf/0/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema38.anyOf[0].properties.Devices.items.properties + .ID, + data: data3, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } else { + const err3 = { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/anyOf/0/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema38.anyOf[0].properties.Devices.items.properties.ID + .type, + parentSchema: + schema38.anyOf[0].properties.Devices.items.properties + .ID, + data: data3, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + } + } + } + } + } else { + const err4 = { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/anyOf/0/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema38.anyOf[0].properties.Devices.items.type, + parentSchema: schema38.anyOf[0].properties.Devices.items, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + } + var valid2 = _errs7 === errors; + if (!valid2) { + break; + } + } + } else { + const err5 = { + instancePath: instancePath + '/Devices', + schemaPath: '#/anyOf/0/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema38.anyOf[0].properties.Devices.type, + parentSchema: schema38.anyOf[0].properties.Devices, + data: data1, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + const err6 = { + instancePath, + schemaPath: '#/anyOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema38.anyOf[0].type, + parentSchema: schema38.anyOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.Callback !== undefined) { + let data4 = data.Callback; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data4 === 'string') { + if (!formats0(data4)) { + const err7 = { + instancePath: instancePath + '/Callback', + schemaPath: '#/anyOf/1/properties/Callback/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema38.anyOf[1].properties.Callback, + data: data4, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: instancePath + '/Callback', + schemaPath: '#/anyOf/1/properties/Callback/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema38.anyOf[1].properties.Callback.type, + parentSchema: schema38.anyOf[1].properties.Callback, + data: data4, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } else { + const err9 = { + instancePath, + schemaPath: '#/anyOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema38.anyOf[1].type, + parentSchema: schema38.anyOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var _valid0 = _errs11 === errors; + valid0 = valid0 || _valid0; + } + if (!valid0) { + const err10 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema38.anyOf, + parentSchema: schema38, + data, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + validate53.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate53.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingBodyResponse = validate54; +const schema39 = { + anyOf: [ + { + type: 'object', + description: 'Use this request for adding devices.', + properties: { + Locked: { + type: 'boolean', + description: + 'Expresses whether the devices should be locked. Must match current status of booking. Is assumed to be false if not set.', + }, + Devices: { + type: 'array', + description: 'List of devices which should be added.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + }, + }, + { + type: 'object', + description: 'Use this request for adding callbacks.', + properties: { + Callback: { + type: 'string', + format: 'uri', + description: 'Callback which should be called at changes.', + }, + }, + }, + ], + 'x-standalone': false, + 'x-name': 'updateBookingBodyResponse', + 'x-location': + '#/paths//booking/{ID}/patch/requestBody/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate54( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.Locked !== undefined) { + let data0 = data.Locked; + const _errs3 = errors; + if (typeof data0 !== 'boolean') { + const err0 = { + instancePath: instancePath + '/Locked', + schemaPath: '#/anyOf/0/properties/Locked/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema39.anyOf[0].properties.Locked.type, + parentSchema: schema39.anyOf[0].properties.Locked, + data: data0, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.Devices !== undefined) { + let data1 = data.Devices; + const _errs5 = errors; + if (errors === _errs5) { + if (Array.isArray(data1)) { + var valid2 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs7 = errors; + if (errors === _errs7) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing0; + if (data2.ID === undefined && (missing0 = 'ID')) { + const err1 = { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/anyOf/0/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema39.anyOf[0].properties.Devices.items.required, + parentSchema: schema39.anyOf[0].properties.Devices.items, + data: data2, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } else { + if (data2.ID !== undefined) { + let data3 = data2.ID; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + const err2 = { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/anyOf/0/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema39.anyOf[0].properties.Devices.items.properties + .ID, + data: data3, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } else { + const err3 = { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/anyOf/0/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema39.anyOf[0].properties.Devices.items.properties.ID + .type, + parentSchema: + schema39.anyOf[0].properties.Devices.items.properties + .ID, + data: data3, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + } + } + } + } + } else { + const err4 = { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/anyOf/0/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema39.anyOf[0].properties.Devices.items.type, + parentSchema: schema39.anyOf[0].properties.Devices.items, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + } + var valid2 = _errs7 === errors; + if (!valid2) { + break; + } + } + } else { + const err5 = { + instancePath: instancePath + '/Devices', + schemaPath: '#/anyOf/0/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema39.anyOf[0].properties.Devices.type, + parentSchema: schema39.anyOf[0].properties.Devices, + data: data1, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + const err6 = { + instancePath, + schemaPath: '#/anyOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema39.anyOf[0].type, + parentSchema: schema39.anyOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.Callback !== undefined) { + let data4 = data.Callback; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data4 === 'string') { + if (!formats0(data4)) { + const err7 = { + instancePath: instancePath + '/Callback', + schemaPath: '#/anyOf/1/properties/Callback/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema39.anyOf[1].properties.Callback, + data: data4, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: instancePath + '/Callback', + schemaPath: '#/anyOf/1/properties/Callback/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema39.anyOf[1].properties.Callback.type, + parentSchema: schema39.anyOf[1].properties.Callback, + data: data4, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } else { + const err9 = { + instancePath, + schemaPath: '#/anyOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema39.anyOf[1].type, + parentSchema: schema39.anyOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var _valid0 = _errs11 === errors; + valid0 = valid0 || _valid0; + } + if (!valid0) { + const err10 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema39.anyOf, + parentSchema: schema39, + data, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + validate54.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate54.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse200Request = validate55; +const schema40 = { + type: 'object', + required: ['BookingID'], + properties: { BookingID: { type: 'string', format: 'uri' } }, + 'x-standalone': false, + 'x-name': 'updateBookingResponse200Request', + 'x-location': + '#/paths//booking/{ID}/patch/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate55( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.BookingID === undefined && (missing0 = 'BookingID')) { + validate55.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema40.required, + parentSchema: schema40, + data, + }, + ]; + return false; + } else { + if (data.BookingID !== undefined) { + let data0 = data.BookingID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate55.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema40.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } else { + validate55.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema40.properties.BookingID.type, + parentSchema: schema40.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate55.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema40.type, + parentSchema: schema40, + data, + }, + ]; + return false; + } + } + validate55.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse200Response = validate56; +const schema41 = { + type: 'object', + required: ['BookingID'], + properties: { BookingID: { type: 'string', format: 'uri' } }, + 'x-standalone': false, + 'x-name': 'updateBookingResponse200Response', + 'x-location': + '#/paths//booking/{ID}/patch/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate56( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.BookingID === undefined && (missing0 = 'BookingID')) { + validate56.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema41.required, + parentSchema: schema41, + data, + }, + ]; + return false; + } else { + if (data.BookingID !== undefined) { + let data0 = data.BookingID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate56.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema41.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } else { + validate56.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema41.properties.BookingID.type, + parentSchema: schema41.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate56.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema41.type, + parentSchema: schema41, + data, + }, + ]; + return false; + } + } + validate56.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse400Request = validate57; +const schema42 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'updateBookingResponse400Request', + 'x-location': + '#/paths//booking/{ID}/patch/responses/400/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate57( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate57.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema42.type, + parentSchema: schema42, + data, + }, + ]; + return false; + } + validate57.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse400Response = validate58; +const schema43 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'updateBookingResponse400Response', + 'x-location': + '#/paths//booking/{ID}/patch/responses/400/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate58( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate58.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema43.type, + parentSchema: schema43, + data, + }, + ]; + return false; + } + validate58.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse500Request = validate59; +const schema44 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'updateBookingResponse500Request', + 'x-location': + '#/paths//booking/{ID}/patch/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate59( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate59.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema44.type, + parentSchema: schema44, + data, + }, + ]; + return false; + } + validate59.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse500Response = validate60; +const schema45 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'updateBookingResponse500Response', + 'x-location': + '#/paths//booking/{ID}/patch/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate60( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate60.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema45.type, + parentSchema: schema45, + data, + }, + ]; + return false; + } + validate60.errors = vErrors; + return errors === 0; +} +exports.validateDeleteBookingResponse500Request = validate61; +const schema46 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'deleteBookingResponse500Request', + 'x-location': + '#/paths//booking/{ID}/delete/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate61( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate61.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema46.type, + parentSchema: schema46, + data, + }, + ]; + return false; + } + validate61.errors = vErrors; + return errors === 0; +} +exports.validateDeleteBookingResponse500Response = validate62; +const schema47 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'deleteBookingResponse500Response', + 'x-location': + '#/paths//booking/{ID}/delete/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate62( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate62.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema47.type, + parentSchema: schema47, + data, + }, + ]; + return false; + } + validate62.errors = vErrors; + return errors === 0; +} +exports.validateGetBookingResponse200Request = validate63; +const schema48 = { + type: 'object', + required: ['Booking', 'Locked'], + properties: { + Booking: { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + }, + Locked: { + type: 'boolean', + description: 'Shows if the booking is in a locked status.', + }, + }, + 'x-standalone': false, + 'x-name': 'getBookingResponse200Request', + 'x-location': + '#/paths//booking/{ID}/get/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate63( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Booking === undefined && (missing0 = 'Booking')) || + (data.Locked === undefined && (missing0 = 'Locked')) + ) { + validate63.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema48.required, + parentSchema: schema48, + data, + }, + ]; + return false; + } else { + if (data.Booking !== undefined) { + let data0 = data.Booking; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if ( + (data0.ID === undefined && (missing1 = 'ID')) || + (data0.Time === undefined && (missing1 = 'Time')) || + (data0.Devices === undefined && (missing1 = 'Devices')) || + (data0.Status === undefined && (missing1 = 'Status')) || + (data0.You === undefined && (missing1 = 'You')) || + (data0.External === undefined && (missing1 = 'External')) + ) { + validate63.errors = [ + { + instancePath: instancePath + '/Booking', + schemaPath: '#/properties/Booking/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema48.properties.Booking.required, + parentSchema: schema48.properties.Booking, + data: data0, + }, + ]; + return false; + } else { + if (data0.ID !== undefined) { + let data1 = data0.ID; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/ID', + schemaPath: '#/properties/Booking/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema48.properties.Booking.properties.ID, + data: data1, + }, + ]; + return false; + } + } else { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/ID', + schemaPath: '#/properties/Booking/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema48.properties.Booking.properties.ID.type, + parentSchema: schema48.properties.Booking.properties.ID, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Time !== undefined) { + let data2 = data0.Time; + const _errs5 = errors; + if (errors === _errs5) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing2; + if ( + (data2.Start === undefined && (missing2 = 'Start')) || + (data2.End === undefined && (missing2 = 'End')) + ) { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Time', + schemaPath: '#/properties/Booking/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema48.properties.Booking.properties.Time.required, + parentSchema: schema48.properties.Booking.properties.Time, + data: data2, + }, + ]; + return false; + } else { + if (data2.Start !== undefined) { + let data3 = data2.Start; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate63.errors = [ + { + instancePath: + instancePath + '/Booking/Time/Start', + schemaPath: + '#/properties/Booking/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema48.properties.Booking.properties.Time + .properties.Start, + data: data3, + }, + ]; + return false; + } + } else { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Time/Start', + schemaPath: + '#/properties/Booking/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema48.properties.Booking.properties.Time + .properties.Start.type, + parentSchema: + schema48.properties.Booking.properties.Time + .properties.Start, + data: data3, + }, + ]; + return false; + } + } + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data2.End !== undefined) { + let data4 = data2.End; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate63.errors = [ + { + instancePath: + instancePath + '/Booking/Time/End', + schemaPath: + '#/properties/Booking/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema48.properties.Booking.properties.Time + .properties.End, + data: data4, + }, + ]; + return false; + } + } else { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Time/End', + schemaPath: + '#/properties/Booking/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema48.properties.Booking.properties.Time + .properties.End.type, + parentSchema: + schema48.properties.Booking.properties.Time + .properties.End, + data: data4, + }, + ]; + return false; + } + } + } + var valid2 = _errs9 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Time', + schemaPath: '#/properties/Booking/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema48.properties.Booking.properties.Time.type, + parentSchema: schema48.properties.Booking.properties.Time, + data: data2, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Devices !== undefined) { + let data5 = data0.Devices; + const _errs11 = errors; + if (errors === _errs11) { + if (Array.isArray(data5)) { + var valid3 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate63.errors = [ + { + instancePath: + instancePath + '/Booking/Devices/' + i0, + schemaPath: + '#/properties/Booking/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema48.properties.Booking.properties.Devices + .items, + data: data6, + }, + ]; + return false; + } + } else { + validate63.errors = [ + { + instancePath: + instancePath + '/Booking/Devices/' + i0, + schemaPath: + '#/properties/Booking/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema48.properties.Booking.properties.Devices + .items.type, + parentSchema: + schema48.properties.Booking.properties.Devices + .items, + data: data6, + }, + ]; + return false; + } + } + } + var valid3 = _errs13 === errors; + if (!valid3) { + break; + } + } + } else { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Devices', + schemaPath: '#/properties/Booking/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema48.properties.Booking.properties.Devices.type, + parentSchema: + schema48.properties.Booking.properties.Devices, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs11 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Type !== undefined) { + let data7 = data0.Type; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Type', + schemaPath: '#/properties/Booking/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema48.properties.Booking.properties.Type.type, + parentSchema: schema48.properties.Booking.properties.Type, + data: data7, + }, + ]; + return false; + } + if (!(data7 === 'normal')) { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Type', + schemaPath: '#/properties/Booking/properties/Type/enum', + keyword: 'enum', + params: { + allowedValues: + schema48.properties.Booking.properties.Type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema48.properties.Booking.properties.Type.enum, + parentSchema: schema48.properties.Booking.properties.Type, + data: data7, + }, + ]; + return false; + } + var valid1 = _errs15 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Status !== undefined) { + let data8 = data0.Status; + const _errs17 = errors; + if (typeof data8 !== 'string') { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Status', + schemaPath: '#/properties/Booking/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema48.properties.Booking.properties.Status.type, + parentSchema: + schema48.properties.Booking.properties.Status, + data: data8, + }, + ]; + return false; + } + if ( + !( + data8 === 'pending' || + data8 === 'booked' || + data8 === 'rejected' || + data8 === 'cancelled' || + data8 === 'active' || + data8 === 'active-pending' || + data8 === 'active-rejected' + ) + ) { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Status', + schemaPath: '#/properties/Booking/properties/Status/enum', + keyword: 'enum', + params: { + allowedValues: + schema48.properties.Booking.properties.Status.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema48.properties.Booking.properties.Status.enum, + parentSchema: + schema48.properties.Booking.properties.Status, + data: data8, + }, + ]; + return false; + } + var valid1 = _errs17 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.You !== undefined) { + let data9 = data0.You; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/You', + schemaPath: '#/properties/Booking/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema48.properties.Booking.properties.You.type, + parentSchema: + schema48.properties.Booking.properties.You, + data: data9, + }, + ]; + return false; + } + var valid1 = _errs19 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.External !== undefined) { + let data10 = data0.External; + const _errs21 = errors; + if (typeof data10 !== 'boolean') { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/External', + schemaPath: + '#/properties/Booking/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema48.properties.Booking.properties.External + .type, + parentSchema: + schema48.properties.Booking.properties.External, + data: data10, + }, + ]; + return false; + } + var valid1 = _errs21 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Message !== undefined) { + let data11 = data0.Message; + const _errs23 = errors; + if (typeof data11 !== 'string') { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Message', + schemaPath: + '#/properties/Booking/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema48.properties.Booking.properties.Message + .type, + parentSchema: + schema48.properties.Booking.properties.Message, + data: data11, + }, + ]; + return false; + } + var valid1 = _errs23 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } + } + } else { + validate63.errors = [ + { + instancePath: instancePath + '/Booking', + schemaPath: '#/properties/Booking/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema48.properties.Booking.type, + parentSchema: schema48.properties.Booking, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Locked !== undefined) { + let data12 = data.Locked; + const _errs25 = errors; + if (typeof data12 !== 'boolean') { + validate63.errors = [ + { + instancePath: instancePath + '/Locked', + schemaPath: '#/properties/Locked/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema48.properties.Locked.type, + parentSchema: schema48.properties.Locked, + data: data12, + }, + ]; + return false; + } + var valid0 = _errs25 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate63.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema48.type, + parentSchema: schema48, + data, + }, + ]; + return false; + } + } + validate63.errors = vErrors; + return errors === 0; +} +exports.validateGetBookingResponse200Response = validate64; +const schema49 = { + type: 'object', + required: ['Booking', 'Locked'], + properties: { + Booking: { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + }, + Locked: { + type: 'boolean', + description: 'Shows if the booking is in a locked status.', + }, + }, + 'x-standalone': false, + 'x-name': 'getBookingResponse200Response', + 'x-location': + '#/paths//booking/{ID}/get/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate64( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Booking === undefined && (missing0 = 'Booking')) || + (data.Locked === undefined && (missing0 = 'Locked')) + ) { + validate64.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema49.required, + parentSchema: schema49, + data, + }, + ]; + return false; + } else { + if (data.Booking !== undefined) { + let data0 = data.Booking; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if ( + (data0.ID === undefined && (missing1 = 'ID')) || + (data0.Time === undefined && (missing1 = 'Time')) || + (data0.Devices === undefined && (missing1 = 'Devices')) || + (data0.Status === undefined && (missing1 = 'Status')) || + (data0.You === undefined && (missing1 = 'You')) || + (data0.External === undefined && (missing1 = 'External')) + ) { + validate64.errors = [ + { + instancePath: instancePath + '/Booking', + schemaPath: '#/properties/Booking/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema49.properties.Booking.required, + parentSchema: schema49.properties.Booking, + data: data0, + }, + ]; + return false; + } else { + if (data0.ID !== undefined) { + let data1 = data0.ID; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/ID', + schemaPath: '#/properties/Booking/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema49.properties.Booking.properties.ID, + data: data1, + }, + ]; + return false; + } + } else { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/ID', + schemaPath: '#/properties/Booking/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema49.properties.Booking.properties.ID.type, + parentSchema: schema49.properties.Booking.properties.ID, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Time !== undefined) { + let data2 = data0.Time; + const _errs5 = errors; + if (errors === _errs5) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing2; + if ( + (data2.Start === undefined && (missing2 = 'Start')) || + (data2.End === undefined && (missing2 = 'End')) + ) { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Time', + schemaPath: '#/properties/Booking/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema49.properties.Booking.properties.Time.required, + parentSchema: schema49.properties.Booking.properties.Time, + data: data2, + }, + ]; + return false; + } else { + if (data2.Start !== undefined) { + let data3 = data2.Start; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate64.errors = [ + { + instancePath: + instancePath + '/Booking/Time/Start', + schemaPath: + '#/properties/Booking/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema49.properties.Booking.properties.Time + .properties.Start, + data: data3, + }, + ]; + return false; + } + } else { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Time/Start', + schemaPath: + '#/properties/Booking/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema49.properties.Booking.properties.Time + .properties.Start.type, + parentSchema: + schema49.properties.Booking.properties.Time + .properties.Start, + data: data3, + }, + ]; + return false; + } + } + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data2.End !== undefined) { + let data4 = data2.End; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate64.errors = [ + { + instancePath: + instancePath + '/Booking/Time/End', + schemaPath: + '#/properties/Booking/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema49.properties.Booking.properties.Time + .properties.End, + data: data4, + }, + ]; + return false; + } + } else { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Time/End', + schemaPath: + '#/properties/Booking/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema49.properties.Booking.properties.Time + .properties.End.type, + parentSchema: + schema49.properties.Booking.properties.Time + .properties.End, + data: data4, + }, + ]; + return false; + } + } + } + var valid2 = _errs9 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Time', + schemaPath: '#/properties/Booking/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema49.properties.Booking.properties.Time.type, + parentSchema: schema49.properties.Booking.properties.Time, + data: data2, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Devices !== undefined) { + let data5 = data0.Devices; + const _errs11 = errors; + if (errors === _errs11) { + if (Array.isArray(data5)) { + var valid3 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate64.errors = [ + { + instancePath: + instancePath + '/Booking/Devices/' + i0, + schemaPath: + '#/properties/Booking/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema49.properties.Booking.properties.Devices + .items, + data: data6, + }, + ]; + return false; + } + } else { + validate64.errors = [ + { + instancePath: + instancePath + '/Booking/Devices/' + i0, + schemaPath: + '#/properties/Booking/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema49.properties.Booking.properties.Devices + .items.type, + parentSchema: + schema49.properties.Booking.properties.Devices + .items, + data: data6, + }, + ]; + return false; + } + } + } + var valid3 = _errs13 === errors; + if (!valid3) { + break; + } + } + } else { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Devices', + schemaPath: '#/properties/Booking/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema49.properties.Booking.properties.Devices.type, + parentSchema: + schema49.properties.Booking.properties.Devices, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs11 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Type !== undefined) { + let data7 = data0.Type; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Type', + schemaPath: '#/properties/Booking/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema49.properties.Booking.properties.Type.type, + parentSchema: schema49.properties.Booking.properties.Type, + data: data7, + }, + ]; + return false; + } + if (!(data7 === 'normal')) { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Type', + schemaPath: '#/properties/Booking/properties/Type/enum', + keyword: 'enum', + params: { + allowedValues: + schema49.properties.Booking.properties.Type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema49.properties.Booking.properties.Type.enum, + parentSchema: schema49.properties.Booking.properties.Type, + data: data7, + }, + ]; + return false; + } + var valid1 = _errs15 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Status !== undefined) { + let data8 = data0.Status; + const _errs17 = errors; + if (typeof data8 !== 'string') { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Status', + schemaPath: '#/properties/Booking/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema49.properties.Booking.properties.Status.type, + parentSchema: + schema49.properties.Booking.properties.Status, + data: data8, + }, + ]; + return false; + } + if ( + !( + data8 === 'pending' || + data8 === 'booked' || + data8 === 'rejected' || + data8 === 'cancelled' || + data8 === 'active' || + data8 === 'active-pending' || + data8 === 'active-rejected' + ) + ) { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Status', + schemaPath: '#/properties/Booking/properties/Status/enum', + keyword: 'enum', + params: { + allowedValues: + schema49.properties.Booking.properties.Status.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema49.properties.Booking.properties.Status.enum, + parentSchema: + schema49.properties.Booking.properties.Status, + data: data8, + }, + ]; + return false; + } + var valid1 = _errs17 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.You !== undefined) { + let data9 = data0.You; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/You', + schemaPath: '#/properties/Booking/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema49.properties.Booking.properties.You.type, + parentSchema: + schema49.properties.Booking.properties.You, + data: data9, + }, + ]; + return false; + } + var valid1 = _errs19 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.External !== undefined) { + let data10 = data0.External; + const _errs21 = errors; + if (typeof data10 !== 'boolean') { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/External', + schemaPath: + '#/properties/Booking/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema49.properties.Booking.properties.External + .type, + parentSchema: + schema49.properties.Booking.properties.External, + data: data10, + }, + ]; + return false; + } + var valid1 = _errs21 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Message !== undefined) { + let data11 = data0.Message; + const _errs23 = errors; + if (typeof data11 !== 'string') { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Message', + schemaPath: + '#/properties/Booking/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema49.properties.Booking.properties.Message + .type, + parentSchema: + schema49.properties.Booking.properties.Message, + data: data11, + }, + ]; + return false; + } + var valid1 = _errs23 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } + } + } else { + validate64.errors = [ + { + instancePath: instancePath + '/Booking', + schemaPath: '#/properties/Booking/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema49.properties.Booking.type, + parentSchema: schema49.properties.Booking, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Locked !== undefined) { + let data12 = data.Locked; + const _errs25 = errors; + if (typeof data12 !== 'boolean') { + validate64.errors = [ + { + instancePath: instancePath + '/Locked', + schemaPath: '#/properties/Locked/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema49.properties.Locked.type, + parentSchema: schema49.properties.Locked, + data: data12, + }, + ]; + return false; + } + var valid0 = _errs25 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate64.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema49.type, + parentSchema: schema49, + data, + }, + ]; + return false; + } + } + validate64.errors = vErrors; + return errors === 0; +} +exports.validateGetBookingResponse500Request = validate65; +const schema50 = { + type: 'string', + description: 'Error code', + 'x-standalone': false, + 'x-name': 'getBookingResponse500Request', + 'x-location': + '#/paths//booking/{ID}/get/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate65( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate65.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema50.type, + parentSchema: schema50, + data, + }, + ]; + return false; + } + validate65.errors = vErrors; + return errors === 0; +} +exports.validateGetBookingResponse500Response = validate66; +const schema51 = { + type: 'string', + description: 'Error code', + 'x-standalone': false, + 'x-name': 'getBookingResponse500Response', + 'x-location': + '#/paths//booking/{ID}/get/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate66( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate66.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema51.type, + parentSchema: schema51, + data, + }, + ]; + return false; + } + validate66.errors = vErrors; + return errors === 0; +} +exports.validateDestroyBookingResponse500Request = validate67; +const schema52 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'destroyBookingResponse500Request', + 'x-location': + '#/paths//booking/{ID}/destroy/delete/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate67( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate67.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema52.type, + parentSchema: schema52, + data, + }, + ]; + return false; + } + validate67.errors = vErrors; + return errors === 0; +} +exports.validateDestroyBookingResponse500Response = validate68; +const schema53 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'destroyBookingResponse500Response', + 'x-location': + '#/paths//booking/{ID}/destroy/delete/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate68( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate68.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema53.type, + parentSchema: schema53, + data, + }, + ]; + return false; + } + validate68.errors = vErrors; + return errors === 0; +} diff --git a/services/booking/src/common/src/clients/booking-frontend/basicValidation.d.cts b/services/booking/src/common/src/clients/booking-frontend/basicValidation.d.cts new file mode 100644 index 00000000..986e0dcc --- /dev/null +++ b/services/booking/src/common/src/clients/booking-frontend/basicValidation.d.cts @@ -0,0 +1,191 @@ +export declare function validateBooking( + object: unknown, +): Booking; + +export declare function validateDevice( + object: unknown, +): Device; + +export declare function validateExperiment( + object: unknown, +): Experiment; + +export declare function validateTimeslot( + object: unknown, +): Timeslot; + +export declare function validateID( + object: unknown, +): ID; + +export declare function validateNewBookingBody( + object: unknown, +): newBookingBody; + +export declare function validateNewBookingResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): newBookingResponse200; + +export declare function validateNewBookingResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): newBookingResponse500; + +export declare function validateUpdateBookingBody< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingBody; + +export declare function validateUpdateBookingResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse200; + +export declare function validateUpdateBookingResponse400< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse400; + +export declare function validateUpdateBookingResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse500; + +export declare function validateDeleteBookingResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): deleteBookingResponse500; + +export declare function validateGetBookingResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): getBookingResponse200; + +export declare function validateGetBookingResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): getBookingResponse500; + +export declare function validateDestroyBookingResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): destroyBookingResponse500; + +export declare function validateBookingRequest( + object: unknown, +): BookingRequest; + +export declare function validateBookingResponse( + object: unknown, +): BookingResponse; + +export declare function validateDeviceRequest( + object: unknown, +): DeviceRequest; + +export declare function validateDeviceResponse( + object: unknown, +): DeviceResponse; + +export declare function validateExperimentRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ExperimentRequest; + +export declare function validateExperimentResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ExperimentResponse; + +export declare function validateTimeslotRequest( + object: unknown, +): TimeslotRequest; + +export declare function validateTimeslotResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): TimeslotResponse; + +export declare function validateIDRequest( + object: unknown, +): IDRequest; + +export declare function validateIDResponse( + object: unknown, +): IDResponse; + +export declare function validateNewBookingBodyRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): newBookingBodyRequest; + +export declare function validateNewBookingBodyResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): newBookingBodyResponse; + +export declare function validateNewBookingResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): newBookingResponse200Request; + +export declare function validateNewBookingResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): newBookingResponse200Response; + +export declare function validateNewBookingResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): newBookingResponse500Request; + +export declare function validateNewBookingResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): newBookingResponse500Response; + +export declare function validateUpdateBookingBodyRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingBodyRequest; + +export declare function validateUpdateBookingBodyResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingBodyResponse; + +export declare function validateUpdateBookingResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse200Request; + +export declare function validateUpdateBookingResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse200Response; + +export declare function validateUpdateBookingResponse400Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse400Request; + +export declare function validateUpdateBookingResponse400Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse400Response; + +export declare function validateUpdateBookingResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse500Request; + +export declare function validateUpdateBookingResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse500Response; + +export declare function validateDeleteBookingResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): deleteBookingResponse500Request; + +export declare function validateDeleteBookingResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): deleteBookingResponse500Response; + +export declare function validateGetBookingResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): getBookingResponse200Request; + +export declare function validateGetBookingResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): getBookingResponse200Response; + +export declare function validateGetBookingResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): getBookingResponse500Request; + +export declare function validateGetBookingResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): getBookingResponse500Response; + +export declare function validateDestroyBookingResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): destroyBookingResponse500Request; + +export declare function validateDestroyBookingResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): destroyBookingResponse500Response; diff --git a/services/booking/src/common/src/clients/booking-frontend/client.ts b/services/booking/src/common/src/clients/booking-frontend/client.ts new file mode 100644 index 00000000..719ff403 --- /dev/null +++ b/services/booking/src/common/src/clients/booking-frontend/client.ts @@ -0,0 +1,609 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import fetch, { RequestInfo, RequestInit, Response } from 'node-fetch'; + +import * as RequestValidation from './requestValidation.js'; +import * as Signatures from './signatures.js'; +import * as Types from './types.js'; +// @ts-ignore +import { type Require } from './types.js'; + +/** + * This error class should be used if an error occurs during validation of a request/response. + * @category Errors + */ +export class ValidationError extends Error { + public errors: unknown; + + constructor(message: string, errors: unknown) { + super(message); + this.name = 'ValidationError'; + this.errors = errors; + } +} + +/** + * This error class should be used if an error occurs while fetching a request. + * @category Errors + */ +export class FetchError extends Error { + constructor(message: string) { + super(message); + this.name = 'FetchError'; + } +} + +/** + * This error class should be used if the response of the server has a status + * greater than or equal to 400. This error should contain the validated response. + * @category Errors + */ +export class UnsuccessfulRequestError extends Error { + public response: Types.ResponseData; + + constructor(message: string, response: Types.ResponseData) { + super(message); + this.response = response; + this.name = 'UnsuccessfulRequestError'; + } +} + +/** + * This error class should be used if the validation of an url fails. + * @category Errors + */ +export class InvalidUrlError extends Error { + constructor(message: string) { + super(message); + this.name = 'InvalidUrlError'; + } +} + +/** + * This function attempts to parse a Response as ResponseData. + */ +async function parseResponse(response: Response): Promise { + let text = null; + try { + text = await response.text(); + const json = JSON.parse(text); + return { status: response.status, body: json }; + } catch { + return { status: response.status, body: text }; + } +} + +/** + * This function checks if a string is a valid http url. + * @param string The string to be checked. + * @returns True if the string is a valid http url. + */ +function isValidHttpUrl(string: string) { + let url; + + try { + url = new URL(string); + } catch (_) { + return false; + } + + return url.protocol === 'http:' || url.protocol === 'https:'; +} + +/** + * This function takes an url and a pattern for the requested endpoint and parses the contained path parameters. + * @param url The url to be parsed. + * @param endpoint Pattern of the requested endpoint. + * @throws {InvalidUrlError} Thrown if the provided url does not end with the provided endpoint. + * @returns An array containing all parsed path parameters in order of appearance. + * @example + * // returns ["username", "role_name"] + * parsePathParameters("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") + */ +function parsePathParameters(url: string, endpoint: string): string[] { + const parameterRegex = '([^/]+)'; + const regex = new RegExp(endpoint.replaceAll('{}', parameterRegex) + '(?:.(?!\\\\))?$'); + const matches = url.match(regex); + + if (!matches) throw new InvalidUrlError('Url does not end with the provided endpoint'); + + return matches.slice(1); +} + +/** + * This function validates a given http url and parses its path parameters. + * @param url The url to be validated. + * @param endpoint Pattern of the requested endpoint. + * @throws {InvalidUrlError} Thrown if the validation of the provided url fails. + * @returns An array containing all parsed path parameters in order of appearance (see {@link parsePathParameters}). + * @example + * // returns ["username", "role_name"] + * validateUrl("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") + */ +function validateUrl(url: string, endpoint: string): string[] { + if (!isValidHttpUrl(url)) + throw new InvalidUrlError('Provided url is not a valid http url'); + return parsePathParameters(url, endpoint); +} + +/** + * This function appends a given endpoint to an url. + * @param url The url to append the endpoint to. + * @param endpoint The endpoint to be appended. + * @example + * // returns "https://api.example.com/devices/device_id/token" + * appendToUrl("https://api.example.com/devices/device_id", "/token") + * @example + * // returns "https://api.example.com/devices/device_id/token" + * appendToUrl("https://api.example.com/devices/device_id/", "/token") + * @returns The url with the appended endpoint. + */ +function appendToUrl(url: string, endpoint: string) { + return url.endsWith('/') ? `${url.slice(0, -1)}${endpoint}` : `${url}${endpoint}`; +} + +/** + * Client for the use of the Crosslab API + * @category Client + */ +export class Client { + public readonly baseUrl: string; + public readonly serviceUrl: string; + public accessToken: string; + private fixedHeaders: [string, string][]; + private fetch = async (url: RequestInfo | URL, init: RequestInit) => { + let raw_response; + const parsedUrl = new URL(url.toString()); + try { + if ( + parsedUrl.toString().startsWith(this.baseUrl) || + parsedUrl.toString().startsWith(this.serviceUrl) + ) { + raw_response = await fetch(url, init); + } else { + raw_response = await fetch( + appendToUrl( + this.baseUrl, + '/proxy?' + new URLSearchParams([['URL', url.toString()]]).toString(), + ), + init, + ); + } + } catch (error) { + if (error instanceof Error) { + throw new FetchError(error.message); + } else if (typeof error === 'string') { + throw new FetchError(error); + } else { + throw new FetchError('Something went wrong while trying to fetch the request'); + } + } + return await parseResponse(raw_response); + }; + + /** + * @category Constructors + */ + constructor( + baseUrl: string, + options: { + serviceUrl?: string; + accessToken?: string; + fixedHeaders?: [string, string][]; + }, + ) { + this.baseUrl = new URL(baseUrl).toString().slice(0, -1); + this.serviceUrl = new URL(options.serviceUrl ?? this.baseUrl).toString().slice(0, -1); + this.accessToken = options.accessToken ?? ''; + this.fixedHeaders = options.fixedHeaders ?? []; + } + + /** + * Books an experiment. + * + * @param body + * @param options.url + * Url of the to be used. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The booking was accepted. The booking status will display whether the booking of all devices was successful. + */ + public async newBooking( + body: { + /** + * List of devices which should be added. + */ + Devices: Types.Device<'request'>[]; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: Types.Timeslot<'request'>; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + [k: string]: unknown; + }, + options?: { + headers?: [string, string][]; + url?: string; + }, + ): Promise { + const url = appendToUrl(options?.url ?? this.baseUrl, '/booking'); + console.log('trying to fetch url:', url); + + if (!RequestValidation.validateNewBookingInput(body)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateNewBookingInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); + + if (!RequestValidation.validateNewBookingOutput(response)) + throw new ValidationError( + 'Response validation failed!', + (RequestValidation.validateNewBookingOutput as Types.FunctionWithErrors).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * Allows the addition of devices to a booking (removing of devices is not supportet) or the registration of callbacks. For adding devices, the scope 'booking:use' is required. + + * + * @param url + * Url of the resource to be accessed. + * @param body + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The booking change was accepted. The booking status will display whether the booking of all devices was successful. + */ + public async updateBooking( + url: string, + body: + | { + /** + * Expresses whether the devices should be locked. Must match current status of booking. Is assumed to be false if not set. + */ + Locked?: boolean; + /** + * List of devices which should be added. + */ + Devices?: Types.Device<'request'>[]; + [k: string]: unknown; + } + | { + /** + * Callback which should be called at changes. + */ + Callback?: string; + [k: string]: unknown; + }, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/booking/{}'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [ID] = validateUrl(new URL(url).toString(), '/booking/{}'); + console.log('trying to fetch url:', url); + + const parameters = { + ID: ID, + }; + + if (!RequestValidation.validateUpdateBookingInput(parameters, body)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateUpdateBookingInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'PATCH', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); + + if (!RequestValidation.validateUpdateBookingOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateUpdateBookingOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * Cancels a booking, as long as the booking was originally done by you. + * + * @param url + * Url of the resource to be accessed. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The booking was cancelled. All associated devices were released. + */ + public async deleteBooking( + url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/booking/{}'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [ID] = validateUrl(new URL(url).toString(), '/booking/{}'); + console.log('trying to fetch url:', url); + + const parameters = { + ID: ID, + }; + + if (!RequestValidation.validateDeleteBookingInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateDeleteBookingInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'DELETE', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateDeleteBookingOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateDeleteBookingOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + } + + /** + * Returns whether a list of devices is currently booked for a user. + * + * @param url + * Url of the resource to be accessed. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * Returns the current booking. + */ + public async getBooking( + url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/booking/{}'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [ID] = validateUrl(new URL(url).toString(), '/booking/{}'); + console.log('trying to fetch url:', url); + + const parameters = { + ID: ID, + }; + + if (!RequestValidation.validateGetBookingInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateGetBookingInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'GET', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateGetBookingOutput(response)) + throw new ValidationError( + 'Response validation failed!', + (RequestValidation.validateGetBookingOutput as Types.FunctionWithErrors).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * Allows selected persons (like lab manager) to remove a user booking. To avoid mistakes, this is a different path than normal delete. + * + * @param url + * Url of the resource to be accessed. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The booking was cancelled. All associated devices were released. + */ + public async destroyBooking( + url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/booking/{}/destroy'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [ID] = validateUrl(new URL(url).toString(), '/booking/{}/destroy'); + console.log('trying to fetch url:', url); + + const parameters = { + ID: ID, + }; + + if (!RequestValidation.validateDestroyBookingInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + ( + RequestValidation.validateDestroyBookingInput as Types.FunctionWithErrors + ).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'DELETE', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateDestroyBookingOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateDestroyBookingOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + } +} diff --git a/services/booking/src/common/src/clients/booking-frontend/requestValidation.ts b/services/booking/src/common/src/clients/booking-frontend/requestValidation.ts new file mode 100644 index 00000000..bf388f61 --- /dev/null +++ b/services/booking/src/common/src/clients/booking-frontend/requestValidation.ts @@ -0,0 +1,373 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +import * as BasicValidation from './basicValidation.cjs'; +import * as Signatures from './signatures.js'; +import { FunctionWithErrors, ResponseData } from './types.js'; + +/** + * This function validates the inputs to newBooking() + */ +export function validateNewBookingInput(body: Signatures.NewBookingBody) { + if (!BasicValidation.validateNewBookingBodyRequest(body)) { + (validateNewBookingInput as FunctionWithErrors).errors = ( + BasicValidation.validateNewBookingBodyRequest as FunctionWithErrors + ).errors; + return false; + } + + return true; +} + +/** + * This function validates the outputs of newBooking() + */ +export function validateNewBookingOutput( + response: ResponseData, +): response is Signatures.NewBookingResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if (!BasicValidation.validateNewBookingResponse200Response(response.body)) { + (validateNewBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateNewBookingResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateNewBookingResponse500Response(response.body)) { + (validateNewBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateNewBookingResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateNewBookingOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to updateBooking() + */ +export function validateUpdateBookingInput( + parameters: Signatures.UpdateBookingParameters, + body: Signatures.UpdateBookingBody, +) { + if (parameters) { + if (!BasicValidation.validateIDRequest(parameters['ID'])) { + (validateUpdateBookingInput as FunctionWithErrors).errors = ( + BasicValidation.validateIDRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + if (!BasicValidation.validateUpdateBookingBodyRequest(body)) { + (validateUpdateBookingInput as FunctionWithErrors).errors = ( + BasicValidation.validateUpdateBookingBodyRequest as FunctionWithErrors + ).errors; + return false; + } + + return true; +} + +/** + * This function validates the outputs of updateBooking() + */ +export function validateUpdateBookingOutput( + response: ResponseData, +): response is Signatures.UpdateBookingResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if (!BasicValidation.validateUpdateBookingResponse200Response(response.body)) { + (validateUpdateBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateUpdateBookingResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 400) { + if (!BasicValidation.validateUpdateBookingResponse400Response(response.body)) { + (validateUpdateBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateUpdateBookingResponse400Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 423) { + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateUpdateBookingResponse500Response(response.body)) { + (validateUpdateBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateUpdateBookingResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateUpdateBookingOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to deleteBooking() + */ +export function validateDeleteBookingInput( + parameters: Signatures.DeleteBookingParameters, +) { + if (parameters) { + if (!BasicValidation.validateIDRequest(parameters['ID'])) { + (validateDeleteBookingInput as FunctionWithErrors).errors = ( + BasicValidation.validateIDRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of deleteBooking() + */ +export function validateDeleteBookingOutput( + response: ResponseData, +): response is Signatures.DeleteBookingResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 423) { + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateDeleteBookingResponse500Response(response.body)) { + (validateDeleteBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateDeleteBookingResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateDeleteBookingOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to getBooking() + */ +export function validateGetBookingInput(parameters: Signatures.GetBookingParameters) { + if (parameters) { + if (!BasicValidation.validateIDRequest(parameters['ID'])) { + (validateGetBookingInput as FunctionWithErrors).errors = ( + BasicValidation.validateIDRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of getBooking() + */ +export function validateGetBookingOutput( + response: ResponseData, +): response is Signatures.GetBookingResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if (!BasicValidation.validateGetBookingResponse200Response(response.body)) { + (validateGetBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateGetBookingResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateGetBookingResponse500Response(response.body)) { + (validateGetBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateGetBookingResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateGetBookingOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to destroyBooking() + */ +export function validateDestroyBookingInput( + parameters: Signatures.DestroyBookingParameters, +) { + if (parameters) { + if (!BasicValidation.validateIDRequest(parameters['ID'])) { + (validateDestroyBookingInput as FunctionWithErrors).errors = ( + BasicValidation.validateIDRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of destroyBooking() + */ +export function validateDestroyBookingOutput( + response: ResponseData, +): response is Signatures.DestroyBookingResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 423) { + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateDestroyBookingResponse500Response(response.body)) { + (validateDestroyBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateDestroyBookingResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateDestroyBookingOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} diff --git a/services/booking/src/common/src/clients/booking-frontend/signatures.ts b/services/booking/src/common/src/clients/booking-frontend/signatures.ts new file mode 100644 index 00000000..09577589 --- /dev/null +++ b/services/booking/src/common/src/clients/booking-frontend/signatures.ts @@ -0,0 +1,627 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import * as Types from './types.js'; +// @ts-ignore +import { type Require } from './types.js'; + +/** + * Typing for the body of the request made by newBooking() + * @category newBooking() + */ +export type NewBookingBody = { + /** + * List of devices which should be added. + */ + Devices: Types.Device<'request'>[]; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: Types.Timeslot<'request'>; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + [k: string]: unknown; +}; + +/** + * Typing for all possible responses to the request made by newBooking() + * @category newBooking() + */ +export type NewBookingResponse = NewBookingSuccessResponse | NewBookingErrorResponse; + +/** + * Typing for all successful responses to the request made by newBooking() + * @category newBooking() + */ +export type NewBookingSuccessResponse = NewBookingResponse200; + +/** + * Typing for all error responses to the request made by newBooking() + * @category newBooking() + */ +export type NewBookingErrorResponse = + | NewBookingResponse401 + | NewBookingResponse403 + | NewBookingResponse500 + | NewBookingResponse503; + +/** + * Typing for a response with status 200 to the request made by newBooking() + * @category newBooking() + */ +export interface NewBookingResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: { + /** + * ID at which the booking can be managed. + */ + BookingID: string; + [k: string]: unknown; + }; +} + +/** + * Typing for a response with status 401 to the request made by newBooking() + * @category newBooking() + */ +export interface NewBookingResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by newBooking() + * @category newBooking() + */ +export interface NewBookingResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by newBooking() + * @category newBooking() + */ +export interface NewBookingResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by newBooking() + * @category newBooking() + */ +export interface NewBookingResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by updateBooking() + * @category updateBooking() + */ +export type UpdateBookingParameters = { + ID: string; +}; + +/** + * Typing for the body of the request made by updateBooking() + * @category updateBooking() + */ +export type UpdateBookingBody = + | { + /** + * Expresses whether the devices should be locked. Must match current status of booking. Is assumed to be false if not set. + */ + Locked?: boolean; + /** + * List of devices which should be added. + */ + Devices?: Types.Device<'request'>[]; + [k: string]: unknown; + } + | { + /** + * Callback which should be called at changes. + */ + Callback?: string; + [k: string]: unknown; + }; + +/** + * Typing for all possible responses to the request made by updateBooking() + * @category updateBooking() + */ +export type UpdateBookingResponse = + | UpdateBookingSuccessResponse + | UpdateBookingErrorResponse; + +/** + * Typing for all successful responses to the request made by updateBooking() + * @category updateBooking() + */ +export type UpdateBookingSuccessResponse = UpdateBookingResponse200; + +/** + * Typing for all error responses to the request made by updateBooking() + * @category updateBooking() + */ +export type UpdateBookingErrorResponse = + | UpdateBookingResponse400 + | UpdateBookingResponse401 + | UpdateBookingResponse403 + | UpdateBookingResponse404 + | UpdateBookingResponse423 + | UpdateBookingResponse500 + | UpdateBookingResponse503; + +/** + * Typing for a response with status 200 to the request made by updateBooking() + * @category updateBooking() + */ +export interface UpdateBookingResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: { + BookingID: string; + [k: string]: unknown; + }; +} + +/** + * Typing for a response with status 400 to the request made by updateBooking() + * @category updateBooking() + */ +export interface UpdateBookingResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 401 to the request made by updateBooking() + * @category updateBooking() + */ +export interface UpdateBookingResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by updateBooking() + * @category updateBooking() + */ +export interface UpdateBookingResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by updateBooking() + * @category updateBooking() + */ +export interface UpdateBookingResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 423 to the request made by updateBooking() + * @category updateBooking() + */ +export interface UpdateBookingResponse423 extends Types.ErrorResponse { + status: 423; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by updateBooking() + * @category updateBooking() + */ +export interface UpdateBookingResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by updateBooking() + * @category updateBooking() + */ +export interface UpdateBookingResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by deleteBooking() + * @category deleteBooking() + */ +export type DeleteBookingParameters = { + ID: string; +}; + +/** + * Typing for all possible responses to the request made by deleteBooking() + * @category deleteBooking() + */ +export type DeleteBookingResponse = + | DeleteBookingSuccessResponse + | DeleteBookingErrorResponse; + +/** + * Typing for all successful responses to the request made by deleteBooking() + * @category deleteBooking() + */ +export type DeleteBookingSuccessResponse = DeleteBookingResponse200; + +/** + * Typing for all error responses to the request made by deleteBooking() + * @category deleteBooking() + */ +export type DeleteBookingErrorResponse = + | DeleteBookingResponse401 + | DeleteBookingResponse403 + | DeleteBookingResponse404 + | DeleteBookingResponse423 + | DeleteBookingResponse500 + | DeleteBookingResponse503; + +/** + * Typing for a response with status 200 to the request made by deleteBooking() + * @category deleteBooking() + */ +export interface DeleteBookingResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by deleteBooking() + * @category deleteBooking() + */ +export interface DeleteBookingResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by deleteBooking() + * @category deleteBooking() + */ +export interface DeleteBookingResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by deleteBooking() + * @category deleteBooking() + */ +export interface DeleteBookingResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 423 to the request made by deleteBooking() + * @category deleteBooking() + */ +export interface DeleteBookingResponse423 extends Types.ErrorResponse { + status: 423; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by deleteBooking() + * @category deleteBooking() + */ +export interface DeleteBookingResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by deleteBooking() + * @category deleteBooking() + */ +export interface DeleteBookingResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by getBooking() + * @category getBooking() + */ +export type GetBookingParameters = { + ID: string; +}; + +/** + * Typing for all possible responses to the request made by getBooking() + * @category getBooking() + */ +export type GetBookingResponse = GetBookingSuccessResponse | GetBookingErrorResponse; + +/** + * Typing for all successful responses to the request made by getBooking() + * @category getBooking() + */ +export type GetBookingSuccessResponse = GetBookingResponse200; + +/** + * Typing for all error responses to the request made by getBooking() + * @category getBooking() + */ +export type GetBookingErrorResponse = + | GetBookingResponse401 + | GetBookingResponse403 + | GetBookingResponse404 + | GetBookingResponse500 + | GetBookingResponse503; + +/** + * Typing for a response with status 200 to the request made by getBooking() + * @category getBooking() + */ +export interface GetBookingResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: { + /** + * A booking in the booking system. + */ + Booking: Types.Booking<'response'>; + /** + * Shows if the booking is in a locked status. + */ + Locked: boolean; + [k: string]: unknown; + }; +} + +/** + * Typing for a response with status 401 to the request made by getBooking() + * @category getBooking() + */ +export interface GetBookingResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by getBooking() + * @category getBooking() + */ +export interface GetBookingResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by getBooking() + * @category getBooking() + */ +export interface GetBookingResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by getBooking() + * @category getBooking() + */ +export interface GetBookingResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by getBooking() + * @category getBooking() + */ +export interface GetBookingResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by destroyBooking() + * @category destroyBooking() + */ +export type DestroyBookingParameters = { + ID: string; +}; + +/** + * Typing for all possible responses to the request made by destroyBooking() + * @category destroyBooking() + */ +export type DestroyBookingResponse = + | DestroyBookingSuccessResponse + | DestroyBookingErrorResponse; + +/** + * Typing for all successful responses to the request made by destroyBooking() + * @category destroyBooking() + */ +export type DestroyBookingSuccessResponse = DestroyBookingResponse200; + +/** + * Typing for all error responses to the request made by destroyBooking() + * @category destroyBooking() + */ +export type DestroyBookingErrorResponse = + | DestroyBookingResponse401 + | DestroyBookingResponse403 + | DestroyBookingResponse404 + | DestroyBookingResponse423 + | DestroyBookingResponse500 + | DestroyBookingResponse503; + +/** + * Typing for a response with status 200 to the request made by destroyBooking() + * @category destroyBooking() + */ +export interface DestroyBookingResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by destroyBooking() + * @category destroyBooking() + */ +export interface DestroyBookingResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by destroyBooking() + * @category destroyBooking() + */ +export interface DestroyBookingResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by destroyBooking() + * @category destroyBooking() + */ +export interface DestroyBookingResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 423 to the request made by destroyBooking() + * @category destroyBooking() + */ +export interface DestroyBookingResponse423 extends Types.ErrorResponse { + status: 423; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by destroyBooking() + * @category destroyBooking() + */ +export interface DestroyBookingResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by destroyBooking() + * @category destroyBooking() + */ +export interface DestroyBookingResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} diff --git a/services/booking/src/common/src/clients/booking-frontend/types.ts b/services/booking/src/common/src/clients/booking-frontend/types.ts new file mode 100644 index 00000000..8d0b0be8 --- /dev/null +++ b/services/booking/src/common/src/clients/booking-frontend/types.ts @@ -0,0 +1,410 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +import * as _BasicValidation from './basicValidation.cjs'; + +/** + * @internal + */ +export interface FunctionWithErrors { + (...args: unknown[]): unknown; + errors?: unknown; +} + +/** + * @internal + */ +export interface RequestInfo { + method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'TRACE' | 'OPTIONS' | 'PATCH' | 'HEAD'; + body?: string; + headers?: [string, string][]; +} + +/** + * @internal + */ +export type FetchFunction = ( + url: string, + info?: RequestInfo, +) => Promise | ResponseData; + +export interface ResponseData { + status: number; + headers?: { + [key: string]: string | undefined; + }; + body?: unknown; +} + +export interface SuccessResponse extends ResponseData { + success?: true; +} + +export interface ErrorResponse extends ResponseData { + success?: false; +} + +/** + * @internal + */ +export function isSuccessResponse(response: ResponseData): response is SuccessResponse { + return response.status < 400; +} + +/** + * @internal + */ +export function isErrorResponse(response: ResponseData): response is ErrorResponse { + return response.status >= 400; +} + +/** + * This type allows to pick the required properties of another type. + */ +export type Require = Partial & { + [Property in Key]-?: Type[Property]; +}; + +export type SizedTuple< + T, + MIN extends number | undefined = undefined, + MAX extends number | undefined = undefined, +> = MIN extends number + ? MAX extends number + ? _SizedTuple> + : TupleObject> & T[] + : MAX extends number + ? _SizedTuple, true> + : T[]; + +type _SizedTuple = ARR extends [ + infer HEAD extends number, + ...infer TAIL extends number[], +] + ? Tuple | _SizedTuple + : never; + +type Tuple = _Tuple< + T, + NumericRangeTuple +>; + +type _Tuple = N extends [ + infer HEAD, + ...infer TAIL extends number[], +] + ? HEAD extends 0 + ? [] | _Tuple + : [T, ..._Tuple] + : []; + +type TupleObject = N extends [ + infer HEAD extends number, + ...infer TAIL extends number[], +] + ? TAIL extends [] + ? Record + : { [P in HEAD]: T } & TupleObject + : Record; + +export type NumericRange< + START extends number, + END extends number, + ARR extends unknown[] = [], + ACC extends number = never, +> = ARR['length'] extends END + ? ACC | START | END + : NumericRange< + START, + END, + [...ARR, 1], + ARR[START] extends undefined ? ACC : ACC | ARR['length'] + >; + +type NumericRangeTuple< + START extends number, + END extends number, + ARR extends unknown[] = [], + ACC extends number[] = [], +> = ARR['length'] extends END + ? [START, ...ACC, END] + : NumericRangeTuple< + START, + END, + [...ARR, 1], + ARR[START] extends undefined ? ACC : [...ACC, ARR['length']] + >; + +/** + * A booking in the booking system. + */ +export type Booking = T extends 'all' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : never; + +/** + * A device might either be a physical/virtual device or a group of device. + */ +export type Device = T extends 'all' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : never; + +/** + * An experiment describes a set of devices and how they should be connected (potentially among other metadata). + */ +export type Experiment = T extends 'all' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device<'request'>[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device<'response'>[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : never; + +/** + * A time slot represents a slice of time used for bookings. + */ +export type Timeslot = T extends 'all' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : never; diff --git a/services/booking/src/common/src/clients/device/basicValidation.cjs b/services/booking/src/common/src/clients/device/basicValidation.cjs new file mode 100644 index 00000000..4db8803d --- /dev/null +++ b/services/booking/src/common/src/clients/device/basicValidation.cjs @@ -0,0 +1,164836 @@ +/* eslint-disable */ +//@ts-nocheck +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +'use strict'; +exports.validateAuthenticationMessage = validate21; +const schema6 = { + title: 'Authentication Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'authenticate' }, + token: { type: 'string' }, + authenticated: { type: 'boolean' }, + }, + required: ['messageType'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'AuthenticationMessage', + 'x-location': '#/components/schemas/authentication_message', + 'x-schema-type': 'all', +}; +function validate21( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate21.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema6.allOf[0].required, + parentSchema: schema6.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.allOf[0].properties.messageType.type, + parentSchema: schema6.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate21.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema6.allOf[0].type, + parentSchema: schema6.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.messageType === undefined && (missing1 = 'messageType')) { + validate21.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema6.allOf[1].required, + parentSchema: schema6.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('authenticate' !== data1) { + validate21.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'authenticate' }, + message: 'must be equal to constant', + schema: 'authenticate', + parentSchema: schema6.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.token !== undefined) { + let data2 = data.token; + const _errs8 = errors; + if (typeof data2 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/token', + schemaPath: '#/allOf/1/properties/token/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.allOf[1].properties.token.type, + parentSchema: schema6.allOf[1].properties.token, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.authenticated !== undefined) { + let data3 = data.authenticated; + const _errs10 = errors; + if (typeof data3 !== 'boolean') { + validate21.errors = [ + { + instancePath: instancePath + '/authenticated', + schemaPath: '#/allOf/1/properties/authenticated/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema6.allOf[1].properties.authenticated.type, + parentSchema: schema6.allOf[1].properties.authenticated, + data: data3, + }, + ]; + return false; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + } + } + } + } else { + validate21.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema6.allOf[1].type, + parentSchema: schema6.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate21.errors = vErrors; + return errors === 0; +} +exports.validateConnectionStateChangedMessage = validate22; +const schema7 = { + title: 'Connection State Changed Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'connection-state-changed' }, + connectionUrl: { type: 'string', format: 'uri' }, + status: { + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['connectionUrl', 'status'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'ConnectionStateChangedMessage', + 'x-location': '#/components/schemas/connection_state_changed_message', + 'x-schema-type': 'all', +}; +const formats0 = require('ajv-formats/dist/formats').fullFormats.uri; +function validate22( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate22.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema7.allOf[0].required, + parentSchema: schema7.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate22.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema7.allOf[0].properties.messageType.type, + parentSchema: schema7.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate22.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema7.allOf[0].type, + parentSchema: schema7.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.connectionUrl === undefined && (missing1 = 'connectionUrl')) || + (data.status === undefined && (missing1 = 'status')) + ) { + validate22.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema7.allOf[1].required, + parentSchema: schema7.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('connection-state-changed' !== data1) { + validate22.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'connection-state-changed' }, + message: 'must be equal to constant', + schema: 'connection-state-changed', + parentSchema: schema7.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.connectionUrl !== undefined) { + let data2 = data.connectionUrl; + const _errs8 = errors; + if (errors === _errs8) { + if (errors === _errs8) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate22.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema7.allOf[1].properties.connectionUrl, + data: data2, + }, + ]; + return false; + } + } else { + validate22.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema7.allOf[1].properties.connectionUrl.type, + parentSchema: schema7.allOf[1].properties.connectionUrl, + data: data2, + }, + ]; + return false; + } + } + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.status !== undefined) { + let data3 = data.status; + const _errs10 = errors; + if (typeof data3 !== 'string') { + validate22.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/1/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema7.allOf[1].properties.status.type, + parentSchema: schema7.allOf[1].properties.status, + data: data3, + }, + ]; + return false; + } + if ( + !( + data3 === 'new' || + data3 === 'connecting' || + data3 === 'connected' || + data3 === 'disconnected' || + data3 === 'failed' || + data3 === 'closed' + ) + ) { + validate22.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/1/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema7.allOf[1].properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema7.allOf[1].properties.status.enum, + parentSchema: schema7.allOf[1].properties.status, + data: data3, + }, + ]; + return false; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + } + } + } + } else { + validate22.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema7.allOf[1].type, + parentSchema: schema7.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate22.errors = vErrors; + return errors === 0; +} +exports.validateUserReference = validate23; +const schema8 = { + title: 'User Reference', + type: 'object', + properties: { url: { type: 'string', description: 'URL of the user', format: 'uri' } }, + required: ['url'], + 'x-standalone': true, + 'x-name': 'UserReference', + 'x-location': '#/components/schemas/user_reference', + 'x-schema-type': 'all', +}; +function validate23( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.url === undefined && (missing0 = 'url')) { + validate23.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema8.required, + parentSchema: schema8, + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate23.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema8.properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema8.properties.url.type, + parentSchema: schema8.properties.url, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate23.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema8.type, + parentSchema: schema8, + data, + }, + ]; + return false; + } + } + validate23.errors = vErrors; + return errors === 0; +} +exports.validateDeviceOverview = validate24; +const schema9 = { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'DeviceOverview', + 'x-location': '#/components/schemas/device_overview', + 'x-schema-type': 'all', +}; +function validate24( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate24.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema9.required, + parentSchema: schema9, + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate24.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema9.properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate24.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema9.properties.url.type, + parentSchema: schema9.properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs3 = errors; + if (typeof data1 !== 'string') { + validate24.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema9.properties.name.type, + parentSchema: schema9.properties.name, + data: data1, + }, + ]; + return false; + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs5 = errors; + if (typeof data2 !== 'string') { + validate24.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema9.properties.description.type, + parentSchema: schema9.properties.description, + data: data2, + }, + ]; + return false; + } + var valid0 = _errs5 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate24.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema9.properties.type.type, + parentSchema: schema9.properties.type, + data: data3, + }, + ]; + return false; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + validate24.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema9.properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema9.properties.type.enum, + parentSchema: schema9.properties.type, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs9 = errors; + if (typeof data4 !== 'boolean') { + validate24.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema9.properties.isPublic.type, + parentSchema: schema9.properties.isPublic, + data: data4, + }, + ]; + return false; + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs11 = errors; + if (errors === _errs11) { + if (Array.isArray(data5)) { + var valid1 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs13 = errors; + if (errors === _errs13) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + validate24.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: schema9.properties.viewer.items.required, + parentSchema: schema9.properties.viewer.items, + data: data6, + }, + ]; + return false; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs15 = errors; + if (errors === _errs15) { + if (errors === _errs15) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + validate24.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema9.properties.viewer.items.properties + .url, + data: data7, + }, + ]; + return false; + } + } else { + validate24.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema9.properties.viewer.items.properties + .url.type, + parentSchema: + schema9.properties.viewer.items.properties + .url, + data: data7, + }, + ]; + return false; + } + } + } + } + } + } else { + validate24.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema9.properties.viewer.items.type, + parentSchema: schema9.properties.viewer.items, + data: data6, + }, + ]; + return false; + } + } + var valid1 = _errs13 === errors; + if (!valid1) { + break; + } + } + } else { + validate24.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema9.properties.viewer.type, + parentSchema: schema9.properties.viewer, + data: data5, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs17 = errors; + if (errors === _errs17) { + if (Array.isArray(data8)) { + var valid3 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs19 = errors; + if (errors === _errs19) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + validate24.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: schema9.properties.owner.items.required, + parentSchema: schema9.properties.owner.items, + data: data9, + }, + ]; + return false; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs21 = errors; + if (errors === _errs21) { + if (errors === _errs21) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + validate24.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema9.properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } else { + validate24.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema9.properties.owner.items.properties + .url.type, + parentSchema: + schema9.properties.owner.items.properties + .url, + data: data10, + }, + ]; + return false; + } + } + } + } + } + } else { + validate24.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema9.properties.owner.items.type, + parentSchema: schema9.properties.owner.items, + data: data9, + }, + ]; + return false; + } + } + var valid3 = _errs19 === errors; + if (!valid3) { + break; + } + } + } else { + validate24.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema9.properties.owner.type, + parentSchema: schema9.properties.owner, + data: data8, + }, + ]; + return false; + } + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } else { + validate24.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema9.type, + parentSchema: schema9, + data, + }, + ]; + return false; + } + } + validate24.errors = vErrors; + return errors === 0; +} +exports.validateServiceDescription = validate25; +const schema10 = { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { type: 'string', enum: ['consumer', 'producer', 'prosumer'] }, + }, + additionalProperties: true, + 'x-standalone': true, + 'x-name': 'ServiceDescription', + 'x-location': '#/components/schemas/service_description', + 'x-schema-type': 'all', +}; +function validate25( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.serviceType !== undefined) { + let data0 = data.serviceType; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate25.errors = [ + { + instancePath: instancePath + '/serviceType', + schemaPath: '#/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema10.properties.serviceType, + data: data0, + }, + ]; + return false; + } + } else { + validate25.errors = [ + { + instancePath: instancePath + '/serviceType', + schemaPath: '#/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema10.properties.serviceType.type, + parentSchema: schema10.properties.serviceType, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs2 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.serviceId !== undefined) { + let data1 = data.serviceId; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate25.errors = [ + { + instancePath: instancePath + '/serviceId', + schemaPath: '#/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema10.properties.serviceId.type, + parentSchema: schema10.properties.serviceId, + data: data1, + }, + ]; + return false; + } + var valid0 = _errs4 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.serviceDirection !== undefined) { + let data2 = data.serviceDirection; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate25.errors = [ + { + instancePath: instancePath + '/serviceDirection', + schemaPath: '#/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema10.properties.serviceDirection.type, + parentSchema: schema10.properties.serviceDirection, + data: data2, + }, + ]; + return false; + } + if (!(data2 === 'consumer' || data2 === 'producer' || data2 === 'prosumer')) { + validate25.errors = [ + { + instancePath: instancePath + '/serviceDirection', + schemaPath: '#/properties/serviceDirection/enum', + keyword: 'enum', + params: { allowedValues: schema10.properties.serviceDirection.enum }, + message: 'must be equal to one of the allowed values', + schema: schema10.properties.serviceDirection.enum, + parentSchema: schema10.properties.serviceDirection, + data: data2, + }, + ]; + return false; + } + var valid0 = _errs6 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate25.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema10.type, + parentSchema: schema10, + data, + }, + ]; + return false; + } + } + validate25.errors = vErrors; + return errors === 0; +} +exports.validateInstantiableCloudDevice = validate26; +const schema11 = { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'InstantiableCloudDevice', + 'x-location': '#/components/schemas/device_cloud_instantiable', + 'x-schema-type': 'all', +}; +function validate26( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate26.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema11.allOf[0].required, + parentSchema: schema11.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate26.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema11.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.allOf[0].properties.url.type, + parentSchema: schema11.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate26.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.allOf[0].properties.name.type, + parentSchema: schema11.allOf[0].properties.name, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate26.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.allOf[0].properties.description.type, + parentSchema: schema11.allOf[0].properties.description, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs8 = errors; + if (typeof data3 !== 'string') { + validate26.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.allOf[0].properties.type.type, + parentSchema: schema11.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + validate26.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema11.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema11.allOf[0].properties.type.enum, + parentSchema: schema11.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs10 = errors; + if (typeof data4 !== 'boolean') { + validate26.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema11.allOf[0].properties.isPublic.type, + parentSchema: schema11.allOf[0].properties.isPublic, + data: data4, + }, + ]; + return false; + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data5)) { + var valid2 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + validate26.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema11.allOf[0].properties.viewer.items.required, + parentSchema: + schema11.allOf[0].properties.viewer.items, + data: data6, + }, + ]; + return false; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + validate26.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema11.allOf[0].properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema11.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema11.allOf[0].properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } + } + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.allOf[0].properties.viewer.items.type, + parentSchema: schema11.allOf[0].properties.viewer.items, + data: data6, + }, + ]; + return false; + } + } + var valid2 = _errs14 === errors; + if (!valid2) { + break; + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema11.allOf[0].properties.viewer.type, + parentSchema: schema11.allOf[0].properties.viewer, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs12 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data8)) { + var valid4 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + validate26.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema11.allOf[0].properties.owner.items.required, + parentSchema: + schema11.allOf[0].properties.owner.items, + data: data9, + }, + ]; + return false; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + validate26.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema11.allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema11.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema11.allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } + } + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.allOf[0].properties.owner.items.type, + parentSchema: + schema11.allOf[0].properties.owner.items, + data: data9, + }, + ]; + return false; + } + } + var valid4 = _errs20 === errors; + if (!valid4) { + break; + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema11.allOf[0].properties.owner.type, + parentSchema: schema11.allOf[0].properties.owner, + data: data8, + }, + ]; + return false; + } + } + var valid1 = _errs18 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } + } else { + validate26.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.allOf[0].type, + parentSchema: schema11.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data11 = data.type; + const _errs26 = errors; + if ('cloud instantiable' !== data11) { + validate26.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema11.allOf[1].properties.type, + data: data11, + }, + ]; + return false; + } + var valid6 = _errs26 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.instantiateUrl !== undefined) { + let data12 = data.instantiateUrl; + const _errs27 = errors; + if (errors === _errs27) { + if (errors === _errs27) { + if (typeof data12 === 'string') { + if (!formats0(data12)) { + validate26.errors = [ + { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema11.allOf[1].properties.instantiateUrl, + data: data12, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.allOf[1].properties.instantiateUrl.type, + parentSchema: schema11.allOf[1].properties.instantiateUrl, + data: data12, + }, + ]; + return false; + } + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data13 = data.services; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data13)) { + var valid7 = true; + const len2 = data13.length; + for (let i2 = 0; i2 < len2; i2++) { + let data14 = data13[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if (data14 && typeof data14 == 'object' && !Array.isArray(data14)) { + if (data14.serviceType !== undefined) { + let data15 = data14.serviceType; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data15 === 'string') { + if (!formats0(data15)) { + validate26.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema11.allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema11.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema11.allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }, + ]; + return false; + } + } + } + var valid8 = _errs34 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data14.serviceId !== undefined) { + let data16 = data14.serviceId; + const _errs36 = errors; + if (typeof data16 !== 'string') { + validate26.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema11.allOf[1].properties.services.items.properties + .serviceId.type, + parentSchema: + schema11.allOf[1].properties.services.items.properties + .serviceId, + data: data16, + }, + ]; + return false; + } + var valid8 = _errs36 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data14.serviceDirection !== undefined) { + let data17 = data14.serviceDirection; + const _errs38 = errors; + if (typeof data17 !== 'string') { + validate26.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema11.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema11.allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }, + ]; + return false; + } + if ( + !( + data17 === 'consumer' || + data17 === 'producer' || + data17 === 'prosumer' + ) + ) { + validate26.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema11.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema11.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema11.allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }, + ]; + return false; + } + var valid8 = _errs38 === errors; + } else { + var valid8 = true; + } + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.allOf[1].properties.services.items.type, + parentSchema: schema11.allOf[1].properties.services.items, + data: data14, + }, + ]; + return false; + } + } + var valid7 = _errs31 === errors; + if (!valid7) { + break; + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema11.allOf[1].properties.services.type, + parentSchema: schema11.allOf[1].properties.services, + data: data13, + }, + ]; + return false; + } + } + var valid6 = _errs29 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate26.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.allOf[1].type, + parentSchema: schema11.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs24 === errors; + } + validate26.errors = vErrors; + return errors === 0; +} +exports.validateTimeSlot = validate27; +const schema12 = { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'TimeSlot', + 'x-location': '#/components/schemas/time_slot', + 'x-schema-type': 'all', +}; +const formats22 = require('ajv-formats/dist/formats').fullFormats['date-time']; +function validate27( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.start !== undefined) { + let data0 = data.start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats22.validate(data0)) { + validate27.errors = [ + { + instancePath: instancePath + '/start', + schemaPath: '#/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema12.properties.start, + data: data0, + }, + ]; + return false; + } + } else { + validate27.errors = [ + { + instancePath: instancePath + '/start', + schemaPath: '#/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema12.properties.start.type, + parentSchema: schema12.properties.start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.end !== undefined) { + let data1 = data.end; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate27.errors = [ + { + instancePath: instancePath + '/end', + schemaPath: '#/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema12.properties.end, + data: data1, + }, + ]; + return false; + } + } else { + validate27.errors = [ + { + instancePath: instancePath + '/end', + schemaPath: '#/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema12.properties.end.type, + parentSchema: schema12.properties.end, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } else { + validate27.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema12.type, + parentSchema: schema12, + data, + }, + ]; + return false; + } + } + validate27.errors = vErrors; + return errors === 0; +} +exports.validateAvailability = validate28; +const schema13 = { + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + 'x-standalone': true, + 'x-name': 'Availability', + 'x-location': '#/components/schemas/availability', + 'x-schema-type': 'all', +}; +function validate28( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.start !== undefined) { + let data1 = data0.start; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate28.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema13.items.properties.start, + data: data1, + }, + ]; + return false; + } + } else { + validate28.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema13.items.properties.start.type, + parentSchema: schema13.items.properties.start, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.end !== undefined) { + let data2 = data0.end; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats22.validate(data2)) { + validate28.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema13.items.properties.end, + data: data2, + }, + ]; + return false; + } + } else { + validate28.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema13.items.properties.end.type, + parentSchema: schema13.items.properties.end, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + validate28.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema13.items.type, + parentSchema: schema13.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate28.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema13.type, + parentSchema: schema13, + data, + }, + ]; + return false; + } + } + validate28.errors = vErrors; + return errors === 0; +} +exports.validateConcreteDevice = validate29; +const schema14 = { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + connected: { + description: + 'If true, the device is connected to the service and can be used.\n', + type: 'boolean', + readOnly: true, + }, + announcedAvailability: { + readOnly: true, + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'ConcreteDevice', + 'x-location': '#/components/schemas/device_concrete', + 'x-schema-type': 'all', +}; +function validate29( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate29.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema14.allOf[0].required, + parentSchema: schema14.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate29.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema14.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate29.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema14.allOf[0].properties.url.type, + parentSchema: schema14.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate29.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema14.allOf[0].properties.name.type, + parentSchema: schema14.allOf[0].properties.name, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate29.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema14.allOf[0].properties.description.type, + parentSchema: schema14.allOf[0].properties.description, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs8 = errors; + if (typeof data3 !== 'string') { + validate29.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema14.allOf[0].properties.type.type, + parentSchema: schema14.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + validate29.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema14.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema14.allOf[0].properties.type.enum, + parentSchema: schema14.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs10 = errors; + if (typeof data4 !== 'boolean') { + validate29.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema14.allOf[0].properties.isPublic.type, + parentSchema: schema14.allOf[0].properties.isPublic, + data: data4, + }, + ]; + return false; + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data5)) { + var valid2 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + validate29.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema14.allOf[0].properties.viewer.items.required, + parentSchema: + schema14.allOf[0].properties.viewer.items, + data: data6, + }, + ]; + return false; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + validate29.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema14.allOf[0].properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } else { + validate29.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema14.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema14.allOf[0].properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } + } + } + } + } else { + validate29.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema14.allOf[0].properties.viewer.items.type, + parentSchema: schema14.allOf[0].properties.viewer.items, + data: data6, + }, + ]; + return false; + } + } + var valid2 = _errs14 === errors; + if (!valid2) { + break; + } + } + } else { + validate29.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema14.allOf[0].properties.viewer.type, + parentSchema: schema14.allOf[0].properties.viewer, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs12 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data8)) { + var valid4 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + validate29.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema14.allOf[0].properties.owner.items.required, + parentSchema: + schema14.allOf[0].properties.owner.items, + data: data9, + }, + ]; + return false; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + validate29.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema14.allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } else { + validate29.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema14.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema14.allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } + } + } + } + } else { + validate29.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema14.allOf[0].properties.owner.items.type, + parentSchema: + schema14.allOf[0].properties.owner.items, + data: data9, + }, + ]; + return false; + } + } + var valid4 = _errs20 === errors; + if (!valid4) { + break; + } + } + } else { + validate29.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema14.allOf[0].properties.owner.type, + parentSchema: schema14.allOf[0].properties.owner, + data: data8, + }, + ]; + return false; + } + } + var valid1 = _errs18 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } + } else { + validate29.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema14.allOf[0].type, + parentSchema: schema14.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data11 = data.type; + const _errs26 = errors; + if ('device' !== data11) { + validate29.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema14.allOf[1].properties.type, + data: data11, + }, + ]; + return false; + } + var valid6 = _errs26 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.connected !== undefined) { + let data12 = data.connected; + const _errs27 = errors; + if (typeof data12 !== 'boolean') { + validate29.errors = [ + { + instancePath: instancePath + '/connected', + schemaPath: '#/allOf/1/properties/connected/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema14.allOf[1].properties.connected.type, + parentSchema: schema14.allOf[1].properties.connected, + data: data12, + }, + ]; + return false; + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.announcedAvailability !== undefined) { + let data13 = data.announcedAvailability; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data13)) { + var valid7 = true; + const len2 = data13.length; + for (let i2 = 0; i2 < len2; i2++) { + let data14 = data13[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if (data14 && typeof data14 == 'object' && !Array.isArray(data14)) { + if (data14.start !== undefined) { + let data15 = data14.start; + const _errs33 = errors; + if (errors === _errs33) { + if (errors === _errs33) { + if (typeof data15 === 'string') { + if (!formats22.validate(data15)) { + validate29.errors = [ + { + instancePath: + instancePath + + '/announcedAvailability/' + + i2 + + '/start', + schemaPath: + '#/allOf/1/properties/announcedAvailability/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema14.allOf[1].properties.announcedAvailability + .items.properties.start, + data: data15, + }, + ]; + return false; + } + } else { + validate29.errors = [ + { + instancePath: + instancePath + + '/announcedAvailability/' + + i2 + + '/start', + schemaPath: + '#/allOf/1/properties/announcedAvailability/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema14.allOf[1].properties.announcedAvailability + .items.properties.start.type, + parentSchema: + schema14.allOf[1].properties.announcedAvailability + .items.properties.start, + data: data15, + }, + ]; + return false; + } + } + } + var valid8 = _errs33 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data14.end !== undefined) { + let data16 = data14.end; + const _errs35 = errors; + if (errors === _errs35) { + if (errors === _errs35) { + if (typeof data16 === 'string') { + if (!formats22.validate(data16)) { + validate29.errors = [ + { + instancePath: + instancePath + + '/announcedAvailability/' + + i2 + + '/end', + schemaPath: + '#/allOf/1/properties/announcedAvailability/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema14.allOf[1].properties + .announcedAvailability.items.properties.end, + data: data16, + }, + ]; + return false; + } + } else { + validate29.errors = [ + { + instancePath: + instancePath + + '/announcedAvailability/' + + i2 + + '/end', + schemaPath: + '#/allOf/1/properties/announcedAvailability/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema14.allOf[1].properties.announcedAvailability + .items.properties.end.type, + parentSchema: + schema14.allOf[1].properties.announcedAvailability + .items.properties.end, + data: data16, + }, + ]; + return false; + } + } + } + var valid8 = _errs35 === errors; + } else { + var valid8 = true; + } + } + } else { + validate29.errors = [ + { + instancePath: instancePath + '/announcedAvailability/' + i2, + schemaPath: + '#/allOf/1/properties/announcedAvailability/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema14.allOf[1].properties.announcedAvailability.items + .type, + parentSchema: + schema14.allOf[1].properties.announcedAvailability.items, + data: data14, + }, + ]; + return false; + } + } + var valid7 = _errs31 === errors; + if (!valid7) { + break; + } + } + } else { + validate29.errors = [ + { + instancePath: instancePath + '/announcedAvailability', + schemaPath: '#/allOf/1/properties/announcedAvailability/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema14.allOf[1].properties.announcedAvailability.type, + parentSchema: schema14.allOf[1].properties.announcedAvailability, + data: data13, + }, + ]; + return false; + } + } + var valid6 = _errs29 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.experiment !== undefined) { + let data17 = data.experiment; + const _errs37 = errors; + if (errors === _errs37) { + if (errors === _errs37) { + if (typeof data17 === 'string') { + if (!formats0(data17)) { + validate29.errors = [ + { + instancePath: instancePath + '/experiment', + schemaPath: '#/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema14.allOf[1].properties.experiment, + data: data17, + }, + ]; + return false; + } + } else { + validate29.errors = [ + { + instancePath: instancePath + '/experiment', + schemaPath: '#/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema14.allOf[1].properties.experiment.type, + parentSchema: schema14.allOf[1].properties.experiment, + data: data17, + }, + ]; + return false; + } + } + } + var valid6 = _errs37 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data18 = data.services; + const _errs39 = errors; + if (errors === _errs39) { + if (Array.isArray(data18)) { + var valid9 = true; + const len3 = data18.length; + for (let i3 = 0; i3 < len3; i3++) { + let data19 = data18[i3]; + const _errs41 = errors; + if (errors === _errs41) { + if ( + data19 && + typeof data19 == 'object' && + !Array.isArray(data19) + ) { + if (data19.serviceType !== undefined) { + let data20 = data19.serviceType; + const _errs44 = errors; + if (errors === _errs44) { + if (errors === _errs44) { + if (typeof data20 === 'string') { + if (!formats0(data20)) { + validate29.errors = [ + { + instancePath: + instancePath + + '/services/' + + i3 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema14.allOf[1].properties.services.items + .properties.serviceType, + data: data20, + }, + ]; + return false; + } + } else { + validate29.errors = [ + { + instancePath: + instancePath + + '/services/' + + i3 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema14.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema14.allOf[1].properties.services.items + .properties.serviceType, + data: data20, + }, + ]; + return false; + } + } + } + var valid10 = _errs44 === errors; + } else { + var valid10 = true; + } + if (valid10) { + if (data19.serviceId !== undefined) { + let data21 = data19.serviceId; + const _errs46 = errors; + if (typeof data21 !== 'string') { + validate29.errors = [ + { + instancePath: + instancePath + '/services/' + i3 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema14.allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema14.allOf[1].properties.services.items + .properties.serviceId, + data: data21, + }, + ]; + return false; + } + var valid10 = _errs46 === errors; + } else { + var valid10 = true; + } + if (valid10) { + if (data19.serviceDirection !== undefined) { + let data22 = data19.serviceDirection; + const _errs48 = errors; + if (typeof data22 !== 'string') { + validate29.errors = [ + { + instancePath: + instancePath + + '/services/' + + i3 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema14.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema14.allOf[1].properties.services.items + .properties.serviceDirection, + data: data22, + }, + ]; + return false; + } + if ( + !( + data22 === 'consumer' || + data22 === 'producer' || + data22 === 'prosumer' + ) + ) { + validate29.errors = [ + { + instancePath: + instancePath + + '/services/' + + i3 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema14.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema14.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema14.allOf[1].properties.services.items + .properties.serviceDirection, + data: data22, + }, + ]; + return false; + } + var valid10 = _errs48 === errors; + } else { + var valid10 = true; + } + } + } + } else { + validate29.errors = [ + { + instancePath: instancePath + '/services/' + i3, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema14.allOf[1].properties.services.items.type, + parentSchema: schema14.allOf[1].properties.services.items, + data: data19, + }, + ]; + return false; + } + } + var valid9 = _errs41 === errors; + if (!valid9) { + break; + } + } + } else { + validate29.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema14.allOf[1].properties.services.type, + parentSchema: schema14.allOf[1].properties.services, + data: data18, + }, + ]; + return false; + } + } + var valid6 = _errs39 === errors; + } else { + var valid6 = true; + } + } + } + } + } + } else { + validate29.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema14.allOf[1].type, + parentSchema: schema14.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs24 === errors; + } + validate29.errors = vErrors; + return errors === 0; +} +exports.validateInstantiableBrowserDevice = validate30; +const schema15 = { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'InstantiableBrowserDevice', + 'x-location': '#/components/schemas/device_edge_instantiable', + 'x-schema-type': 'all', +}; +function validate30( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate30.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema15.allOf[0].required, + parentSchema: schema15.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate30.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema15.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.allOf[0].properties.url.type, + parentSchema: schema15.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate30.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.allOf[0].properties.name.type, + parentSchema: schema15.allOf[0].properties.name, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate30.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.allOf[0].properties.description.type, + parentSchema: schema15.allOf[0].properties.description, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs8 = errors; + if (typeof data3 !== 'string') { + validate30.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.allOf[0].properties.type.type, + parentSchema: schema15.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + validate30.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema15.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema15.allOf[0].properties.type.enum, + parentSchema: schema15.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs10 = errors; + if (typeof data4 !== 'boolean') { + validate30.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema15.allOf[0].properties.isPublic.type, + parentSchema: schema15.allOf[0].properties.isPublic, + data: data4, + }, + ]; + return false; + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data5)) { + var valid2 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + validate30.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema15.allOf[0].properties.viewer.items.required, + parentSchema: + schema15.allOf[0].properties.viewer.items, + data: data6, + }, + ]; + return false; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + validate30.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema15.allOf[0].properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } else { + validate30.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema15.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema15.allOf[0].properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } + } + } + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema15.allOf[0].properties.viewer.items.type, + parentSchema: schema15.allOf[0].properties.viewer.items, + data: data6, + }, + ]; + return false; + } + } + var valid2 = _errs14 === errors; + if (!valid2) { + break; + } + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema15.allOf[0].properties.viewer.type, + parentSchema: schema15.allOf[0].properties.viewer, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs12 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data8)) { + var valid4 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + validate30.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema15.allOf[0].properties.owner.items.required, + parentSchema: + schema15.allOf[0].properties.owner.items, + data: data9, + }, + ]; + return false; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + validate30.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema15.allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } else { + validate30.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema15.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema15.allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } + } + } + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema15.allOf[0].properties.owner.items.type, + parentSchema: + schema15.allOf[0].properties.owner.items, + data: data9, + }, + ]; + return false; + } + } + var valid4 = _errs20 === errors; + if (!valid4) { + break; + } + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema15.allOf[0].properties.owner.type, + parentSchema: schema15.allOf[0].properties.owner, + data: data8, + }, + ]; + return false; + } + } + var valid1 = _errs18 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } + } else { + validate30.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema15.allOf[0].type, + parentSchema: schema15.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data11 = data.type; + const _errs26 = errors; + if ('edge instantiable' !== data11) { + validate30.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema15.allOf[1].properties.type, + data: data11, + }, + ]; + return false; + } + var valid6 = _errs26 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.codeUrl !== undefined) { + let data12 = data.codeUrl; + const _errs27 = errors; + if (errors === _errs27) { + if (errors === _errs27) { + if (typeof data12 === 'string') { + if (!formats0(data12)) { + validate30.errors = [ + { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema15.allOf[1].properties.codeUrl, + data: data12, + }, + ]; + return false; + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.allOf[1].properties.codeUrl.type, + parentSchema: schema15.allOf[1].properties.codeUrl, + data: data12, + }, + ]; + return false; + } + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data13 = data.services; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data13)) { + var valid7 = true; + const len2 = data13.length; + for (let i2 = 0; i2 < len2; i2++) { + let data14 = data13[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if (data14 && typeof data14 == 'object' && !Array.isArray(data14)) { + if (data14.serviceType !== undefined) { + let data15 = data14.serviceType; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data15 === 'string') { + if (!formats0(data15)) { + validate30.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema15.allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }, + ]; + return false; + } + } else { + validate30.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema15.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema15.allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }, + ]; + return false; + } + } + } + var valid8 = _errs34 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data14.serviceId !== undefined) { + let data16 = data14.serviceId; + const _errs36 = errors; + if (typeof data16 !== 'string') { + validate30.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema15.allOf[1].properties.services.items.properties + .serviceId.type, + parentSchema: + schema15.allOf[1].properties.services.items.properties + .serviceId, + data: data16, + }, + ]; + return false; + } + var valid8 = _errs36 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data14.serviceDirection !== undefined) { + let data17 = data14.serviceDirection; + const _errs38 = errors; + if (typeof data17 !== 'string') { + validate30.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema15.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema15.allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }, + ]; + return false; + } + if ( + !( + data17 === 'consumer' || + data17 === 'producer' || + data17 === 'prosumer' + ) + ) { + validate30.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema15.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema15.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema15.allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }, + ]; + return false; + } + var valid8 = _errs38 === errors; + } else { + var valid8 = true; + } + } + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema15.allOf[1].properties.services.items.type, + parentSchema: schema15.allOf[1].properties.services.items, + data: data14, + }, + ]; + return false; + } + } + var valid7 = _errs31 === errors; + if (!valid7) { + break; + } + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema15.allOf[1].properties.services.type, + parentSchema: schema15.allOf[1].properties.services, + data: data13, + }, + ]; + return false; + } + } + var valid6 = _errs29 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate30.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema15.allOf[1].type, + parentSchema: schema15.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs24 === errors; + } + validate30.errors = vErrors; + return errors === 0; +} +exports.validateDeviceReference = validate31; +const schema16 = { + title: 'Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + }, + required: ['url'], + 'x-standalone': true, + 'x-name': 'DeviceReference', + 'x-location': '#/components/schemas/device_reference', + 'x-schema-type': 'all', +}; +function validate31( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.url === undefined && (missing0 = 'url')) { + validate31.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema16.required, + parentSchema: schema16, + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate31.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema16.properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.url.type, + parentSchema: schema16.properties.url, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate31.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema16.type, + parentSchema: schema16, + data, + }, + ]; + return false; + } + } + validate31.errors = vErrors; + return errors === 0; +} +exports.validateDeviceGroup = validate32; +const schema17 = { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'DeviceGroup', + 'x-location': '#/components/schemas/device_group', + 'x-schema-type': 'all', +}; +function validate32( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate32.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema17.allOf[0].required, + parentSchema: schema17.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate32.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema17.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.allOf[0].properties.url.type, + parentSchema: schema17.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate32.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.allOf[0].properties.name.type, + parentSchema: schema17.allOf[0].properties.name, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate32.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.allOf[0].properties.description.type, + parentSchema: schema17.allOf[0].properties.description, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs8 = errors; + if (typeof data3 !== 'string') { + validate32.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.allOf[0].properties.type.type, + parentSchema: schema17.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + validate32.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema17.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema17.allOf[0].properties.type.enum, + parentSchema: schema17.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs10 = errors; + if (typeof data4 !== 'boolean') { + validate32.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema17.allOf[0].properties.isPublic.type, + parentSchema: schema17.allOf[0].properties.isPublic, + data: data4, + }, + ]; + return false; + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data5)) { + var valid2 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + validate32.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema17.allOf[0].properties.viewer.items.required, + parentSchema: + schema17.allOf[0].properties.viewer.items, + data: data6, + }, + ]; + return false; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + validate32.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema17.allOf[0].properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } else { + validate32.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema17.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema17.allOf[0].properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } + } + } + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema17.allOf[0].properties.viewer.items.type, + parentSchema: schema17.allOf[0].properties.viewer.items, + data: data6, + }, + ]; + return false; + } + } + var valid2 = _errs14 === errors; + if (!valid2) { + break; + } + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema17.allOf[0].properties.viewer.type, + parentSchema: schema17.allOf[0].properties.viewer, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs12 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data8)) { + var valid4 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + validate32.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema17.allOf[0].properties.owner.items.required, + parentSchema: + schema17.allOf[0].properties.owner.items, + data: data9, + }, + ]; + return false; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + validate32.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema17.allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } else { + validate32.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema17.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema17.allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } + } + } + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema17.allOf[0].properties.owner.items.type, + parentSchema: + schema17.allOf[0].properties.owner.items, + data: data9, + }, + ]; + return false; + } + } + var valid4 = _errs20 === errors; + if (!valid4) { + break; + } + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema17.allOf[0].properties.owner.type, + parentSchema: schema17.allOf[0].properties.owner, + data: data8, + }, + ]; + return false; + } + } + var valid1 = _errs18 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } + } else { + validate32.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema17.allOf[0].type, + parentSchema: schema17.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if (data.devices === undefined && (missing3 = 'devices')) { + validate32.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema17.allOf[1].required, + parentSchema: schema17.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.type !== undefined) { + let data11 = data.type; + const _errs26 = errors; + if ('group' !== data11) { + validate32.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema17.allOf[1].properties.type, + data: data11, + }, + ]; + return false; + } + var valid6 = _errs26 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.devices !== undefined) { + let data12 = data.devices; + const _errs27 = errors; + if (errors === _errs27) { + if (Array.isArray(data12)) { + var valid7 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs29 = errors; + if (errors === _errs29) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + let missing4; + if (data13.url === undefined && (missing4 = 'url')) { + validate32.errors = [ + { + instancePath: instancePath + '/devices/' + i2, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: "must have required property '" + missing4 + "'", + schema: schema17.allOf[1].properties.devices.items.required, + parentSchema: schema17.allOf[1].properties.devices.items, + data: data13, + }, + ]; + return false; + } else { + if (data13.url !== undefined) { + let data14 = data13.url; + const _errs31 = errors; + if (errors === _errs31) { + if (errors === _errs31) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + validate32.errors = [ + { + instancePath: + instancePath + '/devices/' + i2 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema17.allOf[1].properties.devices.items + .properties.url, + data: data14, + }, + ]; + return false; + } + } else { + validate32.errors = [ + { + instancePath: + instancePath + '/devices/' + i2 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema17.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema17.allOf[1].properties.devices.items + .properties.url, + data: data14, + }, + ]; + return false; + } + } + } + } + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/devices/' + i2, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema17.allOf[1].properties.devices.items.type, + parentSchema: schema17.allOf[1].properties.devices.items, + data: data13, + }, + ]; + return false; + } + } + var valid7 = _errs29 === errors; + if (!valid7) { + break; + } + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema17.allOf[1].properties.devices.type, + parentSchema: schema17.allOf[1].properties.devices, + data: data12, + }, + ]; + return false; + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate32.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema17.allOf[1].type, + parentSchema: schema17.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs24 === errors; + } + validate32.errors = vErrors; + return errors === 0; +} +exports.validateDevice = validate33; +const schema18 = { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + connected: { + description: + 'If true, the device is connected to the service and can be used.\n', + type: 'boolean', + readOnly: true, + }, + announcedAvailability: { + readOnly: true, + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'Device', + 'x-location': '#/components/schemas/device', + 'x-schema-type': 'all', +}; +function validate33( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema18.anyOf[0].allOf[0].required, + parentSchema: schema18.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs4 = errors; + if (errors === _errs4) { + if (errors === _errs4) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + const err1 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema18.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } else { + const err2 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[0].allOf[0].properties.url.type, + parentSchema: schema18.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err3 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema18.anyOf[0].allOf[0].properties.name, + data: data1, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err4 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema18.anyOf[0].allOf[0].properties.description, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs10 = errors; + if (typeof data3 !== 'string') { + const err5 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema18.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + const err6 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema18.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema18.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema18.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs12 = errors; + if (typeof data4 !== 'boolean') { + const err7 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema18.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema18.anyOf[0].allOf[0].properties.isPublic, + data: data4, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs14 = errors; + if (errors === _errs14) { + if (Array.isArray(data5)) { + var valid3 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + const err8 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema18.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema18.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + const err9 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema18.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } else { + const err10 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema18.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + } + } + } + } else { + const err11 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema18.anyOf[0].allOf[0].properties.viewer.items.type, + parentSchema: + schema18.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } + var valid3 = _errs16 === errors; + if (!valid3) { + break; + } + } + } else { + const err12 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema18.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema18.anyOf[0].allOf[0].properties.viewer, + data: data5, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } + var valid2 = _errs14 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs20 = errors; + if (errors === _errs20) { + if (Array.isArray(data8)) { + var valid5 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs22 = errors; + if (errors === _errs22) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + const err13 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema18.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema18.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs24 = errors; + if (errors === _errs24) { + if (errors === _errs24) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + const err14 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema18.anyOf[0].allOf[0].properties + .owner.items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } else { + const err15 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema18.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + } + } + } + } else { + const err16 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema18.anyOf[0].allOf[0].properties.owner.items + .type, + parentSchema: + schema18.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid5 = _errs22 === errors; + if (!valid5) { + break; + } + } + } else { + const err17 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema18.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema18.anyOf[0].allOf[0].properties.owner, + data: data8, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + } + var valid2 = _errs20 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } + } else { + const err18 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema18.anyOf[0].allOf[0].type, + parentSchema: schema18.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs26 = errors; + if (errors === _errs26) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data11 = data.type; + const _errs28 = errors; + if ('cloud instantiable' !== data11) { + const err19 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema18.anyOf[0].allOf[1].properties.type, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + var valid7 = _errs28 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data12 = data.instantiateUrl; + const _errs29 = errors; + if (errors === _errs29) { + if (errors === _errs29) { + if (typeof data12 === 'string') { + if (!formats0(data12)) { + const err20 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema18.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema18.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data13 = data.services; + const _errs31 = errors; + if (errors === _errs31) { + if (Array.isArray(data13)) { + var valid8 = true; + const len2 = data13.length; + for (let i2 = 0; i2 < len2; i2++) { + let data14 = data13[i2]; + const _errs33 = errors; + if (errors === _errs33) { + if (data14 && typeof data14 == 'object' && !Array.isArray(data14)) { + if (data14.serviceType !== undefined) { + let data15 = data14.serviceType; + const _errs36 = errors; + if (errors === _errs36) { + if (errors === _errs36) { + if (typeof data15 === 'string') { + if (!formats0(data15)) { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema18.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } else { + const err23 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema18.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + } + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceId !== undefined) { + let data16 = data14.serviceId; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err24 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema18.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceDirection !== undefined) { + let data17 = data14.serviceDirection; + const _errs40 = errors; + if (typeof data17 !== 'string') { + const err25 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema18.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + if ( + !( + data17 === 'consumer' || + data17 === 'producer' || + data17 === 'prosumer' + ) + ) { + const err26 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema18.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema18.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema18.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + var valid9 = _errs40 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err27 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema18.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema18.anyOf[0].allOf[1].properties.services.items, + data: data14, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid8 = _errs33 === errors; + if (!valid8) { + break; + } + } + } else { + const err28 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema18.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema18.anyOf[0].allOf[1].properties.services, + data: data13, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + } + var valid7 = _errs31 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err29 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema18.anyOf[0].allOf[1].type, + parentSchema: schema18.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + } + var valid1 = _errs26 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs42 = errors; + const _errs43 = errors; + if (errors === _errs43) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if ( + (data.url === undefined && (missing3 = 'url')) || + (data.type === undefined && (missing3 = 'type')) || + (data.name === undefined && (missing3 = 'name')) || + (data.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err30 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema18.anyOf[1].allOf[0].required, + parentSchema: schema18.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } else { + if (data.url !== undefined) { + let data18 = data.url; + const _errs45 = errors; + if (errors === _errs45) { + if (errors === _errs45) { + if (typeof data18 === 'string') { + if (!formats0(data18)) { + const err31 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema18.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } else { + const err32 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[1].allOf[0].properties.url.type, + parentSchema: schema18.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.name !== undefined) { + let data19 = data.name; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err33 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema18.anyOf[1].allOf[0].properties.name, + data: data19, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data20 = data.description; + const _errs49 = errors; + if (typeof data20 !== 'string') { + const err34 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema18.anyOf[1].allOf[0].properties.description, + data: data20, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data21 = data.type; + const _errs51 = errors; + if (typeof data21 !== 'string') { + const err35 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema18.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + if ( + !( + data21 === 'device' || + data21 === 'group' || + data21 === 'edge instantiable' || + data21 === 'cloud instantiable' + ) + ) { + const err36 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema18.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema18.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema18.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data22 = data.isPublic; + const _errs53 = errors; + if (typeof data22 !== 'boolean') { + const err37 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema18.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema18.anyOf[1].allOf[0].properties.isPublic, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + var valid11 = _errs53 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data23 = data.viewer; + const _errs55 = errors; + if (errors === _errs55) { + if (Array.isArray(data23)) { + var valid12 = true; + const len3 = data23.length; + for (let i3 = 0; i3 < len3; i3++) { + let data24 = data23[i3]; + const _errs57 = errors; + if (errors === _errs57) { + if ( + data24 && + typeof data24 == 'object' && + !Array.isArray(data24) + ) { + let missing4; + if (data24.url === undefined && (missing4 = 'url')) { + const err38 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema18.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema18.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } else { + if (data24.url !== undefined) { + let data25 = data24.url; + const _errs59 = errors; + if (errors === _errs59) { + if (errors === _errs59) { + if (typeof data25 === 'string') { + if (!formats0(data25)) { + const err39 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema18.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } else { + const err40 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[1].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema18.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + } + } + } + } else { + const err41 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema18.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema18.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + var valid12 = _errs57 === errors; + if (!valid12) { + break; + } + } + } else { + const err42 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema18.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema18.anyOf[1].allOf[0].properties.viewer, + data: data23, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid11 = _errs55 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data26 = data.owner; + const _errs61 = errors; + if (errors === _errs61) { + if (Array.isArray(data26)) { + var valid14 = true; + const len4 = data26.length; + for (let i4 = 0; i4 < len4; i4++) { + let data27 = data26[i4]; + const _errs63 = errors; + if (errors === _errs63) { + if ( + data27 && + typeof data27 == 'object' && + !Array.isArray(data27) + ) { + let missing5; + if (data27.url === undefined && (missing5 = 'url')) { + const err43 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema18.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema18.anyOf[1].allOf[0].properties.owner.items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } else { + if (data27.url !== undefined) { + let data28 = data27.url; + const _errs65 = errors; + if (errors === _errs65) { + if (errors === _errs65) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err44 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema18.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } else { + const err45 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[1].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema18.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + } + } + } + } + } else { + const err46 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema18.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema18.anyOf[1].allOf[0].properties.owner.items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } + var valid14 = _errs63 === errors; + if (!valid14) { + break; + } + } + } else { + const err47 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema18.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema18.anyOf[1].allOf[0].properties.owner, + data: data26, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var valid11 = _errs61 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } + } else { + const err48 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema18.anyOf[1].allOf[0].type, + parentSchema: schema18.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } + var valid10 = _errs43 === errors; + if (valid10) { + const _errs67 = errors; + if (errors === _errs67) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data29 = data.type; + const _errs69 = errors; + if ('device' !== data29) { + const err49 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema18.anyOf[1].allOf[1].properties.type, + data: data29, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + var valid16 = _errs69 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.connected !== undefined) { + let data30 = data.connected; + const _errs70 = errors; + if (typeof data30 !== 'boolean') { + const err50 = { + instancePath: instancePath + '/connected', + schemaPath: '#/anyOf/1/allOf/1/properties/connected/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema18.anyOf[1].allOf[1].properties.connected.type, + parentSchema: schema18.anyOf[1].allOf[1].properties.connected, + data: data30, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid16 = _errs70 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.announcedAvailability !== undefined) { + let data31 = data.announcedAvailability; + const _errs72 = errors; + if (errors === _errs72) { + if (Array.isArray(data31)) { + var valid17 = true; + const len5 = data31.length; + for (let i5 = 0; i5 < len5; i5++) { + let data32 = data31[i5]; + const _errs74 = errors; + if (errors === _errs74) { + if ( + data32 && + typeof data32 == 'object' && + !Array.isArray(data32) + ) { + if (data32.start !== undefined) { + let data33 = data32.start; + const _errs76 = errors; + if (errors === _errs76) { + if (errors === _errs76) { + if (typeof data33 === 'string') { + if (!formats22.validate(data33)) { + const err51 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema18.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } else { + const err52 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start + .type, + parentSchema: + schema18.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + } + } + var valid18 = _errs76 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data32.end !== undefined) { + let data34 = data32.end; + const _errs78 = errors; + if (errors === _errs78) { + if (errors === _errs78) { + if (typeof data34 === 'string') { + if (!formats22.validate(data34)) { + const err53 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema18.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } else { + const err54 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end + .type, + parentSchema: + schema18.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + } + var valid18 = _errs78 === errors; + } else { + var valid18 = true; + } + } + } else { + const err55 = { + instancePath: instancePath + '/announcedAvailability/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema18.anyOf[1].allOf[1].properties.announcedAvailability + .items.type, + parentSchema: + schema18.anyOf[1].allOf[1].properties.announcedAvailability + .items, + data: data32, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid17 = _errs74 === errors; + if (!valid17) { + break; + } + } + } else { + const err56 = { + instancePath: instancePath + '/announcedAvailability', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema18.anyOf[1].allOf[1].properties.announcedAvailability.type, + parentSchema: + schema18.anyOf[1].allOf[1].properties.announcedAvailability, + data: data31, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + var valid16 = _errs72 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data35 = data.experiment; + const _errs80 = errors; + if (errors === _errs80) { + if (errors === _errs80) { + if (typeof data35 === 'string') { + if (!formats0(data35)) { + const err57 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema18.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } else { + const err58 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema18.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + } + } + var valid16 = _errs80 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data36 = data.services; + const _errs82 = errors; + if (errors === _errs82) { + if (Array.isArray(data36)) { + var valid19 = true; + const len6 = data36.length; + for (let i6 = 0; i6 < len6; i6++) { + let data37 = data36[i6]; + const _errs84 = errors; + if (errors === _errs84) { + if ( + data37 && + typeof data37 == 'object' && + !Array.isArray(data37) + ) { + if (data37.serviceType !== undefined) { + let data38 = data37.serviceType; + const _errs87 = errors; + if (errors === _errs87) { + if (errors === _errs87) { + if (typeof data38 === 'string') { + if (!formats0(data38)) { + const err59 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema18.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } else { + const err60 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema18.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + } + var valid20 = _errs87 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceId !== undefined) { + let data39 = data37.serviceId; + const _errs89 = errors; + if (typeof data39 !== 'string') { + const err61 = { + instancePath: + instancePath + '/services/' + i6 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[1].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema18.anyOf[1].allOf[1].properties.services + .items.properties.serviceId, + data: data39, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs89 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceDirection !== undefined) { + let data40 = data37.serviceDirection; + const _errs91 = errors; + if (typeof data40 !== 'string') { + const err62 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema18.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + if ( + !( + data40 === 'consumer' || + data40 === 'producer' || + data40 === 'prosumer' + ) + ) { + const err63 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema18.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema18.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema18.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + var valid20 = _errs91 === errors; + } else { + var valid20 = true; + } + } + } + } else { + const err64 = { + instancePath: instancePath + '/services/' + i6, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema18.anyOf[1].allOf[1].properties.services.items + .type, + parentSchema: + schema18.anyOf[1].allOf[1].properties.services.items, + data: data37, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + var valid19 = _errs84 === errors; + if (!valid19) { + break; + } + } + } else { + const err65 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema18.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema18.anyOf[1].allOf[1].properties.services, + data: data36, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid16 = _errs82 === errors; + } else { + var valid16 = true; + } + } + } + } + } + } else { + const err66 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema18.anyOf[1].allOf[1].type, + parentSchema: schema18.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid10 = _errs67 === errors; + } + var _valid0 = _errs42 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs93 = errors; + const _errs94 = errors; + if (errors === _errs94) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.url === undefined && (missing6 = 'url')) || + (data.type === undefined && (missing6 = 'type')) || + (data.name === undefined && (missing6 = 'name')) || + (data.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err67 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema18.anyOf[2].allOf[0].required, + parentSchema: schema18.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data.url !== undefined) { + let data41 = data.url; + const _errs96 = errors; + if (errors === _errs96) { + if (errors === _errs96) { + if (typeof data41 === 'string') { + if (!formats0(data41)) { + const err68 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema18.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[2].allOf[0].properties.url.type, + parentSchema: schema18.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + var valid22 = _errs96 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.name !== undefined) { + let data42 = data.name; + const _errs98 = errors; + if (typeof data42 !== 'string') { + const err70 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema18.anyOf[2].allOf[0].properties.name, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var valid22 = _errs98 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.description !== undefined) { + let data43 = data.description; + const _errs100 = errors; + if (typeof data43 !== 'string') { + const err71 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema18.anyOf[2].allOf[0].properties.description, + data: data43, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + var valid22 = _errs100 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs102 = errors; + if (typeof data44 !== 'string') { + const err72 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema18.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + if ( + !( + data44 === 'device' || + data44 === 'group' || + data44 === 'edge instantiable' || + data44 === 'cloud instantiable' + ) + ) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema18.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema18.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema18.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid22 = _errs102 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.isPublic !== undefined) { + let data45 = data.isPublic; + const _errs104 = errors; + if (typeof data45 !== 'boolean') { + const err74 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema18.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema18.anyOf[2].allOf[0].properties.isPublic, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + var valid22 = _errs104 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.viewer !== undefined) { + let data46 = data.viewer; + const _errs106 = errors; + if (errors === _errs106) { + if (Array.isArray(data46)) { + var valid23 = true; + const len7 = data46.length; + for (let i7 = 0; i7 < len7; i7++) { + let data47 = data46[i7]; + const _errs108 = errors; + if (errors === _errs108) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + let missing7; + if (data47.url === undefined && (missing7 = 'url')) { + const err75 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema18.anyOf[2].allOf[0].properties.viewer.items + .required, + parentSchema: + schema18.anyOf[2].allOf[0].properties.viewer + .items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } else { + if (data47.url !== undefined) { + let data48 = data47.url; + const _errs110 = errors; + if (errors === _errs110) { + if (errors === _errs110) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema18.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema18.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + } + } + } else { + const err78 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema18.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema18.anyOf[2].allOf[0].properties.viewer.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + var valid23 = _errs108 === errors; + if (!valid23) { + break; + } + } + } else { + const err79 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema18.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema18.anyOf[2].allOf[0].properties.viewer, + data: data46, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + var valid22 = _errs106 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.owner !== undefined) { + let data49 = data.owner; + const _errs112 = errors; + if (errors === _errs112) { + if (Array.isArray(data49)) { + var valid25 = true; + const len8 = data49.length; + for (let i8 = 0; i8 < len8; i8++) { + let data50 = data49[i8]; + const _errs114 = errors; + if (errors === _errs114) { + if ( + data50 && + typeof data50 == 'object' && + !Array.isArray(data50) + ) { + let missing8; + if (data50.url === undefined && (missing8 = 'url')) { + const err80 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + + missing8 + + "'", + schema: + schema18.anyOf[2].allOf[0].properties.owner + .items.required, + parentSchema: + schema18.anyOf[2].allOf[0].properties.owner + .items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } else { + if (data50.url !== undefined) { + let data51 = data50.url; + const _errs116 = errors; + if (errors === _errs116) { + if (errors === _errs116) { + if (typeof data51 === 'string') { + if (!formats0(data51)) { + const err81 = { + instancePath: + instancePath + + '/owner/' + + i8 + + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema18.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } else { + const err82 = { + instancePath: + instancePath + '/owner/' + i8 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema18.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + } + } + } + } else { + const err83 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema18.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema18.anyOf[2].allOf[0].properties.owner.items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid25 = _errs114 === errors; + if (!valid25) { + break; + } + } + } else { + const err84 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema18.anyOf[2].allOf[0].properties.owner.type, + parentSchema: schema18.anyOf[2].allOf[0].properties.owner, + data: data49, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + var valid22 = _errs112 === errors; + } else { + var valid22 = true; + } + } + } + } + } + } + } + } + } else { + const err85 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema18.anyOf[2].allOf[0].type, + parentSchema: schema18.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + } + var valid21 = _errs94 === errors; + if (valid21) { + const _errs118 = errors; + if (errors === _errs118) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data52 = data.type; + const _errs120 = errors; + if ('edge instantiable' !== data52) { + const err86 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema18.anyOf[2].allOf[1].properties.type, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid27 = _errs120 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.codeUrl !== undefined) { + let data53 = data.codeUrl; + const _errs121 = errors; + if (errors === _errs121) { + if (errors === _errs121) { + if (typeof data53 === 'string') { + if (!formats0(data53)) { + const err87 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema18.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + } else { + const err88 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema18.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + } + } + var valid27 = _errs121 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.services !== undefined) { + let data54 = data.services; + const _errs123 = errors; + if (errors === _errs123) { + if (Array.isArray(data54)) { + var valid28 = true; + const len9 = data54.length; + for (let i9 = 0; i9 < len9; i9++) { + let data55 = data54[i9]; + const _errs125 = errors; + if (errors === _errs125) { + if ( + data55 && + typeof data55 == 'object' && + !Array.isArray(data55) + ) { + if (data55.serviceType !== undefined) { + let data56 = data55.serviceType; + const _errs128 = errors; + if (errors === _errs128) { + if (errors === _errs128) { + if (typeof data56 === 'string') { + if (!formats0(data56)) { + const err89 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema18.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } else { + const err90 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema18.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + } + var valid29 = _errs128 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceId !== undefined) { + let data57 = data55.serviceId; + const _errs130 = errors; + if (typeof data57 !== 'string') { + const err91 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[2].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema18.anyOf[2].allOf[1].properties.services.items + .properties.serviceId, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + var valid29 = _errs130 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceDirection !== undefined) { + let data58 = data55.serviceDirection; + const _errs132 = errors; + if (typeof data58 !== 'string') { + const err92 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema18.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + if ( + !( + data58 === 'consumer' || + data58 === 'producer' || + data58 === 'prosumer' + ) + ) { + const err93 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema18.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema18.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema18.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + var valid29 = _errs132 === errors; + } else { + var valid29 = true; + } + } + } + } else { + const err94 = { + instancePath: instancePath + '/services/' + i9, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema18.anyOf[2].allOf[1].properties.services.items.type, + parentSchema: + schema18.anyOf[2].allOf[1].properties.services.items, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid28 = _errs125 === errors; + if (!valid28) { + break; + } + } + } else { + const err95 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema18.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema18.anyOf[2].allOf[1].properties.services, + data: data54, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + var valid27 = _errs123 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err96 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema18.anyOf[2].allOf[1].type, + parentSchema: schema18.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + var valid21 = _errs118 === errors; + } + var _valid0 = _errs93 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs134 = errors; + const _errs135 = errors; + if (errors === _errs135) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if ( + (data.url === undefined && (missing9 = 'url')) || + (data.type === undefined && (missing9 = 'type')) || + (data.name === undefined && (missing9 = 'name')) || + (data.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err97 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema18.anyOf[3].allOf[0].required, + parentSchema: schema18.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } else { + if (data.url !== undefined) { + let data59 = data.url; + const _errs137 = errors; + if (errors === _errs137) { + if (errors === _errs137) { + if (typeof data59 === 'string') { + if (!formats0(data59)) { + const err98 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema18.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } else { + const err99 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[3].allOf[0].properties.url.type, + parentSchema: schema18.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + } + var valid31 = _errs137 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.name !== undefined) { + let data60 = data.name; + const _errs139 = errors; + if (typeof data60 !== 'string') { + const err100 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema18.anyOf[3].allOf[0].properties.name, + data: data60, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + var valid31 = _errs139 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.description !== undefined) { + let data61 = data.description; + const _errs141 = errors; + if (typeof data61 !== 'string') { + const err101 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema18.anyOf[3].allOf[0].properties.description, + data: data61, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid31 = _errs141 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.type !== undefined) { + let data62 = data.type; + const _errs143 = errors; + if (typeof data62 !== 'string') { + const err102 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema18.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + if ( + !( + data62 === 'device' || + data62 === 'group' || + data62 === 'edge instantiable' || + data62 === 'cloud instantiable' + ) + ) { + const err103 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema18.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema18.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema18.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + var valid31 = _errs143 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.isPublic !== undefined) { + let data63 = data.isPublic; + const _errs145 = errors; + if (typeof data63 !== 'boolean') { + const err104 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema18.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema18.anyOf[3].allOf[0].properties.isPublic, + data: data63, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + var valid31 = _errs145 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.viewer !== undefined) { + let data64 = data.viewer; + const _errs147 = errors; + if (errors === _errs147) { + if (Array.isArray(data64)) { + var valid32 = true; + const len10 = data64.length; + for (let i10 = 0; i10 < len10; i10++) { + let data65 = data64[i10]; + const _errs149 = errors; + if (errors === _errs149) { + if ( + data65 && + typeof data65 == 'object' && + !Array.isArray(data65) + ) { + let missing10; + if (data65.url === undefined && (missing10 = 'url')) { + const err105 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + + missing10 + + "'", + schema: + schema18.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema18.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } else { + if (data65.url !== undefined) { + let data66 = data65.url; + const _errs151 = errors; + if (errors === _errs151) { + if (errors === _errs151) { + if (typeof data66 === 'string') { + if (!formats0(data66)) { + const err106 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema18.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } else { + const err107 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema18.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + } + } + } + } else { + const err108 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema18.anyOf[3].allOf[0].properties.viewer.items + .type, + parentSchema: + schema18.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid32 = _errs149 === errors; + if (!valid32) { + break; + } + } + } else { + const err109 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema18.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: + schema18.anyOf[3].allOf[0].properties.viewer, + data: data64, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + } + } + var valid31 = _errs147 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.owner !== undefined) { + let data67 = data.owner; + const _errs153 = errors; + if (errors === _errs153) { + if (Array.isArray(data67)) { + var valid34 = true; + const len11 = data67.length; + for (let i11 = 0; i11 < len11; i11++) { + let data68 = data67[i11]; + const _errs155 = errors; + if (errors === _errs155) { + if ( + data68 && + typeof data68 == 'object' && + !Array.isArray(data68) + ) { + let missing11; + if ( + data68.url === undefined && + (missing11 = 'url') + ) { + const err110 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema18.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema18.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err110]; + } else { + vErrors.push(err110); + } + errors++; + } else { + if (data68.url !== undefined) { + let data69 = data68.url; + const _errs157 = errors; + if (errors === _errs157) { + if (errors === _errs157) { + if (typeof data69 === 'string') { + if (!formats0(data69)) { + const err111 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema18.anyOf[3].allOf[0] + .properties.owner.items.properties + .url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err111]; + } else { + vErrors.push(err111); + } + errors++; + } + } else { + const err112 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema18.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err112]; + } else { + vErrors.push(err112); + } + errors++; + } + } + } + } + } + } else { + const err113 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema18.anyOf[3].allOf[0].properties.owner + .items.type, + parentSchema: + schema18.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err113]; + } else { + vErrors.push(err113); + } + errors++; + } + } + var valid34 = _errs155 === errors; + if (!valid34) { + break; + } + } + } else { + const err114 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema18.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema18.anyOf[3].allOf[0].properties.owner, + data: data67, + }; + if (vErrors === null) { + vErrors = [err114]; + } else { + vErrors.push(err114); + } + errors++; + } + } + var valid31 = _errs153 === errors; + } else { + var valid31 = true; + } + } + } + } + } + } + } + } + } else { + const err115 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema18.anyOf[3].allOf[0].type, + parentSchema: schema18.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err115]; + } else { + vErrors.push(err115); + } + errors++; + } + } + var valid30 = _errs135 === errors; + if (valid30) { + const _errs159 = errors; + if (errors === _errs159) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if (data.devices === undefined && (missing12 = 'devices')) { + const err116 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema18.anyOf[3].allOf[1].required, + parentSchema: schema18.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err116]; + } else { + vErrors.push(err116); + } + errors++; + } else { + if (data.type !== undefined) { + let data70 = data.type; + const _errs161 = errors; + if ('group' !== data70) { + const err117 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema18.anyOf[3].allOf[1].properties.type, + data: data70, + }; + if (vErrors === null) { + vErrors = [err117]; + } else { + vErrors.push(err117); + } + errors++; + } + var valid36 = _errs161 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data.devices !== undefined) { + let data71 = data.devices; + const _errs162 = errors; + if (errors === _errs162) { + if (Array.isArray(data71)) { + var valid37 = true; + const len12 = data71.length; + for (let i12 = 0; i12 < len12; i12++) { + let data72 = data71[i12]; + const _errs164 = errors; + if (errors === _errs164) { + if ( + data72 && + typeof data72 == 'object' && + !Array.isArray(data72) + ) { + let missing13; + if (data72.url === undefined && (missing13 = 'url')) { + const err118 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: + "must have required property '" + missing13 + "'", + schema: + schema18.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema18.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err118]; + } else { + vErrors.push(err118); + } + errors++; + } else { + if (data72.url !== undefined) { + let data73 = data72.url; + const _errs166 = errors; + if (errors === _errs166) { + if (errors === _errs166) { + if (typeof data73 === 'string') { + if (!formats0(data73)) { + const err119 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema18.anyOf[3].allOf[1].properties + .devices.items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err119]; + } else { + vErrors.push(err119); + } + errors++; + } + } else { + const err120 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema18.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema18.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err120]; + } else { + vErrors.push(err120); + } + errors++; + } + } + } + } + } + } else { + const err121 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema18.anyOf[3].allOf[1].properties.devices.items + .type, + parentSchema: + schema18.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err121]; + } else { + vErrors.push(err121); + } + errors++; + } + } + var valid37 = _errs164 === errors; + if (!valid37) { + break; + } + } + } else { + const err122 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema18.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema18.anyOf[3].allOf[1].properties.devices, + data: data71, + }; + if (vErrors === null) { + vErrors = [err122]; + } else { + vErrors.push(err122); + } + errors++; + } + } + var valid36 = _errs162 === errors; + } else { + var valid36 = true; + } + } + } + } else { + const err123 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema18.anyOf[3].allOf[1].type, + parentSchema: schema18.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err123]; + } else { + vErrors.push(err123); + } + errors++; + } + } + var valid30 = _errs159 === errors; + } + var _valid0 = _errs134 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err124 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema18.anyOf, + parentSchema: schema18, + data, + }; + if (vErrors === null) { + vErrors = [err124]; + } else { + vErrors.push(err124); + } + errors++; + validate33.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate33.errors = vErrors; + return errors === 0; +} +exports.validateCallback = validate34; +const schema19 = { + title: 'Callback', + type: 'object', + properties: { callbackType: { type: 'string' } }, + required: ['callbackType'], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'Callback', + 'x-location': '#/components/schemas/callback', + 'x-schema-type': 'all', +}; +function validate34( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.callbackType === undefined && (missing0 = 'callbackType')) { + validate34.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema19.required, + parentSchema: schema19, + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data0 = data.callbackType; + if (typeof data0 !== 'string') { + validate34.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema19.properties.callbackType.type, + parentSchema: schema19.properties.callbackType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate34.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema19.type, + parentSchema: schema19, + data, + }, + ]; + return false; + } + } + validate34.errors = vErrors; + return errors === 0; +} +exports.validateEventCallback = validate35; +const schema20 = { + title: 'Event Callback', + allOf: [ + { + title: 'Callback', + type: 'object', + properties: { callbackType: { type: 'string' } }, + required: ['callbackType'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + callbackType: { type: 'string', enum: ['event'] }, + eventType: { type: 'string' }, + }, + required: ['callbackType', 'eventType'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'EventCallback', + 'x-location': '#/components/schemas/event_callback', + 'x-schema-type': 'all', +}; +function validate35( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.callbackType === undefined && (missing0 = 'callbackType')) { + validate35.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema20.allOf[0].required, + parentSchema: schema20.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data0 = data.callbackType; + if (typeof data0 !== 'string') { + validate35.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema20.allOf[0].properties.callbackType.type, + parentSchema: schema20.allOf[0].properties.callbackType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate35.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema20.allOf[0].type, + parentSchema: schema20.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs4 = errors; + if (errors === _errs4) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.callbackType === undefined && (missing1 = 'callbackType')) || + (data.eventType === undefined && (missing1 = 'eventType')) + ) { + validate35.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema20.allOf[1].required, + parentSchema: schema20.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data1 = data.callbackType; + const _errs6 = errors; + if (typeof data1 !== 'string') { + validate35.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/1/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema20.allOf[1].properties.callbackType.type, + parentSchema: schema20.allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'event')) { + validate35.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/1/properties/callbackType/enum', + keyword: 'enum', + params: { + allowedValues: schema20.allOf[1].properties.callbackType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema20.allOf[1].properties.callbackType.enum, + parentSchema: schema20.allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.eventType !== undefined) { + let data2 = data.eventType; + const _errs8 = errors; + if (typeof data2 !== 'string') { + validate35.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema20.allOf[1].properties.eventType.type, + parentSchema: schema20.allOf[1].properties.eventType, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate35.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema20.allOf[1].type, + parentSchema: schema20.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs4 === errors; + } + validate35.errors = vErrors; + return errors === 0; +} +exports.validateDeviceChangedEventCallback = validate36; +const schema21 = { + title: 'Device Changed Event Callback', + allOf: [ + { + title: 'Event Callback', + allOf: [ + { + title: 'Callback', + type: 'object', + properties: { callbackType: { type: 'string' } }, + required: ['callbackType'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + callbackType: { type: 'string', enum: ['event'] }, + eventType: { type: 'string' }, + }, + required: ['callbackType', 'eventType'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + eventType: { type: 'string', enum: ['device-changed'] }, + device: { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: [ + 'device', + 'group', + 'edge instantiable', + 'cloud instantiable', + ], + }, + isPublic: { + type: 'boolean', + description: + 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: [ + 'device', + 'group', + 'edge instantiable', + 'cloud instantiable', + ], + }, + isPublic: { + type: 'boolean', + description: + 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + connected: { + description: + 'If true, the device is connected to the service and can be used.\n', + type: 'boolean', + readOnly: true, + }, + announcedAvailability: { + readOnly: true, + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: [ + 'device', + 'group', + 'edge instantiable', + 'cloud instantiable', + ], + }, + isPublic: { + type: 'boolean', + description: + 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: [ + 'device', + 'group', + 'edge instantiable', + 'cloud instantiable', + ], + }, + isPublic: { + type: 'boolean', + description: + 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + }, + }, + required: ['eventType', 'device'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'DeviceChangedEventCallback', + 'x-location': '#/components/schemas/device_changed', + 'x-schema-type': 'all', +}; +function validate36( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.callbackType === undefined && (missing0 = 'callbackType')) { + validate36.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema21.allOf[0].allOf[0].required, + parentSchema: schema21.allOf[0].allOf[0], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data0 = data.callbackType; + if (typeof data0 !== 'string') { + validate36.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/0/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema21.allOf[0].allOf[0].properties.callbackType.type, + parentSchema: schema21.allOf[0].allOf[0].properties.callbackType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate36.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema21.allOf[0].allOf[0].type, + parentSchema: schema21.allOf[0].allOf[0], + data, + }, + ]; + return false; + } + } + var valid1 = _errs1 === errors; + if (valid1) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.callbackType === undefined && (missing1 = 'callbackType')) || + (data.eventType === undefined && (missing1 = 'eventType')) + ) { + validate36.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema21.allOf[0].allOf[1].required, + parentSchema: schema21.allOf[0].allOf[1], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data1 = data.callbackType; + const _errs7 = errors; + if (typeof data1 !== 'string') { + validate36.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema21.allOf[0].allOf[1].properties.callbackType.type, + parentSchema: schema21.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'event')) { + validate36.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/enum', + keyword: 'enum', + params: { + allowedValues: + schema21.allOf[0].allOf[1].properties.callbackType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema21.allOf[0].allOf[1].properties.callbackType.enum, + parentSchema: schema21.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + var valid3 = _errs7 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data.eventType !== undefined) { + let data2 = data.eventType; + const _errs9 = errors; + if (typeof data2 !== 'string') { + validate36.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/0/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema21.allOf[0].allOf[1].properties.eventType.type, + parentSchema: schema21.allOf[0].allOf[1].properties.eventType, + data: data2, + }, + ]; + return false; + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate36.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema21.allOf[0].allOf[1].type, + parentSchema: schema21.allOf[0].allOf[1], + data, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.eventType === undefined && (missing2 = 'eventType')) || + (data.device === undefined && (missing2 = 'device')) + ) { + validate36.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema21.allOf[1].required, + parentSchema: schema21.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.eventType !== undefined) { + let data3 = data.eventType; + const _errs13 = errors; + if (typeof data3 !== 'string') { + validate36.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema21.allOf[1].properties.eventType.type, + parentSchema: schema21.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + if (!(data3 === 'device-changed')) { + validate36.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/enum', + keyword: 'enum', + params: { allowedValues: schema21.allOf[1].properties.eventType.enum }, + message: 'must be equal to one of the allowed values', + schema: schema21.allOf[1].properties.eventType.enum, + parentSchema: schema21.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.device !== undefined) { + let data4 = data.device; + const _errs15 = errors; + const _errs16 = errors; + let valid5 = false; + const _errs17 = errors; + const _errs18 = errors; + if (errors === _errs18) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing3; + if ( + (data4.url === undefined && (missing3 = 'url')) || + (data4.type === undefined && (missing3 = 'type')) || + (data4.name === undefined && (missing3 = 'name')) || + (data4.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err0 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: + schema21.allOf[1].properties.device.anyOf[0].allOf[0].required, + parentSchema: schema21.allOf[1].properties.device.anyOf[0].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + const err1 = { + instancePath: instancePath + '/device/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.url, + data: data5, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } else { + const err2 = { + instancePath: instancePath + '/device/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.url.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.url, + data: data5, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + } + var valid7 = _errs20 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data4.name !== undefined) { + let data6 = data4.name; + const _errs22 = errors; + if (typeof data6 !== 'string') { + const err3 = { + instancePath: instancePath + '/device/name', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.name.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.name, + data: data6, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + var valid7 = _errs22 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data4.description !== undefined) { + let data7 = data4.description; + const _errs24 = errors; + if (typeof data7 !== 'string') { + const err4 = { + instancePath: instancePath + '/device/description', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.description.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.description, + data: data7, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid7 = _errs24 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data4.type !== undefined) { + let data8 = data4.type; + const _errs26 = errors; + if (typeof data8 !== 'string') { + const err5 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.type.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.type, + data: data8, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + if ( + !( + data8 === 'device' || + data8 === 'group' || + data8 === 'edge instantiable' || + data8 === 'cloud instantiable' + ) + ) { + const err6 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema21.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema21.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.type.enum, + parentSchema: + schema21.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.type, + data: data8, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + var valid7 = _errs26 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data4.isPublic !== undefined) { + let data9 = data4.isPublic; + const _errs28 = errors; + if (typeof data9 !== 'boolean') { + const err7 = { + instancePath: instancePath + '/device/isPublic', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema21.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.isPublic.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.isPublic, + data: data9, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + var valid7 = _errs28 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data4.viewer !== undefined) { + let data10 = data4.viewer; + const _errs30 = errors; + if (errors === _errs30) { + if (Array.isArray(data10)) { + var valid8 = true; + const len0 = data10.length; + for (let i0 = 0; i0 < len0; i0++) { + let data11 = data10[i0]; + const _errs32 = errors; + if (errors === _errs32) { + if ( + data11 && + typeof data11 == 'object' && + !Array.isArray(data11) + ) { + let missing4; + if ( + data11.url === undefined && + (missing4 = 'url') + ) { + const err8 = { + instancePath: + instancePath + '/device/viewer/' + i0, + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + + missing4 + + "'", + schema: + schema21.allOf[1].properties.device + .anyOf[0].allOf[0].properties.viewer + .items.required, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[0].allOf[0].properties.viewer + .items, + data: data11, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } else { + if (data11.url !== undefined) { + let data12 = data11.url; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data12 === 'string') { + if (!formats0(data12)) { + const err9 = { + instancePath: + instancePath + + '/device/viewer/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1].properties + .device.anyOf[0].allOf[0] + .properties.viewer.items + .properties.url, + data: data12, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } else { + const err10 = { + instancePath: + instancePath + + '/device/viewer/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties + .device.anyOf[0].allOf[0] + .properties.viewer.items + .properties.url.type, + parentSchema: + schema21.allOf[1].properties + .device.anyOf[0].allOf[0] + .properties.viewer.items + .properties.url, + data: data12, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + } + } + } + } else { + const err11 = { + instancePath: + instancePath + '/device/viewer/' + i0, + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device.anyOf[0] + .allOf[0].properties.viewer.items.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[0] + .allOf[0].properties.viewer.items, + data: data11, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } + var valid8 = _errs32 === errors; + if (!valid8) { + break; + } + } + } else { + const err12 = { + instancePath: instancePath + '/device/viewer', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema21.allOf[1].properties.device.anyOf[0] + .allOf[0].properties.viewer.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[0] + .allOf[0].properties.viewer, + data: data10, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } + var valid7 = _errs30 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data4.owner !== undefined) { + let data13 = data4.owner; + const _errs36 = errors; + if (errors === _errs36) { + if (Array.isArray(data13)) { + var valid10 = true; + const len1 = data13.length; + for (let i1 = 0; i1 < len1; i1++) { + let data14 = data13[i1]; + const _errs38 = errors; + if (errors === _errs38) { + if ( + data14 && + typeof data14 == 'object' && + !Array.isArray(data14) + ) { + let missing5; + if ( + data14.url === undefined && + (missing5 = 'url') + ) { + const err13 = { + instancePath: + instancePath + '/device/owner/' + i1, + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + + missing5 + + "'", + schema: + schema21.allOf[1].properties.device + .anyOf[0].allOf[0].properties.owner + .items.required, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[0].allOf[0].properties.owner + .items, + data: data14, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } else { + if (data14.url !== undefined) { + let data15 = data14.url; + const _errs40 = errors; + if (errors === _errs40) { + if (errors === _errs40) { + if (typeof data15 === 'string') { + if (!formats0(data15)) { + const err14 = { + instancePath: + instancePath + + '/device/owner/' + + i1 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1].properties + .device.anyOf[0].allOf[0] + .properties.owner.items + .properties.url, + data: data15, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } else { + const err15 = { + instancePath: + instancePath + + '/device/owner/' + + i1 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties + .device.anyOf[0].allOf[0] + .properties.owner.items + .properties.url.type, + parentSchema: + schema21.allOf[1].properties + .device.anyOf[0].allOf[0] + .properties.owner.items + .properties.url, + data: data15, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + } + } + } + } else { + const err16 = { + instancePath: + instancePath + '/device/owner/' + i1, + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device + .anyOf[0].allOf[0].properties.owner + .items.type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[0].allOf[0].properties.owner + .items, + data: data14, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid10 = _errs38 === errors; + if (!valid10) { + break; + } + } + } else { + const err17 = { + instancePath: instancePath + '/device/owner', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema21.allOf[1].properties.device.anyOf[0] + .allOf[0].properties.owner.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[0] + .allOf[0].properties.owner, + data: data13, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + } + var valid7 = _errs36 === errors; + } else { + var valid7 = true; + } + } + } + } + } + } + } + } + } else { + const err18 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema21.allOf[1].properties.device.anyOf[0].allOf[0].type, + parentSchema: schema21.allOf[1].properties.device.anyOf[0].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } + var valid6 = _errs18 === errors; + if (valid6) { + const _errs42 = errors; + if (errors === _errs42) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + if (data4.type !== undefined) { + let data16 = data4.type; + const _errs44 = errors; + if ('cloud instantiable' !== data16) { + const err19 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: + schema21.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.type, + data: data16, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + var valid12 = _errs44 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if (data4.instantiateUrl !== undefined) { + let data17 = data4.instantiateUrl; + const _errs45 = errors; + if (errors === _errs45) { + if (errors === _errs45) { + if (typeof data17 === 'string') { + if (!formats0(data17)) { + const err20 = { + instancePath: instancePath + '/device/instantiateUrl', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.instantiateUrl, + data: data17, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: instancePath + '/device/instantiateUrl', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.instantiateUrl.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.instantiateUrl, + data: data17, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid12 = _errs45 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if (data4.services !== undefined) { + let data18 = data4.services; + const _errs47 = errors; + if (errors === _errs47) { + if (Array.isArray(data18)) { + var valid13 = true; + const len2 = data18.length; + for (let i2 = 0; i2 < len2; i2++) { + let data19 = data18[i2]; + const _errs49 = errors; + if (errors === _errs49) { + if ( + data19 && + typeof data19 == 'object' && + !Array.isArray(data19) + ) { + if (data19.serviceType !== undefined) { + let data20 = data19.serviceType; + const _errs52 = errors; + if (errors === _errs52) { + if (errors === _errs52) { + if (typeof data20 === 'string') { + if (!formats0(data20)) { + const err22 = { + instancePath: + instancePath + + '/device/services/' + + i2 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data20, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } else { + const err23 = { + instancePath: + instancePath + + '/device/services/' + + i2 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data20, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + } + } + var valid14 = _errs52 === errors; + } else { + var valid14 = true; + } + if (valid14) { + if (data19.serviceId !== undefined) { + let data21 = data19.serviceId; + const _errs54 = errors; + if (typeof data21 !== 'string') { + const err24 = { + instancePath: + instancePath + + '/device/services/' + + i2 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[0] + .allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[0] + .allOf[1].properties.services.items + .properties.serviceId, + data: data21, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid14 = _errs54 === errors; + } else { + var valid14 = true; + } + if (valid14) { + if (data19.serviceDirection !== undefined) { + let data22 = data19.serviceDirection; + const _errs56 = errors; + if (typeof data22 !== 'string') { + const err25 = { + instancePath: + instancePath + + '/device/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection, + data: data22, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + if ( + !( + data22 === 'consumer' || + data22 === 'producer' || + data22 === 'prosumer' + ) + ) { + const err26 = { + instancePath: + instancePath + + '/device/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema21.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection + .enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema21.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection, + data: data22, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + var valid14 = _errs56 === errors; + } else { + var valid14 = true; + } + } + } + } else { + const err27 = { + instancePath: + instancePath + '/device/services/' + i2, + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device.anyOf[0] + .allOf[1].properties.services.items.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[0] + .allOf[1].properties.services.items, + data: data19, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid13 = _errs49 === errors; + if (!valid13) { + break; + } + } + } else { + const err28 = { + instancePath: instancePath + '/device/services', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema21.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.services.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.services, + data: data18, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + } + var valid12 = _errs47 === errors; + } else { + var valid12 = true; + } + } + } + } else { + const err29 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema21.allOf[1].properties.device.anyOf[0].allOf[1].type, + parentSchema: schema21.allOf[1].properties.device.anyOf[0].allOf[1], + data: data4, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + } + var valid6 = _errs42 === errors; + } + var _valid0 = _errs17 === errors; + valid5 = valid5 || _valid0; + if (!valid5) { + const _errs58 = errors; + const _errs59 = errors; + if (errors === _errs59) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing6; + if ( + (data4.url === undefined && (missing6 = 'url')) || + (data4.type === undefined && (missing6 = 'type')) || + (data4.name === undefined && (missing6 = 'name')) || + (data4.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err30 = { + instancePath: instancePath + '/device', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: + schema21.allOf[1].properties.device.anyOf[1].allOf[0].required, + parentSchema: + schema21.allOf[1].properties.device.anyOf[1].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } else { + if (data4.url !== undefined) { + let data23 = data4.url; + const _errs61 = errors; + if (errors === _errs61) { + if (errors === _errs61) { + if (typeof data23 === 'string') { + if (!formats0(data23)) { + const err31 = { + instancePath: instancePath + '/device/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } else { + const err32 = { + instancePath: instancePath + '/device/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.url.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + } + var valid16 = _errs61 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data4.name !== undefined) { + let data24 = data4.name; + const _errs63 = errors; + if (typeof data24 !== 'string') { + const err33 = { + instancePath: instancePath + '/device/name', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.name.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.name, + data: data24, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid16 = _errs63 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data4.description !== undefined) { + let data25 = data4.description; + const _errs65 = errors; + if (typeof data25 !== 'string') { + const err34 = { + instancePath: instancePath + '/device/description', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.description.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.description, + data: data25, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + var valid16 = _errs65 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data4.type !== undefined) { + let data26 = data4.type; + const _errs67 = errors; + if (typeof data26 !== 'string') { + const err35 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.type.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.type, + data: data26, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + if ( + !( + data26 === 'device' || + data26 === 'group' || + data26 === 'edge instantiable' || + data26 === 'cloud instantiable' + ) + ) { + const err36 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema21.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema21.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.type.enum, + parentSchema: + schema21.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.type, + data: data26, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + var valid16 = _errs67 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data4.isPublic !== undefined) { + let data27 = data4.isPublic; + const _errs69 = errors; + if (typeof data27 !== 'boolean') { + const err37 = { + instancePath: instancePath + '/device/isPublic', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema21.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.isPublic.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.isPublic, + data: data27, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + var valid16 = _errs69 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data4.viewer !== undefined) { + let data28 = data4.viewer; + const _errs71 = errors; + if (errors === _errs71) { + if (Array.isArray(data28)) { + var valid17 = true; + const len3 = data28.length; + for (let i3 = 0; i3 < len3; i3++) { + let data29 = data28[i3]; + const _errs73 = errors; + if (errors === _errs73) { + if ( + data29 && + typeof data29 == 'object' && + !Array.isArray(data29) + ) { + let missing7; + if ( + data29.url === undefined && + (missing7 = 'url') + ) { + const err38 = { + instancePath: + instancePath + '/device/viewer/' + i3, + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + + missing7 + + "'", + schema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[0].properties.viewer + .items.required, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[0].properties.viewer + .items, + data: data29, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } else { + if (data29.url !== undefined) { + let data30 = data29.url; + const _errs75 = errors; + if (errors === _errs75) { + if (errors === _errs75) { + if (typeof data30 === 'string') { + if (!formats0(data30)) { + const err39 = { + instancePath: + instancePath + + '/device/viewer/' + + i3 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1].properties + .device.anyOf[1].allOf[0] + .properties.viewer.items + .properties.url, + data: data30, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } else { + const err40 = { + instancePath: + instancePath + + '/device/viewer/' + + i3 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties + .device.anyOf[1].allOf[0] + .properties.viewer.items + .properties.url.type, + parentSchema: + schema21.allOf[1].properties + .device.anyOf[1].allOf[0] + .properties.viewer.items + .properties.url, + data: data30, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + } + } + } + } else { + const err41 = { + instancePath: + instancePath + '/device/viewer/' + i3, + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[0].properties.viewer + .items.type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[0].properties.viewer + .items, + data: data29, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + var valid17 = _errs73 === errors; + if (!valid17) { + break; + } + } + } else { + const err42 = { + instancePath: instancePath + '/device/viewer', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema21.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.viewer.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.viewer, + data: data28, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid16 = _errs71 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data4.owner !== undefined) { + let data31 = data4.owner; + const _errs77 = errors; + if (errors === _errs77) { + if (Array.isArray(data31)) { + var valid19 = true; + const len4 = data31.length; + for (let i4 = 0; i4 < len4; i4++) { + let data32 = data31[i4]; + const _errs79 = errors; + if (errors === _errs79) { + if ( + data32 && + typeof data32 == 'object' && + !Array.isArray(data32) + ) { + let missing8; + if ( + data32.url === undefined && + (missing8 = 'url') + ) { + const err43 = { + instancePath: + instancePath + '/device/owner/' + i4, + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + + missing8 + + "'", + schema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[0].properties.owner + .items.required, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[0].properties.owner + .items, + data: data32, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } else { + if (data32.url !== undefined) { + let data33 = data32.url; + const _errs81 = errors; + if (errors === _errs81) { + if (errors === _errs81) { + if (typeof data33 === 'string') { + if (!formats0(data33)) { + const err44 = { + instancePath: + instancePath + + '/device/owner/' + + i4 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1].properties + .device.anyOf[1].allOf[0] + .properties.owner.items + .properties.url, + data: data33, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } else { + const err45 = { + instancePath: + instancePath + + '/device/owner/' + + i4 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties + .device.anyOf[1].allOf[0] + .properties.owner.items + .properties.url.type, + parentSchema: + schema21.allOf[1].properties + .device.anyOf[1].allOf[0] + .properties.owner.items + .properties.url, + data: data33, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + } + } + } + } + } else { + const err46 = { + instancePath: + instancePath + '/device/owner/' + i4, + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[0].properties.owner + .items.type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[0].properties.owner + .items, + data: data32, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } + var valid19 = _errs79 === errors; + if (!valid19) { + break; + } + } + } else { + const err47 = { + instancePath: instancePath + '/device/owner', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema21.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.owner.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.owner, + data: data31, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var valid16 = _errs77 === errors; + } else { + var valid16 = true; + } + } + } + } + } + } + } + } + } else { + const err48 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema21.allOf[1].properties.device.anyOf[1].allOf[0].type, + parentSchema: schema21.allOf[1].properties.device.anyOf[1].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } + var valid15 = _errs59 === errors; + if (valid15) { + const _errs83 = errors; + if (errors === _errs83) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + if (data4.type !== undefined) { + let data34 = data4.type; + const _errs85 = errors; + if ('device' !== data34) { + const err49 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: + schema21.allOf[1].properties.device.anyOf[1].allOf[1] + .properties.type, + data: data34, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + var valid21 = _errs85 === errors; + } else { + var valid21 = true; + } + if (valid21) { + if (data4.connected !== undefined) { + let data35 = data4.connected; + const _errs86 = errors; + if (typeof data35 !== 'boolean') { + const err50 = { + instancePath: instancePath + '/device/connected', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/connected/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema21.allOf[1].properties.device.anyOf[1].allOf[1] + .properties.connected.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[1].allOf[1] + .properties.connected, + data: data35, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid21 = _errs86 === errors; + } else { + var valid21 = true; + } + if (valid21) { + if (data4.announcedAvailability !== undefined) { + let data36 = data4.announcedAvailability; + const _errs88 = errors; + if (errors === _errs88) { + if (Array.isArray(data36)) { + var valid22 = true; + const len5 = data36.length; + for (let i5 = 0; i5 < len5; i5++) { + let data37 = data36[i5]; + const _errs90 = errors; + if (errors === _errs90) { + if ( + data37 && + typeof data37 == 'object' && + !Array.isArray(data37) + ) { + if (data37.start !== undefined) { + let data38 = data37.start; + const _errs92 = errors; + if (errors === _errs92) { + if (errors === _errs92) { + if (typeof data38 === 'string') { + if (!formats22.validate(data38)) { + const err51 = { + instancePath: + instancePath + + '/device/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + + 'date-time' + + '"', + schema: 'date-time', + parentSchema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .announcedAvailability.items + .properties.start, + data: data38, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } else { + const err52 = { + instancePath: + instancePath + + '/device/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .announcedAvailability.items + .properties.start.type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .announcedAvailability.items + .properties.start, + data: data38, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + } + } + var valid23 = _errs92 === errors; + } else { + var valid23 = true; + } + if (valid23) { + if (data37.end !== undefined) { + let data39 = data37.end; + const _errs94 = errors; + if (errors === _errs94) { + if (errors === _errs94) { + if (typeof data39 === 'string') { + if (!formats22.validate(data39)) { + const err53 = { + instancePath: + instancePath + + '/device/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + + 'date-time' + + '"', + schema: 'date-time', + parentSchema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .announcedAvailability.items + .properties.end, + data: data39, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } else { + const err54 = { + instancePath: + instancePath + + '/device/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .announcedAvailability.items + .properties.end.type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .announcedAvailability.items + .properties.end, + data: data39, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + } + var valid23 = _errs94 === errors; + } else { + var valid23 = true; + } + } + } else { + const err55 = { + instancePath: + instancePath + + '/device/announcedAvailability/' + + i5, + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/announcedAvailability/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.announcedAvailability + .items.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.announcedAvailability + .items, + data: data37, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid22 = _errs90 === errors; + if (!valid22) { + break; + } + } + } else { + const err56 = { + instancePath: + instancePath + '/device/announcedAvailability', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/announcedAvailability/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema21.allOf[1].properties.device.anyOf[1].allOf[1] + .properties.announcedAvailability.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[1].allOf[1] + .properties.announcedAvailability, + data: data36, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + var valid21 = _errs88 === errors; + } else { + var valid21 = true; + } + if (valid21) { + if (data4.experiment !== undefined) { + let data40 = data4.experiment; + const _errs96 = errors; + if (errors === _errs96) { + if (errors === _errs96) { + if (typeof data40 === 'string') { + if (!formats0(data40)) { + const err57 = { + instancePath: instancePath + '/device/experiment', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.experiment, + data: data40, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } else { + const err58 = { + instancePath: instancePath + '/device/experiment', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.experiment.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.experiment, + data: data40, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + } + } + var valid21 = _errs96 === errors; + } else { + var valid21 = true; + } + if (valid21) { + if (data4.services !== undefined) { + let data41 = data4.services; + const _errs98 = errors; + if (errors === _errs98) { + if (Array.isArray(data41)) { + var valid24 = true; + const len6 = data41.length; + for (let i6 = 0; i6 < len6; i6++) { + let data42 = data41[i6]; + const _errs100 = errors; + if (errors === _errs100) { + if ( + data42 && + typeof data42 == 'object' && + !Array.isArray(data42) + ) { + if (data42.serviceType !== undefined) { + let data43 = data42.serviceType; + const _errs103 = errors; + if (errors === _errs103) { + if (errors === _errs103) { + if (typeof data43 === 'string') { + if (!formats0(data43)) { + const err59 = { + instancePath: + instancePath + + '/device/services/' + + i6 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1].properties + .device.anyOf[1].allOf[1] + .properties.services.items + .properties.serviceType, + data: data43, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } else { + const err60 = { + instancePath: + instancePath + + '/device/services/' + + i6 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties + .serviceType.type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties + .serviceType, + data: data43, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + } + var valid25 = _errs103 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data42.serviceId !== undefined) { + let data44 = data42.serviceId; + const _errs105 = errors; + if (typeof data44 !== 'string') { + const err61 = { + instancePath: + instancePath + + '/device/services/' + + i6 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties.serviceId + .type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties + .serviceId, + data: data44, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid25 = _errs105 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data42.serviceDirection !== undefined) { + let data45 = data42.serviceDirection; + const _errs107 = errors; + if (typeof data45 !== 'string') { + const err62 = { + instancePath: + instancePath + + '/device/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties + .serviceDirection.type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties + .serviceDirection, + data: data45, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + if ( + !( + data45 === 'consumer' || + data45 === 'producer' || + data45 === 'prosumer' + ) + ) { + const err63 = { + instancePath: + instancePath + + '/device/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema21.allOf[1].properties + .device.anyOf[1].allOf[1] + .properties.services.items + .properties.serviceDirection + .enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties + .serviceDirection.enum, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties + .serviceDirection, + data: data45, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + var valid25 = _errs107 === errors; + } else { + var valid25 = true; + } + } + } + } else { + const err64 = { + instancePath: + instancePath + '/device/services/' + i6, + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.services.items.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.services.items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + var valid24 = _errs100 === errors; + if (!valid24) { + break; + } + } + } else { + const err65 = { + instancePath: instancePath + '/device/services', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema21.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.services.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.services, + data: data41, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid21 = _errs98 === errors; + } else { + var valid21 = true; + } + } + } + } + } + } else { + const err66 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device.anyOf[1].allOf[1].type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[1].allOf[1], + data: data4, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid15 = _errs83 === errors; + } + var _valid0 = _errs58 === errors; + valid5 = valid5 || _valid0; + if (!valid5) { + const _errs109 = errors; + const _errs110 = errors; + if (errors === _errs110) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing9; + if ( + (data4.url === undefined && (missing9 = 'url')) || + (data4.type === undefined && (missing9 = 'type')) || + (data4.name === undefined && (missing9 = 'name')) || + (data4.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err67 = { + instancePath: instancePath + '/device', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: + schema21.allOf[1].properties.device.anyOf[2].allOf[0] + .required, + parentSchema: + schema21.allOf[1].properties.device.anyOf[2].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data4.url !== undefined) { + let data46 = data4.url; + const _errs112 = errors; + if (errors === _errs112) { + if (errors === _errs112) { + if (typeof data46 === 'string') { + if (!formats0(data46)) { + const err68 = { + instancePath: instancePath + '/device/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.url, + data: data46, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: instancePath + '/device/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.url.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.url, + data: data46, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + var valid27 = _errs112 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data4.name !== undefined) { + let data47 = data4.name; + const _errs114 = errors; + if (typeof data47 !== 'string') { + const err70 = { + instancePath: instancePath + '/device/name', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.name.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.name, + data: data47, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var valid27 = _errs114 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data4.description !== undefined) { + let data48 = data4.description; + const _errs116 = errors; + if (typeof data48 !== 'string') { + const err71 = { + instancePath: instancePath + '/device/description', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.description.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.description, + data: data48, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + var valid27 = _errs116 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data4.type !== undefined) { + let data49 = data4.type; + const _errs118 = errors; + if (typeof data49 !== 'string') { + const err72 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.type.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.type, + data: data49, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + if ( + !( + data49 === 'device' || + data49 === 'group' || + data49 === 'edge instantiable' || + data49 === 'cloud instantiable' + ) + ) { + const err73 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.type.enum, + parentSchema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.type, + data: data49, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid27 = _errs118 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data4.isPublic !== undefined) { + let data50 = data4.isPublic; + const _errs120 = errors; + if (typeof data50 !== 'boolean') { + const err74 = { + instancePath: instancePath + '/device/isPublic', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.isPublic.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.isPublic, + data: data50, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + var valid27 = _errs120 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data4.viewer !== undefined) { + let data51 = data4.viewer; + const _errs122 = errors; + if (errors === _errs122) { + if (Array.isArray(data51)) { + var valid28 = true; + const len7 = data51.length; + for (let i7 = 0; i7 < len7; i7++) { + let data52 = data51[i7]; + const _errs124 = errors; + if (errors === _errs124) { + if ( + data52 && + typeof data52 == 'object' && + !Array.isArray(data52) + ) { + let missing10; + if ( + data52.url === undefined && + (missing10 = 'url') + ) { + const err75 = { + instancePath: + instancePath + '/device/viewer/' + i7, + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + + missing10 + + "'", + schema: + schema21.allOf[1].properties.device + .anyOf[2].allOf[0].properties.viewer + .items.required, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[2].allOf[0].properties.viewer + .items, + data: data52, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } else { + if (data52.url !== undefined) { + let data53 = data52.url; + const _errs126 = errors; + if (errors === _errs126) { + if (errors === _errs126) { + if (typeof data53 === 'string') { + if (!formats0(data53)) { + const err76 = { + instancePath: + instancePath + + '/device/viewer/' + + i7 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1].properties + .device.anyOf[2].allOf[0] + .properties.viewer.items + .properties.url, + data: data53, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + + '/device/viewer/' + + i7 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties + .device.anyOf[2].allOf[0] + .properties.viewer.items + .properties.url.type, + parentSchema: + schema21.allOf[1].properties + .device.anyOf[2].allOf[0] + .properties.viewer.items + .properties.url, + data: data53, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + } + } + } else { + const err78 = { + instancePath: + instancePath + '/device/viewer/' + i7, + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device + .anyOf[2].allOf[0].properties.viewer + .items.type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[2].allOf[0].properties.viewer + .items, + data: data52, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + var valid28 = _errs124 === errors; + if (!valid28) { + break; + } + } + } else { + const err79 = { + instancePath: instancePath + '/device/viewer', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.viewer.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.viewer, + data: data51, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + var valid27 = _errs122 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data4.owner !== undefined) { + let data54 = data4.owner; + const _errs128 = errors; + if (errors === _errs128) { + if (Array.isArray(data54)) { + var valid30 = true; + const len8 = data54.length; + for (let i8 = 0; i8 < len8; i8++) { + let data55 = data54[i8]; + const _errs130 = errors; + if (errors === _errs130) { + if ( + data55 && + typeof data55 == 'object' && + !Array.isArray(data55) + ) { + let missing11; + if ( + data55.url === undefined && + (missing11 = 'url') + ) { + const err80 = { + instancePath: + instancePath + + '/device/owner/' + + i8, + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { + missingProperty: missing11, + }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema21.allOf[1].properties.device + .anyOf[2].allOf[0].properties + .owner.items.required, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[2].allOf[0].properties + .owner.items, + data: data55, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } else { + if (data55.url !== undefined) { + let data56 = data55.url; + const _errs132 = errors; + if (errors === _errs132) { + if (errors === _errs132) { + if (typeof data56 === 'string') { + if (!formats0(data56)) { + const err81 = { + instancePath: + instancePath + + '/device/owner/' + + i8 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1] + .properties.device + .anyOf[2].allOf[0] + .properties.owner.items + .properties.url, + data: data56, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } else { + const err82 = { + instancePath: + instancePath + + '/device/owner/' + + i8 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties + .device.anyOf[2].allOf[0] + .properties.owner.items + .properties.url.type, + parentSchema: + schema21.allOf[1].properties + .device.anyOf[2].allOf[0] + .properties.owner.items + .properties.url, + data: data56, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + } + } + } + } else { + const err83 = { + instancePath: + instancePath + '/device/owner/' + i8, + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device + .anyOf[2].allOf[0].properties.owner + .items.type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[2].allOf[0].properties.owner + .items, + data: data55, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid30 = _errs130 === errors; + if (!valid30) { + break; + } + } + } else { + const err84 = { + instancePath: instancePath + '/device/owner', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.owner.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.owner, + data: data54, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + var valid27 = _errs128 === errors; + } else { + var valid27 = true; + } + } + } + } + } + } + } + } + } else { + const err85 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device.anyOf[2].allOf[0].type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[2].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + } + var valid26 = _errs110 === errors; + if (valid26) { + const _errs134 = errors; + if (errors === _errs134) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + if (data4.type !== undefined) { + let data57 = data4.type; + const _errs136 = errors; + if ('edge instantiable' !== data57) { + const err86 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: + schema21.allOf[1].properties.device.anyOf[2].allOf[1] + .properties.type, + data: data57, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid32 = _errs136 === errors; + } else { + var valid32 = true; + } + if (valid32) { + if (data4.codeUrl !== undefined) { + let data58 = data4.codeUrl; + const _errs137 = errors; + if (errors === _errs137) { + if (errors === _errs137) { + if (typeof data58 === 'string') { + if (!formats0(data58)) { + const err87 = { + instancePath: instancePath + '/device/codeUrl', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.codeUrl, + data: data58, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + } else { + const err88 = { + instancePath: instancePath + '/device/codeUrl', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.codeUrl.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.codeUrl, + data: data58, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + } + } + var valid32 = _errs137 === errors; + } else { + var valid32 = true; + } + if (valid32) { + if (data4.services !== undefined) { + let data59 = data4.services; + const _errs139 = errors; + if (errors === _errs139) { + if (Array.isArray(data59)) { + var valid33 = true; + const len9 = data59.length; + for (let i9 = 0; i9 < len9; i9++) { + let data60 = data59[i9]; + const _errs141 = errors; + if (errors === _errs141) { + if ( + data60 && + typeof data60 == 'object' && + !Array.isArray(data60) + ) { + if (data60.serviceType !== undefined) { + let data61 = data60.serviceType; + const _errs144 = errors; + if (errors === _errs144) { + if (errors === _errs144) { + if (typeof data61 === 'string') { + if (!formats0(data61)) { + const err89 = { + instancePath: + instancePath + + '/device/services/' + + i9 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceType, + data: data61, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } else { + const err90 = { + instancePath: + instancePath + + '/device/services/' + + i9 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceType.type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceType, + data: data61, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + } + var valid34 = _errs144 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data60.serviceId !== undefined) { + let data62 = data60.serviceId; + const _errs146 = errors; + if (typeof data62 !== 'string') { + const err91 = { + instancePath: + instancePath + + '/device/services/' + + i9 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device + .anyOf[2].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[2].allOf[1].properties.services + .items.properties.serviceId, + data: data62, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + var valid34 = _errs146 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data60.serviceDirection !== undefined) { + let data63 = data60.serviceDirection; + const _errs148 = errors; + if (typeof data63 !== 'string') { + const err92 = { + instancePath: + instancePath + + '/device/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceDirection.type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceDirection, + data: data63, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + if ( + !( + data63 === 'consumer' || + data63 === 'producer' || + data63 === 'prosumer' + ) + ) { + const err93 = { + instancePath: + instancePath + + '/device/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema21.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema21.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceDirection.enum, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceDirection, + data: data63, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + var valid34 = _errs148 === errors; + } else { + var valid34 = true; + } + } + } + } else { + const err94 = { + instancePath: + instancePath + '/device/services/' + i9, + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.services.items.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.services.items, + data: data60, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid33 = _errs141 === errors; + if (!valid33) { + break; + } + } + } else { + const err95 = { + instancePath: instancePath + '/device/services', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.services.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.services, + data: data59, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + var valid32 = _errs139 === errors; + } else { + var valid32 = true; + } + } + } + } else { + const err96 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device.anyOf[2].allOf[1].type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[2].allOf[1], + data: data4, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + var valid26 = _errs134 === errors; + } + var _valid0 = _errs109 === errors; + valid5 = valid5 || _valid0; + if (!valid5) { + const _errs150 = errors; + const _errs151 = errors; + if (errors === _errs151) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing12; + if ( + (data4.url === undefined && (missing12 = 'url')) || + (data4.type === undefined && (missing12 = 'type')) || + (data4.name === undefined && (missing12 = 'name')) || + (data4.isPublic === undefined && (missing12 = 'isPublic')) + ) { + const err97 = { + instancePath: instancePath + '/device', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: + schema21.allOf[1].properties.device.anyOf[3].allOf[0] + .required, + parentSchema: + schema21.allOf[1].properties.device.anyOf[3].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } else { + if (data4.url !== undefined) { + let data64 = data4.url; + const _errs153 = errors; + if (errors === _errs153) { + if (errors === _errs153) { + if (typeof data64 === 'string') { + if (!formats0(data64)) { + const err98 = { + instancePath: instancePath + '/device/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } else { + const err99 = { + instancePath: instancePath + '/device/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.url.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + } + var valid36 = _errs153 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data4.name !== undefined) { + let data65 = data4.name; + const _errs155 = errors; + if (typeof data65 !== 'string') { + const err100 = { + instancePath: instancePath + '/device/name', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[3].allOf[0] + .properties.name.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[3].allOf[0] + .properties.name, + data: data65, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + var valid36 = _errs155 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data4.description !== undefined) { + let data66 = data4.description; + const _errs157 = errors; + if (typeof data66 !== 'string') { + const err101 = { + instancePath: instancePath + '/device/description', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.description.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.description, + data: data66, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid36 = _errs157 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data4.type !== undefined) { + let data67 = data4.type; + const _errs159 = errors; + if (typeof data67 !== 'string') { + const err102 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.type.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.type, + data: data67, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + if ( + !( + data67 === 'device' || + data67 === 'group' || + data67 === 'edge instantiable' || + data67 === 'cloud instantiable' + ) + ) { + const err103 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.type.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.type.enum, + parentSchema: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.type, + data: data67, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + var valid36 = _errs159 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data4.isPublic !== undefined) { + let data68 = data4.isPublic; + const _errs161 = errors; + if (typeof data68 !== 'boolean') { + const err104 = { + instancePath: instancePath + '/device/isPublic', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.isPublic.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.isPublic, + data: data68, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + var valid36 = _errs161 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data4.viewer !== undefined) { + let data69 = data4.viewer; + const _errs163 = errors; + if (errors === _errs163) { + if (Array.isArray(data69)) { + var valid37 = true; + const len10 = data69.length; + for (let i10 = 0; i10 < len10; i10++) { + let data70 = data69[i10]; + const _errs165 = errors; + if (errors === _errs165) { + if ( + data70 && + typeof data70 == 'object' && + !Array.isArray(data70) + ) { + let missing13; + if ( + data70.url === undefined && + (missing13 = 'url') + ) { + const err105 = { + instancePath: + instancePath + + '/device/viewer/' + + i10, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { + missingProperty: missing13, + }, + message: + "must have required property '" + + missing13 + + "'", + schema: + schema21.allOf[1].properties.device + .anyOf[3].allOf[0].properties + .viewer.items.required, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[3].allOf[0].properties + .viewer.items, + data: data70, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } else { + if (data70.url !== undefined) { + let data71 = data70.url; + const _errs167 = errors; + if (errors === _errs167) { + if (errors === _errs167) { + if (typeof data71 === 'string') { + if (!formats0(data71)) { + const err106 = { + instancePath: + instancePath + + '/device/viewer/' + + i10 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1] + .properties.device + .anyOf[3].allOf[0] + .properties.viewer.items + .properties.url, + data: data71, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } else { + const err107 = { + instancePath: + instancePath + + '/device/viewer/' + + i10 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties + .device.anyOf[3].allOf[0] + .properties.viewer.items + .properties.url.type, + parentSchema: + schema21.allOf[1].properties + .device.anyOf[3].allOf[0] + .properties.viewer.items + .properties.url, + data: data71, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + } + } + } + } else { + const err108 = { + instancePath: + instancePath + + '/device/viewer/' + + i10, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device + .anyOf[3].allOf[0].properties.viewer + .items.type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[3].allOf[0].properties.viewer + .items, + data: data70, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid37 = _errs165 === errors; + if (!valid37) { + break; + } + } + } else { + const err109 = { + instancePath: instancePath + '/device/viewer', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.viewer.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.viewer, + data: data69, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + } + } + var valid36 = _errs163 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data4.owner !== undefined) { + let data72 = data4.owner; + const _errs169 = errors; + if (errors === _errs169) { + if (Array.isArray(data72)) { + var valid39 = true; + const len11 = data72.length; + for (let i11 = 0; i11 < len11; i11++) { + let data73 = data72[i11]; + const _errs171 = errors; + if (errors === _errs171) { + if ( + data73 && + typeof data73 == 'object' && + !Array.isArray(data73) + ) { + let missing14; + if ( + data73.url === undefined && + (missing14 = 'url') + ) { + const err110 = { + instancePath: + instancePath + + '/device/owner/' + + i11, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { + missingProperty: missing14, + }, + message: + "must have required property '" + + missing14 + + "'", + schema: + schema21.allOf[1].properties + .device.anyOf[3].allOf[0] + .properties.owner.items + .required, + parentSchema: + schema21.allOf[1].properties + .device.anyOf[3].allOf[0] + .properties.owner.items, + data: data73, + }; + if (vErrors === null) { + vErrors = [err110]; + } else { + vErrors.push(err110); + } + errors++; + } else { + if (data73.url !== undefined) { + let data74 = data73.url; + const _errs173 = errors; + if (errors === _errs173) { + if (errors === _errs173) { + if ( + typeof data74 === 'string' + ) { + if (!formats0(data74)) { + const err111 = { + instancePath: + instancePath + + '/device/owner/' + + i11 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1] + .properties.device + .anyOf[3].allOf[0] + .properties.owner + .items.properties.url, + data: data74, + }; + if (vErrors === null) { + vErrors = [err111]; + } else { + vErrors.push(err111); + } + errors++; + } + } else { + const err112 = { + instancePath: + instancePath + + '/device/owner/' + + i11 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1] + .properties.device + .anyOf[3].allOf[0] + .properties.owner.items + .properties.url.type, + parentSchema: + schema21.allOf[1] + .properties.device + .anyOf[3].allOf[0] + .properties.owner.items + .properties.url, + data: data74, + }; + if (vErrors === null) { + vErrors = [err112]; + } else { + vErrors.push(err112); + } + errors++; + } + } + } + } + } + } else { + const err113 = { + instancePath: + instancePath + + '/device/owner/' + + i11, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device + .anyOf[3].allOf[0].properties + .owner.items.type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[3].allOf[0].properties + .owner.items, + data: data73, + }; + if (vErrors === null) { + vErrors = [err113]; + } else { + vErrors.push(err113); + } + errors++; + } + } + var valid39 = _errs171 === errors; + if (!valid39) { + break; + } + } + } else { + const err114 = { + instancePath: + instancePath + '/device/owner', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema21.allOf[1].properties.device + .anyOf[3].allOf[0].properties.owner + .type, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[3].allOf[0].properties.owner, + data: data72, + }; + if (vErrors === null) { + vErrors = [err114]; + } else { + vErrors.push(err114); + } + errors++; + } + } + var valid36 = _errs169 === errors; + } else { + var valid36 = true; + } + } + } + } + } + } + } + } + } else { + const err115 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device.anyOf[3].allOf[0].type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[3].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err115]; + } else { + vErrors.push(err115); + } + errors++; + } + } + var valid35 = _errs151 === errors; + if (valid35) { + const _errs175 = errors; + if (errors === _errs175) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing15; + if (data4.devices === undefined && (missing15 = 'devices')) { + const err116 = { + instancePath: instancePath + '/device', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing15 }, + message: "must have required property '" + missing15 + "'", + schema: + schema21.allOf[1].properties.device.anyOf[3].allOf[1] + .required, + parentSchema: + schema21.allOf[1].properties.device.anyOf[3].allOf[1], + data: data4, + }; + if (vErrors === null) { + vErrors = [err116]; + } else { + vErrors.push(err116); + } + errors++; + } else { + if (data4.type !== undefined) { + let data75 = data4.type; + const _errs177 = errors; + if ('group' !== data75) { + const err117 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: + schema21.allOf[1].properties.device.anyOf[3].allOf[1] + .properties.type, + data: data75, + }; + if (vErrors === null) { + vErrors = [err117]; + } else { + vErrors.push(err117); + } + errors++; + } + var valid41 = _errs177 === errors; + } else { + var valid41 = true; + } + if (valid41) { + if (data4.devices !== undefined) { + let data76 = data4.devices; + const _errs178 = errors; + if (errors === _errs178) { + if (Array.isArray(data76)) { + var valid42 = true; + const len12 = data76.length; + for (let i12 = 0; i12 < len12; i12++) { + let data77 = data76[i12]; + const _errs180 = errors; + if (errors === _errs180) { + if ( + data77 && + typeof data77 == 'object' && + !Array.isArray(data77) + ) { + let missing16; + if ( + data77.url === undefined && + (missing16 = 'url') + ) { + const err118 = { + instancePath: + instancePath + '/device/devices/' + i12, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing16 }, + message: + "must have required property '" + + missing16 + + "'", + schema: + schema21.allOf[1].properties.device + .anyOf[3].allOf[1].properties.devices + .items.required, + parentSchema: + schema21.allOf[1].properties.device + .anyOf[3].allOf[1].properties.devices + .items, + data: data77, + }; + if (vErrors === null) { + vErrors = [err118]; + } else { + vErrors.push(err118); + } + errors++; + } else { + if (data77.url !== undefined) { + let data78 = data77.url; + const _errs182 = errors; + if (errors === _errs182) { + if (errors === _errs182) { + if (typeof data78 === 'string') { + if (!formats0(data78)) { + const err119 = { + instancePath: + instancePath + + '/device/devices/' + + i12 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema21.allOf[1].properties + .device.anyOf[3].allOf[1] + .properties.devices.items + .properties.url, + data: data78, + }; + if (vErrors === null) { + vErrors = [err119]; + } else { + vErrors.push(err119); + } + errors++; + } + } else { + const err120 = { + instancePath: + instancePath + + '/device/devices/' + + i12 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.allOf[1].properties + .device.anyOf[3].allOf[1] + .properties.devices.items + .properties.url.type, + parentSchema: + schema21.allOf[1].properties + .device.anyOf[3].allOf[1] + .properties.devices.items + .properties.url, + data: data78, + }; + if (vErrors === null) { + vErrors = [err120]; + } else { + vErrors.push(err120); + } + errors++; + } + } + } + } + } + } else { + const err121 = { + instancePath: + instancePath + '/device/devices/' + i12, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[1].properties.devices.items.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[1].properties.devices.items, + data: data77, + }; + if (vErrors === null) { + vErrors = [err121]; + } else { + vErrors.push(err121); + } + errors++; + } + } + var valid42 = _errs180 === errors; + if (!valid42) { + break; + } + } + } else { + const err122 = { + instancePath: instancePath + '/device/devices', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[1].properties.devices.type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[3] + .allOf[1].properties.devices, + data: data76, + }; + if (vErrors === null) { + vErrors = [err122]; + } else { + vErrors.push(err122); + } + errors++; + } + } + var valid41 = _errs178 === errors; + } else { + var valid41 = true; + } + } + } + } else { + const err123 = { + instancePath: instancePath + '/device', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema21.allOf[1].properties.device.anyOf[3].allOf[1].type, + parentSchema: + schema21.allOf[1].properties.device.anyOf[3].allOf[1], + data: data4, + }; + if (vErrors === null) { + vErrors = [err123]; + } else { + vErrors.push(err123); + } + errors++; + } + } + var valid35 = _errs175 === errors; + } + var _valid0 = _errs150 === errors; + valid5 = valid5 || _valid0; + } + } + } + if (!valid5) { + const err124 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema21.allOf[1].properties.device.anyOf, + parentSchema: schema21.allOf[1].properties.device, + data: data4, + }; + if (vErrors === null) { + vErrors = [err124]; + } else { + vErrors.push(err124); + } + errors++; + validate36.errors = vErrors; + return false; + } else { + errors = _errs16; + if (vErrors !== null) { + if (_errs16) { + vErrors.length = _errs16; + } else { + vErrors = null; + } + } + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate36.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema21.allOf[1].type, + parentSchema: schema21.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } + validate36.errors = vErrors; + return errors === 0; +} +exports.validateDeviceOverviewUpdate = validate37; +const schema22 = { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + 'x-standalone': true, + 'x-name': 'DeviceOverviewUpdate', + 'x-location': '#/components/schemas/device_overview_update', + 'x-schema-type': 'all', +}; +function validate37( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate37.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema22.required, + parentSchema: schema22, + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs1 = errors; + if (typeof data0 !== 'string') { + validate37.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.name.type, + parentSchema: schema22.properties.name, + data: data0, + }, + ]; + return false; + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs3 = errors; + if (typeof data1 !== 'string') { + validate37.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.description.type, + parentSchema: schema22.properties.description, + data: data1, + }, + ]; + return false; + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs5 = errors; + if (typeof data2 !== 'string') { + validate37.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.type.type, + parentSchema: schema22.properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate37.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema22.properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema22.properties.type.enum, + parentSchema: schema22.properties.type, + data: data2, + }, + ]; + return false; + } + var valid0 = _errs5 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs7 = errors; + if (typeof data3 !== 'boolean') { + validate37.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema22.properties.isPublic.type, + parentSchema: schema22.properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid1 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate37.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: schema22.properties.viewer.items.required, + parentSchema: schema22.properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate37.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema22.properties.viewer.items.properties + .url, + data: data6, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema22.properties.viewer.items.properties + .url.type, + parentSchema: + schema22.properties.viewer.items.properties + .url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema22.properties.viewer.items.type, + parentSchema: schema22.properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs11 === errors; + if (!valid1) { + break; + } + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema22.properties.viewer.type, + parentSchema: schema22.properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs15 = errors; + if (errors === _errs15) { + if (Array.isArray(data7)) { + var valid3 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs17 = errors; + if (errors === _errs17) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate37.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: schema22.properties.owner.items.required, + parentSchema: schema22.properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs19 = errors; + if (errors === _errs19) { + if (errors === _errs19) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate37.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema22.properties.owner.items.properties + .url, + data: data9, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema22.properties.owner.items.properties + .url.type, + parentSchema: + schema22.properties.owner.items.properties + .url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema22.properties.owner.items.type, + parentSchema: schema22.properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid3 = _errs17 === errors; + if (!valid3) { + break; + } + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema22.properties.owner.type, + parentSchema: schema22.properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } else { + validate37.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema22.type, + parentSchema: schema22, + data, + }, + ]; + return false; + } + } + validate37.errors = vErrors; + return errors === 0; +} +exports.validateInstantiableCloudDeviceUpdate = validate38; +const schema23 = { + title: 'Instantiable Cloud Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-standalone': true, + 'x-name': 'InstantiableCloudDeviceUpdate', + 'x-location': '#/components/schemas/device_cloud_instantiable_update', + 'x-schema-type': 'all', +}; +function validate38( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate38.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema23.allOf[0].required, + parentSchema: schema23.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs2 = errors; + if (typeof data0 !== 'string') { + validate38.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.allOf[0].properties.name.type, + parentSchema: schema23.allOf[0].properties.name, + data: data0, + }, + ]; + return false; + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate38.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.allOf[0].properties.description.type, + parentSchema: schema23.allOf[0].properties.description, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate38.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.allOf[0].properties.type.type, + parentSchema: schema23.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate38.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema23.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema23.allOf[0].properties.type.enum, + parentSchema: schema23.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs8 = errors; + if (typeof data3 !== 'boolean') { + validate38.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema23.allOf[0].properties.isPublic.type, + parentSchema: schema23.allOf[0].properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate38.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema23.allOf[0].properties.viewer.items.required, + parentSchema: schema23.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate38.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema23.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate38.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema23.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema23.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema23.allOf[0].properties.viewer.items.type, + parentSchema: schema23.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + if (!valid2) { + break; + } + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema23.allOf[0].properties.viewer.type, + parentSchema: schema23.allOf[0].properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs16 = errors; + if (errors === _errs16) { + if (Array.isArray(data7)) { + var valid4 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs18 = errors; + if (errors === _errs18) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate38.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema23.allOf[0].properties.owner.items.required, + parentSchema: + schema23.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate38.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema23.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate38.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema23.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema23.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema23.allOf[0].properties.owner.items.type, + parentSchema: schema23.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + if (!valid4) { + break; + } + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema23.allOf[0].properties.owner.type, + parentSchema: schema23.allOf[0].properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid1 = _errs16 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } else { + validate38.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema23.allOf[0].type, + parentSchema: schema23.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs22 = errors; + if (errors === _errs22) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs24 = errors; + if ('cloud instantiable' !== data10) { + validate38.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema23.allOf[1].properties.type, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs24 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.instantiateUrl !== undefined) { + let data11 = data.instantiateUrl; + const _errs25 = errors; + if (errors === _errs25) { + if (errors === _errs25) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + validate38.errors = [ + { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema23.allOf[1].properties.instantiateUrl, + data: data11, + }, + ]; + return false; + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.allOf[1].properties.instantiateUrl.type, + parentSchema: schema23.allOf[1].properties.instantiateUrl, + data: data11, + }, + ]; + return false; + } + } + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs27 = errors; + if (errors === _errs27) { + if (Array.isArray(data12)) { + var valid7 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs29 = errors; + if (errors === _errs29) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs32 = errors; + if (errors === _errs32) { + if (errors === _errs32) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + validate38.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema23.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } else { + validate38.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema23.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema23.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } + } + var valid8 = _errs32 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs34 = errors; + if (typeof data15 !== 'string') { + validate38.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema23.allOf[1].properties.services.items.properties + .serviceId.type, + parentSchema: + schema23.allOf[1].properties.services.items.properties + .serviceId, + data: data15, + }, + ]; + return false; + } + var valid8 = _errs34 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs36 = errors; + if (typeof data16 !== 'string') { + validate38.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema23.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema23.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + validate38.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema23.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema23.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema23.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + var valid8 = _errs36 === errors; + } else { + var valid8 = true; + } + } + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema23.allOf[1].properties.services.items.type, + parentSchema: schema23.allOf[1].properties.services.items, + data: data13, + }, + ]; + return false; + } + } + var valid7 = _errs29 === errors; + if (!valid7) { + break; + } + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema23.allOf[1].properties.services.type, + parentSchema: schema23.allOf[1].properties.services, + data: data12, + }, + ]; + return false; + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate38.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema23.allOf[1].type, + parentSchema: schema23.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs22 === errors; + } + validate38.errors = vErrors; + return errors === 0; +} +exports.validateConcreteDeviceUpdate = validate39; +const schema24 = { + title: 'Concrete Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-standalone': true, + 'x-name': 'ConcreteDeviceUpdate', + 'x-location': '#/components/schemas/device_concrete_update', + 'x-schema-type': 'all', +}; +function validate39( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate39.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema24.allOf[0].required, + parentSchema: schema24.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs2 = errors; + if (typeof data0 !== 'string') { + validate39.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema24.allOf[0].properties.name.type, + parentSchema: schema24.allOf[0].properties.name, + data: data0, + }, + ]; + return false; + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate39.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema24.allOf[0].properties.description.type, + parentSchema: schema24.allOf[0].properties.description, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate39.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema24.allOf[0].properties.type.type, + parentSchema: schema24.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate39.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema24.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema24.allOf[0].properties.type.enum, + parentSchema: schema24.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs8 = errors; + if (typeof data3 !== 'boolean') { + validate39.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema24.allOf[0].properties.isPublic.type, + parentSchema: schema24.allOf[0].properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate39.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema24.allOf[0].properties.viewer.items.required, + parentSchema: schema24.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate39.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema24.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate39.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema24.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema24.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate39.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema24.allOf[0].properties.viewer.items.type, + parentSchema: schema24.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + if (!valid2) { + break; + } + } + } else { + validate39.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema24.allOf[0].properties.viewer.type, + parentSchema: schema24.allOf[0].properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs16 = errors; + if (errors === _errs16) { + if (Array.isArray(data7)) { + var valid4 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs18 = errors; + if (errors === _errs18) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate39.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema24.allOf[0].properties.owner.items.required, + parentSchema: + schema24.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate39.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema24.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate39.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema24.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema24.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate39.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema24.allOf[0].properties.owner.items.type, + parentSchema: schema24.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + if (!valid4) { + break; + } + } + } else { + validate39.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema24.allOf[0].properties.owner.type, + parentSchema: schema24.allOf[0].properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid1 = _errs16 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } else { + validate39.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema24.allOf[0].type, + parentSchema: schema24.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs22 = errors; + if (errors === _errs22) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs24 = errors; + if ('device' !== data10) { + validate39.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema24.allOf[1].properties.type, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs24 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.experiment !== undefined) { + let data11 = data.experiment; + const _errs25 = errors; + if (errors === _errs25) { + if (errors === _errs25) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + validate39.errors = [ + { + instancePath: instancePath + '/experiment', + schemaPath: '#/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema24.allOf[1].properties.experiment, + data: data11, + }, + ]; + return false; + } + } else { + validate39.errors = [ + { + instancePath: instancePath + '/experiment', + schemaPath: '#/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema24.allOf[1].properties.experiment.type, + parentSchema: schema24.allOf[1].properties.experiment, + data: data11, + }, + ]; + return false; + } + } + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs27 = errors; + if (errors === _errs27) { + if (Array.isArray(data12)) { + var valid7 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs29 = errors; + if (errors === _errs29) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs32 = errors; + if (errors === _errs32) { + if (errors === _errs32) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + validate39.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema24.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } else { + validate39.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema24.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema24.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } + } + var valid8 = _errs32 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs34 = errors; + if (typeof data15 !== 'string') { + validate39.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema24.allOf[1].properties.services.items.properties + .serviceId.type, + parentSchema: + schema24.allOf[1].properties.services.items.properties + .serviceId, + data: data15, + }, + ]; + return false; + } + var valid8 = _errs34 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs36 = errors; + if (typeof data16 !== 'string') { + validate39.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema24.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema24.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + validate39.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema24.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema24.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema24.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + var valid8 = _errs36 === errors; + } else { + var valid8 = true; + } + } + } + } else { + validate39.errors = [ + { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema24.allOf[1].properties.services.items.type, + parentSchema: schema24.allOf[1].properties.services.items, + data: data13, + }, + ]; + return false; + } + } + var valid7 = _errs29 === errors; + if (!valid7) { + break; + } + } + } else { + validate39.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema24.allOf[1].properties.services.type, + parentSchema: schema24.allOf[1].properties.services, + data: data12, + }, + ]; + return false; + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate39.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema24.allOf[1].type, + parentSchema: schema24.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs22 === errors; + } + validate39.errors = vErrors; + return errors === 0; +} +exports.validateInstantiableBrowserDeviceUpdate = validate40; +const schema25 = { + title: 'Instantiable Browser Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-standalone': true, + 'x-name': 'InstantiableBrowserDeviceUpdate', + 'x-location': '#/components/schemas/device_edge_instantiable_update', + 'x-schema-type': 'all', +}; +function validate40( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate40.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema25.allOf[0].required, + parentSchema: schema25.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs2 = errors; + if (typeof data0 !== 'string') { + validate40.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema25.allOf[0].properties.name.type, + parentSchema: schema25.allOf[0].properties.name, + data: data0, + }, + ]; + return false; + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate40.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema25.allOf[0].properties.description.type, + parentSchema: schema25.allOf[0].properties.description, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate40.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema25.allOf[0].properties.type.type, + parentSchema: schema25.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate40.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema25.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema25.allOf[0].properties.type.enum, + parentSchema: schema25.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs8 = errors; + if (typeof data3 !== 'boolean') { + validate40.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema25.allOf[0].properties.isPublic.type, + parentSchema: schema25.allOf[0].properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate40.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema25.allOf[0].properties.viewer.items.required, + parentSchema: schema25.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate40.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema25.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate40.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema25.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema25.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate40.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema25.allOf[0].properties.viewer.items.type, + parentSchema: schema25.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + if (!valid2) { + break; + } + } + } else { + validate40.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema25.allOf[0].properties.viewer.type, + parentSchema: schema25.allOf[0].properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs16 = errors; + if (errors === _errs16) { + if (Array.isArray(data7)) { + var valid4 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs18 = errors; + if (errors === _errs18) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate40.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema25.allOf[0].properties.owner.items.required, + parentSchema: + schema25.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate40.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema25.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate40.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema25.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema25.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate40.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema25.allOf[0].properties.owner.items.type, + parentSchema: schema25.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + if (!valid4) { + break; + } + } + } else { + validate40.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema25.allOf[0].properties.owner.type, + parentSchema: schema25.allOf[0].properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid1 = _errs16 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } else { + validate40.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema25.allOf[0].type, + parentSchema: schema25.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs22 = errors; + if (errors === _errs22) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs24 = errors; + if ('edge instantiable' !== data10) { + validate40.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema25.allOf[1].properties.type, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs24 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.codeUrl !== undefined) { + let data11 = data.codeUrl; + const _errs25 = errors; + if (errors === _errs25) { + if (errors === _errs25) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + validate40.errors = [ + { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema25.allOf[1].properties.codeUrl, + data: data11, + }, + ]; + return false; + } + } else { + validate40.errors = [ + { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema25.allOf[1].properties.codeUrl.type, + parentSchema: schema25.allOf[1].properties.codeUrl, + data: data11, + }, + ]; + return false; + } + } + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs27 = errors; + if (errors === _errs27) { + if (Array.isArray(data12)) { + var valid7 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs29 = errors; + if (errors === _errs29) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs32 = errors; + if (errors === _errs32) { + if (errors === _errs32) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + validate40.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema25.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } else { + validate40.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema25.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema25.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } + } + var valid8 = _errs32 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs34 = errors; + if (typeof data15 !== 'string') { + validate40.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema25.allOf[1].properties.services.items.properties + .serviceId.type, + parentSchema: + schema25.allOf[1].properties.services.items.properties + .serviceId, + data: data15, + }, + ]; + return false; + } + var valid8 = _errs34 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs36 = errors; + if (typeof data16 !== 'string') { + validate40.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema25.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema25.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + validate40.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema25.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema25.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema25.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + var valid8 = _errs36 === errors; + } else { + var valid8 = true; + } + } + } + } else { + validate40.errors = [ + { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema25.allOf[1].properties.services.items.type, + parentSchema: schema25.allOf[1].properties.services.items, + data: data13, + }, + ]; + return false; + } + } + var valid7 = _errs29 === errors; + if (!valid7) { + break; + } + } + } else { + validate40.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema25.allOf[1].properties.services.type, + parentSchema: schema25.allOf[1].properties.services, + data: data12, + }, + ]; + return false; + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate40.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema25.allOf[1].type, + parentSchema: schema25.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs22 === errors; + } + validate40.errors = vErrors; + return errors === 0; +} +exports.validateDeviceGroupUpdate = validate41; +const schema26 = { + title: 'Device Group Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + }, + ], + 'x-standalone': true, + 'x-name': 'DeviceGroupUpdate', + 'x-location': '#/components/schemas/device_group_update', + 'x-schema-type': 'all', +}; +function validate41( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate41.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema26.allOf[0].required, + parentSchema: schema26.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs2 = errors; + if (typeof data0 !== 'string') { + validate41.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema26.allOf[0].properties.name.type, + parentSchema: schema26.allOf[0].properties.name, + data: data0, + }, + ]; + return false; + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate41.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema26.allOf[0].properties.description.type, + parentSchema: schema26.allOf[0].properties.description, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate41.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema26.allOf[0].properties.type.type, + parentSchema: schema26.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate41.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema26.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema26.allOf[0].properties.type.enum, + parentSchema: schema26.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs8 = errors; + if (typeof data3 !== 'boolean') { + validate41.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema26.allOf[0].properties.isPublic.type, + parentSchema: schema26.allOf[0].properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate41.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema26.allOf[0].properties.viewer.items.required, + parentSchema: schema26.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate41.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema26.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate41.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema26.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema26.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema26.allOf[0].properties.viewer.items.type, + parentSchema: schema26.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + if (!valid2) { + break; + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema26.allOf[0].properties.viewer.type, + parentSchema: schema26.allOf[0].properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs16 = errors; + if (errors === _errs16) { + if (Array.isArray(data7)) { + var valid4 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs18 = errors; + if (errors === _errs18) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate41.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema26.allOf[0].properties.owner.items.required, + parentSchema: + schema26.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate41.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema26.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate41.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema26.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema26.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema26.allOf[0].properties.owner.items.type, + parentSchema: schema26.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + if (!valid4) { + break; + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema26.allOf[0].properties.owner.type, + parentSchema: schema26.allOf[0].properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid1 = _errs16 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } else { + validate41.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema26.allOf[0].type, + parentSchema: schema26.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs22 = errors; + if (errors === _errs22) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs24 = errors; + if ('group' !== data10) { + validate41.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema26.allOf[1].properties.type, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs24 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.devices !== undefined) { + let data11 = data.devices; + const _errs25 = errors; + if (errors === _errs25) { + if (Array.isArray(data11)) { + var valid7 = true; + const len2 = data11.length; + for (let i2 = 0; i2 < len2; i2++) { + let data12 = data11[i2]; + const _errs27 = errors; + if (errors === _errs27) { + if (data12 && typeof data12 == 'object' && !Array.isArray(data12)) { + let missing3; + if (data12.url === undefined && (missing3 = 'url')) { + validate41.errors = [ + { + instancePath: instancePath + '/devices/' + i2, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema26.allOf[1].properties.devices.items.required, + parentSchema: schema26.allOf[1].properties.devices.items, + data: data12, + }, + ]; + return false; + } else { + if (data12.url !== undefined) { + let data13 = data12.url; + const _errs29 = errors; + if (errors === _errs29) { + if (errors === _errs29) { + if (typeof data13 === 'string') { + if (!formats0(data13)) { + validate41.errors = [ + { + instancePath: + instancePath + '/devices/' + i2 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema26.allOf[1].properties.devices.items + .properties.url, + data: data13, + }, + ]; + return false; + } + } else { + validate41.errors = [ + { + instancePath: + instancePath + '/devices/' + i2 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema26.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema26.allOf[1].properties.devices.items + .properties.url, + data: data13, + }, + ]; + return false; + } + } + } + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/devices/' + i2, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema26.allOf[1].properties.devices.items.type, + parentSchema: schema26.allOf[1].properties.devices.items, + data: data12, + }, + ]; + return false; + } + } + var valid7 = _errs27 === errors; + if (!valid7) { + break; + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema26.allOf[1].properties.devices.type, + parentSchema: schema26.allOf[1].properties.devices, + data: data11, + }, + ]; + return false; + } + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + } + } else { + validate41.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema26.allOf[1].type, + parentSchema: schema26.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs22 === errors; + } + validate41.errors = vErrors; + return errors === 0; +} +exports.validateDeviceUpdate = validate42; +const schema27 = { + title: 'Device Update', + anyOf: [ + { + title: 'Instantiable Cloud Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Concrete Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Instantiable Browser Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Device Group Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + }, + ], + }, + ], + 'x-standalone': true, + 'x-name': 'DeviceUpdate', + 'x-location': '#/components/schemas/device_update', + 'x-schema-type': 'all', +}; +function validate42( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema27.anyOf[0].allOf[0].required, + parentSchema: schema27.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs4 = errors; + if (typeof data0 !== 'string') { + const err1 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema27.anyOf[0].allOf[0].properties.name, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err2 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema27.anyOf[0].allOf[0].properties.description, + data: data1, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err3 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema27.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + const err4 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema27.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema27.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema27.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs10 = errors; + if (typeof data3 !== 'boolean') { + const err5 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema27.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema27.anyOf[0].allOf[0].properties.isPublic, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data4)) { + var valid3 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + const err6 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: + schema27.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema27.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + const err7 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema27.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema27.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } + } else { + const err9 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema27.anyOf[0].allOf[0].properties.viewer.items.type, + parentSchema: + schema27.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var valid3 = _errs14 === errors; + if (!valid3) { + break; + } + } + } else { + const err10 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema27.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema27.anyOf[0].allOf[0].properties.viewer, + data: data4, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid5 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + const err11 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema27.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema27.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + const err12 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema27.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } else { + const err13 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema27.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + } + } + } + } + } else { + const err14 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema27.anyOf[0].allOf[0].properties.owner.items.type, + parentSchema: + schema27.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } + var valid5 = _errs20 === errors; + if (!valid5) { + break; + } + } + } else { + const err15 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema27.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema27.anyOf[0].allOf[0].properties.owner, + data: data7, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + var valid2 = _errs18 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } else { + const err16 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.anyOf[0].allOf[0].type, + parentSchema: schema27.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs26 = errors; + if ('cloud instantiable' !== data10) { + const err17 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema27.anyOf[0].allOf[1].properties.type, + data: data10, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var valid7 = _errs26 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data11 = data.instantiateUrl; + const _errs27 = errors; + if (errors === _errs27) { + if (errors === _errs27) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + const err18 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema27.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } else { + const err19 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema27.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + } + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data12)) { + var valid8 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + const err20 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema27.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema27.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid9 = _errs34 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs36 = errors; + if (typeof data15 !== 'string') { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema27.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err23 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema27.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + const err24 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema27.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema27.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema27.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err25 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema27.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema27.anyOf[0].allOf[1].properties.services.items, + data: data13, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + var valid8 = _errs31 === errors; + if (!valid8) { + break; + } + } + } else { + const err26 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema27.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema27.anyOf[0].allOf[1].properties.services, + data: data12, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err27 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.anyOf[0].allOf[1].type, + parentSchema: schema27.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid1 = _errs24 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs40 = errors; + const _errs41 = errors; + if (errors === _errs41) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if (data.type === undefined && (missing3 = 'type')) { + const err28 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema27.anyOf[1].allOf[0].required, + parentSchema: schema27.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } else { + if (data.name !== undefined) { + let data17 = data.name; + const _errs43 = errors; + if (typeof data17 !== 'string') { + const err29 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema27.anyOf[1].allOf[0].properties.name, + data: data17, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + var valid11 = _errs43 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data18 = data.description; + const _errs45 = errors; + if (typeof data18 !== 'string') { + const err30 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema27.anyOf[1].allOf[0].properties.description, + data: data18, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data19 = data.type; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err31 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema27.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + if ( + !( + data19 === 'device' || + data19 === 'group' || + data19 === 'edge instantiable' || + data19 === 'cloud instantiable' + ) + ) { + const err32 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema27.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema27.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema27.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data20 = data.isPublic; + const _errs49 = errors; + if (typeof data20 !== 'boolean') { + const err33 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema27.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema27.anyOf[1].allOf[0].properties.isPublic, + data: data20, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data21 = data.viewer; + const _errs51 = errors; + if (errors === _errs51) { + if (Array.isArray(data21)) { + var valid12 = true; + const len3 = data21.length; + for (let i3 = 0; i3 < len3; i3++) { + let data22 = data21[i3]; + const _errs53 = errors; + if (errors === _errs53) { + if ( + data22 && + typeof data22 == 'object' && + !Array.isArray(data22) + ) { + let missing4; + if (data22.url === undefined && (missing4 = 'url')) { + const err34 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema27.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema27.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } else { + if (data22.url !== undefined) { + let data23 = data22.url; + const _errs55 = errors; + if (errors === _errs55) { + if (errors === _errs55) { + if (typeof data23 === 'string') { + if (!formats0(data23)) { + const err35 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema27.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } else { + const err36 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[1].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema27.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + } + } + } + } else { + const err37 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema27.anyOf[1].allOf[0].properties.viewer.items.type, + parentSchema: + schema27.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + var valid12 = _errs53 === errors; + if (!valid12) { + break; + } + } + } else { + const err38 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema27.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema27.anyOf[1].allOf[0].properties.viewer, + data: data21, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data24 = data.owner; + const _errs57 = errors; + if (errors === _errs57) { + if (Array.isArray(data24)) { + var valid14 = true; + const len4 = data24.length; + for (let i4 = 0; i4 < len4; i4++) { + let data25 = data24[i4]; + const _errs59 = errors; + if (errors === _errs59) { + if ( + data25 && + typeof data25 == 'object' && + !Array.isArray(data25) + ) { + let missing5; + if (data25.url === undefined && (missing5 = 'url')) { + const err39 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema27.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema27.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } else { + if (data25.url !== undefined) { + let data26 = data25.url; + const _errs61 = errors; + if (errors === _errs61) { + if (errors === _errs61) { + if (typeof data26 === 'string') { + if (!formats0(data26)) { + const err40 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema27.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } else { + const err41 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[1].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema27.anyOf[1].allOf[0].properties.owner + .items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + } + } + } + } else { + const err42 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema27.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema27.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid14 = _errs59 === errors; + if (!valid14) { + break; + } + } + } else { + const err43 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema27.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema27.anyOf[1].allOf[0].properties.owner, + data: data24, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + } + var valid11 = _errs57 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } else { + const err44 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.anyOf[1].allOf[0].type, + parentSchema: schema27.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var valid10 = _errs41 === errors; + if (valid10) { + const _errs63 = errors; + if (errors === _errs63) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data27 = data.type; + const _errs65 = errors; + if ('device' !== data27) { + const err45 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema27.anyOf[1].allOf[1].properties.type, + data: data27, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + var valid16 = _errs65 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data28 = data.experiment; + const _errs66 = errors; + if (errors === _errs66) { + if (errors === _errs66) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err46 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema27.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } else { + const err47 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema27.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + } + var valid16 = _errs66 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data29 = data.services; + const _errs68 = errors; + if (errors === _errs68) { + if (Array.isArray(data29)) { + var valid17 = true; + const len5 = data29.length; + for (let i5 = 0; i5 < len5; i5++) { + let data30 = data29[i5]; + const _errs70 = errors; + if (errors === _errs70) { + if ( + data30 && + typeof data30 == 'object' && + !Array.isArray(data30) + ) { + if (data30.serviceType !== undefined) { + let data31 = data30.serviceType; + const _errs73 = errors; + if (errors === _errs73) { + if (errors === _errs73) { + if (typeof data31 === 'string') { + if (!formats0(data31)) { + const err48 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema27.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } else { + const err49 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[1].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema27.anyOf[1].allOf[1].properties.services.items + .properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + } + } + var valid18 = _errs73 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceId !== undefined) { + let data32 = data30.serviceId; + const _errs75 = errors; + if (typeof data32 !== 'string') { + const err50 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[1].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema27.anyOf[1].allOf[1].properties.services.items + .properties.serviceId, + data: data32, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid18 = _errs75 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceDirection !== undefined) { + let data33 = data30.serviceDirection; + const _errs77 = errors; + if (typeof data33 !== 'string') { + const err51 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[1].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema27.anyOf[1].allOf[1].properties.services.items + .properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + if ( + !( + data33 === 'consumer' || + data33 === 'producer' || + data33 === 'prosumer' + ) + ) { + const err52 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema27.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema27.anyOf[1].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema27.anyOf[1].allOf[1].properties.services.items + .properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + var valid18 = _errs77 === errors; + } else { + var valid18 = true; + } + } + } + } else { + const err53 = { + instancePath: instancePath + '/services/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema27.anyOf[1].allOf[1].properties.services.items.type, + parentSchema: + schema27.anyOf[1].allOf[1].properties.services.items, + data: data30, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + var valid17 = _errs70 === errors; + if (!valid17) { + break; + } + } + } else { + const err54 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema27.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema27.anyOf[1].allOf[1].properties.services, + data: data29, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + var valid16 = _errs68 === errors; + } else { + var valid16 = true; + } + } + } + } else { + const err55 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.anyOf[1].allOf[1].type, + parentSchema: schema27.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid10 = _errs63 === errors; + } + var _valid0 = _errs40 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs79 = errors; + const _errs80 = errors; + if (errors === _errs80) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if (data.type === undefined && (missing6 = 'type')) { + const err56 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema27.anyOf[2].allOf[0].required, + parentSchema: schema27.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } else { + if (data.name !== undefined) { + let data34 = data.name; + const _errs82 = errors; + if (typeof data34 !== 'string') { + const err57 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema27.anyOf[2].allOf[0].properties.name, + data: data34, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + var valid20 = _errs82 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.description !== undefined) { + let data35 = data.description; + const _errs84 = errors; + if (typeof data35 !== 'string') { + const err58 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema27.anyOf[2].allOf[0].properties.description, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + var valid20 = _errs84 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.type !== undefined) { + let data36 = data.type; + const _errs86 = errors; + if (typeof data36 !== 'string') { + const err59 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema27.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + if ( + !( + data36 === 'device' || + data36 === 'group' || + data36 === 'edge instantiable' || + data36 === 'cloud instantiable' + ) + ) { + const err60 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema27.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema27.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema27.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + var valid20 = _errs86 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.isPublic !== undefined) { + let data37 = data.isPublic; + const _errs88 = errors; + if (typeof data37 !== 'boolean') { + const err61 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema27.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema27.anyOf[2].allOf[0].properties.isPublic, + data: data37, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs88 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.viewer !== undefined) { + let data38 = data.viewer; + const _errs90 = errors; + if (errors === _errs90) { + if (Array.isArray(data38)) { + var valid21 = true; + const len6 = data38.length; + for (let i6 = 0; i6 < len6; i6++) { + let data39 = data38[i6]; + const _errs92 = errors; + if (errors === _errs92) { + if ( + data39 && + typeof data39 == 'object' && + !Array.isArray(data39) + ) { + let missing7; + if (data39.url === undefined && (missing7 = 'url')) { + const err62 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema27.anyOf[2].allOf[0].properties.viewer.items + .required, + parentSchema: + schema27.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } else { + if (data39.url !== undefined) { + let data40 = data39.url; + const _errs94 = errors; + if (errors === _errs94) { + if (errors === _errs94) { + if (typeof data40 === 'string') { + if (!formats0(data40)) { + const err63 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema27.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + } else { + const err64 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[2].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema27.anyOf[2].allOf[0].properties.viewer + .items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + } + } + } + } else { + const err65 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema27.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema27.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid21 = _errs92 === errors; + if (!valid21) { + break; + } + } + } else { + const err66 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema27.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema27.anyOf[2].allOf[0].properties.viewer, + data: data38, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid20 = _errs90 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.owner !== undefined) { + let data41 = data.owner; + const _errs96 = errors; + if (errors === _errs96) { + if (Array.isArray(data41)) { + var valid23 = true; + const len7 = data41.length; + for (let i7 = 0; i7 < len7; i7++) { + let data42 = data41[i7]; + const _errs98 = errors; + if (errors === _errs98) { + if ( + data42 && + typeof data42 == 'object' && + !Array.isArray(data42) + ) { + let missing8; + if (data42.url === undefined && (missing8 = 'url')) { + const err67 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + missing8 + "'", + schema: + schema27.anyOf[2].allOf[0].properties.owner.items + .required, + parentSchema: + schema27.anyOf[2].allOf[0].properties.owner.items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data42.url !== undefined) { + let data43 = data42.url; + const _errs100 = errors; + if (errors === _errs100) { + if (errors === _errs100) { + if (typeof data43 === 'string') { + if (!formats0(data43)) { + const err68 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema27.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema27.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + } + } + } else { + const err70 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema27.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema27.anyOf[2].allOf[0].properties.owner.items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + } + var valid23 = _errs98 === errors; + if (!valid23) { + break; + } + } + } else { + const err71 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema27.anyOf[2].allOf[0].properties.owner.type, + parentSchema: schema27.anyOf[2].allOf[0].properties.owner, + data: data41, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + } + var valid20 = _errs96 === errors; + } else { + var valid20 = true; + } + } + } + } + } + } + } + } else { + const err72 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.anyOf[2].allOf[0].type, + parentSchema: schema27.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + var valid19 = _errs80 === errors; + if (valid19) { + const _errs102 = errors; + if (errors === _errs102) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs104 = errors; + if ('edge instantiable' !== data44) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema27.anyOf[2].allOf[1].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid25 = _errs104 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.codeUrl !== undefined) { + let data45 = data.codeUrl; + const _errs105 = errors; + if (errors === _errs105) { + if (errors === _errs105) { + if (typeof data45 === 'string') { + if (!formats0(data45)) { + const err74 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema27.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } else { + const err75 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema27.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + } + var valid25 = _errs105 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.services !== undefined) { + let data46 = data.services; + const _errs107 = errors; + if (errors === _errs107) { + if (Array.isArray(data46)) { + var valid26 = true; + const len8 = data46.length; + for (let i8 = 0; i8 < len8; i8++) { + let data47 = data46[i8]; + const _errs109 = errors; + if (errors === _errs109) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + if (data47.serviceType !== undefined) { + let data48 = data47.serviceType; + const _errs112 = errors; + if (errors === _errs112) { + if (errors === _errs112) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema27.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema27.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + var valid27 = _errs112 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceId !== undefined) { + let data49 = data47.serviceId; + const _errs114 = errors; + if (typeof data49 !== 'string') { + const err78 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[2].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema27.anyOf[2].allOf[1].properties.services.items + .properties.serviceId, + data: data49, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + var valid27 = _errs114 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceDirection !== undefined) { + let data50 = data47.serviceDirection; + const _errs116 = errors; + if (typeof data50 !== 'string') { + const err79 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema27.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + if ( + !( + data50 === 'consumer' || + data50 === 'producer' || + data50 === 'prosumer' + ) + ) { + const err80 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema27.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema27.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema27.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + var valid27 = _errs116 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err81 = { + instancePath: instancePath + '/services/' + i8, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema27.anyOf[2].allOf[1].properties.services.items.type, + parentSchema: + schema27.anyOf[2].allOf[1].properties.services.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + var valid26 = _errs109 === errors; + if (!valid26) { + break; + } + } + } else { + const err82 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema27.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema27.anyOf[2].allOf[1].properties.services, + data: data46, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + var valid25 = _errs107 === errors; + } else { + var valid25 = true; + } + } + } + } else { + const err83 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.anyOf[2].allOf[1].type, + parentSchema: schema27.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid19 = _errs102 === errors; + } + var _valid0 = _errs79 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs118 = errors; + const _errs119 = errors; + if (errors === _errs119) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if (data.type === undefined && (missing9 = 'type')) { + const err84 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema27.anyOf[3].allOf[0].required, + parentSchema: schema27.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } else { + if (data.name !== undefined) { + let data51 = data.name; + const _errs121 = errors; + if (typeof data51 !== 'string') { + const err85 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema27.anyOf[3].allOf[0].properties.name, + data: data51, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + var valid29 = _errs121 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.description !== undefined) { + let data52 = data.description; + const _errs123 = errors; + if (typeof data52 !== 'string') { + const err86 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema27.anyOf[3].allOf[0].properties.description, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid29 = _errs123 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.type !== undefined) { + let data53 = data.type; + const _errs125 = errors; + if (typeof data53 !== 'string') { + const err87 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema27.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + if ( + !( + data53 === 'device' || + data53 === 'group' || + data53 === 'edge instantiable' || + data53 === 'cloud instantiable' + ) + ) { + const err88 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema27.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema27.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema27.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + var valid29 = _errs125 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.isPublic !== undefined) { + let data54 = data.isPublic; + const _errs127 = errors; + if (typeof data54 !== 'boolean') { + const err89 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema27.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema27.anyOf[3].allOf[0].properties.isPublic, + data: data54, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + var valid29 = _errs127 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.viewer !== undefined) { + let data55 = data.viewer; + const _errs129 = errors; + if (errors === _errs129) { + if (Array.isArray(data55)) { + var valid30 = true; + const len9 = data55.length; + for (let i9 = 0; i9 < len9; i9++) { + let data56 = data55[i9]; + const _errs131 = errors; + if (errors === _errs131) { + if ( + data56 && + typeof data56 == 'object' && + !Array.isArray(data56) + ) { + let missing10; + if (data56.url === undefined && (missing10 = 'url')) { + const err90 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + missing10 + "'", + schema: + schema27.anyOf[3].allOf[0].properties.viewer.items + .required, + parentSchema: + schema27.anyOf[3].allOf[0].properties.viewer + .items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } else { + if (data56.url !== undefined) { + let data57 = data56.url; + const _errs133 = errors; + if (errors === _errs133) { + if (errors === _errs133) { + if (typeof data57 === 'string') { + if (!formats0(data57)) { + const err91 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema27.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + } else { + const err92 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema27.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + } + } + } + } + } else { + const err93 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema27.anyOf[3].allOf[0].properties.viewer.items + .type, + parentSchema: + schema27.anyOf[3].allOf[0].properties.viewer.items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + var valid30 = _errs131 === errors; + if (!valid30) { + break; + } + } + } else { + const err94 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema27.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: schema27.anyOf[3].allOf[0].properties.viewer, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid29 = _errs129 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.owner !== undefined) { + let data58 = data.owner; + const _errs135 = errors; + if (errors === _errs135) { + if (Array.isArray(data58)) { + var valid32 = true; + const len10 = data58.length; + for (let i10 = 0; i10 < len10; i10++) { + let data59 = data58[i10]; + const _errs137 = errors; + if (errors === _errs137) { + if ( + data59 && + typeof data59 == 'object' && + !Array.isArray(data59) + ) { + let missing11; + if (data59.url === undefined && (missing11 = 'url')) { + const err95 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema27.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema27.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } else { + if (data59.url !== undefined) { + let data60 = data59.url; + const _errs139 = errors; + if (errors === _errs139) { + if (errors === _errs139) { + if (typeof data60 === 'string') { + if (!formats0(data60)) { + const err96 = { + instancePath: + instancePath + + '/owner/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema27.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } else { + const err97 = { + instancePath: + instancePath + '/owner/' + i10 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema27.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + } + } + } + } + } else { + const err98 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema27.anyOf[3].allOf[0].properties.owner.items + .type, + parentSchema: + schema27.anyOf[3].allOf[0].properties.owner.items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } + var valid32 = _errs137 === errors; + if (!valid32) { + break; + } + } + } else { + const err99 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema27.anyOf[3].allOf[0].properties.owner.type, + parentSchema: schema27.anyOf[3].allOf[0].properties.owner, + data: data58, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + var valid29 = _errs135 === errors; + } else { + var valid29 = true; + } + } + } + } + } + } + } + } else { + const err100 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.anyOf[3].allOf[0].type, + parentSchema: schema27.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + } + var valid28 = _errs119 === errors; + if (valid28) { + const _errs141 = errors; + if (errors === _errs141) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data61 = data.type; + const _errs143 = errors; + if ('group' !== data61) { + const err101 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema27.anyOf[3].allOf[1].properties.type, + data: data61, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid34 = _errs143 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data.devices !== undefined) { + let data62 = data.devices; + const _errs144 = errors; + if (errors === _errs144) { + if (Array.isArray(data62)) { + var valid35 = true; + const len11 = data62.length; + for (let i11 = 0; i11 < len11; i11++) { + let data63 = data62[i11]; + const _errs146 = errors; + if (errors === _errs146) { + if ( + data63 && + typeof data63 == 'object' && + !Array.isArray(data63) + ) { + let missing12; + if (data63.url === undefined && (missing12 = 'url')) { + const err102 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: + "must have required property '" + missing12 + "'", + schema: + schema27.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema27.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } else { + if (data63.url !== undefined) { + let data64 = data63.url; + const _errs148 = errors; + if (errors === _errs148) { + if (errors === _errs148) { + if (typeof data64 === 'string') { + if (!formats0(data64)) { + const err103 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema27.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + } else { + const err104 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema27.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + } + } + } + } + } else { + const err105 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema27.anyOf[3].allOf[1].properties.devices.items.type, + parentSchema: + schema27.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } + } + var valid35 = _errs146 === errors; + if (!valid35) { + break; + } + } + } else { + const err106 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema27.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema27.anyOf[3].allOf[1].properties.devices, + data: data62, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } + var valid34 = _errs144 === errors; + } else { + var valid34 = true; + } + } + } else { + const err107 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.anyOf[3].allOf[1].type, + parentSchema: schema27.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + var valid28 = _errs141 === errors; + } + var _valid0 = _errs118 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err108 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema27.anyOf, + parentSchema: schema27, + data, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + validate42.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate42.errors = vErrors; + return errors === 0; +} +exports.validateAvailabilityRule = validate43; +const schema28 = { + title: 'Availability Rule', + type: 'object', + allOf: [ + { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + { + type: 'object', + properties: { + available: { type: 'boolean' }, + repeat: { + description: + 'If specified the time slot is repeated in a fixed offset specified by the frequency', + type: 'object', + properties: { + frequency: { type: 'string', enum: ['HOURLY', 'DAILY', 'WEEKLY'] }, + until: { + description: 'Up to this date-time the time slot will be repeated.', + type: 'string', + format: 'date-time', + }, + count: { + description: 'How often the time slot will be repeated', + type: 'integer', + }, + }, + required: ['frequency'], + }, + }, + }, + ], + 'x-standalone': true, + 'x-name': 'AvailabilityRule', + 'x-location': '#/components/schemas/availability_rule', + 'x-schema-type': 'all', +}; +function validate43( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (!(data && typeof data == 'object' && !Array.isArray(data))) { + validate43.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema28.type, + parentSchema: schema28, + data, + }, + ]; + return false; + } + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.start !== undefined) { + let data0 = data.start; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data0 === 'string') { + if (!formats22.validate(data0)) { + validate43.errors = [ + { + instancePath: instancePath + '/start', + schemaPath: '#/allOf/0/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema28.allOf[0].properties.start, + data: data0, + }, + ]; + return false; + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/start', + schemaPath: '#/allOf/0/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema28.allOf[0].properties.start.type, + parentSchema: schema28.allOf[0].properties.start, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.end !== undefined) { + let data1 = data.end; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate43.errors = [ + { + instancePath: instancePath + '/end', + schemaPath: '#/allOf/0/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema28.allOf[0].properties.end, + data: data1, + }, + ]; + return false; + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/end', + schemaPath: '#/allOf/0/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema28.allOf[0].properties.end.type, + parentSchema: schema28.allOf[0].properties.end, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + validate43.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema28.allOf[0].type, + parentSchema: schema28.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (valid0) { + const _errs7 = errors; + if (errors === _errs7) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.available !== undefined) { + let data2 = data.available; + const _errs9 = errors; + if (typeof data2 !== 'boolean') { + validate43.errors = [ + { + instancePath: instancePath + '/available', + schemaPath: '#/allOf/1/properties/available/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema28.allOf[1].properties.available.type, + parentSchema: schema28.allOf[1].properties.available, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs9 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.repeat !== undefined) { + let data3 = data.repeat; + const _errs11 = errors; + if (errors === _errs11) { + if (data3 && typeof data3 == 'object' && !Array.isArray(data3)) { + let missing0; + if (data3.frequency === undefined && (missing0 = 'frequency')) { + validate43.errors = [ + { + instancePath: instancePath + '/repeat', + schemaPath: '#/allOf/1/properties/repeat/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema28.allOf[1].properties.repeat.required, + parentSchema: schema28.allOf[1].properties.repeat, + data: data3, + }, + ]; + return false; + } else { + if (data3.frequency !== undefined) { + let data4 = data3.frequency; + const _errs13 = errors; + if (typeof data4 !== 'string') { + validate43.errors = [ + { + instancePath: instancePath + '/repeat/frequency', + schemaPath: + '#/allOf/1/properties/repeat/properties/frequency/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema28.allOf[1].properties.repeat.properties.frequency.type, + parentSchema: + schema28.allOf[1].properties.repeat.properties.frequency, + data: data4, + }, + ]; + return false; + } + if ( + !(data4 === 'HOURLY' || data4 === 'DAILY' || data4 === 'WEEKLY') + ) { + validate43.errors = [ + { + instancePath: instancePath + '/repeat/frequency', + schemaPath: + '#/allOf/1/properties/repeat/properties/frequency/enum', + keyword: 'enum', + params: { + allowedValues: + schema28.allOf[1].properties.repeat.properties.frequency + .enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema28.allOf[1].properties.repeat.properties.frequency.enum, + parentSchema: + schema28.allOf[1].properties.repeat.properties.frequency, + data: data4, + }, + ]; + return false; + } + var valid3 = _errs13 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.until !== undefined) { + let data5 = data3.until; + const _errs15 = errors; + if (errors === _errs15) { + if (errors === _errs15) { + if (typeof data5 === 'string') { + if (!formats22.validate(data5)) { + validate43.errors = [ + { + instancePath: instancePath + '/repeat/until', + schemaPath: + '#/allOf/1/properties/repeat/properties/until/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema28.allOf[1].properties.repeat.properties.until, + data: data5, + }, + ]; + return false; + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/repeat/until', + schemaPath: + '#/allOf/1/properties/repeat/properties/until/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema28.allOf[1].properties.repeat.properties.until + .type, + parentSchema: + schema28.allOf[1].properties.repeat.properties.until, + data: data5, + }, + ]; + return false; + } + } + } + var valid3 = _errs15 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.count !== undefined) { + let data6 = data3.count; + const _errs17 = errors; + if ( + !( + typeof data6 == 'number' && + !(data6 % 1) && + !isNaN(data6) && + isFinite(data6) + ) + ) { + validate43.errors = [ + { + instancePath: instancePath + '/repeat/count', + schemaPath: + '#/allOf/1/properties/repeat/properties/count/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + schema: + schema28.allOf[1].properties.repeat.properties.count.type, + parentSchema: + schema28.allOf[1].properties.repeat.properties.count, + data: data6, + }, + ]; + return false; + } + var valid3 = _errs17 === errors; + } else { + var valid3 = true; + } + } + } + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/repeat', + schemaPath: '#/allOf/1/properties/repeat/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema28.allOf[1].properties.repeat.type, + parentSchema: schema28.allOf[1].properties.repeat, + data: data3, + }, + ]; + return false; + } + } + var valid2 = _errs11 === errors; + } else { + var valid2 = true; + } + } + } else { + validate43.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema28.allOf[1].type, + parentSchema: schema28.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs7 === errors; + } + validate43.errors = vErrors; + return errors === 0; +} +exports.validateMessage = validate44; +const schema29 = { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'Message', + 'x-location': '#/components/schemas/message', + 'x-schema-type': 'all', +}; +function validate44( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate44.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema29.required, + parentSchema: schema29, + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate44.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema29.properties.messageType.type, + parentSchema: schema29.properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate44.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema29.type, + parentSchema: schema29, + data, + }, + ]; + return false; + } + } + validate44.errors = vErrors; + return errors === 0; +} +exports.validateCommandMessage = validate45; +const schema30 = { + title: 'Command Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { messageType: { const: 'command' }, command: { type: 'string' } }, + required: ['messageType', 'command'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'CommandMessage', + 'x-location': '#/components/schemas/command_message', + 'x-schema-type': 'all', +}; +function validate45( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate45.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema30.allOf[0].required, + parentSchema: schema30.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate45.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema30.allOf[0].properties.messageType.type, + parentSchema: schema30.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate45.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema30.allOf[0].type, + parentSchema: schema30.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.command === undefined && (missing1 = 'command')) + ) { + validate45.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema30.allOf[1].required, + parentSchema: schema30.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('command' !== data1) { + validate45.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'command' }, + message: 'must be equal to constant', + schema: 'command', + parentSchema: schema30.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.command !== undefined) { + let data2 = data.command; + const _errs8 = errors; + if (typeof data2 !== 'string') { + validate45.errors = [ + { + instancePath: instancePath + '/command', + schemaPath: '#/allOf/1/properties/command/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema30.allOf[1].properties.command.type, + parentSchema: schema30.allOf[1].properties.command, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate45.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema30.allOf[1].type, + parentSchema: schema30.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate45.errors = vErrors; + return errors === 0; +} +exports.validateServiceConfig = validate46; +const schema31 = { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + 'x-standalone': true, + 'x-name': 'ServiceConfig', + 'x-location': '#/components/schemas/service_config', + 'x-schema-type': 'all', +}; +function validate46( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.serviceType === undefined && (missing0 = 'serviceType')) || + (data.serviceId === undefined && (missing0 = 'serviceId')) || + (data.remoteServiceId === undefined && (missing0 = 'remoteServiceId')) + ) { + validate46.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema31.required, + parentSchema: schema31, + data, + }, + ]; + return false; + } else { + if (data.serviceType !== undefined) { + let data0 = data.serviceType; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate46.errors = [ + { + instancePath: instancePath + '/serviceType', + schemaPath: '#/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema31.properties.serviceType, + data: data0, + }, + ]; + return false; + } + } else { + validate46.errors = [ + { + instancePath: instancePath + '/serviceType', + schemaPath: '#/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema31.properties.serviceType.type, + parentSchema: schema31.properties.serviceType, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs2 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.serviceId !== undefined) { + let data1 = data.serviceId; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate46.errors = [ + { + instancePath: instancePath + '/serviceId', + schemaPath: '#/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema31.properties.serviceId.type, + parentSchema: schema31.properties.serviceId, + data: data1, + }, + ]; + return false; + } + var valid0 = _errs4 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.remoteServiceId !== undefined) { + let data2 = data.remoteServiceId; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate46.errors = [ + { + instancePath: instancePath + '/remoteServiceId', + schemaPath: '#/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema31.properties.remoteServiceId.type, + parentSchema: schema31.properties.remoteServiceId, + data: data2, + }, + ]; + return false; + } + var valid0 = _errs6 === errors; + } else { + var valid0 = true; + } + } + } + } + } else { + validate46.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema31.type, + parentSchema: schema31, + data, + }, + ]; + return false; + } + } + validate46.errors = vErrors; + return errors === 0; +} +exports.validateCreatePeerconnectionMessage = validate47; +const schema32 = { + title: 'Create Peerconnection Message', + allOf: [ + { + title: 'Command Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { messageType: { const: 'command' }, command: { type: 'string' } }, + required: ['messageType', 'command'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + command: { const: 'createPeerconnection' }, + connectionType: { type: 'string', enum: ['webrtc', 'websocket', 'local'] }, + connectionUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + type: 'object', + required: ['serviceType', 'serviceId', 'remoteServiceId'], + title: 'Service Config', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + additionalProperties: true, + }, + }, + tiebreaker: { type: 'boolean' }, + config: { type: 'object', additionalProperties: true }, + }, + required: ['command', 'connectionType', 'connectionUrl', 'services', 'tiebreaker'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'CreatePeerconnectionMessage', + 'x-location': '#/components/schemas/create_peerconnection_message', + 'x-schema-type': 'all', +}; +function validate47( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate47.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema32.allOf[0].allOf[0].required, + parentSchema: schema32.allOf[0].allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate47.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema32.allOf[0].allOf[0].properties.messageType.type, + parentSchema: schema32.allOf[0].allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate47.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema32.allOf[0].allOf[0].type, + parentSchema: schema32.allOf[0].allOf[0], + data, + }, + ]; + return false; + } + } + var valid1 = _errs1 === errors; + if (valid1) { + const _errs6 = errors; + if (errors === _errs6) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.command === undefined && (missing1 = 'command')) + ) { + validate47.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema32.allOf[0].allOf[1].required, + parentSchema: schema32.allOf[0].allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs8 = errors; + if ('command' !== data1) { + validate47.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'command' }, + message: 'must be equal to constant', + schema: 'command', + parentSchema: schema32.allOf[0].allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid3 = _errs8 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data.command !== undefined) { + let data2 = data.command; + const _errs9 = errors; + if (typeof data2 !== 'string') { + validate47.errors = [ + { + instancePath: instancePath + '/command', + schemaPath: '#/allOf/0/allOf/1/properties/command/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema32.allOf[0].allOf[1].properties.command.type, + parentSchema: schema32.allOf[0].allOf[1].properties.command, + data: data2, + }, + ]; + return false; + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate47.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema32.allOf[0].allOf[1].type, + parentSchema: schema32.allOf[0].allOf[1], + data, + }, + ]; + return false; + } + } + var valid1 = _errs6 === errors; + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.command === undefined && (missing2 = 'command')) || + (data.connectionType === undefined && (missing2 = 'connectionType')) || + (data.connectionUrl === undefined && (missing2 = 'connectionUrl')) || + (data.services === undefined && (missing2 = 'services')) || + (data.tiebreaker === undefined && (missing2 = 'tiebreaker')) + ) { + validate47.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema32.allOf[1].required, + parentSchema: schema32.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.command !== undefined) { + let data3 = data.command; + const _errs13 = errors; + if ('createPeerconnection' !== data3) { + validate47.errors = [ + { + instancePath: instancePath + '/command', + schemaPath: '#/allOf/1/properties/command/const', + keyword: 'const', + params: { allowedValue: 'createPeerconnection' }, + message: 'must be equal to constant', + schema: 'createPeerconnection', + parentSchema: schema32.allOf[1].properties.command, + data: data3, + }, + ]; + return false; + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.connectionType !== undefined) { + let data4 = data.connectionType; + const _errs14 = errors; + if (typeof data4 !== 'string') { + validate47.errors = [ + { + instancePath: instancePath + '/connectionType', + schemaPath: '#/allOf/1/properties/connectionType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema32.allOf[1].properties.connectionType.type, + parentSchema: schema32.allOf[1].properties.connectionType, + data: data4, + }, + ]; + return false; + } + if (!(data4 === 'webrtc' || data4 === 'websocket' || data4 === 'local')) { + validate47.errors = [ + { + instancePath: instancePath + '/connectionType', + schemaPath: '#/allOf/1/properties/connectionType/enum', + keyword: 'enum', + params: { + allowedValues: schema32.allOf[1].properties.connectionType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema32.allOf[1].properties.connectionType.enum, + parentSchema: schema32.allOf[1].properties.connectionType, + data: data4, + }, + ]; + return false; + } + var valid4 = _errs14 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.connectionUrl !== undefined) { + let data5 = data.connectionUrl; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate47.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema32.allOf[1].properties.connectionUrl, + data: data5, + }, + ]; + return false; + } + } else { + validate47.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema32.allOf[1].properties.connectionUrl.type, + parentSchema: schema32.allOf[1].properties.connectionUrl, + data: data5, + }, + ]; + return false; + } + } + } + var valid4 = _errs16 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.services !== undefined) { + let data6 = data.services; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data6)) { + var valid5 = true; + const len0 = data6.length; + for (let i0 = 0; i0 < len0; i0++) { + let data7 = data6[i0]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing3; + if ( + (data7.serviceType === undefined && + (missing3 = 'serviceType')) || + (data7.serviceId === undefined && + (missing3 = 'serviceId')) || + (data7.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate47.errors = [ + { + instancePath: instancePath + '/services/' + i0, + schemaPath: + '#/allOf/1/properties/services/items/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: + "must have required property '" + missing3 + "'", + schema: + schema32.allOf[1].properties.services.items.required, + parentSchema: + schema32.allOf[1].properties.services.items, + data: data7, + }, + ]; + return false; + } else { + if (data7.serviceType !== undefined) { + let data8 = data7.serviceType; + const _errs23 = errors; + if (errors === _errs23) { + if (errors === _errs23) { + if (typeof data8 === 'string') { + if (!formats0(data8)) { + validate47.errors = [ + { + instancePath: + instancePath + + '/services/' + + i0 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema32.allOf[1].properties.services.items + .properties.serviceType, + data: data8, + }, + ]; + return false; + } + } else { + validate47.errors = [ + { + instancePath: + instancePath + + '/services/' + + i0 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema32.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema32.allOf[1].properties.services.items + .properties.serviceType, + data: data8, + }, + ]; + return false; + } + } + } + var valid6 = _errs23 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data7.serviceId !== undefined) { + let data9 = data7.serviceId; + const _errs25 = errors; + if (typeof data9 !== 'string') { + validate47.errors = [ + { + instancePath: + instancePath + '/services/' + i0 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema32.allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema32.allOf[1].properties.services.items + .properties.serviceId, + data: data9, + }, + ]; + return false; + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data7.remoteServiceId !== undefined) { + let data10 = data7.remoteServiceId; + const _errs27 = errors; + if (typeof data10 !== 'string') { + validate47.errors = [ + { + instancePath: + instancePath + + '/services/' + + i0 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema32.allOf[1].properties.services.items + .properties.remoteServiceId.type, + parentSchema: + schema32.allOf[1].properties.services.items + .properties.remoteServiceId, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + } + } + } + } else { + validate47.errors = [ + { + instancePath: instancePath + '/services/' + i0, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema32.allOf[1].properties.services.items.type, + parentSchema: schema32.allOf[1].properties.services.items, + data: data7, + }, + ]; + return false; + } + } + var valid5 = _errs20 === errors; + if (!valid5) { + break; + } + } + } else { + validate47.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema32.allOf[1].properties.services.type, + parentSchema: schema32.allOf[1].properties.services, + data: data6, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.tiebreaker !== undefined) { + let data11 = data.tiebreaker; + const _errs29 = errors; + if (typeof data11 !== 'boolean') { + validate47.errors = [ + { + instancePath: instancePath + '/tiebreaker', + schemaPath: '#/allOf/1/properties/tiebreaker/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema32.allOf[1].properties.tiebreaker.type, + parentSchema: schema32.allOf[1].properties.tiebreaker, + data: data11, + }, + ]; + return false; + } + var valid4 = _errs29 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.config !== undefined) { + let data12 = data.config; + const _errs31 = errors; + if (errors === _errs31) { + if ( + data12 && + typeof data12 == 'object' && + !Array.isArray(data12) + ) { + } else { + validate47.errors = [ + { + instancePath: instancePath + '/config', + schemaPath: '#/allOf/1/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema32.allOf[1].properties.config.type, + parentSchema: schema32.allOf[1].properties.config, + data: data12, + }, + ]; + return false; + } + } + var valid4 = _errs31 === errors; + } else { + var valid4 = true; + } + } + } + } + } + } + } + } else { + validate47.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema32.allOf[1].type, + parentSchema: schema32.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } + validate47.errors = vErrors; + return errors === 0; +} +exports.validateClosePeerconnectionMessage = validate48; +const schema33 = { + title: 'Close Peerconnection Message', + allOf: [ + { + title: 'Command Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { messageType: { const: 'command' }, command: { type: 'string' } }, + required: ['messageType', 'command'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + command: { const: 'closePeerconnection' }, + connectionUrl: { type: 'string', format: 'uri' }, + }, + required: ['command', 'connectionUrl'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'ClosePeerconnectionMessage', + 'x-location': '#/components/schemas/close_peerconnection_message', + 'x-schema-type': 'all', +}; +function validate48( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate48.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema33.allOf[0].allOf[0].required, + parentSchema: schema33.allOf[0].allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate48.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema33.allOf[0].allOf[0].properties.messageType.type, + parentSchema: schema33.allOf[0].allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate48.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema33.allOf[0].allOf[0].type, + parentSchema: schema33.allOf[0].allOf[0], + data, + }, + ]; + return false; + } + } + var valid1 = _errs1 === errors; + if (valid1) { + const _errs6 = errors; + if (errors === _errs6) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.command === undefined && (missing1 = 'command')) + ) { + validate48.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema33.allOf[0].allOf[1].required, + parentSchema: schema33.allOf[0].allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs8 = errors; + if ('command' !== data1) { + validate48.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'command' }, + message: 'must be equal to constant', + schema: 'command', + parentSchema: schema33.allOf[0].allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid3 = _errs8 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data.command !== undefined) { + let data2 = data.command; + const _errs9 = errors; + if (typeof data2 !== 'string') { + validate48.errors = [ + { + instancePath: instancePath + '/command', + schemaPath: '#/allOf/0/allOf/1/properties/command/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema33.allOf[0].allOf[1].properties.command.type, + parentSchema: schema33.allOf[0].allOf[1].properties.command, + data: data2, + }, + ]; + return false; + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate48.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema33.allOf[0].allOf[1].type, + parentSchema: schema33.allOf[0].allOf[1], + data, + }, + ]; + return false; + } + } + var valid1 = _errs6 === errors; + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.command === undefined && (missing2 = 'command')) || + (data.connectionUrl === undefined && (missing2 = 'connectionUrl')) + ) { + validate48.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema33.allOf[1].required, + parentSchema: schema33.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.command !== undefined) { + let data3 = data.command; + const _errs13 = errors; + if ('closePeerconnection' !== data3) { + validate48.errors = [ + { + instancePath: instancePath + '/command', + schemaPath: '#/allOf/1/properties/command/const', + keyword: 'const', + params: { allowedValue: 'closePeerconnection' }, + message: 'must be equal to constant', + schema: 'closePeerconnection', + parentSchema: schema33.allOf[1].properties.command, + data: data3, + }, + ]; + return false; + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.connectionUrl !== undefined) { + let data4 = data.connectionUrl; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data4 === 'string') { + if (!formats0(data4)) { + validate48.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema33.allOf[1].properties.connectionUrl, + data: data4, + }, + ]; + return false; + } + } else { + validate48.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema33.allOf[1].properties.connectionUrl.type, + parentSchema: schema33.allOf[1].properties.connectionUrl, + data: data4, + }, + ]; + return false; + } + } + } + var valid4 = _errs14 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate48.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema33.allOf[1].type, + parentSchema: schema33.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } + validate48.errors = vErrors; + return errors === 0; +} +exports.validateSignalingMessage = validate49; +const schema34 = { + title: 'Signaling Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'signaling' }, + signalingType: { type: 'string' }, + connectionUrl: { type: 'string', format: 'uri' }, + content: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'signalingType', 'connectionUrl', 'content'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'SignalingMessage', + 'x-location': '#/components/schemas/signaling_message', + 'x-schema-type': 'all', +}; +function validate49( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate49.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema34.allOf[0].required, + parentSchema: schema34.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate49.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema34.allOf[0].properties.messageType.type, + parentSchema: schema34.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate49.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema34.allOf[0].type, + parentSchema: schema34.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.signalingType === undefined && (missing1 = 'signalingType')) || + (data.connectionUrl === undefined && (missing1 = 'connectionUrl')) || + (data.content === undefined && (missing1 = 'content')) + ) { + validate49.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema34.allOf[1].required, + parentSchema: schema34.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('signaling' !== data1) { + validate49.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'signaling' }, + message: 'must be equal to constant', + schema: 'signaling', + parentSchema: schema34.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.signalingType !== undefined) { + let data2 = data.signalingType; + const _errs8 = errors; + if (typeof data2 !== 'string') { + validate49.errors = [ + { + instancePath: instancePath + '/signalingType', + schemaPath: '#/allOf/1/properties/signalingType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema34.allOf[1].properties.signalingType.type, + parentSchema: schema34.allOf[1].properties.signalingType, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.connectionUrl !== undefined) { + let data3 = data.connectionUrl; + const _errs10 = errors; + if (errors === _errs10) { + if (errors === _errs10) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + validate49.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema34.allOf[1].properties.connectionUrl, + data: data3, + }, + ]; + return false; + } + } else { + validate49.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema34.allOf[1].properties.connectionUrl.type, + parentSchema: schema34.allOf[1].properties.connectionUrl, + data: data3, + }, + ]; + return false; + } + } + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.content !== undefined) { + let data4 = data.content; + const _errs12 = errors; + if (errors === _errs12) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + } else { + validate49.errors = [ + { + instancePath: instancePath + '/content', + schemaPath: '#/allOf/1/properties/content/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema34.allOf[1].properties.content.type, + parentSchema: schema34.allOf[1].properties.content, + data: data4, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } else { + validate49.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema34.allOf[1].type, + parentSchema: schema34.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate49.errors = vErrors; + return errors === 0; +} +exports.validateConfigurationMessage = validate50; +const schema35 = { + title: 'Configuration Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'configuration' }, + configuration: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'configuration'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'ConfigurationMessage', + 'x-location': '#/components/schemas/configuration_message', + 'x-schema-type': 'all', +}; +function validate50( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate50.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema35.allOf[0].required, + parentSchema: schema35.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate50.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema35.allOf[0].properties.messageType.type, + parentSchema: schema35.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate50.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema35.allOf[0].type, + parentSchema: schema35.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.configuration === undefined && (missing1 = 'configuration')) + ) { + validate50.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema35.allOf[1].required, + parentSchema: schema35.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('configuration' !== data1) { + validate50.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'configuration' }, + message: 'must be equal to constant', + schema: 'configuration', + parentSchema: schema35.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.configuration !== undefined) { + let data2 = data.configuration; + const _errs8 = errors; + if (errors === _errs8) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + } else { + validate50.errors = [ + { + instancePath: instancePath + '/configuration', + schemaPath: '#/allOf/1/properties/configuration/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema35.allOf[1].properties.configuration.type, + parentSchema: schema35.allOf[1].properties.configuration, + data: data2, + }, + ]; + return false; + } + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate50.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema35.allOf[1].type, + parentSchema: schema35.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate50.errors = vErrors; + return errors === 0; +} +exports.validateExperimentStatusChangedMessage = validate51; +const schema36 = { + title: 'Experiment Status Changed Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'experiment-status-changed' }, + status: { type: 'string' }, + message: { type: 'string' }, + }, + required: ['messageType', 'status'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'ExperimentStatusChangedMessage', + 'x-location': '#/components/schemas/experiment_status_changed_message', + 'x-schema-type': 'all', +}; +function validate51( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate51.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema36.allOf[0].required, + parentSchema: schema36.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate51.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema36.allOf[0].properties.messageType.type, + parentSchema: schema36.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate51.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema36.allOf[0].type, + parentSchema: schema36.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.status === undefined && (missing1 = 'status')) + ) { + validate51.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema36.allOf[1].required, + parentSchema: schema36.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('experiment-status-changed' !== data1) { + validate51.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'experiment-status-changed' }, + message: 'must be equal to constant', + schema: 'experiment-status-changed', + parentSchema: schema36.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.status !== undefined) { + let data2 = data.status; + const _errs8 = errors; + if (typeof data2 !== 'string') { + validate51.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/1/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema36.allOf[1].properties.status.type, + parentSchema: schema36.allOf[1].properties.status, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.message !== undefined) { + let data3 = data.message; + const _errs10 = errors; + if (typeof data3 !== 'string') { + validate51.errors = [ + { + instancePath: instancePath + '/message', + schemaPath: '#/allOf/1/properties/message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema36.allOf[1].properties.message.type, + parentSchema: schema36.allOf[1].properties.message, + data: data3, + }, + ]; + return false; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + } + } + } + } else { + validate51.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema36.allOf[1].type, + parentSchema: schema36.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate51.errors = vErrors; + return errors === 0; +} +exports.validateLoggingMessage = validate52; +const schema37 = { + title: 'Logging Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'logging' }, + content: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'content'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'LoggingMessage', + 'x-location': '#/components/schemas/logging_message', + 'x-schema-type': 'all', +}; +function validate52( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate52.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema37.allOf[0].required, + parentSchema: schema37.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate52.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema37.allOf[0].properties.messageType.type, + parentSchema: schema37.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate52.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema37.allOf[0].type, + parentSchema: schema37.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.content === undefined && (missing1 = 'content')) + ) { + validate52.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema37.allOf[1].required, + parentSchema: schema37.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('logging' !== data1) { + validate52.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'logging' }, + message: 'must be equal to constant', + schema: 'logging', + parentSchema: schema37.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.content !== undefined) { + let data2 = data.content; + const _errs8 = errors; + if (errors === _errs8) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + } else { + validate52.errors = [ + { + instancePath: instancePath + '/content', + schemaPath: '#/allOf/1/properties/content/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema37.allOf[1].properties.content.type, + parentSchema: schema37.allOf[1].properties.content, + data: data2, + }, + ]; + return false; + } + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate52.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema37.allOf[1].type, + parentSchema: schema37.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate52.errors = vErrors; + return errors === 0; +} +exports.validateConnectionStatus = validate53; +const schema38 = { + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + 'x-standalone': true, + 'x-name': 'ConnectionStatus', + 'x-location': '#/components/schemas/peerconnection_status', + 'x-schema-type': 'all', +}; +function validate53( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate53.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema38.type, + parentSchema: schema38, + data, + }, + ]; + return false; + } + if ( + !( + data === 'new' || + data === 'connecting' || + data === 'connected' || + data === 'disconnected' || + data === 'failed' || + data === 'closed' + ) + ) { + validate53.errors = [ + { + instancePath, + schemaPath: '#/enum', + keyword: 'enum', + params: { allowedValues: schema38.enum }, + message: 'must be equal to one of the allowed values', + schema: schema38.enum, + parentSchema: schema38, + data, + }, + ]; + return false; + } + validate53.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnectionCommon = validate54; +const schema39 = { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['url', 'type', 'status'], + 'x-standalone': true, + 'x-name': 'PeerconnectionCommon', + 'x-location': '#/components/schemas/peerconnection_common', + 'x-schema-type': 'all', +}; +function validate54( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.status === undefined && (missing0 = 'status')) + ) { + validate54.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema39.required, + parentSchema: schema39, + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate54.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema39.properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate54.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema39.properties.url.type, + parentSchema: schema39.properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.type !== undefined) { + let data1 = data.type; + const _errs3 = errors; + if (typeof data1 !== 'string') { + validate54.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema39.properties.type.type, + parentSchema: schema39.properties.type, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'local' || data1 === 'webrtc')) { + validate54.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema39.properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema39.properties.type.enum, + parentSchema: schema39.properties.type, + data: data1, + }, + ]; + return false; + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.status !== undefined) { + let data2 = data.status; + const _errs5 = errors; + if (typeof data2 !== 'string') { + validate54.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema39.properties.status.type, + parentSchema: schema39.properties.status, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'new' || + data2 === 'connecting' || + data2 === 'connected' || + data2 === 'disconnected' || + data2 === 'failed' || + data2 === 'closed' + ) + ) { + validate54.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema39.properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema39.properties.status.enum, + parentSchema: schema39.properties.status, + data: data2, + }, + ]; + return false; + } + var valid0 = _errs5 === errors; + } else { + var valid0 = true; + } + } + } + } + } else { + validate54.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema39.type, + parentSchema: schema39, + data, + }, + ]; + return false; + } + } + validate54.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnectionOverview = validate55; +const schema40 = { + title: 'Peerconnection Overview', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-standalone': true, + 'x-name': 'PeerconnectionOverview', + 'x-location': '#/components/schemas/peerconnection_overview', + 'x-schema-type': 'all', +}; +function validate55( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.status === undefined && (missing0 = 'status')) + ) { + validate55.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema40.allOf[0].required, + parentSchema: schema40.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate55.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema40.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate55.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema40.allOf[0].properties.url.type, + parentSchema: schema40.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data1 = data.type; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate55.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema40.allOf[0].properties.type.type, + parentSchema: schema40.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'local' || data1 === 'webrtc')) { + validate55.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema40.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema40.allOf[0].properties.type.enum, + parentSchema: schema40.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.status !== undefined) { + let data2 = data.status; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate55.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema40.allOf[0].properties.status.type, + parentSchema: schema40.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'new' || + data2 === 'connecting' || + data2 === 'connected' || + data2 === 'disconnected' || + data2 === 'failed' || + data2 === 'closed' + ) + ) { + validate55.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema40.allOf[0].properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema40.allOf[0].properties.status.enum, + parentSchema: schema40.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate55.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema40.allOf[0].type, + parentSchema: schema40.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs8 = errors; + if (errors === _errs8) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate55.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema40.allOf[1].required, + parentSchema: schema40.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data3 = data.devices; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data3)) { + if (data3.length > 2) { + validate55.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema40.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + if (data3.length < 2) { + validate55.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema40.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data3.length; + for (let i0 = 0; i0 < len0; i0++) { + let data4 = data3[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing2; + if (data4.url === undefined && (missing2 = 'url')) { + validate55.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema40.allOf[1].properties.devices.items.required, + parentSchema: schema40.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate55.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema40.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } else { + validate55.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema40.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema40.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } + } + } + } + } else { + validate55.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema40.allOf[1].properties.devices.items.type, + parentSchema: schema40.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } + } + var valid3 = _errs12 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate55.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema40.allOf[1].properties.devices.type, + parentSchema: schema40.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } + } + } + } + } else { + validate55.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema40.allOf[1].type, + parentSchema: schema40.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs8 === errors; + } + validate55.errors = vErrors; + return errors === 0; +} +exports.validateConfiguredDeviceReference = validate56; +const schema41 = { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + 'x-standalone': true, + 'x-name': 'ConfiguredDeviceReference', + 'x-location': '#/components/schemas/configured_device_reference', + 'x-schema-type': 'all', +}; +function validate56( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.url === undefined && (missing0 = 'url')) { + validate56.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema41.required, + parentSchema: schema41, + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate56.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema41.properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate56.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema41.properties.url.type, + parentSchema: schema41.properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.config !== undefined) { + let data1 = data.config; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + if (data1.services !== undefined) { + let data2 = data1.services; + const _errs5 = errors; + if (errors === _errs5) { + if (Array.isArray(data2)) { + var valid2 = true; + const len0 = data2.length; + for (let i0 = 0; i0 < len0; i0++) { + let data3 = data2[i0]; + const _errs7 = errors; + if (errors === _errs7) { + if ( + data3 && + typeof data3 == 'object' && + !Array.isArray(data3) + ) { + let missing1; + if ( + (data3.serviceType === undefined && + (missing1 = 'serviceType')) || + (data3.serviceId === undefined && + (missing1 = 'serviceId')) || + (data3.remoteServiceId === undefined && + (missing1 = 'remoteServiceId')) + ) { + validate56.errors = [ + { + instancePath: instancePath + '/config/services/' + i0, + schemaPath: + '#/properties/config/properties/services/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema41.properties.config.properties.services.items + .required, + parentSchema: + schema41.properties.config.properties.services.items, + data: data3, + }, + ]; + return false; + } else { + if (data3.serviceType !== undefined) { + let data4 = data3.serviceType; + const _errs10 = errors; + if (errors === _errs10) { + if (errors === _errs10) { + if (typeof data4 === 'string') { + if (!formats0(data4)) { + validate56.errors = [ + { + instancePath: + instancePath + + '/config/services/' + + i0 + + '/serviceType', + schemaPath: + '#/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema41.properties.config.properties + .services.items.properties.serviceType, + data: data4, + }, + ]; + return false; + } + } else { + validate56.errors = [ + { + instancePath: + instancePath + + '/config/services/' + + i0 + + '/serviceType', + schemaPath: + '#/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema41.properties.config.properties.services + .items.properties.serviceType.type, + parentSchema: + schema41.properties.config.properties.services + .items.properties.serviceType, + data: data4, + }, + ]; + return false; + } + } + } + var valid3 = _errs10 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.serviceId !== undefined) { + let data5 = data3.serviceId; + const _errs12 = errors; + if (typeof data5 !== 'string') { + validate56.errors = [ + { + instancePath: + instancePath + + '/config/services/' + + i0 + + '/serviceId', + schemaPath: + '#/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema41.properties.config.properties.services + .items.properties.serviceId.type, + parentSchema: + schema41.properties.config.properties.services + .items.properties.serviceId, + data: data5, + }, + ]; + return false; + } + var valid3 = _errs12 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.remoteServiceId !== undefined) { + let data6 = data3.remoteServiceId; + const _errs14 = errors; + if (typeof data6 !== 'string') { + validate56.errors = [ + { + instancePath: + instancePath + + '/config/services/' + + i0 + + '/remoteServiceId', + schemaPath: + '#/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema41.properties.config.properties.services + .items.properties.remoteServiceId.type, + parentSchema: + schema41.properties.config.properties.services + .items.properties.remoteServiceId, + data: data6, + }, + ]; + return false; + } + var valid3 = _errs14 === errors; + } else { + var valid3 = true; + } + } + } + } + } else { + validate56.errors = [ + { + instancePath: instancePath + '/config/services/' + i0, + schemaPath: + '#/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema41.properties.config.properties.services.items + .type, + parentSchema: + schema41.properties.config.properties.services.items, + data: data3, + }, + ]; + return false; + } + } + var valid2 = _errs7 === errors; + if (!valid2) { + break; + } + } + } else { + validate56.errors = [ + { + instancePath: instancePath + '/config/services', + schemaPath: '#/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema41.properties.config.properties.services.type, + parentSchema: schema41.properties.config.properties.services, + data: data2, + }, + ]; + return false; + } + } + } + } else { + validate56.errors = [ + { + instancePath: instancePath + '/config', + schemaPath: '#/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema41.properties.config.type, + parentSchema: schema41.properties.config, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate56.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema41.type, + parentSchema: schema41, + data, + }, + ]; + return false; + } + } + validate56.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnection = validate57; +const schema42 = { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'Peerconnection', + 'x-location': '#/components/schemas/peerconnection', + 'x-schema-type': 'all', +}; +function validate57( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.status === undefined && (missing0 = 'status')) + ) { + validate57.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema42.allOf[0].required, + parentSchema: schema42.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate57.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema42.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate57.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema42.allOf[0].properties.url.type, + parentSchema: schema42.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data1 = data.type; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate57.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema42.allOf[0].properties.type.type, + parentSchema: schema42.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'local' || data1 === 'webrtc')) { + validate57.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema42.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema42.allOf[0].properties.type.enum, + parentSchema: schema42.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.status !== undefined) { + let data2 = data.status; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate57.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema42.allOf[0].properties.status.type, + parentSchema: schema42.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'new' || + data2 === 'connecting' || + data2 === 'connected' || + data2 === 'disconnected' || + data2 === 'failed' || + data2 === 'closed' + ) + ) { + validate57.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema42.allOf[0].properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema42.allOf[0].properties.status.enum, + parentSchema: schema42.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate57.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema42.allOf[0].type, + parentSchema: schema42.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs8 = errors; + if (errors === _errs8) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate57.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema42.allOf[1].required, + parentSchema: schema42.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data3 = data.devices; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data3)) { + if (data3.length > 2) { + validate57.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema42.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + if (data3.length < 2) { + validate57.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema42.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data3.length; + for (let i0 = 0; i0 < len0; i0++) { + let data4 = data3[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing2; + if (data4.url === undefined && (missing2 = 'url')) { + validate57.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema42.allOf[1].properties.devices.items.required, + parentSchema: schema42.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate57.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema42.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } else { + validate57.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema42.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema42.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } + } + var valid4 = _errs14 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data4.config !== undefined) { + let data6 = data4.config; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + if (data6.services !== undefined) { + let data7 = data6.services; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid6 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing3; + if ( + (data8.serviceType === undefined && + (missing3 = 'serviceType')) || + (data8.serviceId === undefined && + (missing3 = 'serviceId')) || + (data8.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate57.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: missing3, + }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema42.allOf[1].properties + .devices.items.properties.config + .properties.services.items + .required, + parentSchema: + schema42.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.serviceType !== undefined) { + let data9 = data8.serviceType; + const _errs23 = errors; + if (errors === _errs23) { + if (errors === _errs23) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate57.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema42.allOf[1] + .properties.devices + .items.properties + .config.properties + .services.items + .properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } else { + validate57.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema42.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType.type, + parentSchema: + schema42.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } + } + var valid7 = _errs23 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data8.serviceId !== undefined) { + let data10 = data8.serviceId; + const _errs25 = errors; + if (typeof data10 !== 'string') { + validate57.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema42.allOf[1].properties + .devices.items.properties + .config.properties + .services.items.properties + .serviceId.type, + parentSchema: + schema42.allOf[1].properties + .devices.items.properties + .config.properties + .services.items.properties + .serviceId, + data: data10, + }, + ]; + return false; + } + var valid7 = _errs25 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if ( + data8.remoteServiceId !== + undefined + ) { + let data11 = + data8.remoteServiceId; + const _errs27 = errors; + if (typeof data11 !== 'string') { + validate57.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema42.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId.type, + parentSchema: + schema42.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId, + data: data11, + }, + ]; + return false; + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + validate57.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema42.allOf[1].properties.devices + .items.properties.config + .properties.services.items.type, + parentSchema: + schema42.allOf[1].properties.devices + .items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } + } + var valid6 = _errs20 === errors; + if (!valid6) { + break; + } + } + } else { + validate57.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema42.allOf[1].properties.devices.items + .properties.config.properties.services + .type, + parentSchema: + schema42.allOf[1].properties.devices.items + .properties.config.properties.services, + data: data7, + }, + ]; + return false; + } + } + } + } else { + validate57.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/config', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema42.allOf[1].properties.devices.items + .properties.config.type, + parentSchema: + schema42.allOf[1].properties.devices.items + .properties.config, + data: data6, + }, + ]; + return false; + } + } + var valid4 = _errs16 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate57.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema42.allOf[1].properties.devices.items.type, + parentSchema: schema42.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } + } + var valid3 = _errs12 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate57.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema42.allOf[1].properties.devices.type, + parentSchema: schema42.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } + } + } + } + } else { + validate57.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema42.allOf[1].type, + parentSchema: schema42.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs8 === errors; + } + validate57.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnectionClosedEventCallback = validate58; +const schema43 = { + title: 'Peerconnection Closed Event Callback', + allOf: [ + { + title: 'Event Callback', + allOf: [ + { + title: 'Callback', + type: 'object', + properties: { callbackType: { type: 'string' } }, + required: ['callbackType'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + callbackType: { type: 'string', enum: ['event'] }, + eventType: { type: 'string' }, + }, + required: ['callbackType', 'eventType'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + eventType: { type: 'string', enum: ['peerconnection-closed'] }, + peerconnection: { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: [ + 'new', + 'connecting', + 'connected', + 'disconnected', + 'failed', + 'closed', + ], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + }, + required: ['eventType', 'peerconnection'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'PeerconnectionClosedEventCallback', + 'x-location': '#/components/schemas/peerconnection_closed', + 'x-schema-type': 'all', +}; +function validate58( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.callbackType === undefined && (missing0 = 'callbackType')) { + validate58.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema43.allOf[0].allOf[0].required, + parentSchema: schema43.allOf[0].allOf[0], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data0 = data.callbackType; + if (typeof data0 !== 'string') { + validate58.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/0/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema43.allOf[0].allOf[0].properties.callbackType.type, + parentSchema: schema43.allOf[0].allOf[0].properties.callbackType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate58.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema43.allOf[0].allOf[0].type, + parentSchema: schema43.allOf[0].allOf[0], + data, + }, + ]; + return false; + } + } + var valid1 = _errs1 === errors; + if (valid1) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.callbackType === undefined && (missing1 = 'callbackType')) || + (data.eventType === undefined && (missing1 = 'eventType')) + ) { + validate58.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema43.allOf[0].allOf[1].required, + parentSchema: schema43.allOf[0].allOf[1], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data1 = data.callbackType; + const _errs7 = errors; + if (typeof data1 !== 'string') { + validate58.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema43.allOf[0].allOf[1].properties.callbackType.type, + parentSchema: schema43.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'event')) { + validate58.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/enum', + keyword: 'enum', + params: { + allowedValues: + schema43.allOf[0].allOf[1].properties.callbackType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema43.allOf[0].allOf[1].properties.callbackType.enum, + parentSchema: schema43.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + var valid3 = _errs7 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data.eventType !== undefined) { + let data2 = data.eventType; + const _errs9 = errors; + if (typeof data2 !== 'string') { + validate58.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/0/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema43.allOf[0].allOf[1].properties.eventType.type, + parentSchema: schema43.allOf[0].allOf[1].properties.eventType, + data: data2, + }, + ]; + return false; + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate58.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema43.allOf[0].allOf[1].type, + parentSchema: schema43.allOf[0].allOf[1], + data, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.eventType === undefined && (missing2 = 'eventType')) || + (data.peerconnection === undefined && (missing2 = 'peerconnection')) + ) { + validate58.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema43.allOf[1].required, + parentSchema: schema43.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.eventType !== undefined) { + let data3 = data.eventType; + const _errs13 = errors; + if (typeof data3 !== 'string') { + validate58.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema43.allOf[1].properties.eventType.type, + parentSchema: schema43.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + if (!(data3 === 'peerconnection-closed')) { + validate58.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/enum', + keyword: 'enum', + params: { allowedValues: schema43.allOf[1].properties.eventType.enum }, + message: 'must be equal to one of the allowed values', + schema: schema43.allOf[1].properties.eventType.enum, + parentSchema: schema43.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.peerconnection !== undefined) { + let data4 = data.peerconnection; + const _errs15 = errors; + const _errs16 = errors; + if (errors === _errs16) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing3; + if ( + (data4.url === undefined && (missing3 = 'url')) || + (data4.type === undefined && (missing3 = 'type')) || + (data4.status === undefined && (missing3 = 'status')) + ) { + validate58.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: + schema43.allOf[1].properties.peerconnection.allOf[0].required, + parentSchema: + schema43.allOf[1].properties.peerconnection.allOf[0], + data: data4, + }, + ]; + return false; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate58.errors = [ + { + instancePath: instancePath + '/peerconnection/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema43.allOf[1].properties.peerconnection.allOf[0] + .properties.url, + data: data5, + }, + ]; + return false; + } + } else { + validate58.errors = [ + { + instancePath: instancePath + '/peerconnection/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema43.allOf[1].properties.peerconnection.allOf[0] + .properties.url.type, + parentSchema: + schema43.allOf[1].properties.peerconnection.allOf[0] + .properties.url, + data: data5, + }, + ]; + return false; + } + } + } + var valid6 = _errs18 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data4.type !== undefined) { + let data6 = data4.type; + const _errs20 = errors; + if (typeof data6 !== 'string') { + validate58.errors = [ + { + instancePath: instancePath + '/peerconnection/type', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema43.allOf[1].properties.peerconnection.allOf[0] + .properties.type.type, + parentSchema: + schema43.allOf[1].properties.peerconnection.allOf[0] + .properties.type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'local' || data6 === 'webrtc')) { + validate58.errors = [ + { + instancePath: instancePath + '/peerconnection/type', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema43.allOf[1].properties.peerconnection.allOf[0] + .properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema43.allOf[1].properties.peerconnection.allOf[0] + .properties.type.enum, + parentSchema: + schema43.allOf[1].properties.peerconnection.allOf[0] + .properties.type, + data: data6, + }, + ]; + return false; + } + var valid6 = _errs20 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data4.status !== undefined) { + let data7 = data4.status; + const _errs22 = errors; + if (typeof data7 !== 'string') { + validate58.errors = [ + { + instancePath: instancePath + '/peerconnection/status', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema43.allOf[1].properties.peerconnection.allOf[0] + .properties.status.type, + parentSchema: + schema43.allOf[1].properties.peerconnection.allOf[0] + .properties.status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'new' || + data7 === 'connecting' || + data7 === 'connected' || + data7 === 'disconnected' || + data7 === 'failed' || + data7 === 'closed' + ) + ) { + validate58.errors = [ + { + instancePath: instancePath + '/peerconnection/status', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/status/enum', + keyword: 'enum', + params: { + allowedValues: + schema43.allOf[1].properties.peerconnection.allOf[0] + .properties.status.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema43.allOf[1].properties.peerconnection.allOf[0] + .properties.status.enum, + parentSchema: + schema43.allOf[1].properties.peerconnection.allOf[0] + .properties.status, + data: data7, + }, + ]; + return false; + } + var valid6 = _errs22 === errors; + } else { + var valid6 = true; + } + } + } + } + } else { + validate58.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: '#/allOf/1/properties/peerconnection/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema43.allOf[1].properties.peerconnection.allOf[0].type, + parentSchema: schema43.allOf[1].properties.peerconnection.allOf[0], + data: data4, + }, + ]; + return false; + } + } + var valid5 = _errs16 === errors; + if (valid5) { + const _errs24 = errors; + if (errors === _errs24) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing4; + if (data4.devices === undefined && (missing4 = 'devices')) { + validate58.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: "must have required property '" + missing4 + "'", + schema: + schema43.allOf[1].properties.peerconnection.allOf[1].required, + parentSchema: + schema43.allOf[1].properties.peerconnection.allOf[1], + data: data4, + }, + ]; + return false; + } else { + if (data4.devices !== undefined) { + let data8 = data4.devices; + const _errs26 = errors; + if (errors === _errs26) { + if (Array.isArray(data8)) { + if (data8.length > 2) { + validate58.errors = [ + { + instancePath: instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: + schema43.allOf[1].properties.peerconnection.allOf[1] + .properties.devices, + data: data8, + }, + ]; + return false; + } else { + if (data8.length < 2) { + validate58.errors = [ + { + instancePath: + instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: + schema43.allOf[1].properties.peerconnection.allOf[1] + .properties.devices, + data: data8, + }, + ]; + return false; + } else { + var valid8 = true; + const len0 = data8.length; + for (let i0 = 0; i0 < len0; i0++) { + let data9 = data8[i0]; + const _errs28 = errors; + if (errors === _errs28) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing5; + if (data9.url === undefined && (missing5 = 'url')) { + validate58.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + + missing5 + + "'", + schema: + schema43.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items + .required, + parentSchema: + schema43.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items, + data: data9, + }, + ]; + return false; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs30 = errors; + if (errors === _errs30) { + if (errors === _errs30) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + validate58.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema43.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } else { + validate58.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema43.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url.type, + parentSchema: + schema43.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } + } + var valid9 = _errs30 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data9.config !== undefined) { + let data11 = data9.config; + const _errs32 = errors; + if (errors === _errs32) { + if ( + data11 && + typeof data11 == 'object' && + !Array.isArray(data11) + ) { + if (data11.services !== undefined) { + let data12 = data11.services; + const _errs34 = errors; + if (errors === _errs34) { + if (Array.isArray(data12)) { + var valid11 = true; + const len1 = data12.length; + for (let i1 = 0; i1 < len1; i1++) { + let data13 = data12[i1]; + const _errs36 = errors; + if (errors === _errs36) { + if ( + data13 && + typeof data13 == 'object' && + !Array.isArray(data13) + ) { + let missing6; + if ( + (data13.serviceType === + undefined && + (missing6 = + 'serviceType')) || + (data13.serviceId === + undefined && + (missing6 = + 'serviceId')) || + (data13.remoteServiceId === + undefined && + (missing6 = + 'remoteServiceId')) + ) { + validate58.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: + missing6, + }, + message: + "must have required property '" + + missing6 + + "'", + schema: + schema43.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items.required, + parentSchema: + schema43.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items, + data: data13, + }, + ]; + return false; + } else { + if ( + data13.serviceType !== + undefined + ) { + let data14 = + data13.serviceType; + const _errs39 = errors; + if (errors === _errs39) { + if ( + errors === _errs39 + ) { + if ( + typeof data14 === + 'string' + ) { + if ( + !formats0(data14) + ) { + validate58.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: + 'format', + params: { + format: + 'uri', + }, + message: + 'must match format "' + + 'uri' + + '"', + schema: + 'uri', + parentSchema: + schema43 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType, + data: data14, + }, + ]; + return false; + } + } else { + validate58.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: + 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema43 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType + .type, + parentSchema: + schema43 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType, + data: data14, + }, + ]; + return false; + } + } + } + var valid12 = + _errs39 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if ( + data13.serviceId !== + undefined + ) { + let data15 = + data13.serviceId; + const _errs41 = errors; + if ( + typeof data15 !== + 'string' + ) { + validate58.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema43 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices.items + .properties + .config + .properties + .services + .items + .properties + .serviceId + .type, + parentSchema: + schema43 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices.items + .properties + .config + .properties + .services + .items + .properties + .serviceId, + data: data15, + }, + ]; + return false; + } + var valid12 = + _errs41 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if ( + data13.remoteServiceId !== + undefined + ) { + let data16 = + data13.remoteServiceId; + const _errs43 = + errors; + if ( + typeof data16 !== + 'string' + ) { + validate58.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: + 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema43 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .remoteServiceId + .type, + parentSchema: + schema43 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .remoteServiceId, + data: data16, + }, + ]; + return false; + } + var valid12 = + _errs43 === errors; + } else { + var valid12 = true; + } + } + } + } + } else { + validate58.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { + type: 'object', + }, + message: 'must be object', + schema: + schema43.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items.type, + parentSchema: + schema43.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items, + data: data13, + }, + ]; + return false; + } + } + var valid11 = _errs36 === errors; + if (!valid11) { + break; + } + } + } else { + validate58.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema43.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config + .properties.services.type, + parentSchema: + schema43.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config + .properties.services, + data: data12, + }, + ]; + return false; + } + } + } + } else { + validate58.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema43.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config.type, + parentSchema: + schema43.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config, + data: data11, + }, + ]; + return false; + } + } + var valid9 = _errs32 === errors; + } else { + var valid9 = true; + } + } + } + } else { + validate58.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema43.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items.type, + parentSchema: + schema43.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items, + data: data9, + }, + ]; + return false; + } + } + var valid8 = _errs28 === errors; + if (!valid8) { + break; + } + } + } + } + } else { + validate58.errors = [ + { + instancePath: instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema43.allOf[1].properties.peerconnection.allOf[1] + .properties.devices.type, + parentSchema: + schema43.allOf[1].properties.peerconnection.allOf[1] + .properties.devices, + data: data8, + }, + ]; + return false; + } + } + } + } + } else { + validate58.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: '#/allOf/1/properties/peerconnection/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema43.allOf[1].properties.peerconnection.allOf[1].type, + parentSchema: + schema43.allOf[1].properties.peerconnection.allOf[1], + data: data4, + }, + ]; + return false; + } + } + var valid5 = _errs24 === errors; + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate58.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema43.allOf[1].type, + parentSchema: schema43.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } + validate58.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnectionStatusChangedEventCallback = validate59; +const schema44 = { + title: 'Peerconnection Status Changed Event Callback', + allOf: [ + { + title: 'Event Callback', + allOf: [ + { + title: 'Callback', + type: 'object', + properties: { callbackType: { type: 'string' } }, + required: ['callbackType'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + callbackType: { type: 'string', enum: ['event'] }, + eventType: { type: 'string' }, + }, + required: ['callbackType', 'eventType'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + eventType: { type: 'string', enum: ['peerconnection-status-changed'] }, + peerconnection: { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: [ + 'new', + 'connecting', + 'connected', + 'disconnected', + 'failed', + 'closed', + ], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + }, + required: ['eventType', 'peerconnection'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'PeerconnectionStatusChangedEventCallback', + 'x-location': '#/components/schemas/peerconnection_status_changed', + 'x-schema-type': 'all', +}; +function validate59( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.callbackType === undefined && (missing0 = 'callbackType')) { + validate59.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema44.allOf[0].allOf[0].required, + parentSchema: schema44.allOf[0].allOf[0], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data0 = data.callbackType; + if (typeof data0 !== 'string') { + validate59.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/0/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema44.allOf[0].allOf[0].properties.callbackType.type, + parentSchema: schema44.allOf[0].allOf[0].properties.callbackType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate59.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema44.allOf[0].allOf[0].type, + parentSchema: schema44.allOf[0].allOf[0], + data, + }, + ]; + return false; + } + } + var valid1 = _errs1 === errors; + if (valid1) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.callbackType === undefined && (missing1 = 'callbackType')) || + (data.eventType === undefined && (missing1 = 'eventType')) + ) { + validate59.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema44.allOf[0].allOf[1].required, + parentSchema: schema44.allOf[0].allOf[1], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data1 = data.callbackType; + const _errs7 = errors; + if (typeof data1 !== 'string') { + validate59.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema44.allOf[0].allOf[1].properties.callbackType.type, + parentSchema: schema44.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'event')) { + validate59.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/enum', + keyword: 'enum', + params: { + allowedValues: + schema44.allOf[0].allOf[1].properties.callbackType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema44.allOf[0].allOf[1].properties.callbackType.enum, + parentSchema: schema44.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + var valid3 = _errs7 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data.eventType !== undefined) { + let data2 = data.eventType; + const _errs9 = errors; + if (typeof data2 !== 'string') { + validate59.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/0/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema44.allOf[0].allOf[1].properties.eventType.type, + parentSchema: schema44.allOf[0].allOf[1].properties.eventType, + data: data2, + }, + ]; + return false; + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate59.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema44.allOf[0].allOf[1].type, + parentSchema: schema44.allOf[0].allOf[1], + data, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.eventType === undefined && (missing2 = 'eventType')) || + (data.peerconnection === undefined && (missing2 = 'peerconnection')) + ) { + validate59.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema44.allOf[1].required, + parentSchema: schema44.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.eventType !== undefined) { + let data3 = data.eventType; + const _errs13 = errors; + if (typeof data3 !== 'string') { + validate59.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema44.allOf[1].properties.eventType.type, + parentSchema: schema44.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + if (!(data3 === 'peerconnection-status-changed')) { + validate59.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/enum', + keyword: 'enum', + params: { allowedValues: schema44.allOf[1].properties.eventType.enum }, + message: 'must be equal to one of the allowed values', + schema: schema44.allOf[1].properties.eventType.enum, + parentSchema: schema44.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.peerconnection !== undefined) { + let data4 = data.peerconnection; + const _errs15 = errors; + const _errs16 = errors; + if (errors === _errs16) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing3; + if ( + (data4.url === undefined && (missing3 = 'url')) || + (data4.type === undefined && (missing3 = 'type')) || + (data4.status === undefined && (missing3 = 'status')) + ) { + validate59.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: + schema44.allOf[1].properties.peerconnection.allOf[0].required, + parentSchema: + schema44.allOf[1].properties.peerconnection.allOf[0], + data: data4, + }, + ]; + return false; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate59.errors = [ + { + instancePath: instancePath + '/peerconnection/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema44.allOf[1].properties.peerconnection.allOf[0] + .properties.url, + data: data5, + }, + ]; + return false; + } + } else { + validate59.errors = [ + { + instancePath: instancePath + '/peerconnection/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema44.allOf[1].properties.peerconnection.allOf[0] + .properties.url.type, + parentSchema: + schema44.allOf[1].properties.peerconnection.allOf[0] + .properties.url, + data: data5, + }, + ]; + return false; + } + } + } + var valid6 = _errs18 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data4.type !== undefined) { + let data6 = data4.type; + const _errs20 = errors; + if (typeof data6 !== 'string') { + validate59.errors = [ + { + instancePath: instancePath + '/peerconnection/type', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema44.allOf[1].properties.peerconnection.allOf[0] + .properties.type.type, + parentSchema: + schema44.allOf[1].properties.peerconnection.allOf[0] + .properties.type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'local' || data6 === 'webrtc')) { + validate59.errors = [ + { + instancePath: instancePath + '/peerconnection/type', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema44.allOf[1].properties.peerconnection.allOf[0] + .properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema44.allOf[1].properties.peerconnection.allOf[0] + .properties.type.enum, + parentSchema: + schema44.allOf[1].properties.peerconnection.allOf[0] + .properties.type, + data: data6, + }, + ]; + return false; + } + var valid6 = _errs20 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data4.status !== undefined) { + let data7 = data4.status; + const _errs22 = errors; + if (typeof data7 !== 'string') { + validate59.errors = [ + { + instancePath: instancePath + '/peerconnection/status', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema44.allOf[1].properties.peerconnection.allOf[0] + .properties.status.type, + parentSchema: + schema44.allOf[1].properties.peerconnection.allOf[0] + .properties.status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'new' || + data7 === 'connecting' || + data7 === 'connected' || + data7 === 'disconnected' || + data7 === 'failed' || + data7 === 'closed' + ) + ) { + validate59.errors = [ + { + instancePath: instancePath + '/peerconnection/status', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/status/enum', + keyword: 'enum', + params: { + allowedValues: + schema44.allOf[1].properties.peerconnection.allOf[0] + .properties.status.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema44.allOf[1].properties.peerconnection.allOf[0] + .properties.status.enum, + parentSchema: + schema44.allOf[1].properties.peerconnection.allOf[0] + .properties.status, + data: data7, + }, + ]; + return false; + } + var valid6 = _errs22 === errors; + } else { + var valid6 = true; + } + } + } + } + } else { + validate59.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: '#/allOf/1/properties/peerconnection/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema44.allOf[1].properties.peerconnection.allOf[0].type, + parentSchema: schema44.allOf[1].properties.peerconnection.allOf[0], + data: data4, + }, + ]; + return false; + } + } + var valid5 = _errs16 === errors; + if (valid5) { + const _errs24 = errors; + if (errors === _errs24) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing4; + if (data4.devices === undefined && (missing4 = 'devices')) { + validate59.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: "must have required property '" + missing4 + "'", + schema: + schema44.allOf[1].properties.peerconnection.allOf[1].required, + parentSchema: + schema44.allOf[1].properties.peerconnection.allOf[1], + data: data4, + }, + ]; + return false; + } else { + if (data4.devices !== undefined) { + let data8 = data4.devices; + const _errs26 = errors; + if (errors === _errs26) { + if (Array.isArray(data8)) { + if (data8.length > 2) { + validate59.errors = [ + { + instancePath: instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: + schema44.allOf[1].properties.peerconnection.allOf[1] + .properties.devices, + data: data8, + }, + ]; + return false; + } else { + if (data8.length < 2) { + validate59.errors = [ + { + instancePath: + instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: + schema44.allOf[1].properties.peerconnection.allOf[1] + .properties.devices, + data: data8, + }, + ]; + return false; + } else { + var valid8 = true; + const len0 = data8.length; + for (let i0 = 0; i0 < len0; i0++) { + let data9 = data8[i0]; + const _errs28 = errors; + if (errors === _errs28) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing5; + if (data9.url === undefined && (missing5 = 'url')) { + validate59.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + + missing5 + + "'", + schema: + schema44.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items + .required, + parentSchema: + schema44.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items, + data: data9, + }, + ]; + return false; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs30 = errors; + if (errors === _errs30) { + if (errors === _errs30) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + validate59.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema44.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } else { + validate59.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema44.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url.type, + parentSchema: + schema44.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } + } + var valid9 = _errs30 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data9.config !== undefined) { + let data11 = data9.config; + const _errs32 = errors; + if (errors === _errs32) { + if ( + data11 && + typeof data11 == 'object' && + !Array.isArray(data11) + ) { + if (data11.services !== undefined) { + let data12 = data11.services; + const _errs34 = errors; + if (errors === _errs34) { + if (Array.isArray(data12)) { + var valid11 = true; + const len1 = data12.length; + for (let i1 = 0; i1 < len1; i1++) { + let data13 = data12[i1]; + const _errs36 = errors; + if (errors === _errs36) { + if ( + data13 && + typeof data13 == 'object' && + !Array.isArray(data13) + ) { + let missing6; + if ( + (data13.serviceType === + undefined && + (missing6 = + 'serviceType')) || + (data13.serviceId === + undefined && + (missing6 = + 'serviceId')) || + (data13.remoteServiceId === + undefined && + (missing6 = + 'remoteServiceId')) + ) { + validate59.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: + missing6, + }, + message: + "must have required property '" + + missing6 + + "'", + schema: + schema44.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items.required, + parentSchema: + schema44.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items, + data: data13, + }, + ]; + return false; + } else { + if ( + data13.serviceType !== + undefined + ) { + let data14 = + data13.serviceType; + const _errs39 = errors; + if (errors === _errs39) { + if ( + errors === _errs39 + ) { + if ( + typeof data14 === + 'string' + ) { + if ( + !formats0(data14) + ) { + validate59.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: + 'format', + params: { + format: + 'uri', + }, + message: + 'must match format "' + + 'uri' + + '"', + schema: + 'uri', + parentSchema: + schema44 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType, + data: data14, + }, + ]; + return false; + } + } else { + validate59.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: + 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema44 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType + .type, + parentSchema: + schema44 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType, + data: data14, + }, + ]; + return false; + } + } + } + var valid12 = + _errs39 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if ( + data13.serviceId !== + undefined + ) { + let data15 = + data13.serviceId; + const _errs41 = errors; + if ( + typeof data15 !== + 'string' + ) { + validate59.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema44 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices.items + .properties + .config + .properties + .services + .items + .properties + .serviceId + .type, + parentSchema: + schema44 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices.items + .properties + .config + .properties + .services + .items + .properties + .serviceId, + data: data15, + }, + ]; + return false; + } + var valid12 = + _errs41 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if ( + data13.remoteServiceId !== + undefined + ) { + let data16 = + data13.remoteServiceId; + const _errs43 = + errors; + if ( + typeof data16 !== + 'string' + ) { + validate59.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: + 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema44 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .remoteServiceId + .type, + parentSchema: + schema44 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .remoteServiceId, + data: data16, + }, + ]; + return false; + } + var valid12 = + _errs43 === errors; + } else { + var valid12 = true; + } + } + } + } + } else { + validate59.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { + type: 'object', + }, + message: 'must be object', + schema: + schema44.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items.type, + parentSchema: + schema44.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items, + data: data13, + }, + ]; + return false; + } + } + var valid11 = _errs36 === errors; + if (!valid11) { + break; + } + } + } else { + validate59.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema44.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config + .properties.services.type, + parentSchema: + schema44.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config + .properties.services, + data: data12, + }, + ]; + return false; + } + } + } + } else { + validate59.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema44.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config.type, + parentSchema: + schema44.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config, + data: data11, + }, + ]; + return false; + } + } + var valid9 = _errs32 === errors; + } else { + var valid9 = true; + } + } + } + } else { + validate59.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema44.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items.type, + parentSchema: + schema44.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items, + data: data9, + }, + ]; + return false; + } + } + var valid8 = _errs28 === errors; + if (!valid8) { + break; + } + } + } + } + } else { + validate59.errors = [ + { + instancePath: instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema44.allOf[1].properties.peerconnection.allOf[1] + .properties.devices.type, + parentSchema: + schema44.allOf[1].properties.peerconnection.allOf[1] + .properties.devices, + data: data8, + }, + ]; + return false; + } + } + } + } + } else { + validate59.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: '#/allOf/1/properties/peerconnection/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema44.allOf[1].properties.peerconnection.allOf[1].type, + parentSchema: + schema44.allOf[1].properties.peerconnection.allOf[1], + data: data4, + }, + ]; + return false; + } + } + var valid5 = _errs24 === errors; + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate59.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema44.allOf[1].type, + parentSchema: schema44.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } + validate59.errors = vErrors; + return errors === 0; +} +exports.validateChangedUrl = validate60; +const schema45 = { + type: 'string', + format: 'uri', + 'x-standalone': false, + 'x-name': 'ChangedUrl', + 'x-location': '#/components/parameters/device_changed_url/schema', + 'x-schema-type': 'all', +}; +function validate60( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats0(data)) { + validate60.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema45, + data, + }, + ]; + return false; + } + } else { + validate60.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema45.type, + parentSchema: schema45, + data, + }, + ]; + return false; + } + } + } + validate60.errors = vErrors; + return errors === 0; +} +exports.validateDeviceId = validate61; +const schema46 = { + type: 'string', + format: 'uuid', + 'x-standalone': false, + 'x-name': 'DeviceId', + 'x-location': '#/components/parameters/device_id/schema', + 'x-schema-type': 'all', +}; +const formats258 = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; +function validate61( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats258.test(data)) { + validate61.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uuid' }, + message: 'must match format "' + 'uuid' + '"', + schema: 'uuid', + parentSchema: schema46, + data, + }, + ]; + return false; + } + } else { + validate61.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema46.type, + parentSchema: schema46, + data, + }, + ]; + return false; + } + } + } + validate61.errors = vErrors; + return errors === 0; +} +exports.validateFlatGroup = validate62; +const schema47 = { + type: 'boolean', + default: false, + 'x-standalone': false, + 'x-name': 'FlatGroup', + 'x-location': '#/components/parameters/flat_group/schema', + 'x-schema-type': 'all', +}; +function validate62( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'boolean') { + validate62.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema47.type, + parentSchema: schema47, + data, + }, + ]; + return false; + } + validate62.errors = vErrors; + return errors === 0; +} +exports.validateStartTime = validate63; +const schema48 = { + type: 'string', + format: 'date-time', + 'x-standalone': false, + 'x-name': 'StartTime', + 'x-location': '#/components/parameters/start_time/schema', + 'x-schema-type': 'all', +}; +function validate63( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats22.validate(data)) { + validate63.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema48, + data, + }, + ]; + return false; + } + } else { + validate63.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema48.type, + parentSchema: schema48, + data, + }, + ]; + return false; + } + } + } + validate63.errors = vErrors; + return errors === 0; +} +exports.validateEndTime = validate64; +const schema49 = { + type: 'string', + format: 'date-time', + 'x-standalone': false, + 'x-name': 'EndTime', + 'x-location': '#/components/parameters/end_time/schema', + 'x-schema-type': 'all', +}; +function validate64( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats22.validate(data)) { + validate64.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema49, + data, + }, + ]; + return false; + } + } else { + validate64.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema49.type, + parentSchema: schema49, + data, + }, + ]; + return false; + } + } + } + validate64.errors = vErrors; + return errors === 0; +} +exports.validateClosedUrl = validate65; +const schema50 = { + type: 'string', + format: 'uri', + 'x-standalone': false, + 'x-name': 'ClosedUrl', + 'x-location': '#/components/parameters/closed_url/schema', + 'x-schema-type': 'all', +}; +function validate65( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats0(data)) { + validate65.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema50, + data, + }, + ]; + return false; + } + } else { + validate65.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema50.type, + parentSchema: schema50, + data, + }, + ]; + return false; + } + } + } + validate65.errors = vErrors; + return errors === 0; +} +exports.validateStatusChangedUrl = validate66; +const schema51 = { + type: 'string', + format: 'uri', + 'x-standalone': false, + 'x-name': 'StatusChangedUrl', + 'x-location': '#/components/parameters/status_changed_url/schema', + 'x-schema-type': 'all', +}; +function validate66( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats0(data)) { + validate66.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema51, + data, + }, + ]; + return false; + } + } else { + validate66.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema51.type, + parentSchema: schema51, + data, + }, + ]; + return false; + } + } + } + validate66.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnectionId = validate67; +const schema52 = { + type: 'string', + format: 'uuid', + 'x-standalone': false, + 'x-name': 'PeerconnectionId', + 'x-location': '#/components/parameters/peerconnection_id/schema', + 'x-schema-type': 'all', +}; +function validate67( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats258.test(data)) { + validate67.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uuid' }, + message: 'must match format "' + 'uuid' + '"', + schema: 'uuid', + parentSchema: schema52, + data, + }, + ]; + return false; + } + } else { + validate67.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema52.type, + parentSchema: schema52, + data, + }, + ]; + return false; + } + } + } + validate67.errors = vErrors; + return errors === 0; +} +exports.validateDeviceUrl = validate68; +const schema53 = { + type: 'string', + format: 'uri', + 'x-standalone': false, + 'x-name': 'DeviceUrl', + 'x-location': '#/components/parameters/device_url/schema', + 'x-schema-type': 'all', +}; +function validate68( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats0(data)) { + validate68.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema53, + data, + }, + ]; + return false; + } + } else { + validate68.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema53.type, + parentSchema: schema53, + data, + }, + ]; + return false; + } + } + } + validate68.errors = vErrors; + return errors === 0; +} +exports.validateListDevicesResponse200 = validate69; +const schema54 = { + type: 'array', + items: { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + 'x-standalone': false, + 'x-name': 'listDevicesResponse200', + 'x-location': '#/paths//devices/get/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate69( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if ( + (data0.url === undefined && (missing0 = 'url')) || + (data0.type === undefined && (missing0 = 'type')) || + (data0.name === undefined && (missing0 = 'name')) || + (data0.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate69.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema54.items.required, + parentSchema: schema54.items, + data: data0, + }, + ]; + return false; + } else { + if (data0.url !== undefined) { + let data1 = data0.url; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate69.errors = [ + { + instancePath: instancePath + '/' + i0 + '/url', + schemaPath: '#/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema54.items.properties.url, + data: data1, + }, + ]; + return false; + } + } else { + validate69.errors = [ + { + instancePath: instancePath + '/' + i0 + '/url', + schemaPath: '#/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema54.items.properties.url.type, + parentSchema: schema54.items.properties.url, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.name !== undefined) { + let data2 = data0.name; + const _errs5 = errors; + if (typeof data2 !== 'string') { + validate69.errors = [ + { + instancePath: instancePath + '/' + i0 + '/name', + schemaPath: '#/items/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema54.items.properties.name.type, + parentSchema: schema54.items.properties.name, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.description !== undefined) { + let data3 = data0.description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate69.errors = [ + { + instancePath: instancePath + '/' + i0 + '/description', + schemaPath: '#/items/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema54.items.properties.description.type, + parentSchema: schema54.items.properties.description, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.type !== undefined) { + let data4 = data0.type; + const _errs9 = errors; + if (typeof data4 !== 'string') { + validate69.errors = [ + { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema54.items.properties.type.type, + parentSchema: schema54.items.properties.type, + data: data4, + }, + ]; + return false; + } + if ( + !( + data4 === 'device' || + data4 === 'group' || + data4 === 'edge instantiable' || + data4 === 'cloud instantiable' + ) + ) { + validate69.errors = [ + { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema54.items.properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema54.items.properties.type.enum, + parentSchema: schema54.items.properties.type, + data: data4, + }, + ]; + return false; + } + var valid1 = _errs9 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.isPublic !== undefined) { + let data5 = data0.isPublic; + const _errs11 = errors; + if (typeof data5 !== 'boolean') { + validate69.errors = [ + { + instancePath: instancePath + '/' + i0 + '/isPublic', + schemaPath: '#/items/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema54.items.properties.isPublic.type, + parentSchema: schema54.items.properties.isPublic, + data: data5, + }, + ]; + return false; + } + var valid1 = _errs11 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.viewer !== undefined) { + let data6 = data0.viewer; + const _errs13 = errors; + if (errors === _errs13) { + if (Array.isArray(data6)) { + var valid2 = true; + const len1 = data6.length; + for (let i1 = 0; i1 < len1; i1++) { + let data7 = data6[i1]; + const _errs15 = errors; + if (errors === _errs15) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing1; + if (data7.url === undefined && (missing1 = 'url')) { + validate69.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/viewer/' + i1, + schemaPath: + '#/items/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + + missing1 + + "'", + schema: + schema54.items.properties.viewer.items + .required, + parentSchema: + schema54.items.properties.viewer.items, + data: data7, + }, + ]; + return false; + } else { + if (data7.url !== undefined) { + let data8 = data7.url; + const _errs17 = errors; + if (errors === _errs17) { + if (errors === _errs17) { + if (typeof data8 === 'string') { + if (!formats0(data8)) { + validate69.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/viewer/' + + i1 + + '/url', + schemaPath: + '#/items/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema54.items.properties.viewer + .items.properties.url, + data: data8, + }, + ]; + return false; + } + } else { + validate69.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/viewer/' + + i1 + + '/url', + schemaPath: + '#/items/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema54.items.properties.viewer.items + .properties.url.type, + parentSchema: + schema54.items.properties.viewer.items + .properties.url, + data: data8, + }, + ]; + return false; + } + } + } + } + } + } else { + validate69.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/viewer/' + i1, + schemaPath: + '#/items/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema54.items.properties.viewer.items.type, + parentSchema: + schema54.items.properties.viewer.items, + data: data7, + }, + ]; + return false; + } + } + var valid2 = _errs15 === errors; + if (!valid2) { + break; + } + } + } else { + validate69.errors = [ + { + instancePath: instancePath + '/' + i0 + '/viewer', + schemaPath: '#/items/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema54.items.properties.viewer.type, + parentSchema: schema54.items.properties.viewer, + data: data6, + }, + ]; + return false; + } + } + var valid1 = _errs13 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.owner !== undefined) { + let data9 = data0.owner; + const _errs19 = errors; + if (errors === _errs19) { + if (Array.isArray(data9)) { + var valid4 = true; + const len2 = data9.length; + for (let i2 = 0; i2 < len2; i2++) { + let data10 = data9[i2]; + const _errs21 = errors; + if (errors === _errs21) { + if ( + data10 && + typeof data10 == 'object' && + !Array.isArray(data10) + ) { + let missing2; + if ( + data10.url === undefined && + (missing2 = 'url') + ) { + validate69.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/owner/' + i2, + schemaPath: + '#/items/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + + missing2 + + "'", + schema: + schema54.items.properties.owner.items + .required, + parentSchema: + schema54.items.properties.owner.items, + data: data10, + }, + ]; + return false; + } else { + if (data10.url !== undefined) { + let data11 = data10.url; + const _errs23 = errors; + if (errors === _errs23) { + if (errors === _errs23) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + validate69.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/owner/' + + i2 + + '/url', + schemaPath: + '#/items/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema54.items.properties.owner + .items.properties.url, + data: data11, + }, + ]; + return false; + } + } else { + validate69.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/owner/' + + i2 + + '/url', + schemaPath: + '#/items/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema54.items.properties.owner + .items.properties.url.type, + parentSchema: + schema54.items.properties.owner + .items.properties.url, + data: data11, + }, + ]; + return false; + } + } + } + } + } + } else { + validate69.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/owner/' + i2, + schemaPath: + '#/items/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema54.items.properties.owner.items.type, + parentSchema: + schema54.items.properties.owner.items, + data: data10, + }, + ]; + return false; + } + } + var valid4 = _errs21 === errors; + if (!valid4) { + break; + } + } + } else { + validate69.errors = [ + { + instancePath: instancePath + '/' + i0 + '/owner', + schemaPath: '#/items/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema54.items.properties.owner.type, + parentSchema: schema54.items.properties.owner, + data: data9, + }, + ]; + return false; + } + } + var valid1 = _errs19 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } + } else { + validate69.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema54.items.type, + parentSchema: schema54.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate69.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema54.type, + parentSchema: schema54, + data, + }, + ]; + return false; + } + } + validate69.errors = vErrors; + return errors === 0; +} +exports.validateCreateDeviceBody = validate70; +const schema55 = { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + connected: { + description: + 'If true, the device is connected to the service and can be used.\n', + type: 'boolean', + readOnly: true, + }, + announcedAvailability: { + readOnly: true, + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'createDeviceBody', + 'x-location': '#/paths//devices/post/requestBody/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate70( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema55.anyOf[0].allOf[0].required, + parentSchema: schema55.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs4 = errors; + if (errors === _errs4) { + if (errors === _errs4) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + const err1 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema55.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } else { + const err2 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[0].allOf[0].properties.url.type, + parentSchema: schema55.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err3 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema55.anyOf[0].allOf[0].properties.name, + data: data1, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err4 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema55.anyOf[0].allOf[0].properties.description, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs10 = errors; + if (typeof data3 !== 'string') { + const err5 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema55.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + const err6 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema55.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema55.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema55.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs12 = errors; + if (typeof data4 !== 'boolean') { + const err7 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema55.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema55.anyOf[0].allOf[0].properties.isPublic, + data: data4, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs14 = errors; + if (errors === _errs14) { + if (Array.isArray(data5)) { + var valid3 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + const err8 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema55.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema55.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + const err9 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema55.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } else { + const err10 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema55.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + } + } + } + } else { + const err11 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema55.anyOf[0].allOf[0].properties.viewer.items.type, + parentSchema: + schema55.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } + var valid3 = _errs16 === errors; + if (!valid3) { + break; + } + } + } else { + const err12 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema55.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema55.anyOf[0].allOf[0].properties.viewer, + data: data5, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } + var valid2 = _errs14 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs20 = errors; + if (errors === _errs20) { + if (Array.isArray(data8)) { + var valid5 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs22 = errors; + if (errors === _errs22) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + const err13 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema55.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema55.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs24 = errors; + if (errors === _errs24) { + if (errors === _errs24) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + const err14 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema55.anyOf[0].allOf[0].properties + .owner.items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } else { + const err15 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema55.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + } + } + } + } else { + const err16 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema55.anyOf[0].allOf[0].properties.owner.items + .type, + parentSchema: + schema55.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid5 = _errs22 === errors; + if (!valid5) { + break; + } + } + } else { + const err17 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema55.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema55.anyOf[0].allOf[0].properties.owner, + data: data8, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + } + var valid2 = _errs20 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } + } else { + const err18 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema55.anyOf[0].allOf[0].type, + parentSchema: schema55.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs26 = errors; + if (errors === _errs26) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data11 = data.type; + const _errs28 = errors; + if ('cloud instantiable' !== data11) { + const err19 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema55.anyOf[0].allOf[1].properties.type, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + var valid7 = _errs28 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data12 = data.instantiateUrl; + const _errs29 = errors; + if (errors === _errs29) { + if (errors === _errs29) { + if (typeof data12 === 'string') { + if (!formats0(data12)) { + const err20 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema55.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema55.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data13 = data.services; + const _errs31 = errors; + if (errors === _errs31) { + if (Array.isArray(data13)) { + var valid8 = true; + const len2 = data13.length; + for (let i2 = 0; i2 < len2; i2++) { + let data14 = data13[i2]; + const _errs33 = errors; + if (errors === _errs33) { + if (data14 && typeof data14 == 'object' && !Array.isArray(data14)) { + if (data14.serviceType !== undefined) { + let data15 = data14.serviceType; + const _errs36 = errors; + if (errors === _errs36) { + if (errors === _errs36) { + if (typeof data15 === 'string') { + if (!formats0(data15)) { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema55.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } else { + const err23 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema55.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + } + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceId !== undefined) { + let data16 = data14.serviceId; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err24 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema55.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceDirection !== undefined) { + let data17 = data14.serviceDirection; + const _errs40 = errors; + if (typeof data17 !== 'string') { + const err25 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema55.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + if ( + !( + data17 === 'consumer' || + data17 === 'producer' || + data17 === 'prosumer' + ) + ) { + const err26 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema55.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema55.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema55.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + var valid9 = _errs40 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err27 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema55.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema55.anyOf[0].allOf[1].properties.services.items, + data: data14, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid8 = _errs33 === errors; + if (!valid8) { + break; + } + } + } else { + const err28 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema55.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema55.anyOf[0].allOf[1].properties.services, + data: data13, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + } + var valid7 = _errs31 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err29 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema55.anyOf[0].allOf[1].type, + parentSchema: schema55.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + } + var valid1 = _errs26 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs42 = errors; + const _errs43 = errors; + if (errors === _errs43) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if ( + (data.url === undefined && (missing3 = 'url')) || + (data.type === undefined && (missing3 = 'type')) || + (data.name === undefined && (missing3 = 'name')) || + (data.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err30 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema55.anyOf[1].allOf[0].required, + parentSchema: schema55.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } else { + if (data.url !== undefined) { + let data18 = data.url; + const _errs45 = errors; + if (errors === _errs45) { + if (errors === _errs45) { + if (typeof data18 === 'string') { + if (!formats0(data18)) { + const err31 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema55.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } else { + const err32 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[1].allOf[0].properties.url.type, + parentSchema: schema55.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.name !== undefined) { + let data19 = data.name; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err33 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema55.anyOf[1].allOf[0].properties.name, + data: data19, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data20 = data.description; + const _errs49 = errors; + if (typeof data20 !== 'string') { + const err34 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema55.anyOf[1].allOf[0].properties.description, + data: data20, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data21 = data.type; + const _errs51 = errors; + if (typeof data21 !== 'string') { + const err35 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema55.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + if ( + !( + data21 === 'device' || + data21 === 'group' || + data21 === 'edge instantiable' || + data21 === 'cloud instantiable' + ) + ) { + const err36 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema55.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema55.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema55.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data22 = data.isPublic; + const _errs53 = errors; + if (typeof data22 !== 'boolean') { + const err37 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema55.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema55.anyOf[1].allOf[0].properties.isPublic, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + var valid11 = _errs53 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data23 = data.viewer; + const _errs55 = errors; + if (errors === _errs55) { + if (Array.isArray(data23)) { + var valid12 = true; + const len3 = data23.length; + for (let i3 = 0; i3 < len3; i3++) { + let data24 = data23[i3]; + const _errs57 = errors; + if (errors === _errs57) { + if ( + data24 && + typeof data24 == 'object' && + !Array.isArray(data24) + ) { + let missing4; + if (data24.url === undefined && (missing4 = 'url')) { + const err38 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema55.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema55.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } else { + if (data24.url !== undefined) { + let data25 = data24.url; + const _errs59 = errors; + if (errors === _errs59) { + if (errors === _errs59) { + if (typeof data25 === 'string') { + if (!formats0(data25)) { + const err39 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema55.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } else { + const err40 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[1].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema55.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + } + } + } + } else { + const err41 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema55.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema55.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + var valid12 = _errs57 === errors; + if (!valid12) { + break; + } + } + } else { + const err42 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema55.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema55.anyOf[1].allOf[0].properties.viewer, + data: data23, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid11 = _errs55 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data26 = data.owner; + const _errs61 = errors; + if (errors === _errs61) { + if (Array.isArray(data26)) { + var valid14 = true; + const len4 = data26.length; + for (let i4 = 0; i4 < len4; i4++) { + let data27 = data26[i4]; + const _errs63 = errors; + if (errors === _errs63) { + if ( + data27 && + typeof data27 == 'object' && + !Array.isArray(data27) + ) { + let missing5; + if (data27.url === undefined && (missing5 = 'url')) { + const err43 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema55.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema55.anyOf[1].allOf[0].properties.owner.items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } else { + if (data27.url !== undefined) { + let data28 = data27.url; + const _errs65 = errors; + if (errors === _errs65) { + if (errors === _errs65) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err44 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema55.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } else { + const err45 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[1].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema55.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + } + } + } + } + } else { + const err46 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema55.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema55.anyOf[1].allOf[0].properties.owner.items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } + var valid14 = _errs63 === errors; + if (!valid14) { + break; + } + } + } else { + const err47 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema55.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema55.anyOf[1].allOf[0].properties.owner, + data: data26, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var valid11 = _errs61 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } + } else { + const err48 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema55.anyOf[1].allOf[0].type, + parentSchema: schema55.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } + var valid10 = _errs43 === errors; + if (valid10) { + const _errs67 = errors; + if (errors === _errs67) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data29 = data.type; + const _errs69 = errors; + if ('device' !== data29) { + const err49 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema55.anyOf[1].allOf[1].properties.type, + data: data29, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + var valid16 = _errs69 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.connected !== undefined) { + let data30 = data.connected; + const _errs70 = errors; + if (typeof data30 !== 'boolean') { + const err50 = { + instancePath: instancePath + '/connected', + schemaPath: '#/anyOf/1/allOf/1/properties/connected/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema55.anyOf[1].allOf[1].properties.connected.type, + parentSchema: schema55.anyOf[1].allOf[1].properties.connected, + data: data30, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid16 = _errs70 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.announcedAvailability !== undefined) { + let data31 = data.announcedAvailability; + const _errs72 = errors; + if (errors === _errs72) { + if (Array.isArray(data31)) { + var valid17 = true; + const len5 = data31.length; + for (let i5 = 0; i5 < len5; i5++) { + let data32 = data31[i5]; + const _errs74 = errors; + if (errors === _errs74) { + if ( + data32 && + typeof data32 == 'object' && + !Array.isArray(data32) + ) { + if (data32.start !== undefined) { + let data33 = data32.start; + const _errs76 = errors; + if (errors === _errs76) { + if (errors === _errs76) { + if (typeof data33 === 'string') { + if (!formats22.validate(data33)) { + const err51 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema55.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } else { + const err52 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start + .type, + parentSchema: + schema55.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + } + } + var valid18 = _errs76 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data32.end !== undefined) { + let data34 = data32.end; + const _errs78 = errors; + if (errors === _errs78) { + if (errors === _errs78) { + if (typeof data34 === 'string') { + if (!formats22.validate(data34)) { + const err53 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema55.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } else { + const err54 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end + .type, + parentSchema: + schema55.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + } + var valid18 = _errs78 === errors; + } else { + var valid18 = true; + } + } + } else { + const err55 = { + instancePath: instancePath + '/announcedAvailability/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema55.anyOf[1].allOf[1].properties.announcedAvailability + .items.type, + parentSchema: + schema55.anyOf[1].allOf[1].properties.announcedAvailability + .items, + data: data32, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid17 = _errs74 === errors; + if (!valid17) { + break; + } + } + } else { + const err56 = { + instancePath: instancePath + '/announcedAvailability', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema55.anyOf[1].allOf[1].properties.announcedAvailability.type, + parentSchema: + schema55.anyOf[1].allOf[1].properties.announcedAvailability, + data: data31, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + var valid16 = _errs72 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data35 = data.experiment; + const _errs80 = errors; + if (errors === _errs80) { + if (errors === _errs80) { + if (typeof data35 === 'string') { + if (!formats0(data35)) { + const err57 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema55.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } else { + const err58 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema55.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + } + } + var valid16 = _errs80 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data36 = data.services; + const _errs82 = errors; + if (errors === _errs82) { + if (Array.isArray(data36)) { + var valid19 = true; + const len6 = data36.length; + for (let i6 = 0; i6 < len6; i6++) { + let data37 = data36[i6]; + const _errs84 = errors; + if (errors === _errs84) { + if ( + data37 && + typeof data37 == 'object' && + !Array.isArray(data37) + ) { + if (data37.serviceType !== undefined) { + let data38 = data37.serviceType; + const _errs87 = errors; + if (errors === _errs87) { + if (errors === _errs87) { + if (typeof data38 === 'string') { + if (!formats0(data38)) { + const err59 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema55.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } else { + const err60 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema55.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + } + var valid20 = _errs87 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceId !== undefined) { + let data39 = data37.serviceId; + const _errs89 = errors; + if (typeof data39 !== 'string') { + const err61 = { + instancePath: + instancePath + '/services/' + i6 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[1].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema55.anyOf[1].allOf[1].properties.services + .items.properties.serviceId, + data: data39, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs89 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceDirection !== undefined) { + let data40 = data37.serviceDirection; + const _errs91 = errors; + if (typeof data40 !== 'string') { + const err62 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema55.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + if ( + !( + data40 === 'consumer' || + data40 === 'producer' || + data40 === 'prosumer' + ) + ) { + const err63 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema55.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema55.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema55.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + var valid20 = _errs91 === errors; + } else { + var valid20 = true; + } + } + } + } else { + const err64 = { + instancePath: instancePath + '/services/' + i6, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema55.anyOf[1].allOf[1].properties.services.items + .type, + parentSchema: + schema55.anyOf[1].allOf[1].properties.services.items, + data: data37, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + var valid19 = _errs84 === errors; + if (!valid19) { + break; + } + } + } else { + const err65 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema55.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema55.anyOf[1].allOf[1].properties.services, + data: data36, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid16 = _errs82 === errors; + } else { + var valid16 = true; + } + } + } + } + } + } else { + const err66 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema55.anyOf[1].allOf[1].type, + parentSchema: schema55.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid10 = _errs67 === errors; + } + var _valid0 = _errs42 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs93 = errors; + const _errs94 = errors; + if (errors === _errs94) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.url === undefined && (missing6 = 'url')) || + (data.type === undefined && (missing6 = 'type')) || + (data.name === undefined && (missing6 = 'name')) || + (data.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err67 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema55.anyOf[2].allOf[0].required, + parentSchema: schema55.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data.url !== undefined) { + let data41 = data.url; + const _errs96 = errors; + if (errors === _errs96) { + if (errors === _errs96) { + if (typeof data41 === 'string') { + if (!formats0(data41)) { + const err68 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema55.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[2].allOf[0].properties.url.type, + parentSchema: schema55.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + var valid22 = _errs96 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.name !== undefined) { + let data42 = data.name; + const _errs98 = errors; + if (typeof data42 !== 'string') { + const err70 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema55.anyOf[2].allOf[0].properties.name, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var valid22 = _errs98 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.description !== undefined) { + let data43 = data.description; + const _errs100 = errors; + if (typeof data43 !== 'string') { + const err71 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema55.anyOf[2].allOf[0].properties.description, + data: data43, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + var valid22 = _errs100 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs102 = errors; + if (typeof data44 !== 'string') { + const err72 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema55.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + if ( + !( + data44 === 'device' || + data44 === 'group' || + data44 === 'edge instantiable' || + data44 === 'cloud instantiable' + ) + ) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema55.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema55.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema55.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid22 = _errs102 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.isPublic !== undefined) { + let data45 = data.isPublic; + const _errs104 = errors; + if (typeof data45 !== 'boolean') { + const err74 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema55.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema55.anyOf[2].allOf[0].properties.isPublic, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + var valid22 = _errs104 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.viewer !== undefined) { + let data46 = data.viewer; + const _errs106 = errors; + if (errors === _errs106) { + if (Array.isArray(data46)) { + var valid23 = true; + const len7 = data46.length; + for (let i7 = 0; i7 < len7; i7++) { + let data47 = data46[i7]; + const _errs108 = errors; + if (errors === _errs108) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + let missing7; + if (data47.url === undefined && (missing7 = 'url')) { + const err75 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema55.anyOf[2].allOf[0].properties.viewer.items + .required, + parentSchema: + schema55.anyOf[2].allOf[0].properties.viewer + .items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } else { + if (data47.url !== undefined) { + let data48 = data47.url; + const _errs110 = errors; + if (errors === _errs110) { + if (errors === _errs110) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema55.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema55.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + } + } + } else { + const err78 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema55.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema55.anyOf[2].allOf[0].properties.viewer.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + var valid23 = _errs108 === errors; + if (!valid23) { + break; + } + } + } else { + const err79 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema55.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema55.anyOf[2].allOf[0].properties.viewer, + data: data46, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + var valid22 = _errs106 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.owner !== undefined) { + let data49 = data.owner; + const _errs112 = errors; + if (errors === _errs112) { + if (Array.isArray(data49)) { + var valid25 = true; + const len8 = data49.length; + for (let i8 = 0; i8 < len8; i8++) { + let data50 = data49[i8]; + const _errs114 = errors; + if (errors === _errs114) { + if ( + data50 && + typeof data50 == 'object' && + !Array.isArray(data50) + ) { + let missing8; + if (data50.url === undefined && (missing8 = 'url')) { + const err80 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + + missing8 + + "'", + schema: + schema55.anyOf[2].allOf[0].properties.owner + .items.required, + parentSchema: + schema55.anyOf[2].allOf[0].properties.owner + .items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } else { + if (data50.url !== undefined) { + let data51 = data50.url; + const _errs116 = errors; + if (errors === _errs116) { + if (errors === _errs116) { + if (typeof data51 === 'string') { + if (!formats0(data51)) { + const err81 = { + instancePath: + instancePath + + '/owner/' + + i8 + + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema55.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } else { + const err82 = { + instancePath: + instancePath + '/owner/' + i8 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema55.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + } + } + } + } else { + const err83 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema55.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema55.anyOf[2].allOf[0].properties.owner.items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid25 = _errs114 === errors; + if (!valid25) { + break; + } + } + } else { + const err84 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema55.anyOf[2].allOf[0].properties.owner.type, + parentSchema: schema55.anyOf[2].allOf[0].properties.owner, + data: data49, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + var valid22 = _errs112 === errors; + } else { + var valid22 = true; + } + } + } + } + } + } + } + } + } else { + const err85 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema55.anyOf[2].allOf[0].type, + parentSchema: schema55.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + } + var valid21 = _errs94 === errors; + if (valid21) { + const _errs118 = errors; + if (errors === _errs118) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data52 = data.type; + const _errs120 = errors; + if ('edge instantiable' !== data52) { + const err86 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema55.anyOf[2].allOf[1].properties.type, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid27 = _errs120 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.codeUrl !== undefined) { + let data53 = data.codeUrl; + const _errs121 = errors; + if (errors === _errs121) { + if (errors === _errs121) { + if (typeof data53 === 'string') { + if (!formats0(data53)) { + const err87 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema55.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + } else { + const err88 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema55.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + } + } + var valid27 = _errs121 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.services !== undefined) { + let data54 = data.services; + const _errs123 = errors; + if (errors === _errs123) { + if (Array.isArray(data54)) { + var valid28 = true; + const len9 = data54.length; + for (let i9 = 0; i9 < len9; i9++) { + let data55 = data54[i9]; + const _errs125 = errors; + if (errors === _errs125) { + if ( + data55 && + typeof data55 == 'object' && + !Array.isArray(data55) + ) { + if (data55.serviceType !== undefined) { + let data56 = data55.serviceType; + const _errs128 = errors; + if (errors === _errs128) { + if (errors === _errs128) { + if (typeof data56 === 'string') { + if (!formats0(data56)) { + const err89 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema55.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } else { + const err90 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema55.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + } + var valid29 = _errs128 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceId !== undefined) { + let data57 = data55.serviceId; + const _errs130 = errors; + if (typeof data57 !== 'string') { + const err91 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[2].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema55.anyOf[2].allOf[1].properties.services.items + .properties.serviceId, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + var valid29 = _errs130 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceDirection !== undefined) { + let data58 = data55.serviceDirection; + const _errs132 = errors; + if (typeof data58 !== 'string') { + const err92 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema55.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + if ( + !( + data58 === 'consumer' || + data58 === 'producer' || + data58 === 'prosumer' + ) + ) { + const err93 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema55.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema55.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema55.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + var valid29 = _errs132 === errors; + } else { + var valid29 = true; + } + } + } + } else { + const err94 = { + instancePath: instancePath + '/services/' + i9, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema55.anyOf[2].allOf[1].properties.services.items.type, + parentSchema: + schema55.anyOf[2].allOf[1].properties.services.items, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid28 = _errs125 === errors; + if (!valid28) { + break; + } + } + } else { + const err95 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema55.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema55.anyOf[2].allOf[1].properties.services, + data: data54, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + var valid27 = _errs123 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err96 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema55.anyOf[2].allOf[1].type, + parentSchema: schema55.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + var valid21 = _errs118 === errors; + } + var _valid0 = _errs93 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs134 = errors; + const _errs135 = errors; + if (errors === _errs135) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if ( + (data.url === undefined && (missing9 = 'url')) || + (data.type === undefined && (missing9 = 'type')) || + (data.name === undefined && (missing9 = 'name')) || + (data.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err97 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema55.anyOf[3].allOf[0].required, + parentSchema: schema55.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } else { + if (data.url !== undefined) { + let data59 = data.url; + const _errs137 = errors; + if (errors === _errs137) { + if (errors === _errs137) { + if (typeof data59 === 'string') { + if (!formats0(data59)) { + const err98 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema55.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } else { + const err99 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[3].allOf[0].properties.url.type, + parentSchema: schema55.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + } + var valid31 = _errs137 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.name !== undefined) { + let data60 = data.name; + const _errs139 = errors; + if (typeof data60 !== 'string') { + const err100 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema55.anyOf[3].allOf[0].properties.name, + data: data60, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + var valid31 = _errs139 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.description !== undefined) { + let data61 = data.description; + const _errs141 = errors; + if (typeof data61 !== 'string') { + const err101 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema55.anyOf[3].allOf[0].properties.description, + data: data61, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid31 = _errs141 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.type !== undefined) { + let data62 = data.type; + const _errs143 = errors; + if (typeof data62 !== 'string') { + const err102 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema55.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema55.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + if ( + !( + data62 === 'device' || + data62 === 'group' || + data62 === 'edge instantiable' || + data62 === 'cloud instantiable' + ) + ) { + const err103 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema55.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema55.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema55.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + var valid31 = _errs143 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.isPublic !== undefined) { + let data63 = data.isPublic; + const _errs145 = errors; + if (typeof data63 !== 'boolean') { + const err104 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema55.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema55.anyOf[3].allOf[0].properties.isPublic, + data: data63, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + var valid31 = _errs145 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.viewer !== undefined) { + let data64 = data.viewer; + const _errs147 = errors; + if (errors === _errs147) { + if (Array.isArray(data64)) { + var valid32 = true; + const len10 = data64.length; + for (let i10 = 0; i10 < len10; i10++) { + let data65 = data64[i10]; + const _errs149 = errors; + if (errors === _errs149) { + if ( + data65 && + typeof data65 == 'object' && + !Array.isArray(data65) + ) { + let missing10; + if (data65.url === undefined && (missing10 = 'url')) { + const err105 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + + missing10 + + "'", + schema: + schema55.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema55.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } else { + if (data65.url !== undefined) { + let data66 = data65.url; + const _errs151 = errors; + if (errors === _errs151) { + if (errors === _errs151) { + if (typeof data66 === 'string') { + if (!formats0(data66)) { + const err106 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema55.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } else { + const err107 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema55.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + } + } + } + } else { + const err108 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema55.anyOf[3].allOf[0].properties.viewer.items + .type, + parentSchema: + schema55.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid32 = _errs149 === errors; + if (!valid32) { + break; + } + } + } else { + const err109 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema55.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: + schema55.anyOf[3].allOf[0].properties.viewer, + data: data64, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + } + } + var valid31 = _errs147 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.owner !== undefined) { + let data67 = data.owner; + const _errs153 = errors; + if (errors === _errs153) { + if (Array.isArray(data67)) { + var valid34 = true; + const len11 = data67.length; + for (let i11 = 0; i11 < len11; i11++) { + let data68 = data67[i11]; + const _errs155 = errors; + if (errors === _errs155) { + if ( + data68 && + typeof data68 == 'object' && + !Array.isArray(data68) + ) { + let missing11; + if ( + data68.url === undefined && + (missing11 = 'url') + ) { + const err110 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema55.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema55.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err110]; + } else { + vErrors.push(err110); + } + errors++; + } else { + if (data68.url !== undefined) { + let data69 = data68.url; + const _errs157 = errors; + if (errors === _errs157) { + if (errors === _errs157) { + if (typeof data69 === 'string') { + if (!formats0(data69)) { + const err111 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema55.anyOf[3].allOf[0] + .properties.owner.items.properties + .url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err111]; + } else { + vErrors.push(err111); + } + errors++; + } + } else { + const err112 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema55.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err112]; + } else { + vErrors.push(err112); + } + errors++; + } + } + } + } + } + } else { + const err113 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema55.anyOf[3].allOf[0].properties.owner + .items.type, + parentSchema: + schema55.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err113]; + } else { + vErrors.push(err113); + } + errors++; + } + } + var valid34 = _errs155 === errors; + if (!valid34) { + break; + } + } + } else { + const err114 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema55.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema55.anyOf[3].allOf[0].properties.owner, + data: data67, + }; + if (vErrors === null) { + vErrors = [err114]; + } else { + vErrors.push(err114); + } + errors++; + } + } + var valid31 = _errs153 === errors; + } else { + var valid31 = true; + } + } + } + } + } + } + } + } + } else { + const err115 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema55.anyOf[3].allOf[0].type, + parentSchema: schema55.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err115]; + } else { + vErrors.push(err115); + } + errors++; + } + } + var valid30 = _errs135 === errors; + if (valid30) { + const _errs159 = errors; + if (errors === _errs159) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if (data.devices === undefined && (missing12 = 'devices')) { + const err116 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema55.anyOf[3].allOf[1].required, + parentSchema: schema55.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err116]; + } else { + vErrors.push(err116); + } + errors++; + } else { + if (data.type !== undefined) { + let data70 = data.type; + const _errs161 = errors; + if ('group' !== data70) { + const err117 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema55.anyOf[3].allOf[1].properties.type, + data: data70, + }; + if (vErrors === null) { + vErrors = [err117]; + } else { + vErrors.push(err117); + } + errors++; + } + var valid36 = _errs161 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data.devices !== undefined) { + let data71 = data.devices; + const _errs162 = errors; + if (errors === _errs162) { + if (Array.isArray(data71)) { + var valid37 = true; + const len12 = data71.length; + for (let i12 = 0; i12 < len12; i12++) { + let data72 = data71[i12]; + const _errs164 = errors; + if (errors === _errs164) { + if ( + data72 && + typeof data72 == 'object' && + !Array.isArray(data72) + ) { + let missing13; + if (data72.url === undefined && (missing13 = 'url')) { + const err118 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: + "must have required property '" + missing13 + "'", + schema: + schema55.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema55.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err118]; + } else { + vErrors.push(err118); + } + errors++; + } else { + if (data72.url !== undefined) { + let data73 = data72.url; + const _errs166 = errors; + if (errors === _errs166) { + if (errors === _errs166) { + if (typeof data73 === 'string') { + if (!formats0(data73)) { + const err119 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema55.anyOf[3].allOf[1].properties + .devices.items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err119]; + } else { + vErrors.push(err119); + } + errors++; + } + } else { + const err120 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema55.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema55.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err120]; + } else { + vErrors.push(err120); + } + errors++; + } + } + } + } + } + } else { + const err121 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema55.anyOf[3].allOf[1].properties.devices.items + .type, + parentSchema: + schema55.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err121]; + } else { + vErrors.push(err121); + } + errors++; + } + } + var valid37 = _errs164 === errors; + if (!valid37) { + break; + } + } + } else { + const err122 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema55.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema55.anyOf[3].allOf[1].properties.devices, + data: data71, + }; + if (vErrors === null) { + vErrors = [err122]; + } else { + vErrors.push(err122); + } + errors++; + } + } + var valid36 = _errs162 === errors; + } else { + var valid36 = true; + } + } + } + } else { + const err123 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema55.anyOf[3].allOf[1].type, + parentSchema: schema55.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err123]; + } else { + vErrors.push(err123); + } + errors++; + } + } + var valid30 = _errs159 === errors; + } + var _valid0 = _errs134 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err124 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema55.anyOf, + parentSchema: schema55, + data, + }; + if (vErrors === null) { + vErrors = [err124]; + } else { + vErrors.push(err124); + } + errors++; + validate70.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate70.errors = vErrors; + return errors === 0; +} +exports.validateCreateDeviceResponse201 = validate71; +const schema56 = { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + connected: { + description: + 'If true, the device is connected to the service and can be used.\n', + type: 'boolean', + readOnly: true, + }, + announcedAvailability: { + readOnly: true, + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'createDeviceResponse201', + 'x-location': '#/paths//devices/post/responses/201/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate71( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema56.anyOf[0].allOf[0].required, + parentSchema: schema56.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs4 = errors; + if (errors === _errs4) { + if (errors === _errs4) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + const err1 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema56.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } else { + const err2 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[0].allOf[0].properties.url.type, + parentSchema: schema56.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err3 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema56.anyOf[0].allOf[0].properties.name, + data: data1, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err4 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema56.anyOf[0].allOf[0].properties.description, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs10 = errors; + if (typeof data3 !== 'string') { + const err5 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema56.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + const err6 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema56.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema56.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema56.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs12 = errors; + if (typeof data4 !== 'boolean') { + const err7 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema56.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema56.anyOf[0].allOf[0].properties.isPublic, + data: data4, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs14 = errors; + if (errors === _errs14) { + if (Array.isArray(data5)) { + var valid3 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + const err8 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema56.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema56.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + const err9 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema56.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } else { + const err10 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema56.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + } + } + } + } else { + const err11 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema56.anyOf[0].allOf[0].properties.viewer.items.type, + parentSchema: + schema56.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } + var valid3 = _errs16 === errors; + if (!valid3) { + break; + } + } + } else { + const err12 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema56.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema56.anyOf[0].allOf[0].properties.viewer, + data: data5, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } + var valid2 = _errs14 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs20 = errors; + if (errors === _errs20) { + if (Array.isArray(data8)) { + var valid5 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs22 = errors; + if (errors === _errs22) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + const err13 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema56.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema56.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs24 = errors; + if (errors === _errs24) { + if (errors === _errs24) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + const err14 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema56.anyOf[0].allOf[0].properties + .owner.items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } else { + const err15 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema56.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + } + } + } + } else { + const err16 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema56.anyOf[0].allOf[0].properties.owner.items + .type, + parentSchema: + schema56.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid5 = _errs22 === errors; + if (!valid5) { + break; + } + } + } else { + const err17 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema56.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema56.anyOf[0].allOf[0].properties.owner, + data: data8, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + } + var valid2 = _errs20 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } + } else { + const err18 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema56.anyOf[0].allOf[0].type, + parentSchema: schema56.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs26 = errors; + if (errors === _errs26) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data11 = data.type; + const _errs28 = errors; + if ('cloud instantiable' !== data11) { + const err19 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema56.anyOf[0].allOf[1].properties.type, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + var valid7 = _errs28 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data12 = data.instantiateUrl; + const _errs29 = errors; + if (errors === _errs29) { + if (errors === _errs29) { + if (typeof data12 === 'string') { + if (!formats0(data12)) { + const err20 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema56.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema56.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data13 = data.services; + const _errs31 = errors; + if (errors === _errs31) { + if (Array.isArray(data13)) { + var valid8 = true; + const len2 = data13.length; + for (let i2 = 0; i2 < len2; i2++) { + let data14 = data13[i2]; + const _errs33 = errors; + if (errors === _errs33) { + if (data14 && typeof data14 == 'object' && !Array.isArray(data14)) { + if (data14.serviceType !== undefined) { + let data15 = data14.serviceType; + const _errs36 = errors; + if (errors === _errs36) { + if (errors === _errs36) { + if (typeof data15 === 'string') { + if (!formats0(data15)) { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema56.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } else { + const err23 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema56.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + } + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceId !== undefined) { + let data16 = data14.serviceId; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err24 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema56.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceDirection !== undefined) { + let data17 = data14.serviceDirection; + const _errs40 = errors; + if (typeof data17 !== 'string') { + const err25 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema56.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + if ( + !( + data17 === 'consumer' || + data17 === 'producer' || + data17 === 'prosumer' + ) + ) { + const err26 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema56.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema56.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema56.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + var valid9 = _errs40 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err27 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema56.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema56.anyOf[0].allOf[1].properties.services.items, + data: data14, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid8 = _errs33 === errors; + if (!valid8) { + break; + } + } + } else { + const err28 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema56.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema56.anyOf[0].allOf[1].properties.services, + data: data13, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + } + var valid7 = _errs31 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err29 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema56.anyOf[0].allOf[1].type, + parentSchema: schema56.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + } + var valid1 = _errs26 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs42 = errors; + const _errs43 = errors; + if (errors === _errs43) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if ( + (data.url === undefined && (missing3 = 'url')) || + (data.type === undefined && (missing3 = 'type')) || + (data.name === undefined && (missing3 = 'name')) || + (data.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err30 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema56.anyOf[1].allOf[0].required, + parentSchema: schema56.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } else { + if (data.url !== undefined) { + let data18 = data.url; + const _errs45 = errors; + if (errors === _errs45) { + if (errors === _errs45) { + if (typeof data18 === 'string') { + if (!formats0(data18)) { + const err31 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema56.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } else { + const err32 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[1].allOf[0].properties.url.type, + parentSchema: schema56.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.name !== undefined) { + let data19 = data.name; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err33 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema56.anyOf[1].allOf[0].properties.name, + data: data19, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data20 = data.description; + const _errs49 = errors; + if (typeof data20 !== 'string') { + const err34 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema56.anyOf[1].allOf[0].properties.description, + data: data20, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data21 = data.type; + const _errs51 = errors; + if (typeof data21 !== 'string') { + const err35 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema56.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + if ( + !( + data21 === 'device' || + data21 === 'group' || + data21 === 'edge instantiable' || + data21 === 'cloud instantiable' + ) + ) { + const err36 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema56.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema56.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema56.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data22 = data.isPublic; + const _errs53 = errors; + if (typeof data22 !== 'boolean') { + const err37 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema56.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema56.anyOf[1].allOf[0].properties.isPublic, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + var valid11 = _errs53 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data23 = data.viewer; + const _errs55 = errors; + if (errors === _errs55) { + if (Array.isArray(data23)) { + var valid12 = true; + const len3 = data23.length; + for (let i3 = 0; i3 < len3; i3++) { + let data24 = data23[i3]; + const _errs57 = errors; + if (errors === _errs57) { + if ( + data24 && + typeof data24 == 'object' && + !Array.isArray(data24) + ) { + let missing4; + if (data24.url === undefined && (missing4 = 'url')) { + const err38 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema56.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema56.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } else { + if (data24.url !== undefined) { + let data25 = data24.url; + const _errs59 = errors; + if (errors === _errs59) { + if (errors === _errs59) { + if (typeof data25 === 'string') { + if (!formats0(data25)) { + const err39 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema56.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } else { + const err40 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[1].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema56.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + } + } + } + } else { + const err41 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema56.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema56.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + var valid12 = _errs57 === errors; + if (!valid12) { + break; + } + } + } else { + const err42 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema56.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema56.anyOf[1].allOf[0].properties.viewer, + data: data23, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid11 = _errs55 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data26 = data.owner; + const _errs61 = errors; + if (errors === _errs61) { + if (Array.isArray(data26)) { + var valid14 = true; + const len4 = data26.length; + for (let i4 = 0; i4 < len4; i4++) { + let data27 = data26[i4]; + const _errs63 = errors; + if (errors === _errs63) { + if ( + data27 && + typeof data27 == 'object' && + !Array.isArray(data27) + ) { + let missing5; + if (data27.url === undefined && (missing5 = 'url')) { + const err43 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema56.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema56.anyOf[1].allOf[0].properties.owner.items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } else { + if (data27.url !== undefined) { + let data28 = data27.url; + const _errs65 = errors; + if (errors === _errs65) { + if (errors === _errs65) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err44 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema56.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } else { + const err45 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[1].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema56.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + } + } + } + } + } else { + const err46 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema56.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema56.anyOf[1].allOf[0].properties.owner.items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } + var valid14 = _errs63 === errors; + if (!valid14) { + break; + } + } + } else { + const err47 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema56.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema56.anyOf[1].allOf[0].properties.owner, + data: data26, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var valid11 = _errs61 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } + } else { + const err48 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema56.anyOf[1].allOf[0].type, + parentSchema: schema56.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } + var valid10 = _errs43 === errors; + if (valid10) { + const _errs67 = errors; + if (errors === _errs67) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data29 = data.type; + const _errs69 = errors; + if ('device' !== data29) { + const err49 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema56.anyOf[1].allOf[1].properties.type, + data: data29, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + var valid16 = _errs69 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.connected !== undefined) { + let data30 = data.connected; + const _errs70 = errors; + if (typeof data30 !== 'boolean') { + const err50 = { + instancePath: instancePath + '/connected', + schemaPath: '#/anyOf/1/allOf/1/properties/connected/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema56.anyOf[1].allOf[1].properties.connected.type, + parentSchema: schema56.anyOf[1].allOf[1].properties.connected, + data: data30, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid16 = _errs70 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.announcedAvailability !== undefined) { + let data31 = data.announcedAvailability; + const _errs72 = errors; + if (errors === _errs72) { + if (Array.isArray(data31)) { + var valid17 = true; + const len5 = data31.length; + for (let i5 = 0; i5 < len5; i5++) { + let data32 = data31[i5]; + const _errs74 = errors; + if (errors === _errs74) { + if ( + data32 && + typeof data32 == 'object' && + !Array.isArray(data32) + ) { + if (data32.start !== undefined) { + let data33 = data32.start; + const _errs76 = errors; + if (errors === _errs76) { + if (errors === _errs76) { + if (typeof data33 === 'string') { + if (!formats22.validate(data33)) { + const err51 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema56.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } else { + const err52 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start + .type, + parentSchema: + schema56.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + } + } + var valid18 = _errs76 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data32.end !== undefined) { + let data34 = data32.end; + const _errs78 = errors; + if (errors === _errs78) { + if (errors === _errs78) { + if (typeof data34 === 'string') { + if (!formats22.validate(data34)) { + const err53 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema56.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } else { + const err54 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end + .type, + parentSchema: + schema56.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + } + var valid18 = _errs78 === errors; + } else { + var valid18 = true; + } + } + } else { + const err55 = { + instancePath: instancePath + '/announcedAvailability/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema56.anyOf[1].allOf[1].properties.announcedAvailability + .items.type, + parentSchema: + schema56.anyOf[1].allOf[1].properties.announcedAvailability + .items, + data: data32, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid17 = _errs74 === errors; + if (!valid17) { + break; + } + } + } else { + const err56 = { + instancePath: instancePath + '/announcedAvailability', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema56.anyOf[1].allOf[1].properties.announcedAvailability.type, + parentSchema: + schema56.anyOf[1].allOf[1].properties.announcedAvailability, + data: data31, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + var valid16 = _errs72 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data35 = data.experiment; + const _errs80 = errors; + if (errors === _errs80) { + if (errors === _errs80) { + if (typeof data35 === 'string') { + if (!formats0(data35)) { + const err57 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema56.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } else { + const err58 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema56.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + } + } + var valid16 = _errs80 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data36 = data.services; + const _errs82 = errors; + if (errors === _errs82) { + if (Array.isArray(data36)) { + var valid19 = true; + const len6 = data36.length; + for (let i6 = 0; i6 < len6; i6++) { + let data37 = data36[i6]; + const _errs84 = errors; + if (errors === _errs84) { + if ( + data37 && + typeof data37 == 'object' && + !Array.isArray(data37) + ) { + if (data37.serviceType !== undefined) { + let data38 = data37.serviceType; + const _errs87 = errors; + if (errors === _errs87) { + if (errors === _errs87) { + if (typeof data38 === 'string') { + if (!formats0(data38)) { + const err59 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema56.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } else { + const err60 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema56.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + } + var valid20 = _errs87 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceId !== undefined) { + let data39 = data37.serviceId; + const _errs89 = errors; + if (typeof data39 !== 'string') { + const err61 = { + instancePath: + instancePath + '/services/' + i6 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[1].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema56.anyOf[1].allOf[1].properties.services + .items.properties.serviceId, + data: data39, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs89 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceDirection !== undefined) { + let data40 = data37.serviceDirection; + const _errs91 = errors; + if (typeof data40 !== 'string') { + const err62 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema56.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + if ( + !( + data40 === 'consumer' || + data40 === 'producer' || + data40 === 'prosumer' + ) + ) { + const err63 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema56.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema56.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema56.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + var valid20 = _errs91 === errors; + } else { + var valid20 = true; + } + } + } + } else { + const err64 = { + instancePath: instancePath + '/services/' + i6, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema56.anyOf[1].allOf[1].properties.services.items + .type, + parentSchema: + schema56.anyOf[1].allOf[1].properties.services.items, + data: data37, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + var valid19 = _errs84 === errors; + if (!valid19) { + break; + } + } + } else { + const err65 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema56.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema56.anyOf[1].allOf[1].properties.services, + data: data36, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid16 = _errs82 === errors; + } else { + var valid16 = true; + } + } + } + } + } + } else { + const err66 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema56.anyOf[1].allOf[1].type, + parentSchema: schema56.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid10 = _errs67 === errors; + } + var _valid0 = _errs42 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs93 = errors; + const _errs94 = errors; + if (errors === _errs94) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.url === undefined && (missing6 = 'url')) || + (data.type === undefined && (missing6 = 'type')) || + (data.name === undefined && (missing6 = 'name')) || + (data.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err67 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema56.anyOf[2].allOf[0].required, + parentSchema: schema56.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data.url !== undefined) { + let data41 = data.url; + const _errs96 = errors; + if (errors === _errs96) { + if (errors === _errs96) { + if (typeof data41 === 'string') { + if (!formats0(data41)) { + const err68 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema56.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[2].allOf[0].properties.url.type, + parentSchema: schema56.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + var valid22 = _errs96 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.name !== undefined) { + let data42 = data.name; + const _errs98 = errors; + if (typeof data42 !== 'string') { + const err70 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema56.anyOf[2].allOf[0].properties.name, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var valid22 = _errs98 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.description !== undefined) { + let data43 = data.description; + const _errs100 = errors; + if (typeof data43 !== 'string') { + const err71 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema56.anyOf[2].allOf[0].properties.description, + data: data43, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + var valid22 = _errs100 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs102 = errors; + if (typeof data44 !== 'string') { + const err72 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema56.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + if ( + !( + data44 === 'device' || + data44 === 'group' || + data44 === 'edge instantiable' || + data44 === 'cloud instantiable' + ) + ) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema56.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema56.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema56.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid22 = _errs102 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.isPublic !== undefined) { + let data45 = data.isPublic; + const _errs104 = errors; + if (typeof data45 !== 'boolean') { + const err74 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema56.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema56.anyOf[2].allOf[0].properties.isPublic, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + var valid22 = _errs104 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.viewer !== undefined) { + let data46 = data.viewer; + const _errs106 = errors; + if (errors === _errs106) { + if (Array.isArray(data46)) { + var valid23 = true; + const len7 = data46.length; + for (let i7 = 0; i7 < len7; i7++) { + let data47 = data46[i7]; + const _errs108 = errors; + if (errors === _errs108) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + let missing7; + if (data47.url === undefined && (missing7 = 'url')) { + const err75 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema56.anyOf[2].allOf[0].properties.viewer.items + .required, + parentSchema: + schema56.anyOf[2].allOf[0].properties.viewer + .items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } else { + if (data47.url !== undefined) { + let data48 = data47.url; + const _errs110 = errors; + if (errors === _errs110) { + if (errors === _errs110) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema56.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema56.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + } + } + } else { + const err78 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema56.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema56.anyOf[2].allOf[0].properties.viewer.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + var valid23 = _errs108 === errors; + if (!valid23) { + break; + } + } + } else { + const err79 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema56.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema56.anyOf[2].allOf[0].properties.viewer, + data: data46, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + var valid22 = _errs106 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.owner !== undefined) { + let data49 = data.owner; + const _errs112 = errors; + if (errors === _errs112) { + if (Array.isArray(data49)) { + var valid25 = true; + const len8 = data49.length; + for (let i8 = 0; i8 < len8; i8++) { + let data50 = data49[i8]; + const _errs114 = errors; + if (errors === _errs114) { + if ( + data50 && + typeof data50 == 'object' && + !Array.isArray(data50) + ) { + let missing8; + if (data50.url === undefined && (missing8 = 'url')) { + const err80 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + + missing8 + + "'", + schema: + schema56.anyOf[2].allOf[0].properties.owner + .items.required, + parentSchema: + schema56.anyOf[2].allOf[0].properties.owner + .items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } else { + if (data50.url !== undefined) { + let data51 = data50.url; + const _errs116 = errors; + if (errors === _errs116) { + if (errors === _errs116) { + if (typeof data51 === 'string') { + if (!formats0(data51)) { + const err81 = { + instancePath: + instancePath + + '/owner/' + + i8 + + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema56.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } else { + const err82 = { + instancePath: + instancePath + '/owner/' + i8 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema56.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + } + } + } + } else { + const err83 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema56.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema56.anyOf[2].allOf[0].properties.owner.items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid25 = _errs114 === errors; + if (!valid25) { + break; + } + } + } else { + const err84 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema56.anyOf[2].allOf[0].properties.owner.type, + parentSchema: schema56.anyOf[2].allOf[0].properties.owner, + data: data49, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + var valid22 = _errs112 === errors; + } else { + var valid22 = true; + } + } + } + } + } + } + } + } + } else { + const err85 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema56.anyOf[2].allOf[0].type, + parentSchema: schema56.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + } + var valid21 = _errs94 === errors; + if (valid21) { + const _errs118 = errors; + if (errors === _errs118) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data52 = data.type; + const _errs120 = errors; + if ('edge instantiable' !== data52) { + const err86 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema56.anyOf[2].allOf[1].properties.type, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid27 = _errs120 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.codeUrl !== undefined) { + let data53 = data.codeUrl; + const _errs121 = errors; + if (errors === _errs121) { + if (errors === _errs121) { + if (typeof data53 === 'string') { + if (!formats0(data53)) { + const err87 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema56.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + } else { + const err88 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema56.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + } + } + var valid27 = _errs121 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.services !== undefined) { + let data54 = data.services; + const _errs123 = errors; + if (errors === _errs123) { + if (Array.isArray(data54)) { + var valid28 = true; + const len9 = data54.length; + for (let i9 = 0; i9 < len9; i9++) { + let data55 = data54[i9]; + const _errs125 = errors; + if (errors === _errs125) { + if ( + data55 && + typeof data55 == 'object' && + !Array.isArray(data55) + ) { + if (data55.serviceType !== undefined) { + let data56 = data55.serviceType; + const _errs128 = errors; + if (errors === _errs128) { + if (errors === _errs128) { + if (typeof data56 === 'string') { + if (!formats0(data56)) { + const err89 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema56.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } else { + const err90 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema56.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + } + var valid29 = _errs128 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceId !== undefined) { + let data57 = data55.serviceId; + const _errs130 = errors; + if (typeof data57 !== 'string') { + const err91 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[2].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema56.anyOf[2].allOf[1].properties.services.items + .properties.serviceId, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + var valid29 = _errs130 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceDirection !== undefined) { + let data58 = data55.serviceDirection; + const _errs132 = errors; + if (typeof data58 !== 'string') { + const err92 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema56.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + if ( + !( + data58 === 'consumer' || + data58 === 'producer' || + data58 === 'prosumer' + ) + ) { + const err93 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema56.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema56.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema56.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + var valid29 = _errs132 === errors; + } else { + var valid29 = true; + } + } + } + } else { + const err94 = { + instancePath: instancePath + '/services/' + i9, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema56.anyOf[2].allOf[1].properties.services.items.type, + parentSchema: + schema56.anyOf[2].allOf[1].properties.services.items, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid28 = _errs125 === errors; + if (!valid28) { + break; + } + } + } else { + const err95 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema56.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema56.anyOf[2].allOf[1].properties.services, + data: data54, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + var valid27 = _errs123 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err96 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema56.anyOf[2].allOf[1].type, + parentSchema: schema56.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + var valid21 = _errs118 === errors; + } + var _valid0 = _errs93 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs134 = errors; + const _errs135 = errors; + if (errors === _errs135) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if ( + (data.url === undefined && (missing9 = 'url')) || + (data.type === undefined && (missing9 = 'type')) || + (data.name === undefined && (missing9 = 'name')) || + (data.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err97 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema56.anyOf[3].allOf[0].required, + parentSchema: schema56.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } else { + if (data.url !== undefined) { + let data59 = data.url; + const _errs137 = errors; + if (errors === _errs137) { + if (errors === _errs137) { + if (typeof data59 === 'string') { + if (!formats0(data59)) { + const err98 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema56.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } else { + const err99 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[3].allOf[0].properties.url.type, + parentSchema: schema56.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + } + var valid31 = _errs137 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.name !== undefined) { + let data60 = data.name; + const _errs139 = errors; + if (typeof data60 !== 'string') { + const err100 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema56.anyOf[3].allOf[0].properties.name, + data: data60, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + var valid31 = _errs139 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.description !== undefined) { + let data61 = data.description; + const _errs141 = errors; + if (typeof data61 !== 'string') { + const err101 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema56.anyOf[3].allOf[0].properties.description, + data: data61, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid31 = _errs141 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.type !== undefined) { + let data62 = data.type; + const _errs143 = errors; + if (typeof data62 !== 'string') { + const err102 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema56.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema56.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + if ( + !( + data62 === 'device' || + data62 === 'group' || + data62 === 'edge instantiable' || + data62 === 'cloud instantiable' + ) + ) { + const err103 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema56.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema56.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema56.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + var valid31 = _errs143 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.isPublic !== undefined) { + let data63 = data.isPublic; + const _errs145 = errors; + if (typeof data63 !== 'boolean') { + const err104 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema56.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema56.anyOf[3].allOf[0].properties.isPublic, + data: data63, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + var valid31 = _errs145 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.viewer !== undefined) { + let data64 = data.viewer; + const _errs147 = errors; + if (errors === _errs147) { + if (Array.isArray(data64)) { + var valid32 = true; + const len10 = data64.length; + for (let i10 = 0; i10 < len10; i10++) { + let data65 = data64[i10]; + const _errs149 = errors; + if (errors === _errs149) { + if ( + data65 && + typeof data65 == 'object' && + !Array.isArray(data65) + ) { + let missing10; + if (data65.url === undefined && (missing10 = 'url')) { + const err105 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + + missing10 + + "'", + schema: + schema56.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema56.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } else { + if (data65.url !== undefined) { + let data66 = data65.url; + const _errs151 = errors; + if (errors === _errs151) { + if (errors === _errs151) { + if (typeof data66 === 'string') { + if (!formats0(data66)) { + const err106 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema56.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } else { + const err107 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema56.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + } + } + } + } else { + const err108 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema56.anyOf[3].allOf[0].properties.viewer.items + .type, + parentSchema: + schema56.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid32 = _errs149 === errors; + if (!valid32) { + break; + } + } + } else { + const err109 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema56.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: + schema56.anyOf[3].allOf[0].properties.viewer, + data: data64, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + } + } + var valid31 = _errs147 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.owner !== undefined) { + let data67 = data.owner; + const _errs153 = errors; + if (errors === _errs153) { + if (Array.isArray(data67)) { + var valid34 = true; + const len11 = data67.length; + for (let i11 = 0; i11 < len11; i11++) { + let data68 = data67[i11]; + const _errs155 = errors; + if (errors === _errs155) { + if ( + data68 && + typeof data68 == 'object' && + !Array.isArray(data68) + ) { + let missing11; + if ( + data68.url === undefined && + (missing11 = 'url') + ) { + const err110 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema56.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema56.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err110]; + } else { + vErrors.push(err110); + } + errors++; + } else { + if (data68.url !== undefined) { + let data69 = data68.url; + const _errs157 = errors; + if (errors === _errs157) { + if (errors === _errs157) { + if (typeof data69 === 'string') { + if (!formats0(data69)) { + const err111 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema56.anyOf[3].allOf[0] + .properties.owner.items.properties + .url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err111]; + } else { + vErrors.push(err111); + } + errors++; + } + } else { + const err112 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema56.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err112]; + } else { + vErrors.push(err112); + } + errors++; + } + } + } + } + } + } else { + const err113 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema56.anyOf[3].allOf[0].properties.owner + .items.type, + parentSchema: + schema56.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err113]; + } else { + vErrors.push(err113); + } + errors++; + } + } + var valid34 = _errs155 === errors; + if (!valid34) { + break; + } + } + } else { + const err114 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema56.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema56.anyOf[3].allOf[0].properties.owner, + data: data67, + }; + if (vErrors === null) { + vErrors = [err114]; + } else { + vErrors.push(err114); + } + errors++; + } + } + var valid31 = _errs153 === errors; + } else { + var valid31 = true; + } + } + } + } + } + } + } + } + } else { + const err115 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema56.anyOf[3].allOf[0].type, + parentSchema: schema56.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err115]; + } else { + vErrors.push(err115); + } + errors++; + } + } + var valid30 = _errs135 === errors; + if (valid30) { + const _errs159 = errors; + if (errors === _errs159) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if (data.devices === undefined && (missing12 = 'devices')) { + const err116 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema56.anyOf[3].allOf[1].required, + parentSchema: schema56.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err116]; + } else { + vErrors.push(err116); + } + errors++; + } else { + if (data.type !== undefined) { + let data70 = data.type; + const _errs161 = errors; + if ('group' !== data70) { + const err117 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema56.anyOf[3].allOf[1].properties.type, + data: data70, + }; + if (vErrors === null) { + vErrors = [err117]; + } else { + vErrors.push(err117); + } + errors++; + } + var valid36 = _errs161 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data.devices !== undefined) { + let data71 = data.devices; + const _errs162 = errors; + if (errors === _errs162) { + if (Array.isArray(data71)) { + var valid37 = true; + const len12 = data71.length; + for (let i12 = 0; i12 < len12; i12++) { + let data72 = data71[i12]; + const _errs164 = errors; + if (errors === _errs164) { + if ( + data72 && + typeof data72 == 'object' && + !Array.isArray(data72) + ) { + let missing13; + if (data72.url === undefined && (missing13 = 'url')) { + const err118 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: + "must have required property '" + missing13 + "'", + schema: + schema56.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema56.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err118]; + } else { + vErrors.push(err118); + } + errors++; + } else { + if (data72.url !== undefined) { + let data73 = data72.url; + const _errs166 = errors; + if (errors === _errs166) { + if (errors === _errs166) { + if (typeof data73 === 'string') { + if (!formats0(data73)) { + const err119 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema56.anyOf[3].allOf[1].properties + .devices.items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err119]; + } else { + vErrors.push(err119); + } + errors++; + } + } else { + const err120 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema56.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema56.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err120]; + } else { + vErrors.push(err120); + } + errors++; + } + } + } + } + } + } else { + const err121 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema56.anyOf[3].allOf[1].properties.devices.items + .type, + parentSchema: + schema56.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err121]; + } else { + vErrors.push(err121); + } + errors++; + } + } + var valid37 = _errs164 === errors; + if (!valid37) { + break; + } + } + } else { + const err122 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema56.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema56.anyOf[3].allOf[1].properties.devices, + data: data71, + }; + if (vErrors === null) { + vErrors = [err122]; + } else { + vErrors.push(err122); + } + errors++; + } + } + var valid36 = _errs162 === errors; + } else { + var valid36 = true; + } + } + } + } else { + const err123 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema56.anyOf[3].allOf[1].type, + parentSchema: schema56.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err123]; + } else { + vErrors.push(err123); + } + errors++; + } + } + var valid30 = _errs159 === errors; + } + var _valid0 = _errs134 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err124 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema56.anyOf, + parentSchema: schema56, + data, + }; + if (vErrors === null) { + vErrors = [err124]; + } else { + vErrors.push(err124); + } + errors++; + validate71.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate71.errors = vErrors; + return errors === 0; +} +exports.validateGetDeviceResponse200 = validate72; +const schema57 = { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + connected: { + description: + 'If true, the device is connected to the service and can be used.\n', + type: 'boolean', + readOnly: true, + }, + announcedAvailability: { + readOnly: true, + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'getDeviceResponse200', + 'x-location': + '#/paths//devices/{device_id}/get/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate72( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema57.anyOf[0].allOf[0].required, + parentSchema: schema57.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs4 = errors; + if (errors === _errs4) { + if (errors === _errs4) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + const err1 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema57.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } else { + const err2 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[0].allOf[0].properties.url.type, + parentSchema: schema57.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err3 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema57.anyOf[0].allOf[0].properties.name, + data: data1, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err4 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema57.anyOf[0].allOf[0].properties.description, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs10 = errors; + if (typeof data3 !== 'string') { + const err5 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema57.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + const err6 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema57.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema57.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema57.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs12 = errors; + if (typeof data4 !== 'boolean') { + const err7 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema57.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema57.anyOf[0].allOf[0].properties.isPublic, + data: data4, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs14 = errors; + if (errors === _errs14) { + if (Array.isArray(data5)) { + var valid3 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + const err8 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema57.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema57.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + const err9 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema57.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } else { + const err10 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema57.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + } + } + } + } else { + const err11 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema57.anyOf[0].allOf[0].properties.viewer.items.type, + parentSchema: + schema57.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } + var valid3 = _errs16 === errors; + if (!valid3) { + break; + } + } + } else { + const err12 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema57.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema57.anyOf[0].allOf[0].properties.viewer, + data: data5, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } + var valid2 = _errs14 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs20 = errors; + if (errors === _errs20) { + if (Array.isArray(data8)) { + var valid5 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs22 = errors; + if (errors === _errs22) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + const err13 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema57.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema57.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs24 = errors; + if (errors === _errs24) { + if (errors === _errs24) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + const err14 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema57.anyOf[0].allOf[0].properties + .owner.items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } else { + const err15 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema57.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + } + } + } + } else { + const err16 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema57.anyOf[0].allOf[0].properties.owner.items + .type, + parentSchema: + schema57.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid5 = _errs22 === errors; + if (!valid5) { + break; + } + } + } else { + const err17 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema57.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema57.anyOf[0].allOf[0].properties.owner, + data: data8, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + } + var valid2 = _errs20 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } + } else { + const err18 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema57.anyOf[0].allOf[0].type, + parentSchema: schema57.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs26 = errors; + if (errors === _errs26) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data11 = data.type; + const _errs28 = errors; + if ('cloud instantiable' !== data11) { + const err19 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema57.anyOf[0].allOf[1].properties.type, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + var valid7 = _errs28 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data12 = data.instantiateUrl; + const _errs29 = errors; + if (errors === _errs29) { + if (errors === _errs29) { + if (typeof data12 === 'string') { + if (!formats0(data12)) { + const err20 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema57.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema57.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data13 = data.services; + const _errs31 = errors; + if (errors === _errs31) { + if (Array.isArray(data13)) { + var valid8 = true; + const len2 = data13.length; + for (let i2 = 0; i2 < len2; i2++) { + let data14 = data13[i2]; + const _errs33 = errors; + if (errors === _errs33) { + if (data14 && typeof data14 == 'object' && !Array.isArray(data14)) { + if (data14.serviceType !== undefined) { + let data15 = data14.serviceType; + const _errs36 = errors; + if (errors === _errs36) { + if (errors === _errs36) { + if (typeof data15 === 'string') { + if (!formats0(data15)) { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema57.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } else { + const err23 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema57.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + } + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceId !== undefined) { + let data16 = data14.serviceId; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err24 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema57.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceDirection !== undefined) { + let data17 = data14.serviceDirection; + const _errs40 = errors; + if (typeof data17 !== 'string') { + const err25 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema57.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + if ( + !( + data17 === 'consumer' || + data17 === 'producer' || + data17 === 'prosumer' + ) + ) { + const err26 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema57.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema57.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema57.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + var valid9 = _errs40 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err27 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema57.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema57.anyOf[0].allOf[1].properties.services.items, + data: data14, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid8 = _errs33 === errors; + if (!valid8) { + break; + } + } + } else { + const err28 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema57.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema57.anyOf[0].allOf[1].properties.services, + data: data13, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + } + var valid7 = _errs31 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err29 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema57.anyOf[0].allOf[1].type, + parentSchema: schema57.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + } + var valid1 = _errs26 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs42 = errors; + const _errs43 = errors; + if (errors === _errs43) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if ( + (data.url === undefined && (missing3 = 'url')) || + (data.type === undefined && (missing3 = 'type')) || + (data.name === undefined && (missing3 = 'name')) || + (data.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err30 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema57.anyOf[1].allOf[0].required, + parentSchema: schema57.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } else { + if (data.url !== undefined) { + let data18 = data.url; + const _errs45 = errors; + if (errors === _errs45) { + if (errors === _errs45) { + if (typeof data18 === 'string') { + if (!formats0(data18)) { + const err31 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema57.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } else { + const err32 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[1].allOf[0].properties.url.type, + parentSchema: schema57.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.name !== undefined) { + let data19 = data.name; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err33 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema57.anyOf[1].allOf[0].properties.name, + data: data19, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data20 = data.description; + const _errs49 = errors; + if (typeof data20 !== 'string') { + const err34 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema57.anyOf[1].allOf[0].properties.description, + data: data20, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data21 = data.type; + const _errs51 = errors; + if (typeof data21 !== 'string') { + const err35 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema57.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + if ( + !( + data21 === 'device' || + data21 === 'group' || + data21 === 'edge instantiable' || + data21 === 'cloud instantiable' + ) + ) { + const err36 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema57.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema57.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema57.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data22 = data.isPublic; + const _errs53 = errors; + if (typeof data22 !== 'boolean') { + const err37 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema57.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema57.anyOf[1].allOf[0].properties.isPublic, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + var valid11 = _errs53 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data23 = data.viewer; + const _errs55 = errors; + if (errors === _errs55) { + if (Array.isArray(data23)) { + var valid12 = true; + const len3 = data23.length; + for (let i3 = 0; i3 < len3; i3++) { + let data24 = data23[i3]; + const _errs57 = errors; + if (errors === _errs57) { + if ( + data24 && + typeof data24 == 'object' && + !Array.isArray(data24) + ) { + let missing4; + if (data24.url === undefined && (missing4 = 'url')) { + const err38 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema57.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema57.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } else { + if (data24.url !== undefined) { + let data25 = data24.url; + const _errs59 = errors; + if (errors === _errs59) { + if (errors === _errs59) { + if (typeof data25 === 'string') { + if (!formats0(data25)) { + const err39 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema57.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } else { + const err40 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[1].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema57.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + } + } + } + } else { + const err41 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema57.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema57.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + var valid12 = _errs57 === errors; + if (!valid12) { + break; + } + } + } else { + const err42 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema57.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema57.anyOf[1].allOf[0].properties.viewer, + data: data23, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid11 = _errs55 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data26 = data.owner; + const _errs61 = errors; + if (errors === _errs61) { + if (Array.isArray(data26)) { + var valid14 = true; + const len4 = data26.length; + for (let i4 = 0; i4 < len4; i4++) { + let data27 = data26[i4]; + const _errs63 = errors; + if (errors === _errs63) { + if ( + data27 && + typeof data27 == 'object' && + !Array.isArray(data27) + ) { + let missing5; + if (data27.url === undefined && (missing5 = 'url')) { + const err43 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema57.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema57.anyOf[1].allOf[0].properties.owner.items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } else { + if (data27.url !== undefined) { + let data28 = data27.url; + const _errs65 = errors; + if (errors === _errs65) { + if (errors === _errs65) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err44 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema57.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } else { + const err45 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[1].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema57.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + } + } + } + } + } else { + const err46 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema57.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema57.anyOf[1].allOf[0].properties.owner.items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } + var valid14 = _errs63 === errors; + if (!valid14) { + break; + } + } + } else { + const err47 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema57.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema57.anyOf[1].allOf[0].properties.owner, + data: data26, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var valid11 = _errs61 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } + } else { + const err48 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema57.anyOf[1].allOf[0].type, + parentSchema: schema57.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } + var valid10 = _errs43 === errors; + if (valid10) { + const _errs67 = errors; + if (errors === _errs67) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data29 = data.type; + const _errs69 = errors; + if ('device' !== data29) { + const err49 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema57.anyOf[1].allOf[1].properties.type, + data: data29, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + var valid16 = _errs69 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.connected !== undefined) { + let data30 = data.connected; + const _errs70 = errors; + if (typeof data30 !== 'boolean') { + const err50 = { + instancePath: instancePath + '/connected', + schemaPath: '#/anyOf/1/allOf/1/properties/connected/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema57.anyOf[1].allOf[1].properties.connected.type, + parentSchema: schema57.anyOf[1].allOf[1].properties.connected, + data: data30, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid16 = _errs70 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.announcedAvailability !== undefined) { + let data31 = data.announcedAvailability; + const _errs72 = errors; + if (errors === _errs72) { + if (Array.isArray(data31)) { + var valid17 = true; + const len5 = data31.length; + for (let i5 = 0; i5 < len5; i5++) { + let data32 = data31[i5]; + const _errs74 = errors; + if (errors === _errs74) { + if ( + data32 && + typeof data32 == 'object' && + !Array.isArray(data32) + ) { + if (data32.start !== undefined) { + let data33 = data32.start; + const _errs76 = errors; + if (errors === _errs76) { + if (errors === _errs76) { + if (typeof data33 === 'string') { + if (!formats22.validate(data33)) { + const err51 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema57.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } else { + const err52 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start + .type, + parentSchema: + schema57.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + } + } + var valid18 = _errs76 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data32.end !== undefined) { + let data34 = data32.end; + const _errs78 = errors; + if (errors === _errs78) { + if (errors === _errs78) { + if (typeof data34 === 'string') { + if (!formats22.validate(data34)) { + const err53 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema57.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } else { + const err54 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end + .type, + parentSchema: + schema57.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + } + var valid18 = _errs78 === errors; + } else { + var valid18 = true; + } + } + } else { + const err55 = { + instancePath: instancePath + '/announcedAvailability/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema57.anyOf[1].allOf[1].properties.announcedAvailability + .items.type, + parentSchema: + schema57.anyOf[1].allOf[1].properties.announcedAvailability + .items, + data: data32, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid17 = _errs74 === errors; + if (!valid17) { + break; + } + } + } else { + const err56 = { + instancePath: instancePath + '/announcedAvailability', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema57.anyOf[1].allOf[1].properties.announcedAvailability.type, + parentSchema: + schema57.anyOf[1].allOf[1].properties.announcedAvailability, + data: data31, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + var valid16 = _errs72 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data35 = data.experiment; + const _errs80 = errors; + if (errors === _errs80) { + if (errors === _errs80) { + if (typeof data35 === 'string') { + if (!formats0(data35)) { + const err57 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema57.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } else { + const err58 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema57.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + } + } + var valid16 = _errs80 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data36 = data.services; + const _errs82 = errors; + if (errors === _errs82) { + if (Array.isArray(data36)) { + var valid19 = true; + const len6 = data36.length; + for (let i6 = 0; i6 < len6; i6++) { + let data37 = data36[i6]; + const _errs84 = errors; + if (errors === _errs84) { + if ( + data37 && + typeof data37 == 'object' && + !Array.isArray(data37) + ) { + if (data37.serviceType !== undefined) { + let data38 = data37.serviceType; + const _errs87 = errors; + if (errors === _errs87) { + if (errors === _errs87) { + if (typeof data38 === 'string') { + if (!formats0(data38)) { + const err59 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema57.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } else { + const err60 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema57.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + } + var valid20 = _errs87 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceId !== undefined) { + let data39 = data37.serviceId; + const _errs89 = errors; + if (typeof data39 !== 'string') { + const err61 = { + instancePath: + instancePath + '/services/' + i6 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[1].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema57.anyOf[1].allOf[1].properties.services + .items.properties.serviceId, + data: data39, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs89 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceDirection !== undefined) { + let data40 = data37.serviceDirection; + const _errs91 = errors; + if (typeof data40 !== 'string') { + const err62 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema57.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + if ( + !( + data40 === 'consumer' || + data40 === 'producer' || + data40 === 'prosumer' + ) + ) { + const err63 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema57.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema57.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema57.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + var valid20 = _errs91 === errors; + } else { + var valid20 = true; + } + } + } + } else { + const err64 = { + instancePath: instancePath + '/services/' + i6, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema57.anyOf[1].allOf[1].properties.services.items + .type, + parentSchema: + schema57.anyOf[1].allOf[1].properties.services.items, + data: data37, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + var valid19 = _errs84 === errors; + if (!valid19) { + break; + } + } + } else { + const err65 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema57.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema57.anyOf[1].allOf[1].properties.services, + data: data36, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid16 = _errs82 === errors; + } else { + var valid16 = true; + } + } + } + } + } + } else { + const err66 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema57.anyOf[1].allOf[1].type, + parentSchema: schema57.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid10 = _errs67 === errors; + } + var _valid0 = _errs42 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs93 = errors; + const _errs94 = errors; + if (errors === _errs94) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.url === undefined && (missing6 = 'url')) || + (data.type === undefined && (missing6 = 'type')) || + (data.name === undefined && (missing6 = 'name')) || + (data.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err67 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema57.anyOf[2].allOf[0].required, + parentSchema: schema57.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data.url !== undefined) { + let data41 = data.url; + const _errs96 = errors; + if (errors === _errs96) { + if (errors === _errs96) { + if (typeof data41 === 'string') { + if (!formats0(data41)) { + const err68 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema57.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[2].allOf[0].properties.url.type, + parentSchema: schema57.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + var valid22 = _errs96 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.name !== undefined) { + let data42 = data.name; + const _errs98 = errors; + if (typeof data42 !== 'string') { + const err70 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema57.anyOf[2].allOf[0].properties.name, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var valid22 = _errs98 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.description !== undefined) { + let data43 = data.description; + const _errs100 = errors; + if (typeof data43 !== 'string') { + const err71 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema57.anyOf[2].allOf[0].properties.description, + data: data43, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + var valid22 = _errs100 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs102 = errors; + if (typeof data44 !== 'string') { + const err72 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema57.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + if ( + !( + data44 === 'device' || + data44 === 'group' || + data44 === 'edge instantiable' || + data44 === 'cloud instantiable' + ) + ) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema57.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema57.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema57.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid22 = _errs102 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.isPublic !== undefined) { + let data45 = data.isPublic; + const _errs104 = errors; + if (typeof data45 !== 'boolean') { + const err74 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema57.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema57.anyOf[2].allOf[0].properties.isPublic, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + var valid22 = _errs104 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.viewer !== undefined) { + let data46 = data.viewer; + const _errs106 = errors; + if (errors === _errs106) { + if (Array.isArray(data46)) { + var valid23 = true; + const len7 = data46.length; + for (let i7 = 0; i7 < len7; i7++) { + let data47 = data46[i7]; + const _errs108 = errors; + if (errors === _errs108) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + let missing7; + if (data47.url === undefined && (missing7 = 'url')) { + const err75 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema57.anyOf[2].allOf[0].properties.viewer.items + .required, + parentSchema: + schema57.anyOf[2].allOf[0].properties.viewer + .items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } else { + if (data47.url !== undefined) { + let data48 = data47.url; + const _errs110 = errors; + if (errors === _errs110) { + if (errors === _errs110) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema57.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema57.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + } + } + } else { + const err78 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema57.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema57.anyOf[2].allOf[0].properties.viewer.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + var valid23 = _errs108 === errors; + if (!valid23) { + break; + } + } + } else { + const err79 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema57.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema57.anyOf[2].allOf[0].properties.viewer, + data: data46, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + var valid22 = _errs106 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.owner !== undefined) { + let data49 = data.owner; + const _errs112 = errors; + if (errors === _errs112) { + if (Array.isArray(data49)) { + var valid25 = true; + const len8 = data49.length; + for (let i8 = 0; i8 < len8; i8++) { + let data50 = data49[i8]; + const _errs114 = errors; + if (errors === _errs114) { + if ( + data50 && + typeof data50 == 'object' && + !Array.isArray(data50) + ) { + let missing8; + if (data50.url === undefined && (missing8 = 'url')) { + const err80 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + + missing8 + + "'", + schema: + schema57.anyOf[2].allOf[0].properties.owner + .items.required, + parentSchema: + schema57.anyOf[2].allOf[0].properties.owner + .items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } else { + if (data50.url !== undefined) { + let data51 = data50.url; + const _errs116 = errors; + if (errors === _errs116) { + if (errors === _errs116) { + if (typeof data51 === 'string') { + if (!formats0(data51)) { + const err81 = { + instancePath: + instancePath + + '/owner/' + + i8 + + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema57.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } else { + const err82 = { + instancePath: + instancePath + '/owner/' + i8 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema57.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + } + } + } + } else { + const err83 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema57.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema57.anyOf[2].allOf[0].properties.owner.items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid25 = _errs114 === errors; + if (!valid25) { + break; + } + } + } else { + const err84 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema57.anyOf[2].allOf[0].properties.owner.type, + parentSchema: schema57.anyOf[2].allOf[0].properties.owner, + data: data49, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + var valid22 = _errs112 === errors; + } else { + var valid22 = true; + } + } + } + } + } + } + } + } + } else { + const err85 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema57.anyOf[2].allOf[0].type, + parentSchema: schema57.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + } + var valid21 = _errs94 === errors; + if (valid21) { + const _errs118 = errors; + if (errors === _errs118) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data52 = data.type; + const _errs120 = errors; + if ('edge instantiable' !== data52) { + const err86 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema57.anyOf[2].allOf[1].properties.type, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid27 = _errs120 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.codeUrl !== undefined) { + let data53 = data.codeUrl; + const _errs121 = errors; + if (errors === _errs121) { + if (errors === _errs121) { + if (typeof data53 === 'string') { + if (!formats0(data53)) { + const err87 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema57.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + } else { + const err88 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema57.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + } + } + var valid27 = _errs121 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.services !== undefined) { + let data54 = data.services; + const _errs123 = errors; + if (errors === _errs123) { + if (Array.isArray(data54)) { + var valid28 = true; + const len9 = data54.length; + for (let i9 = 0; i9 < len9; i9++) { + let data55 = data54[i9]; + const _errs125 = errors; + if (errors === _errs125) { + if ( + data55 && + typeof data55 == 'object' && + !Array.isArray(data55) + ) { + if (data55.serviceType !== undefined) { + let data56 = data55.serviceType; + const _errs128 = errors; + if (errors === _errs128) { + if (errors === _errs128) { + if (typeof data56 === 'string') { + if (!formats0(data56)) { + const err89 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema57.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } else { + const err90 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema57.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + } + var valid29 = _errs128 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceId !== undefined) { + let data57 = data55.serviceId; + const _errs130 = errors; + if (typeof data57 !== 'string') { + const err91 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[2].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema57.anyOf[2].allOf[1].properties.services.items + .properties.serviceId, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + var valid29 = _errs130 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceDirection !== undefined) { + let data58 = data55.serviceDirection; + const _errs132 = errors; + if (typeof data58 !== 'string') { + const err92 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema57.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + if ( + !( + data58 === 'consumer' || + data58 === 'producer' || + data58 === 'prosumer' + ) + ) { + const err93 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema57.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema57.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema57.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + var valid29 = _errs132 === errors; + } else { + var valid29 = true; + } + } + } + } else { + const err94 = { + instancePath: instancePath + '/services/' + i9, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema57.anyOf[2].allOf[1].properties.services.items.type, + parentSchema: + schema57.anyOf[2].allOf[1].properties.services.items, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid28 = _errs125 === errors; + if (!valid28) { + break; + } + } + } else { + const err95 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema57.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema57.anyOf[2].allOf[1].properties.services, + data: data54, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + var valid27 = _errs123 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err96 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema57.anyOf[2].allOf[1].type, + parentSchema: schema57.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + var valid21 = _errs118 === errors; + } + var _valid0 = _errs93 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs134 = errors; + const _errs135 = errors; + if (errors === _errs135) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if ( + (data.url === undefined && (missing9 = 'url')) || + (data.type === undefined && (missing9 = 'type')) || + (data.name === undefined && (missing9 = 'name')) || + (data.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err97 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema57.anyOf[3].allOf[0].required, + parentSchema: schema57.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } else { + if (data.url !== undefined) { + let data59 = data.url; + const _errs137 = errors; + if (errors === _errs137) { + if (errors === _errs137) { + if (typeof data59 === 'string') { + if (!formats0(data59)) { + const err98 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema57.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } else { + const err99 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[3].allOf[0].properties.url.type, + parentSchema: schema57.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + } + var valid31 = _errs137 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.name !== undefined) { + let data60 = data.name; + const _errs139 = errors; + if (typeof data60 !== 'string') { + const err100 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema57.anyOf[3].allOf[0].properties.name, + data: data60, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + var valid31 = _errs139 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.description !== undefined) { + let data61 = data.description; + const _errs141 = errors; + if (typeof data61 !== 'string') { + const err101 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema57.anyOf[3].allOf[0].properties.description, + data: data61, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid31 = _errs141 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.type !== undefined) { + let data62 = data.type; + const _errs143 = errors; + if (typeof data62 !== 'string') { + const err102 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema57.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema57.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + if ( + !( + data62 === 'device' || + data62 === 'group' || + data62 === 'edge instantiable' || + data62 === 'cloud instantiable' + ) + ) { + const err103 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema57.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema57.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema57.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + var valid31 = _errs143 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.isPublic !== undefined) { + let data63 = data.isPublic; + const _errs145 = errors; + if (typeof data63 !== 'boolean') { + const err104 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema57.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema57.anyOf[3].allOf[0].properties.isPublic, + data: data63, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + var valid31 = _errs145 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.viewer !== undefined) { + let data64 = data.viewer; + const _errs147 = errors; + if (errors === _errs147) { + if (Array.isArray(data64)) { + var valid32 = true; + const len10 = data64.length; + for (let i10 = 0; i10 < len10; i10++) { + let data65 = data64[i10]; + const _errs149 = errors; + if (errors === _errs149) { + if ( + data65 && + typeof data65 == 'object' && + !Array.isArray(data65) + ) { + let missing10; + if (data65.url === undefined && (missing10 = 'url')) { + const err105 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + + missing10 + + "'", + schema: + schema57.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema57.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } else { + if (data65.url !== undefined) { + let data66 = data65.url; + const _errs151 = errors; + if (errors === _errs151) { + if (errors === _errs151) { + if (typeof data66 === 'string') { + if (!formats0(data66)) { + const err106 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema57.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } else { + const err107 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema57.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + } + } + } + } else { + const err108 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema57.anyOf[3].allOf[0].properties.viewer.items + .type, + parentSchema: + schema57.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid32 = _errs149 === errors; + if (!valid32) { + break; + } + } + } else { + const err109 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema57.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: + schema57.anyOf[3].allOf[0].properties.viewer, + data: data64, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + } + } + var valid31 = _errs147 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.owner !== undefined) { + let data67 = data.owner; + const _errs153 = errors; + if (errors === _errs153) { + if (Array.isArray(data67)) { + var valid34 = true; + const len11 = data67.length; + for (let i11 = 0; i11 < len11; i11++) { + let data68 = data67[i11]; + const _errs155 = errors; + if (errors === _errs155) { + if ( + data68 && + typeof data68 == 'object' && + !Array.isArray(data68) + ) { + let missing11; + if ( + data68.url === undefined && + (missing11 = 'url') + ) { + const err110 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema57.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema57.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err110]; + } else { + vErrors.push(err110); + } + errors++; + } else { + if (data68.url !== undefined) { + let data69 = data68.url; + const _errs157 = errors; + if (errors === _errs157) { + if (errors === _errs157) { + if (typeof data69 === 'string') { + if (!formats0(data69)) { + const err111 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema57.anyOf[3].allOf[0] + .properties.owner.items.properties + .url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err111]; + } else { + vErrors.push(err111); + } + errors++; + } + } else { + const err112 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema57.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err112]; + } else { + vErrors.push(err112); + } + errors++; + } + } + } + } + } + } else { + const err113 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema57.anyOf[3].allOf[0].properties.owner + .items.type, + parentSchema: + schema57.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err113]; + } else { + vErrors.push(err113); + } + errors++; + } + } + var valid34 = _errs155 === errors; + if (!valid34) { + break; + } + } + } else { + const err114 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema57.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema57.anyOf[3].allOf[0].properties.owner, + data: data67, + }; + if (vErrors === null) { + vErrors = [err114]; + } else { + vErrors.push(err114); + } + errors++; + } + } + var valid31 = _errs153 === errors; + } else { + var valid31 = true; + } + } + } + } + } + } + } + } + } else { + const err115 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema57.anyOf[3].allOf[0].type, + parentSchema: schema57.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err115]; + } else { + vErrors.push(err115); + } + errors++; + } + } + var valid30 = _errs135 === errors; + if (valid30) { + const _errs159 = errors; + if (errors === _errs159) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if (data.devices === undefined && (missing12 = 'devices')) { + const err116 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema57.anyOf[3].allOf[1].required, + parentSchema: schema57.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err116]; + } else { + vErrors.push(err116); + } + errors++; + } else { + if (data.type !== undefined) { + let data70 = data.type; + const _errs161 = errors; + if ('group' !== data70) { + const err117 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema57.anyOf[3].allOf[1].properties.type, + data: data70, + }; + if (vErrors === null) { + vErrors = [err117]; + } else { + vErrors.push(err117); + } + errors++; + } + var valid36 = _errs161 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data.devices !== undefined) { + let data71 = data.devices; + const _errs162 = errors; + if (errors === _errs162) { + if (Array.isArray(data71)) { + var valid37 = true; + const len12 = data71.length; + for (let i12 = 0; i12 < len12; i12++) { + let data72 = data71[i12]; + const _errs164 = errors; + if (errors === _errs164) { + if ( + data72 && + typeof data72 == 'object' && + !Array.isArray(data72) + ) { + let missing13; + if (data72.url === undefined && (missing13 = 'url')) { + const err118 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: + "must have required property '" + missing13 + "'", + schema: + schema57.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema57.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err118]; + } else { + vErrors.push(err118); + } + errors++; + } else { + if (data72.url !== undefined) { + let data73 = data72.url; + const _errs166 = errors; + if (errors === _errs166) { + if (errors === _errs166) { + if (typeof data73 === 'string') { + if (!formats0(data73)) { + const err119 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema57.anyOf[3].allOf[1].properties + .devices.items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err119]; + } else { + vErrors.push(err119); + } + errors++; + } + } else { + const err120 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema57.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema57.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err120]; + } else { + vErrors.push(err120); + } + errors++; + } + } + } + } + } + } else { + const err121 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema57.anyOf[3].allOf[1].properties.devices.items + .type, + parentSchema: + schema57.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err121]; + } else { + vErrors.push(err121); + } + errors++; + } + } + var valid37 = _errs164 === errors; + if (!valid37) { + break; + } + } + } else { + const err122 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema57.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema57.anyOf[3].allOf[1].properties.devices, + data: data71, + }; + if (vErrors === null) { + vErrors = [err122]; + } else { + vErrors.push(err122); + } + errors++; + } + } + var valid36 = _errs162 === errors; + } else { + var valid36 = true; + } + } + } + } else { + const err123 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema57.anyOf[3].allOf[1].type, + parentSchema: schema57.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err123]; + } else { + vErrors.push(err123); + } + errors++; + } + } + var valid30 = _errs159 === errors; + } + var _valid0 = _errs134 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err124 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema57.anyOf, + parentSchema: schema57, + data, + }; + if (vErrors === null) { + vErrors = [err124]; + } else { + vErrors.push(err124); + } + errors++; + validate72.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate72.errors = vErrors; + return errors === 0; +} +exports.validateUpdateDeviceBody = validate73; +const schema58 = { + title: 'Device Update', + anyOf: [ + { + title: 'Instantiable Cloud Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Concrete Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Instantiable Browser Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Device Group Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + }, + ], + }, + ], + 'x-standalone': false, + 'x-name': 'updateDeviceBody', + 'x-location': + '#/paths//devices/{device_id}/patch/requestBody/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate73( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema58.anyOf[0].allOf[0].required, + parentSchema: schema58.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs4 = errors; + if (typeof data0 !== 'string') { + const err1 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema58.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema58.anyOf[0].allOf[0].properties.name, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err2 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema58.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema58.anyOf[0].allOf[0].properties.description, + data: data1, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err3 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema58.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema58.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + const err4 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema58.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema58.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema58.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs10 = errors; + if (typeof data3 !== 'boolean') { + const err5 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema58.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema58.anyOf[0].allOf[0].properties.isPublic, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data4)) { + var valid3 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + const err6 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: + schema58.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema58.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + const err7 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema58.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema58.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } + } else { + const err9 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema58.anyOf[0].allOf[0].properties.viewer.items.type, + parentSchema: + schema58.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var valid3 = _errs14 === errors; + if (!valid3) { + break; + } + } + } else { + const err10 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema58.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema58.anyOf[0].allOf[0].properties.viewer, + data: data4, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid5 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + const err11 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema58.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema58.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + const err12 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema58.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } else { + const err13 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema58.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + } + } + } + } + } else { + const err14 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema58.anyOf[0].allOf[0].properties.owner.items.type, + parentSchema: + schema58.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } + var valid5 = _errs20 === errors; + if (!valid5) { + break; + } + } + } else { + const err15 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema58.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema58.anyOf[0].allOf[0].properties.owner, + data: data7, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + var valid2 = _errs18 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } else { + const err16 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema58.anyOf[0].allOf[0].type, + parentSchema: schema58.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs26 = errors; + if ('cloud instantiable' !== data10) { + const err17 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema58.anyOf[0].allOf[1].properties.type, + data: data10, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var valid7 = _errs26 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data11 = data.instantiateUrl; + const _errs27 = errors; + if (errors === _errs27) { + if (errors === _errs27) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + const err18 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema58.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } else { + const err19 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema58.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema58.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + } + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data12)) { + var valid8 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + const err20 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema58.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema58.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid9 = _errs34 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs36 = errors; + if (typeof data15 !== 'string') { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema58.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err23 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema58.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + const err24 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema58.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema58.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema58.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err25 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema58.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema58.anyOf[0].allOf[1].properties.services.items, + data: data13, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + var valid8 = _errs31 === errors; + if (!valid8) { + break; + } + } + } else { + const err26 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema58.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema58.anyOf[0].allOf[1].properties.services, + data: data12, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err27 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema58.anyOf[0].allOf[1].type, + parentSchema: schema58.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid1 = _errs24 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs40 = errors; + const _errs41 = errors; + if (errors === _errs41) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if (data.type === undefined && (missing3 = 'type')) { + const err28 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema58.anyOf[1].allOf[0].required, + parentSchema: schema58.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } else { + if (data.name !== undefined) { + let data17 = data.name; + const _errs43 = errors; + if (typeof data17 !== 'string') { + const err29 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema58.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema58.anyOf[1].allOf[0].properties.name, + data: data17, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + var valid11 = _errs43 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data18 = data.description; + const _errs45 = errors; + if (typeof data18 !== 'string') { + const err30 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema58.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema58.anyOf[1].allOf[0].properties.description, + data: data18, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data19 = data.type; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err31 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema58.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema58.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + if ( + !( + data19 === 'device' || + data19 === 'group' || + data19 === 'edge instantiable' || + data19 === 'cloud instantiable' + ) + ) { + const err32 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema58.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema58.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema58.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data20 = data.isPublic; + const _errs49 = errors; + if (typeof data20 !== 'boolean') { + const err33 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema58.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema58.anyOf[1].allOf[0].properties.isPublic, + data: data20, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data21 = data.viewer; + const _errs51 = errors; + if (errors === _errs51) { + if (Array.isArray(data21)) { + var valid12 = true; + const len3 = data21.length; + for (let i3 = 0; i3 < len3; i3++) { + let data22 = data21[i3]; + const _errs53 = errors; + if (errors === _errs53) { + if ( + data22 && + typeof data22 == 'object' && + !Array.isArray(data22) + ) { + let missing4; + if (data22.url === undefined && (missing4 = 'url')) { + const err34 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema58.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema58.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } else { + if (data22.url !== undefined) { + let data23 = data22.url; + const _errs55 = errors; + if (errors === _errs55) { + if (errors === _errs55) { + if (typeof data23 === 'string') { + if (!formats0(data23)) { + const err35 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema58.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } else { + const err36 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[1].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema58.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + } + } + } + } else { + const err37 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema58.anyOf[1].allOf[0].properties.viewer.items.type, + parentSchema: + schema58.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + var valid12 = _errs53 === errors; + if (!valid12) { + break; + } + } + } else { + const err38 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema58.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema58.anyOf[1].allOf[0].properties.viewer, + data: data21, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data24 = data.owner; + const _errs57 = errors; + if (errors === _errs57) { + if (Array.isArray(data24)) { + var valid14 = true; + const len4 = data24.length; + for (let i4 = 0; i4 < len4; i4++) { + let data25 = data24[i4]; + const _errs59 = errors; + if (errors === _errs59) { + if ( + data25 && + typeof data25 == 'object' && + !Array.isArray(data25) + ) { + let missing5; + if (data25.url === undefined && (missing5 = 'url')) { + const err39 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema58.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema58.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } else { + if (data25.url !== undefined) { + let data26 = data25.url; + const _errs61 = errors; + if (errors === _errs61) { + if (errors === _errs61) { + if (typeof data26 === 'string') { + if (!formats0(data26)) { + const err40 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema58.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } else { + const err41 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[1].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema58.anyOf[1].allOf[0].properties.owner + .items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + } + } + } + } else { + const err42 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema58.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema58.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid14 = _errs59 === errors; + if (!valid14) { + break; + } + } + } else { + const err43 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema58.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema58.anyOf[1].allOf[0].properties.owner, + data: data24, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + } + var valid11 = _errs57 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } else { + const err44 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema58.anyOf[1].allOf[0].type, + parentSchema: schema58.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var valid10 = _errs41 === errors; + if (valid10) { + const _errs63 = errors; + if (errors === _errs63) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data27 = data.type; + const _errs65 = errors; + if ('device' !== data27) { + const err45 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema58.anyOf[1].allOf[1].properties.type, + data: data27, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + var valid16 = _errs65 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data28 = data.experiment; + const _errs66 = errors; + if (errors === _errs66) { + if (errors === _errs66) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err46 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema58.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } else { + const err47 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema58.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema58.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + } + var valid16 = _errs66 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data29 = data.services; + const _errs68 = errors; + if (errors === _errs68) { + if (Array.isArray(data29)) { + var valid17 = true; + const len5 = data29.length; + for (let i5 = 0; i5 < len5; i5++) { + let data30 = data29[i5]; + const _errs70 = errors; + if (errors === _errs70) { + if ( + data30 && + typeof data30 == 'object' && + !Array.isArray(data30) + ) { + if (data30.serviceType !== undefined) { + let data31 = data30.serviceType; + const _errs73 = errors; + if (errors === _errs73) { + if (errors === _errs73) { + if (typeof data31 === 'string') { + if (!formats0(data31)) { + const err48 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema58.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } else { + const err49 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[1].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema58.anyOf[1].allOf[1].properties.services.items + .properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + } + } + var valid18 = _errs73 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceId !== undefined) { + let data32 = data30.serviceId; + const _errs75 = errors; + if (typeof data32 !== 'string') { + const err50 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[1].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema58.anyOf[1].allOf[1].properties.services.items + .properties.serviceId, + data: data32, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid18 = _errs75 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceDirection !== undefined) { + let data33 = data30.serviceDirection; + const _errs77 = errors; + if (typeof data33 !== 'string') { + const err51 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[1].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema58.anyOf[1].allOf[1].properties.services.items + .properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + if ( + !( + data33 === 'consumer' || + data33 === 'producer' || + data33 === 'prosumer' + ) + ) { + const err52 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema58.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema58.anyOf[1].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema58.anyOf[1].allOf[1].properties.services.items + .properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + var valid18 = _errs77 === errors; + } else { + var valid18 = true; + } + } + } + } else { + const err53 = { + instancePath: instancePath + '/services/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema58.anyOf[1].allOf[1].properties.services.items.type, + parentSchema: + schema58.anyOf[1].allOf[1].properties.services.items, + data: data30, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + var valid17 = _errs70 === errors; + if (!valid17) { + break; + } + } + } else { + const err54 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema58.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema58.anyOf[1].allOf[1].properties.services, + data: data29, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + var valid16 = _errs68 === errors; + } else { + var valid16 = true; + } + } + } + } else { + const err55 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema58.anyOf[1].allOf[1].type, + parentSchema: schema58.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid10 = _errs63 === errors; + } + var _valid0 = _errs40 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs79 = errors; + const _errs80 = errors; + if (errors === _errs80) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if (data.type === undefined && (missing6 = 'type')) { + const err56 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema58.anyOf[2].allOf[0].required, + parentSchema: schema58.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } else { + if (data.name !== undefined) { + let data34 = data.name; + const _errs82 = errors; + if (typeof data34 !== 'string') { + const err57 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema58.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema58.anyOf[2].allOf[0].properties.name, + data: data34, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + var valid20 = _errs82 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.description !== undefined) { + let data35 = data.description; + const _errs84 = errors; + if (typeof data35 !== 'string') { + const err58 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema58.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema58.anyOf[2].allOf[0].properties.description, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + var valid20 = _errs84 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.type !== undefined) { + let data36 = data.type; + const _errs86 = errors; + if (typeof data36 !== 'string') { + const err59 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema58.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema58.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + if ( + !( + data36 === 'device' || + data36 === 'group' || + data36 === 'edge instantiable' || + data36 === 'cloud instantiable' + ) + ) { + const err60 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema58.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema58.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema58.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + var valid20 = _errs86 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.isPublic !== undefined) { + let data37 = data.isPublic; + const _errs88 = errors; + if (typeof data37 !== 'boolean') { + const err61 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema58.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema58.anyOf[2].allOf[0].properties.isPublic, + data: data37, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs88 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.viewer !== undefined) { + let data38 = data.viewer; + const _errs90 = errors; + if (errors === _errs90) { + if (Array.isArray(data38)) { + var valid21 = true; + const len6 = data38.length; + for (let i6 = 0; i6 < len6; i6++) { + let data39 = data38[i6]; + const _errs92 = errors; + if (errors === _errs92) { + if ( + data39 && + typeof data39 == 'object' && + !Array.isArray(data39) + ) { + let missing7; + if (data39.url === undefined && (missing7 = 'url')) { + const err62 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema58.anyOf[2].allOf[0].properties.viewer.items + .required, + parentSchema: + schema58.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } else { + if (data39.url !== undefined) { + let data40 = data39.url; + const _errs94 = errors; + if (errors === _errs94) { + if (errors === _errs94) { + if (typeof data40 === 'string') { + if (!formats0(data40)) { + const err63 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema58.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + } else { + const err64 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[2].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema58.anyOf[2].allOf[0].properties.viewer + .items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + } + } + } + } else { + const err65 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema58.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema58.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid21 = _errs92 === errors; + if (!valid21) { + break; + } + } + } else { + const err66 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema58.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema58.anyOf[2].allOf[0].properties.viewer, + data: data38, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid20 = _errs90 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.owner !== undefined) { + let data41 = data.owner; + const _errs96 = errors; + if (errors === _errs96) { + if (Array.isArray(data41)) { + var valid23 = true; + const len7 = data41.length; + for (let i7 = 0; i7 < len7; i7++) { + let data42 = data41[i7]; + const _errs98 = errors; + if (errors === _errs98) { + if ( + data42 && + typeof data42 == 'object' && + !Array.isArray(data42) + ) { + let missing8; + if (data42.url === undefined && (missing8 = 'url')) { + const err67 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + missing8 + "'", + schema: + schema58.anyOf[2].allOf[0].properties.owner.items + .required, + parentSchema: + schema58.anyOf[2].allOf[0].properties.owner.items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data42.url !== undefined) { + let data43 = data42.url; + const _errs100 = errors; + if (errors === _errs100) { + if (errors === _errs100) { + if (typeof data43 === 'string') { + if (!formats0(data43)) { + const err68 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema58.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema58.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + } + } + } else { + const err70 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema58.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema58.anyOf[2].allOf[0].properties.owner.items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + } + var valid23 = _errs98 === errors; + if (!valid23) { + break; + } + } + } else { + const err71 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema58.anyOf[2].allOf[0].properties.owner.type, + parentSchema: schema58.anyOf[2].allOf[0].properties.owner, + data: data41, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + } + var valid20 = _errs96 === errors; + } else { + var valid20 = true; + } + } + } + } + } + } + } + } else { + const err72 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema58.anyOf[2].allOf[0].type, + parentSchema: schema58.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + var valid19 = _errs80 === errors; + if (valid19) { + const _errs102 = errors; + if (errors === _errs102) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs104 = errors; + if ('edge instantiable' !== data44) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema58.anyOf[2].allOf[1].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid25 = _errs104 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.codeUrl !== undefined) { + let data45 = data.codeUrl; + const _errs105 = errors; + if (errors === _errs105) { + if (errors === _errs105) { + if (typeof data45 === 'string') { + if (!formats0(data45)) { + const err74 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema58.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } else { + const err75 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema58.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema58.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + } + var valid25 = _errs105 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.services !== undefined) { + let data46 = data.services; + const _errs107 = errors; + if (errors === _errs107) { + if (Array.isArray(data46)) { + var valid26 = true; + const len8 = data46.length; + for (let i8 = 0; i8 < len8; i8++) { + let data47 = data46[i8]; + const _errs109 = errors; + if (errors === _errs109) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + if (data47.serviceType !== undefined) { + let data48 = data47.serviceType; + const _errs112 = errors; + if (errors === _errs112) { + if (errors === _errs112) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema58.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema58.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + var valid27 = _errs112 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceId !== undefined) { + let data49 = data47.serviceId; + const _errs114 = errors; + if (typeof data49 !== 'string') { + const err78 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[2].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema58.anyOf[2].allOf[1].properties.services.items + .properties.serviceId, + data: data49, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + var valid27 = _errs114 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceDirection !== undefined) { + let data50 = data47.serviceDirection; + const _errs116 = errors; + if (typeof data50 !== 'string') { + const err79 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema58.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + if ( + !( + data50 === 'consumer' || + data50 === 'producer' || + data50 === 'prosumer' + ) + ) { + const err80 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema58.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema58.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema58.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + var valid27 = _errs116 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err81 = { + instancePath: instancePath + '/services/' + i8, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema58.anyOf[2].allOf[1].properties.services.items.type, + parentSchema: + schema58.anyOf[2].allOf[1].properties.services.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + var valid26 = _errs109 === errors; + if (!valid26) { + break; + } + } + } else { + const err82 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema58.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema58.anyOf[2].allOf[1].properties.services, + data: data46, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + var valid25 = _errs107 === errors; + } else { + var valid25 = true; + } + } + } + } else { + const err83 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema58.anyOf[2].allOf[1].type, + parentSchema: schema58.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid19 = _errs102 === errors; + } + var _valid0 = _errs79 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs118 = errors; + const _errs119 = errors; + if (errors === _errs119) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if (data.type === undefined && (missing9 = 'type')) { + const err84 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema58.anyOf[3].allOf[0].required, + parentSchema: schema58.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } else { + if (data.name !== undefined) { + let data51 = data.name; + const _errs121 = errors; + if (typeof data51 !== 'string') { + const err85 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema58.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema58.anyOf[3].allOf[0].properties.name, + data: data51, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + var valid29 = _errs121 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.description !== undefined) { + let data52 = data.description; + const _errs123 = errors; + if (typeof data52 !== 'string') { + const err86 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema58.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema58.anyOf[3].allOf[0].properties.description, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid29 = _errs123 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.type !== undefined) { + let data53 = data.type; + const _errs125 = errors; + if (typeof data53 !== 'string') { + const err87 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema58.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema58.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + if ( + !( + data53 === 'device' || + data53 === 'group' || + data53 === 'edge instantiable' || + data53 === 'cloud instantiable' + ) + ) { + const err88 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema58.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema58.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema58.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + var valid29 = _errs125 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.isPublic !== undefined) { + let data54 = data.isPublic; + const _errs127 = errors; + if (typeof data54 !== 'boolean') { + const err89 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema58.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema58.anyOf[3].allOf[0].properties.isPublic, + data: data54, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + var valid29 = _errs127 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.viewer !== undefined) { + let data55 = data.viewer; + const _errs129 = errors; + if (errors === _errs129) { + if (Array.isArray(data55)) { + var valid30 = true; + const len9 = data55.length; + for (let i9 = 0; i9 < len9; i9++) { + let data56 = data55[i9]; + const _errs131 = errors; + if (errors === _errs131) { + if ( + data56 && + typeof data56 == 'object' && + !Array.isArray(data56) + ) { + let missing10; + if (data56.url === undefined && (missing10 = 'url')) { + const err90 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + missing10 + "'", + schema: + schema58.anyOf[3].allOf[0].properties.viewer.items + .required, + parentSchema: + schema58.anyOf[3].allOf[0].properties.viewer + .items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } else { + if (data56.url !== undefined) { + let data57 = data56.url; + const _errs133 = errors; + if (errors === _errs133) { + if (errors === _errs133) { + if (typeof data57 === 'string') { + if (!formats0(data57)) { + const err91 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema58.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + } else { + const err92 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema58.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + } + } + } + } + } else { + const err93 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema58.anyOf[3].allOf[0].properties.viewer.items + .type, + parentSchema: + schema58.anyOf[3].allOf[0].properties.viewer.items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + var valid30 = _errs131 === errors; + if (!valid30) { + break; + } + } + } else { + const err94 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema58.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: schema58.anyOf[3].allOf[0].properties.viewer, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid29 = _errs129 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.owner !== undefined) { + let data58 = data.owner; + const _errs135 = errors; + if (errors === _errs135) { + if (Array.isArray(data58)) { + var valid32 = true; + const len10 = data58.length; + for (let i10 = 0; i10 < len10; i10++) { + let data59 = data58[i10]; + const _errs137 = errors; + if (errors === _errs137) { + if ( + data59 && + typeof data59 == 'object' && + !Array.isArray(data59) + ) { + let missing11; + if (data59.url === undefined && (missing11 = 'url')) { + const err95 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema58.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema58.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } else { + if (data59.url !== undefined) { + let data60 = data59.url; + const _errs139 = errors; + if (errors === _errs139) { + if (errors === _errs139) { + if (typeof data60 === 'string') { + if (!formats0(data60)) { + const err96 = { + instancePath: + instancePath + + '/owner/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema58.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } else { + const err97 = { + instancePath: + instancePath + '/owner/' + i10 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema58.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + } + } + } + } + } else { + const err98 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema58.anyOf[3].allOf[0].properties.owner.items + .type, + parentSchema: + schema58.anyOf[3].allOf[0].properties.owner.items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } + var valid32 = _errs137 === errors; + if (!valid32) { + break; + } + } + } else { + const err99 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema58.anyOf[3].allOf[0].properties.owner.type, + parentSchema: schema58.anyOf[3].allOf[0].properties.owner, + data: data58, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + var valid29 = _errs135 === errors; + } else { + var valid29 = true; + } + } + } + } + } + } + } + } else { + const err100 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema58.anyOf[3].allOf[0].type, + parentSchema: schema58.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + } + var valid28 = _errs119 === errors; + if (valid28) { + const _errs141 = errors; + if (errors === _errs141) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data61 = data.type; + const _errs143 = errors; + if ('group' !== data61) { + const err101 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema58.anyOf[3].allOf[1].properties.type, + data: data61, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid34 = _errs143 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data.devices !== undefined) { + let data62 = data.devices; + const _errs144 = errors; + if (errors === _errs144) { + if (Array.isArray(data62)) { + var valid35 = true; + const len11 = data62.length; + for (let i11 = 0; i11 < len11; i11++) { + let data63 = data62[i11]; + const _errs146 = errors; + if (errors === _errs146) { + if ( + data63 && + typeof data63 == 'object' && + !Array.isArray(data63) + ) { + let missing12; + if (data63.url === undefined && (missing12 = 'url')) { + const err102 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: + "must have required property '" + missing12 + "'", + schema: + schema58.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema58.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } else { + if (data63.url !== undefined) { + let data64 = data63.url; + const _errs148 = errors; + if (errors === _errs148) { + if (errors === _errs148) { + if (typeof data64 === 'string') { + if (!formats0(data64)) { + const err103 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema58.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + } else { + const err104 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema58.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema58.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + } + } + } + } + } else { + const err105 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema58.anyOf[3].allOf[1].properties.devices.items.type, + parentSchema: + schema58.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } + } + var valid35 = _errs146 === errors; + if (!valid35) { + break; + } + } + } else { + const err106 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema58.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema58.anyOf[3].allOf[1].properties.devices, + data: data62, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } + var valid34 = _errs144 === errors; + } else { + var valid34 = true; + } + } + } else { + const err107 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema58.anyOf[3].allOf[1].type, + parentSchema: schema58.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + var valid28 = _errs141 === errors; + } + var _valid0 = _errs118 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err108 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema58.anyOf, + parentSchema: schema58, + data, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + validate73.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate73.errors = vErrors; + return errors === 0; +} +exports.validateUpdateDeviceResponse200 = validate74; +const schema59 = { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + connected: { + description: + 'If true, the device is connected to the service and can be used.\n', + type: 'boolean', + readOnly: true, + }, + announcedAvailability: { + readOnly: true, + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'updateDeviceResponse200', + 'x-location': + '#/paths//devices/{device_id}/patch/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate74( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema59.anyOf[0].allOf[0].required, + parentSchema: schema59.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs4 = errors; + if (errors === _errs4) { + if (errors === _errs4) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + const err1 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema59.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } else { + const err2 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[0].allOf[0].properties.url.type, + parentSchema: schema59.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err3 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema59.anyOf[0].allOf[0].properties.name, + data: data1, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err4 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema59.anyOf[0].allOf[0].properties.description, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs10 = errors; + if (typeof data3 !== 'string') { + const err5 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema59.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + const err6 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema59.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema59.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema59.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs12 = errors; + if (typeof data4 !== 'boolean') { + const err7 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema59.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema59.anyOf[0].allOf[0].properties.isPublic, + data: data4, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs14 = errors; + if (errors === _errs14) { + if (Array.isArray(data5)) { + var valid3 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + const err8 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema59.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema59.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + const err9 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema59.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } else { + const err10 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema59.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + } + } + } + } else { + const err11 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema59.anyOf[0].allOf[0].properties.viewer.items.type, + parentSchema: + schema59.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } + var valid3 = _errs16 === errors; + if (!valid3) { + break; + } + } + } else { + const err12 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema59.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema59.anyOf[0].allOf[0].properties.viewer, + data: data5, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } + var valid2 = _errs14 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs20 = errors; + if (errors === _errs20) { + if (Array.isArray(data8)) { + var valid5 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs22 = errors; + if (errors === _errs22) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + const err13 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema59.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema59.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs24 = errors; + if (errors === _errs24) { + if (errors === _errs24) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + const err14 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema59.anyOf[0].allOf[0].properties + .owner.items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } else { + const err15 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema59.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + } + } + } + } else { + const err16 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema59.anyOf[0].allOf[0].properties.owner.items + .type, + parentSchema: + schema59.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid5 = _errs22 === errors; + if (!valid5) { + break; + } + } + } else { + const err17 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema59.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema59.anyOf[0].allOf[0].properties.owner, + data: data8, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + } + var valid2 = _errs20 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } + } else { + const err18 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema59.anyOf[0].allOf[0].type, + parentSchema: schema59.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs26 = errors; + if (errors === _errs26) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data11 = data.type; + const _errs28 = errors; + if ('cloud instantiable' !== data11) { + const err19 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema59.anyOf[0].allOf[1].properties.type, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + var valid7 = _errs28 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data12 = data.instantiateUrl; + const _errs29 = errors; + if (errors === _errs29) { + if (errors === _errs29) { + if (typeof data12 === 'string') { + if (!formats0(data12)) { + const err20 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema59.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema59.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data13 = data.services; + const _errs31 = errors; + if (errors === _errs31) { + if (Array.isArray(data13)) { + var valid8 = true; + const len2 = data13.length; + for (let i2 = 0; i2 < len2; i2++) { + let data14 = data13[i2]; + const _errs33 = errors; + if (errors === _errs33) { + if (data14 && typeof data14 == 'object' && !Array.isArray(data14)) { + if (data14.serviceType !== undefined) { + let data15 = data14.serviceType; + const _errs36 = errors; + if (errors === _errs36) { + if (errors === _errs36) { + if (typeof data15 === 'string') { + if (!formats0(data15)) { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema59.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } else { + const err23 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema59.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + } + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceId !== undefined) { + let data16 = data14.serviceId; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err24 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema59.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceDirection !== undefined) { + let data17 = data14.serviceDirection; + const _errs40 = errors; + if (typeof data17 !== 'string') { + const err25 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema59.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + if ( + !( + data17 === 'consumer' || + data17 === 'producer' || + data17 === 'prosumer' + ) + ) { + const err26 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema59.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema59.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema59.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + var valid9 = _errs40 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err27 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema59.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema59.anyOf[0].allOf[1].properties.services.items, + data: data14, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid8 = _errs33 === errors; + if (!valid8) { + break; + } + } + } else { + const err28 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema59.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema59.anyOf[0].allOf[1].properties.services, + data: data13, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + } + var valid7 = _errs31 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err29 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema59.anyOf[0].allOf[1].type, + parentSchema: schema59.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + } + var valid1 = _errs26 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs42 = errors; + const _errs43 = errors; + if (errors === _errs43) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if ( + (data.url === undefined && (missing3 = 'url')) || + (data.type === undefined && (missing3 = 'type')) || + (data.name === undefined && (missing3 = 'name')) || + (data.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err30 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema59.anyOf[1].allOf[0].required, + parentSchema: schema59.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } else { + if (data.url !== undefined) { + let data18 = data.url; + const _errs45 = errors; + if (errors === _errs45) { + if (errors === _errs45) { + if (typeof data18 === 'string') { + if (!formats0(data18)) { + const err31 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema59.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } else { + const err32 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[1].allOf[0].properties.url.type, + parentSchema: schema59.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.name !== undefined) { + let data19 = data.name; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err33 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema59.anyOf[1].allOf[0].properties.name, + data: data19, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data20 = data.description; + const _errs49 = errors; + if (typeof data20 !== 'string') { + const err34 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema59.anyOf[1].allOf[0].properties.description, + data: data20, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data21 = data.type; + const _errs51 = errors; + if (typeof data21 !== 'string') { + const err35 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema59.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + if ( + !( + data21 === 'device' || + data21 === 'group' || + data21 === 'edge instantiable' || + data21 === 'cloud instantiable' + ) + ) { + const err36 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema59.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema59.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema59.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data22 = data.isPublic; + const _errs53 = errors; + if (typeof data22 !== 'boolean') { + const err37 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema59.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema59.anyOf[1].allOf[0].properties.isPublic, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + var valid11 = _errs53 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data23 = data.viewer; + const _errs55 = errors; + if (errors === _errs55) { + if (Array.isArray(data23)) { + var valid12 = true; + const len3 = data23.length; + for (let i3 = 0; i3 < len3; i3++) { + let data24 = data23[i3]; + const _errs57 = errors; + if (errors === _errs57) { + if ( + data24 && + typeof data24 == 'object' && + !Array.isArray(data24) + ) { + let missing4; + if (data24.url === undefined && (missing4 = 'url')) { + const err38 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema59.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema59.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } else { + if (data24.url !== undefined) { + let data25 = data24.url; + const _errs59 = errors; + if (errors === _errs59) { + if (errors === _errs59) { + if (typeof data25 === 'string') { + if (!formats0(data25)) { + const err39 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema59.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } else { + const err40 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[1].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema59.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + } + } + } + } else { + const err41 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema59.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema59.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + var valid12 = _errs57 === errors; + if (!valid12) { + break; + } + } + } else { + const err42 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema59.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema59.anyOf[1].allOf[0].properties.viewer, + data: data23, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid11 = _errs55 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data26 = data.owner; + const _errs61 = errors; + if (errors === _errs61) { + if (Array.isArray(data26)) { + var valid14 = true; + const len4 = data26.length; + for (let i4 = 0; i4 < len4; i4++) { + let data27 = data26[i4]; + const _errs63 = errors; + if (errors === _errs63) { + if ( + data27 && + typeof data27 == 'object' && + !Array.isArray(data27) + ) { + let missing5; + if (data27.url === undefined && (missing5 = 'url')) { + const err43 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema59.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema59.anyOf[1].allOf[0].properties.owner.items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } else { + if (data27.url !== undefined) { + let data28 = data27.url; + const _errs65 = errors; + if (errors === _errs65) { + if (errors === _errs65) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err44 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema59.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } else { + const err45 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[1].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema59.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + } + } + } + } + } else { + const err46 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema59.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema59.anyOf[1].allOf[0].properties.owner.items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } + var valid14 = _errs63 === errors; + if (!valid14) { + break; + } + } + } else { + const err47 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema59.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema59.anyOf[1].allOf[0].properties.owner, + data: data26, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var valid11 = _errs61 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } + } else { + const err48 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema59.anyOf[1].allOf[0].type, + parentSchema: schema59.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } + var valid10 = _errs43 === errors; + if (valid10) { + const _errs67 = errors; + if (errors === _errs67) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data29 = data.type; + const _errs69 = errors; + if ('device' !== data29) { + const err49 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema59.anyOf[1].allOf[1].properties.type, + data: data29, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + var valid16 = _errs69 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.connected !== undefined) { + let data30 = data.connected; + const _errs70 = errors; + if (typeof data30 !== 'boolean') { + const err50 = { + instancePath: instancePath + '/connected', + schemaPath: '#/anyOf/1/allOf/1/properties/connected/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema59.anyOf[1].allOf[1].properties.connected.type, + parentSchema: schema59.anyOf[1].allOf[1].properties.connected, + data: data30, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid16 = _errs70 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.announcedAvailability !== undefined) { + let data31 = data.announcedAvailability; + const _errs72 = errors; + if (errors === _errs72) { + if (Array.isArray(data31)) { + var valid17 = true; + const len5 = data31.length; + for (let i5 = 0; i5 < len5; i5++) { + let data32 = data31[i5]; + const _errs74 = errors; + if (errors === _errs74) { + if ( + data32 && + typeof data32 == 'object' && + !Array.isArray(data32) + ) { + if (data32.start !== undefined) { + let data33 = data32.start; + const _errs76 = errors; + if (errors === _errs76) { + if (errors === _errs76) { + if (typeof data33 === 'string') { + if (!formats22.validate(data33)) { + const err51 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema59.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } else { + const err52 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start + .type, + parentSchema: + schema59.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + } + } + var valid18 = _errs76 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data32.end !== undefined) { + let data34 = data32.end; + const _errs78 = errors; + if (errors === _errs78) { + if (errors === _errs78) { + if (typeof data34 === 'string') { + if (!formats22.validate(data34)) { + const err53 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema59.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } else { + const err54 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end + .type, + parentSchema: + schema59.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + } + var valid18 = _errs78 === errors; + } else { + var valid18 = true; + } + } + } else { + const err55 = { + instancePath: instancePath + '/announcedAvailability/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema59.anyOf[1].allOf[1].properties.announcedAvailability + .items.type, + parentSchema: + schema59.anyOf[1].allOf[1].properties.announcedAvailability + .items, + data: data32, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid17 = _errs74 === errors; + if (!valid17) { + break; + } + } + } else { + const err56 = { + instancePath: instancePath + '/announcedAvailability', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema59.anyOf[1].allOf[1].properties.announcedAvailability.type, + parentSchema: + schema59.anyOf[1].allOf[1].properties.announcedAvailability, + data: data31, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + var valid16 = _errs72 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data35 = data.experiment; + const _errs80 = errors; + if (errors === _errs80) { + if (errors === _errs80) { + if (typeof data35 === 'string') { + if (!formats0(data35)) { + const err57 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema59.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } else { + const err58 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema59.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + } + } + var valid16 = _errs80 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data36 = data.services; + const _errs82 = errors; + if (errors === _errs82) { + if (Array.isArray(data36)) { + var valid19 = true; + const len6 = data36.length; + for (let i6 = 0; i6 < len6; i6++) { + let data37 = data36[i6]; + const _errs84 = errors; + if (errors === _errs84) { + if ( + data37 && + typeof data37 == 'object' && + !Array.isArray(data37) + ) { + if (data37.serviceType !== undefined) { + let data38 = data37.serviceType; + const _errs87 = errors; + if (errors === _errs87) { + if (errors === _errs87) { + if (typeof data38 === 'string') { + if (!formats0(data38)) { + const err59 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema59.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } else { + const err60 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema59.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + } + var valid20 = _errs87 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceId !== undefined) { + let data39 = data37.serviceId; + const _errs89 = errors; + if (typeof data39 !== 'string') { + const err61 = { + instancePath: + instancePath + '/services/' + i6 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[1].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema59.anyOf[1].allOf[1].properties.services + .items.properties.serviceId, + data: data39, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs89 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceDirection !== undefined) { + let data40 = data37.serviceDirection; + const _errs91 = errors; + if (typeof data40 !== 'string') { + const err62 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema59.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + if ( + !( + data40 === 'consumer' || + data40 === 'producer' || + data40 === 'prosumer' + ) + ) { + const err63 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema59.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema59.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema59.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + var valid20 = _errs91 === errors; + } else { + var valid20 = true; + } + } + } + } else { + const err64 = { + instancePath: instancePath + '/services/' + i6, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema59.anyOf[1].allOf[1].properties.services.items + .type, + parentSchema: + schema59.anyOf[1].allOf[1].properties.services.items, + data: data37, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + var valid19 = _errs84 === errors; + if (!valid19) { + break; + } + } + } else { + const err65 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema59.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema59.anyOf[1].allOf[1].properties.services, + data: data36, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid16 = _errs82 === errors; + } else { + var valid16 = true; + } + } + } + } + } + } else { + const err66 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema59.anyOf[1].allOf[1].type, + parentSchema: schema59.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid10 = _errs67 === errors; + } + var _valid0 = _errs42 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs93 = errors; + const _errs94 = errors; + if (errors === _errs94) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.url === undefined && (missing6 = 'url')) || + (data.type === undefined && (missing6 = 'type')) || + (data.name === undefined && (missing6 = 'name')) || + (data.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err67 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema59.anyOf[2].allOf[0].required, + parentSchema: schema59.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data.url !== undefined) { + let data41 = data.url; + const _errs96 = errors; + if (errors === _errs96) { + if (errors === _errs96) { + if (typeof data41 === 'string') { + if (!formats0(data41)) { + const err68 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema59.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[2].allOf[0].properties.url.type, + parentSchema: schema59.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + var valid22 = _errs96 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.name !== undefined) { + let data42 = data.name; + const _errs98 = errors; + if (typeof data42 !== 'string') { + const err70 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema59.anyOf[2].allOf[0].properties.name, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var valid22 = _errs98 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.description !== undefined) { + let data43 = data.description; + const _errs100 = errors; + if (typeof data43 !== 'string') { + const err71 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema59.anyOf[2].allOf[0].properties.description, + data: data43, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + var valid22 = _errs100 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs102 = errors; + if (typeof data44 !== 'string') { + const err72 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema59.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + if ( + !( + data44 === 'device' || + data44 === 'group' || + data44 === 'edge instantiable' || + data44 === 'cloud instantiable' + ) + ) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema59.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema59.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema59.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid22 = _errs102 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.isPublic !== undefined) { + let data45 = data.isPublic; + const _errs104 = errors; + if (typeof data45 !== 'boolean') { + const err74 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema59.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema59.anyOf[2].allOf[0].properties.isPublic, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + var valid22 = _errs104 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.viewer !== undefined) { + let data46 = data.viewer; + const _errs106 = errors; + if (errors === _errs106) { + if (Array.isArray(data46)) { + var valid23 = true; + const len7 = data46.length; + for (let i7 = 0; i7 < len7; i7++) { + let data47 = data46[i7]; + const _errs108 = errors; + if (errors === _errs108) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + let missing7; + if (data47.url === undefined && (missing7 = 'url')) { + const err75 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema59.anyOf[2].allOf[0].properties.viewer.items + .required, + parentSchema: + schema59.anyOf[2].allOf[0].properties.viewer + .items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } else { + if (data47.url !== undefined) { + let data48 = data47.url; + const _errs110 = errors; + if (errors === _errs110) { + if (errors === _errs110) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema59.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema59.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + } + } + } else { + const err78 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema59.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema59.anyOf[2].allOf[0].properties.viewer.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + var valid23 = _errs108 === errors; + if (!valid23) { + break; + } + } + } else { + const err79 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema59.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema59.anyOf[2].allOf[0].properties.viewer, + data: data46, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + var valid22 = _errs106 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.owner !== undefined) { + let data49 = data.owner; + const _errs112 = errors; + if (errors === _errs112) { + if (Array.isArray(data49)) { + var valid25 = true; + const len8 = data49.length; + for (let i8 = 0; i8 < len8; i8++) { + let data50 = data49[i8]; + const _errs114 = errors; + if (errors === _errs114) { + if ( + data50 && + typeof data50 == 'object' && + !Array.isArray(data50) + ) { + let missing8; + if (data50.url === undefined && (missing8 = 'url')) { + const err80 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + + missing8 + + "'", + schema: + schema59.anyOf[2].allOf[0].properties.owner + .items.required, + parentSchema: + schema59.anyOf[2].allOf[0].properties.owner + .items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } else { + if (data50.url !== undefined) { + let data51 = data50.url; + const _errs116 = errors; + if (errors === _errs116) { + if (errors === _errs116) { + if (typeof data51 === 'string') { + if (!formats0(data51)) { + const err81 = { + instancePath: + instancePath + + '/owner/' + + i8 + + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema59.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } else { + const err82 = { + instancePath: + instancePath + '/owner/' + i8 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema59.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + } + } + } + } else { + const err83 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema59.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema59.anyOf[2].allOf[0].properties.owner.items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid25 = _errs114 === errors; + if (!valid25) { + break; + } + } + } else { + const err84 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema59.anyOf[2].allOf[0].properties.owner.type, + parentSchema: schema59.anyOf[2].allOf[0].properties.owner, + data: data49, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + var valid22 = _errs112 === errors; + } else { + var valid22 = true; + } + } + } + } + } + } + } + } + } else { + const err85 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema59.anyOf[2].allOf[0].type, + parentSchema: schema59.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + } + var valid21 = _errs94 === errors; + if (valid21) { + const _errs118 = errors; + if (errors === _errs118) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data52 = data.type; + const _errs120 = errors; + if ('edge instantiable' !== data52) { + const err86 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema59.anyOf[2].allOf[1].properties.type, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid27 = _errs120 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.codeUrl !== undefined) { + let data53 = data.codeUrl; + const _errs121 = errors; + if (errors === _errs121) { + if (errors === _errs121) { + if (typeof data53 === 'string') { + if (!formats0(data53)) { + const err87 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema59.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + } else { + const err88 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema59.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + } + } + var valid27 = _errs121 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.services !== undefined) { + let data54 = data.services; + const _errs123 = errors; + if (errors === _errs123) { + if (Array.isArray(data54)) { + var valid28 = true; + const len9 = data54.length; + for (let i9 = 0; i9 < len9; i9++) { + let data55 = data54[i9]; + const _errs125 = errors; + if (errors === _errs125) { + if ( + data55 && + typeof data55 == 'object' && + !Array.isArray(data55) + ) { + if (data55.serviceType !== undefined) { + let data56 = data55.serviceType; + const _errs128 = errors; + if (errors === _errs128) { + if (errors === _errs128) { + if (typeof data56 === 'string') { + if (!formats0(data56)) { + const err89 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema59.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } else { + const err90 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema59.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + } + var valid29 = _errs128 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceId !== undefined) { + let data57 = data55.serviceId; + const _errs130 = errors; + if (typeof data57 !== 'string') { + const err91 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[2].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema59.anyOf[2].allOf[1].properties.services.items + .properties.serviceId, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + var valid29 = _errs130 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceDirection !== undefined) { + let data58 = data55.serviceDirection; + const _errs132 = errors; + if (typeof data58 !== 'string') { + const err92 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema59.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + if ( + !( + data58 === 'consumer' || + data58 === 'producer' || + data58 === 'prosumer' + ) + ) { + const err93 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema59.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema59.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema59.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + var valid29 = _errs132 === errors; + } else { + var valid29 = true; + } + } + } + } else { + const err94 = { + instancePath: instancePath + '/services/' + i9, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema59.anyOf[2].allOf[1].properties.services.items.type, + parentSchema: + schema59.anyOf[2].allOf[1].properties.services.items, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid28 = _errs125 === errors; + if (!valid28) { + break; + } + } + } else { + const err95 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema59.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema59.anyOf[2].allOf[1].properties.services, + data: data54, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + var valid27 = _errs123 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err96 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema59.anyOf[2].allOf[1].type, + parentSchema: schema59.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + var valid21 = _errs118 === errors; + } + var _valid0 = _errs93 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs134 = errors; + const _errs135 = errors; + if (errors === _errs135) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if ( + (data.url === undefined && (missing9 = 'url')) || + (data.type === undefined && (missing9 = 'type')) || + (data.name === undefined && (missing9 = 'name')) || + (data.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err97 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema59.anyOf[3].allOf[0].required, + parentSchema: schema59.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } else { + if (data.url !== undefined) { + let data59 = data.url; + const _errs137 = errors; + if (errors === _errs137) { + if (errors === _errs137) { + if (typeof data59 === 'string') { + if (!formats0(data59)) { + const err98 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema59.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } else { + const err99 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[3].allOf[0].properties.url.type, + parentSchema: schema59.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + } + var valid31 = _errs137 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.name !== undefined) { + let data60 = data.name; + const _errs139 = errors; + if (typeof data60 !== 'string') { + const err100 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema59.anyOf[3].allOf[0].properties.name, + data: data60, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + var valid31 = _errs139 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.description !== undefined) { + let data61 = data.description; + const _errs141 = errors; + if (typeof data61 !== 'string') { + const err101 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema59.anyOf[3].allOf[0].properties.description, + data: data61, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid31 = _errs141 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.type !== undefined) { + let data62 = data.type; + const _errs143 = errors; + if (typeof data62 !== 'string') { + const err102 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema59.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema59.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + if ( + !( + data62 === 'device' || + data62 === 'group' || + data62 === 'edge instantiable' || + data62 === 'cloud instantiable' + ) + ) { + const err103 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema59.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema59.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema59.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + var valid31 = _errs143 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.isPublic !== undefined) { + let data63 = data.isPublic; + const _errs145 = errors; + if (typeof data63 !== 'boolean') { + const err104 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema59.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema59.anyOf[3].allOf[0].properties.isPublic, + data: data63, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + var valid31 = _errs145 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.viewer !== undefined) { + let data64 = data.viewer; + const _errs147 = errors; + if (errors === _errs147) { + if (Array.isArray(data64)) { + var valid32 = true; + const len10 = data64.length; + for (let i10 = 0; i10 < len10; i10++) { + let data65 = data64[i10]; + const _errs149 = errors; + if (errors === _errs149) { + if ( + data65 && + typeof data65 == 'object' && + !Array.isArray(data65) + ) { + let missing10; + if (data65.url === undefined && (missing10 = 'url')) { + const err105 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + + missing10 + + "'", + schema: + schema59.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema59.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } else { + if (data65.url !== undefined) { + let data66 = data65.url; + const _errs151 = errors; + if (errors === _errs151) { + if (errors === _errs151) { + if (typeof data66 === 'string') { + if (!formats0(data66)) { + const err106 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema59.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } else { + const err107 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema59.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + } + } + } + } else { + const err108 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema59.anyOf[3].allOf[0].properties.viewer.items + .type, + parentSchema: + schema59.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid32 = _errs149 === errors; + if (!valid32) { + break; + } + } + } else { + const err109 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema59.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: + schema59.anyOf[3].allOf[0].properties.viewer, + data: data64, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + } + } + var valid31 = _errs147 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.owner !== undefined) { + let data67 = data.owner; + const _errs153 = errors; + if (errors === _errs153) { + if (Array.isArray(data67)) { + var valid34 = true; + const len11 = data67.length; + for (let i11 = 0; i11 < len11; i11++) { + let data68 = data67[i11]; + const _errs155 = errors; + if (errors === _errs155) { + if ( + data68 && + typeof data68 == 'object' && + !Array.isArray(data68) + ) { + let missing11; + if ( + data68.url === undefined && + (missing11 = 'url') + ) { + const err110 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema59.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema59.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err110]; + } else { + vErrors.push(err110); + } + errors++; + } else { + if (data68.url !== undefined) { + let data69 = data68.url; + const _errs157 = errors; + if (errors === _errs157) { + if (errors === _errs157) { + if (typeof data69 === 'string') { + if (!formats0(data69)) { + const err111 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema59.anyOf[3].allOf[0] + .properties.owner.items.properties + .url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err111]; + } else { + vErrors.push(err111); + } + errors++; + } + } else { + const err112 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema59.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err112]; + } else { + vErrors.push(err112); + } + errors++; + } + } + } + } + } + } else { + const err113 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema59.anyOf[3].allOf[0].properties.owner + .items.type, + parentSchema: + schema59.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err113]; + } else { + vErrors.push(err113); + } + errors++; + } + } + var valid34 = _errs155 === errors; + if (!valid34) { + break; + } + } + } else { + const err114 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema59.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema59.anyOf[3].allOf[0].properties.owner, + data: data67, + }; + if (vErrors === null) { + vErrors = [err114]; + } else { + vErrors.push(err114); + } + errors++; + } + } + var valid31 = _errs153 === errors; + } else { + var valid31 = true; + } + } + } + } + } + } + } + } + } else { + const err115 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema59.anyOf[3].allOf[0].type, + parentSchema: schema59.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err115]; + } else { + vErrors.push(err115); + } + errors++; + } + } + var valid30 = _errs135 === errors; + if (valid30) { + const _errs159 = errors; + if (errors === _errs159) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if (data.devices === undefined && (missing12 = 'devices')) { + const err116 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema59.anyOf[3].allOf[1].required, + parentSchema: schema59.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err116]; + } else { + vErrors.push(err116); + } + errors++; + } else { + if (data.type !== undefined) { + let data70 = data.type; + const _errs161 = errors; + if ('group' !== data70) { + const err117 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema59.anyOf[3].allOf[1].properties.type, + data: data70, + }; + if (vErrors === null) { + vErrors = [err117]; + } else { + vErrors.push(err117); + } + errors++; + } + var valid36 = _errs161 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data.devices !== undefined) { + let data71 = data.devices; + const _errs162 = errors; + if (errors === _errs162) { + if (Array.isArray(data71)) { + var valid37 = true; + const len12 = data71.length; + for (let i12 = 0; i12 < len12; i12++) { + let data72 = data71[i12]; + const _errs164 = errors; + if (errors === _errs164) { + if ( + data72 && + typeof data72 == 'object' && + !Array.isArray(data72) + ) { + let missing13; + if (data72.url === undefined && (missing13 = 'url')) { + const err118 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: + "must have required property '" + missing13 + "'", + schema: + schema59.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema59.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err118]; + } else { + vErrors.push(err118); + } + errors++; + } else { + if (data72.url !== undefined) { + let data73 = data72.url; + const _errs166 = errors; + if (errors === _errs166) { + if (errors === _errs166) { + if (typeof data73 === 'string') { + if (!formats0(data73)) { + const err119 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema59.anyOf[3].allOf[1].properties + .devices.items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err119]; + } else { + vErrors.push(err119); + } + errors++; + } + } else { + const err120 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema59.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema59.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err120]; + } else { + vErrors.push(err120); + } + errors++; + } + } + } + } + } + } else { + const err121 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema59.anyOf[3].allOf[1].properties.devices.items + .type, + parentSchema: + schema59.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err121]; + } else { + vErrors.push(err121); + } + errors++; + } + } + var valid37 = _errs164 === errors; + if (!valid37) { + break; + } + } + } else { + const err122 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema59.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema59.anyOf[3].allOf[1].properties.devices, + data: data71, + }; + if (vErrors === null) { + vErrors = [err122]; + } else { + vErrors.push(err122); + } + errors++; + } + } + var valid36 = _errs162 === errors; + } else { + var valid36 = true; + } + } + } + } else { + const err123 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema59.anyOf[3].allOf[1].type, + parentSchema: schema59.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err123]; + } else { + vErrors.push(err123); + } + errors++; + } + } + var valid30 = _errs159 === errors; + } + var _valid0 = _errs134 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err124 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema59.anyOf, + parentSchema: schema59, + data, + }; + if (vErrors === null) { + vErrors = [err124]; + } else { + vErrors.push(err124); + } + errors++; + validate74.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate74.errors = vErrors; + return errors === 0; +} +exports.validateInstantiateDeviceResponse201 = validate75; +const schema60 = { + type: 'object', + properties: { + instance: { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + connected: { + description: + 'If true, the device is connected to the service and can be used.\n', + type: 'boolean', + readOnly: true, + }, + announcedAvailability: { + readOnly: true, + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + deviceToken: { type: 'string' }, + }, + required: ['instance', 'deviceToken'], + 'x-standalone': false, + 'x-name': 'instantiateDeviceResponse201', + 'x-location': + '#/paths//devices/{device_id}/post/responses/201/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate75( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.instance === undefined && (missing0 = 'instance')) || + (data.deviceToken === undefined && (missing0 = 'deviceToken')) + ) { + validate75.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema60.required, + parentSchema: schema60, + data, + }, + ]; + return false; + } else { + if (data.instance !== undefined) { + let data0 = data.instance; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if ( + (data0.url === undefined && (missing1 = 'url')) || + (data0.type === undefined && (missing1 = 'type')) || + (data0.name === undefined && (missing1 = 'name')) || + (data0.isPublic === undefined && (missing1 = 'isPublic')) + ) { + validate75.errors = [ + { + instancePath: instancePath + '/instance', + schemaPath: '#/properties/instance/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema60.properties.instance.allOf[0].required, + parentSchema: schema60.properties.instance.allOf[0], + data: data0, + }, + ]; + return false; + } else { + if (data0.url !== undefined) { + let data1 = data0.url; + const _errs4 = errors; + if (errors === _errs4) { + if (errors === _errs4) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate75.errors = [ + { + instancePath: instancePath + '/instance/url', + schemaPath: + '#/properties/instance/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema60.properties.instance.allOf[0].properties.url, + data: data1, + }, + ]; + return false; + } + } else { + validate75.errors = [ + { + instancePath: instancePath + '/instance/url', + schemaPath: + '#/properties/instance/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema60.properties.instance.allOf[0].properties.url.type, + parentSchema: + schema60.properties.instance.allOf[0].properties.url, + data: data1, + }, + ]; + return false; + } + } + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.name !== undefined) { + let data2 = data0.name; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate75.errors = [ + { + instancePath: instancePath + '/instance/name', + schemaPath: + '#/properties/instance/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema60.properties.instance.allOf[0].properties.name.type, + parentSchema: + schema60.properties.instance.allOf[0].properties.name, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.description !== undefined) { + let data3 = data0.description; + const _errs8 = errors; + if (typeof data3 !== 'string') { + validate75.errors = [ + { + instancePath: instancePath + '/instance/description', + schemaPath: + '#/properties/instance/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema60.properties.instance.allOf[0].properties.description + .type, + parentSchema: + schema60.properties.instance.allOf[0].properties + .description, + data: data3, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.type !== undefined) { + let data4 = data0.type; + const _errs10 = errors; + if (typeof data4 !== 'string') { + validate75.errors = [ + { + instancePath: instancePath + '/instance/type', + schemaPath: + '#/properties/instance/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema60.properties.instance.allOf[0].properties.type + .type, + parentSchema: + schema60.properties.instance.allOf[0].properties.type, + data: data4, + }, + ]; + return false; + } + if ( + !( + data4 === 'device' || + data4 === 'group' || + data4 === 'edge instantiable' || + data4 === 'cloud instantiable' + ) + ) { + validate75.errors = [ + { + instancePath: instancePath + '/instance/type', + schemaPath: + '#/properties/instance/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema60.properties.instance.allOf[0].properties.type + .enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema60.properties.instance.allOf[0].properties.type + .enum, + parentSchema: + schema60.properties.instance.allOf[0].properties.type, + data: data4, + }, + ]; + return false; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.isPublic !== undefined) { + let data5 = data0.isPublic; + const _errs12 = errors; + if (typeof data5 !== 'boolean') { + validate75.errors = [ + { + instancePath: instancePath + '/instance/isPublic', + schemaPath: + '#/properties/instance/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema60.properties.instance.allOf[0].properties + .isPublic.type, + parentSchema: + schema60.properties.instance.allOf[0].properties + .isPublic, + data: data5, + }, + ]; + return false; + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.viewer !== undefined) { + let data6 = data0.viewer; + const _errs14 = errors; + if (errors === _errs14) { + if (Array.isArray(data6)) { + var valid3 = true; + const len0 = data6.length; + for (let i0 = 0; i0 < len0; i0++) { + let data7 = data6[i0]; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing2; + if (data7.url === undefined && (missing2 = 'url')) { + validate75.errors = [ + { + instancePath: + instancePath + '/instance/viewer/' + i0, + schemaPath: + '#/properties/instance/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + + missing2 + + "'", + schema: + schema60.properties.instance.allOf[0] + .properties.viewer.items.required, + parentSchema: + schema60.properties.instance.allOf[0] + .properties.viewer.items, + data: data7, + }, + ]; + return false; + } else { + if (data7.url !== undefined) { + let data8 = data7.url; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data8 === 'string') { + if (!formats0(data8)) { + validate75.errors = [ + { + instancePath: + instancePath + + '/instance/viewer/' + + i0 + + '/url', + schemaPath: + '#/properties/instance/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema60.properties.instance + .allOf[0].properties.viewer + .items.properties.url, + data: data8, + }, + ]; + return false; + } + } else { + validate75.errors = [ + { + instancePath: + instancePath + + '/instance/viewer/' + + i0 + + '/url', + schemaPath: + '#/properties/instance/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema60.properties.instance + .allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema60.properties.instance + .allOf[0].properties.viewer.items + .properties.url, + data: data8, + }, + ]; + return false; + } + } + } + } + } + } else { + validate75.errors = [ + { + instancePath: + instancePath + '/instance/viewer/' + i0, + schemaPath: + '#/properties/instance/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema60.properties.instance.allOf[0] + .properties.viewer.items.type, + parentSchema: + schema60.properties.instance.allOf[0] + .properties.viewer.items, + data: data7, + }, + ]; + return false; + } + } + var valid3 = _errs16 === errors; + if (!valid3) { + break; + } + } + } else { + validate75.errors = [ + { + instancePath: instancePath + '/instance/viewer', + schemaPath: + '#/properties/instance/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema60.properties.instance.allOf[0].properties + .viewer.type, + parentSchema: + schema60.properties.instance.allOf[0].properties + .viewer, + data: data6, + }, + ]; + return false; + } + } + var valid2 = _errs14 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.owner !== undefined) { + let data9 = data0.owner; + const _errs20 = errors; + if (errors === _errs20) { + if (Array.isArray(data9)) { + var valid5 = true; + const len1 = data9.length; + for (let i1 = 0; i1 < len1; i1++) { + let data10 = data9[i1]; + const _errs22 = errors; + if (errors === _errs22) { + if ( + data10 && + typeof data10 == 'object' && + !Array.isArray(data10) + ) { + let missing3; + if ( + data10.url === undefined && + (missing3 = 'url') + ) { + validate75.errors = [ + { + instancePath: + instancePath + '/instance/owner/' + i1, + schemaPath: + '#/properties/instance/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema60.properties.instance.allOf[0] + .properties.owner.items.required, + parentSchema: + schema60.properties.instance.allOf[0] + .properties.owner.items, + data: data10, + }, + ]; + return false; + } else { + if (data10.url !== undefined) { + let data11 = data10.url; + const _errs24 = errors; + if (errors === _errs24) { + if (errors === _errs24) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + validate75.errors = [ + { + instancePath: + instancePath + + '/instance/owner/' + + i1 + + '/url', + schemaPath: + '#/properties/instance/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema60.properties.instance + .allOf[0].properties.owner + .items.properties.url, + data: data11, + }, + ]; + return false; + } + } else { + validate75.errors = [ + { + instancePath: + instancePath + + '/instance/owner/' + + i1 + + '/url', + schemaPath: + '#/properties/instance/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema60.properties.instance + .allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema60.properties.instance + .allOf[0].properties.owner.items + .properties.url, + data: data11, + }, + ]; + return false; + } + } + } + } + } + } else { + validate75.errors = [ + { + instancePath: + instancePath + '/instance/owner/' + i1, + schemaPath: + '#/properties/instance/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema60.properties.instance.allOf[0] + .properties.owner.items.type, + parentSchema: + schema60.properties.instance.allOf[0] + .properties.owner.items, + data: data10, + }, + ]; + return false; + } + } + var valid5 = _errs22 === errors; + if (!valid5) { + break; + } + } + } else { + validate75.errors = [ + { + instancePath: instancePath + '/instance/owner', + schemaPath: + '#/properties/instance/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema60.properties.instance.allOf[0].properties + .owner.type, + parentSchema: + schema60.properties.instance.allOf[0].properties + .owner, + data: data9, + }, + ]; + return false; + } + } + var valid2 = _errs20 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } + } else { + validate75.errors = [ + { + instancePath: instancePath + '/instance', + schemaPath: '#/properties/instance/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema60.properties.instance.allOf[0].type, + parentSchema: schema60.properties.instance.allOf[0], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs26 = errors; + if (errors === _errs26) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.type !== undefined) { + let data12 = data0.type; + const _errs28 = errors; + if ('device' !== data12) { + validate75.errors = [ + { + instancePath: instancePath + '/instance/type', + schemaPath: '#/properties/instance/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: + schema60.properties.instance.allOf[1].properties.type, + data: data12, + }, + ]; + return false; + } + var valid7 = _errs28 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data0.connected !== undefined) { + let data13 = data0.connected; + const _errs29 = errors; + if (typeof data13 !== 'boolean') { + validate75.errors = [ + { + instancePath: instancePath + '/instance/connected', + schemaPath: + '#/properties/instance/allOf/1/properties/connected/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema60.properties.instance.allOf[1].properties.connected + .type, + parentSchema: + schema60.properties.instance.allOf[1].properties.connected, + data: data13, + }, + ]; + return false; + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data0.announcedAvailability !== undefined) { + let data14 = data0.announcedAvailability; + const _errs31 = errors; + if (errors === _errs31) { + if (Array.isArray(data14)) { + var valid8 = true; + const len2 = data14.length; + for (let i2 = 0; i2 < len2; i2++) { + let data15 = data14[i2]; + const _errs33 = errors; + if (errors === _errs33) { + if ( + data15 && + typeof data15 == 'object' && + !Array.isArray(data15) + ) { + if (data15.start !== undefined) { + let data16 = data15.start; + const _errs35 = errors; + if (errors === _errs35) { + if (errors === _errs35) { + if (typeof data16 === 'string') { + if (!formats22.validate(data16)) { + validate75.errors = [ + { + instancePath: + instancePath + + '/instance/announcedAvailability/' + + i2 + + '/start', + schemaPath: + '#/properties/instance/allOf/1/properties/announcedAvailability/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema60.properties.instance.allOf[1] + .properties.announcedAvailability.items + .properties.start, + data: data16, + }, + ]; + return false; + } + } else { + validate75.errors = [ + { + instancePath: + instancePath + + '/instance/announcedAvailability/' + + i2 + + '/start', + schemaPath: + '#/properties/instance/allOf/1/properties/announcedAvailability/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema60.properties.instance.allOf[1] + .properties.announcedAvailability.items + .properties.start.type, + parentSchema: + schema60.properties.instance.allOf[1] + .properties.announcedAvailability.items + .properties.start, + data: data16, + }, + ]; + return false; + } + } + } + var valid9 = _errs35 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data15.end !== undefined) { + let data17 = data15.end; + const _errs37 = errors; + if (errors === _errs37) { + if (errors === _errs37) { + if (typeof data17 === 'string') { + if (!formats22.validate(data17)) { + validate75.errors = [ + { + instancePath: + instancePath + + '/instance/announcedAvailability/' + + i2 + + '/end', + schemaPath: + '#/properties/instance/allOf/1/properties/announcedAvailability/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + + 'date-time' + + '"', + schema: 'date-time', + parentSchema: + schema60.properties.instance.allOf[1] + .properties.announcedAvailability + .items.properties.end, + data: data17, + }, + ]; + return false; + } + } else { + validate75.errors = [ + { + instancePath: + instancePath + + '/instance/announcedAvailability/' + + i2 + + '/end', + schemaPath: + '#/properties/instance/allOf/1/properties/announcedAvailability/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema60.properties.instance.allOf[1] + .properties.announcedAvailability.items + .properties.end.type, + parentSchema: + schema60.properties.instance.allOf[1] + .properties.announcedAvailability.items + .properties.end, + data: data17, + }, + ]; + return false; + } + } + } + var valid9 = _errs37 === errors; + } else { + var valid9 = true; + } + } + } else { + validate75.errors = [ + { + instancePath: + instancePath + + '/instance/announcedAvailability/' + + i2, + schemaPath: + '#/properties/instance/allOf/1/properties/announcedAvailability/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema60.properties.instance.allOf[1].properties + .announcedAvailability.items.type, + parentSchema: + schema60.properties.instance.allOf[1].properties + .announcedAvailability.items, + data: data15, + }, + ]; + return false; + } + } + var valid8 = _errs33 === errors; + if (!valid8) { + break; + } + } + } else { + validate75.errors = [ + { + instancePath: + instancePath + '/instance/announcedAvailability', + schemaPath: + '#/properties/instance/allOf/1/properties/announcedAvailability/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema60.properties.instance.allOf[1].properties + .announcedAvailability.type, + parentSchema: + schema60.properties.instance.allOf[1].properties + .announcedAvailability, + data: data14, + }, + ]; + return false; + } + } + var valid7 = _errs31 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data0.experiment !== undefined) { + let data18 = data0.experiment; + const _errs39 = errors; + if (errors === _errs39) { + if (errors === _errs39) { + if (typeof data18 === 'string') { + if (!formats0(data18)) { + validate75.errors = [ + { + instancePath: instancePath + '/instance/experiment', + schemaPath: + '#/properties/instance/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema60.properties.instance.allOf[1].properties + .experiment, + data: data18, + }, + ]; + return false; + } + } else { + validate75.errors = [ + { + instancePath: instancePath + '/instance/experiment', + schemaPath: + '#/properties/instance/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema60.properties.instance.allOf[1].properties + .experiment.type, + parentSchema: + schema60.properties.instance.allOf[1].properties + .experiment, + data: data18, + }, + ]; + return false; + } + } + } + var valid7 = _errs39 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data0.services !== undefined) { + let data19 = data0.services; + const _errs41 = errors; + if (errors === _errs41) { + if (Array.isArray(data19)) { + var valid10 = true; + const len3 = data19.length; + for (let i3 = 0; i3 < len3; i3++) { + let data20 = data19[i3]; + const _errs43 = errors; + if (errors === _errs43) { + if ( + data20 && + typeof data20 == 'object' && + !Array.isArray(data20) + ) { + if (data20.serviceType !== undefined) { + let data21 = data20.serviceType; + const _errs46 = errors; + if (errors === _errs46) { + if (errors === _errs46) { + if (typeof data21 === 'string') { + if (!formats0(data21)) { + validate75.errors = [ + { + instancePath: + instancePath + + '/instance/services/' + + i3 + + '/serviceType', + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema60.properties.instance.allOf[1] + .properties.services.items + .properties.serviceType, + data: data21, + }, + ]; + return false; + } + } else { + validate75.errors = [ + { + instancePath: + instancePath + + '/instance/services/' + + i3 + + '/serviceType', + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema60.properties.instance.allOf[1] + .properties.services.items.properties + .serviceType.type, + parentSchema: + schema60.properties.instance.allOf[1] + .properties.services.items.properties + .serviceType, + data: data21, + }, + ]; + return false; + } + } + } + var valid11 = _errs46 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data20.serviceId !== undefined) { + let data22 = data20.serviceId; + const _errs48 = errors; + if (typeof data22 !== 'string') { + validate75.errors = [ + { + instancePath: + instancePath + + '/instance/services/' + + i3 + + '/serviceId', + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema60.properties.instance.allOf[1] + .properties.services.items.properties + .serviceId.type, + parentSchema: + schema60.properties.instance.allOf[1] + .properties.services.items.properties + .serviceId, + data: data22, + }, + ]; + return false; + } + var valid11 = _errs48 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data20.serviceDirection !== undefined) { + let data23 = data20.serviceDirection; + const _errs50 = errors; + if (typeof data23 !== 'string') { + validate75.errors = [ + { + instancePath: + instancePath + + '/instance/services/' + + i3 + + '/serviceDirection', + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema60.properties.instance.allOf[1] + .properties.services.items.properties + .serviceDirection.type, + parentSchema: + schema60.properties.instance.allOf[1] + .properties.services.items.properties + .serviceDirection, + data: data23, + }, + ]; + return false; + } + if ( + !( + data23 === 'consumer' || + data23 === 'producer' || + data23 === 'prosumer' + ) + ) { + validate75.errors = [ + { + instancePath: + instancePath + + '/instance/services/' + + i3 + + '/serviceDirection', + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema60.properties.instance.allOf[1] + .properties.services.items + .properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema60.properties.instance.allOf[1] + .properties.services.items.properties + .serviceDirection.enum, + parentSchema: + schema60.properties.instance.allOf[1] + .properties.services.items.properties + .serviceDirection, + data: data23, + }, + ]; + return false; + } + var valid11 = _errs50 === errors; + } else { + var valid11 = true; + } + } + } + } else { + validate75.errors = [ + { + instancePath: + instancePath + '/instance/services/' + i3, + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema60.properties.instance.allOf[1].properties + .services.items.type, + parentSchema: + schema60.properties.instance.allOf[1].properties + .services.items, + data: data20, + }, + ]; + return false; + } + } + var valid10 = _errs43 === errors; + if (!valid10) { + break; + } + } + } else { + validate75.errors = [ + { + instancePath: instancePath + '/instance/services', + schemaPath: + '#/properties/instance/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema60.properties.instance.allOf[1].properties + .services.type, + parentSchema: + schema60.properties.instance.allOf[1].properties + .services, + data: data19, + }, + ]; + return false; + } + } + var valid7 = _errs41 === errors; + } else { + var valid7 = true; + } + } + } + } + } + } else { + validate75.errors = [ + { + instancePath: instancePath + '/instance', + schemaPath: '#/properties/instance/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema60.properties.instance.allOf[1].type, + parentSchema: schema60.properties.instance.allOf[1], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs26 === errors; + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.deviceToken !== undefined) { + let data24 = data.deviceToken; + const _errs52 = errors; + if (typeof data24 !== 'string') { + validate75.errors = [ + { + instancePath: instancePath + '/deviceToken', + schemaPath: '#/properties/deviceToken/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema60.properties.deviceToken.type, + parentSchema: schema60.properties.deviceToken, + data: data24, + }, + ]; + return false; + } + var valid0 = _errs52 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate75.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema60.type, + parentSchema: schema60, + data, + }, + ]; + return false; + } + } + validate75.errors = vErrors; + return errors === 0; +} +exports.validateGetDeviceAvailabilityResponse200 = validate76; +const schema61 = { + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + 'x-standalone': false, + 'x-name': 'getDeviceAvailabilityResponse200', + 'x-location': + '#/paths//devices/{device_id}/availability/get/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate76( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.start !== undefined) { + let data1 = data0.start; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate76.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema61.items.properties.start, + data: data1, + }, + ]; + return false; + } + } else { + validate76.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema61.items.properties.start.type, + parentSchema: schema61.items.properties.start, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.end !== undefined) { + let data2 = data0.end; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats22.validate(data2)) { + validate76.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema61.items.properties.end, + data: data2, + }, + ]; + return false; + } + } else { + validate76.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema61.items.properties.end.type, + parentSchema: schema61.items.properties.end, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + validate76.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema61.items.type, + parentSchema: schema61.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate76.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema61.type, + parentSchema: schema61, + data, + }, + ]; + return false; + } + } + validate76.errors = vErrors; + return errors === 0; +} +exports.validateAddDeviceAvailabilityRulesBody = validate77; +const schema62 = { + title: 'Availability Rules', + description: 'The availability rule to be applied.', + type: 'array', + items: { + title: 'Availability Rule', + type: 'object', + allOf: [ + { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + { + type: 'object', + properties: { + available: { type: 'boolean' }, + repeat: { + description: + 'If specified the time slot is repeated in a fixed offset specified by the frequency', + type: 'object', + properties: { + frequency: { type: 'string', enum: ['HOURLY', 'DAILY', 'WEEKLY'] }, + until: { + description: 'Up to this date-time the time slot will be repeated.', + type: 'string', + format: 'date-time', + }, + count: { + description: 'How often the time slot will be repeated', + type: 'integer', + }, + }, + required: ['frequency'], + }, + }, + }, + ], + }, + 'x-standalone': false, + 'x-name': 'addDeviceAvailabilityRulesBody', + 'x-location': + '#/paths//devices/{device_id}/availability/post/requestBody/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate77( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (!(data0 && typeof data0 == 'object' && !Array.isArray(data0))) { + validate77.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema62.items.type, + parentSchema: schema62.items, + data: data0, + }, + ]; + return false; + } + const _errs3 = errors; + if (errors === _errs3) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.start !== undefined) { + let data1 = data0.start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate77.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/allOf/0/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema62.items.allOf[0].properties.start, + data: data1, + }, + ]; + return false; + } + } else { + validate77.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/allOf/0/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema62.items.allOf[0].properties.start.type, + parentSchema: schema62.items.allOf[0].properties.start, + data: data1, + }, + ]; + return false; + } + } + } + var valid2 = _errs5 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.end !== undefined) { + let data2 = data0.end; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data2 === 'string') { + if (!formats22.validate(data2)) { + validate77.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/allOf/0/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema62.items.allOf[0].properties.end, + data: data2, + }, + ]; + return false; + } + } else { + validate77.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/allOf/0/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema62.items.allOf[0].properties.end.type, + parentSchema: schema62.items.allOf[0].properties.end, + data: data2, + }, + ]; + return false; + } + } + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + } + } else { + validate77.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema62.items.allOf[0].type, + parentSchema: schema62.items.allOf[0], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (valid1) { + const _errs9 = errors; + if (errors === _errs9) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.available !== undefined) { + let data3 = data0.available; + const _errs11 = errors; + if (typeof data3 !== 'boolean') { + validate77.errors = [ + { + instancePath: instancePath + '/' + i0 + '/available', + schemaPath: '#/items/allOf/1/properties/available/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema62.items.allOf[1].properties.available.type, + parentSchema: schema62.items.allOf[1].properties.available, + data: data3, + }, + ]; + return false; + } + var valid3 = _errs11 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data0.repeat !== undefined) { + let data4 = data0.repeat; + const _errs13 = errors; + if (errors === _errs13) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing0; + if (data4.frequency === undefined && (missing0 = 'frequency')) { + validate77.errors = [ + { + instancePath: instancePath + '/' + i0 + '/repeat', + schemaPath: '#/items/allOf/1/properties/repeat/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema62.items.allOf[1].properties.repeat.required, + parentSchema: schema62.items.allOf[1].properties.repeat, + data: data4, + }, + ]; + return false; + } else { + if (data4.frequency !== undefined) { + let data5 = data4.frequency; + const _errs15 = errors; + if (typeof data5 !== 'string') { + validate77.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/repeat/frequency', + schemaPath: + '#/items/allOf/1/properties/repeat/properties/frequency/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema62.items.allOf[1].properties.repeat.properties + .frequency.type, + parentSchema: + schema62.items.allOf[1].properties.repeat.properties + .frequency, + data: data5, + }, + ]; + return false; + } + if ( + !( + data5 === 'HOURLY' || + data5 === 'DAILY' || + data5 === 'WEEKLY' + ) + ) { + validate77.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/repeat/frequency', + schemaPath: + '#/items/allOf/1/properties/repeat/properties/frequency/enum', + keyword: 'enum', + params: { + allowedValues: + schema62.items.allOf[1].properties.repeat.properties + .frequency.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema62.items.allOf[1].properties.repeat.properties + .frequency.enum, + parentSchema: + schema62.items.allOf[1].properties.repeat.properties + .frequency, + data: data5, + }, + ]; + return false; + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data4.until !== undefined) { + let data6 = data4.until; + const _errs17 = errors; + if (errors === _errs17) { + if (errors === _errs17) { + if (typeof data6 === 'string') { + if (!formats22.validate(data6)) { + validate77.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/repeat/until', + schemaPath: + '#/items/allOf/1/properties/repeat/properties/until/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema62.items.allOf[1].properties.repeat + .properties.until, + data: data6, + }, + ]; + return false; + } + } else { + validate77.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/repeat/until', + schemaPath: + '#/items/allOf/1/properties/repeat/properties/until/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema62.items.allOf[1].properties.repeat + .properties.until.type, + parentSchema: + schema62.items.allOf[1].properties.repeat + .properties.until, + data: data6, + }, + ]; + return false; + } + } + } + var valid4 = _errs17 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data4.count !== undefined) { + let data7 = data4.count; + const _errs19 = errors; + if ( + !( + typeof data7 == 'number' && + !(data7 % 1) && + !isNaN(data7) && + isFinite(data7) + ) + ) { + validate77.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/repeat/count', + schemaPath: + '#/items/allOf/1/properties/repeat/properties/count/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + schema: + schema62.items.allOf[1].properties.repeat.properties + .count.type, + parentSchema: + schema62.items.allOf[1].properties.repeat.properties + .count, + data: data7, + }, + ]; + return false; + } + var valid4 = _errs19 === errors; + } else { + var valid4 = true; + } + } + } + } + } else { + validate77.errors = [ + { + instancePath: instancePath + '/' + i0 + '/repeat', + schemaPath: '#/items/allOf/1/properties/repeat/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema62.items.allOf[1].properties.repeat.type, + parentSchema: schema62.items.allOf[1].properties.repeat, + data: data4, + }, + ]; + return false; + } + } + var valid3 = _errs13 === errors; + } else { + var valid3 = true; + } + } + } else { + validate77.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema62.items.allOf[1].type, + parentSchema: schema62.items.allOf[1], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs9 === errors; + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate77.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema62.type, + parentSchema: schema62, + data, + }, + ]; + return false; + } + } + validate77.errors = vErrors; + return errors === 0; +} +exports.validateAddDeviceAvailabilityRulesResponse200 = validate78; +const schema63 = { + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + 'x-standalone': false, + 'x-name': 'addDeviceAvailabilityRulesResponse200', + 'x-location': + '#/paths//devices/{device_id}/availability/post/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate78( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.start !== undefined) { + let data1 = data0.start; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate78.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema63.items.properties.start, + data: data1, + }, + ]; + return false; + } + } else { + validate78.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema63.items.properties.start.type, + parentSchema: schema63.items.properties.start, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.end !== undefined) { + let data2 = data0.end; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats22.validate(data2)) { + validate78.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema63.items.properties.end, + data: data2, + }, + ]; + return false; + } + } else { + validate78.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema63.items.properties.end.type, + parentSchema: schema63.items.properties.end, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + validate78.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema63.items.type, + parentSchema: schema63.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate78.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema63.type, + parentSchema: schema63, + data, + }, + ]; + return false; + } + } + validate78.errors = vErrors; + return errors === 0; +} +exports.validateCreateWebsocketTokenResponse200 = validate79; +const schema64 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'createWebsocketTokenResponse200', + 'x-location': + '#/paths//devices/{device_id}/websocket/post/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate79( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate79.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema64.type, + parentSchema: schema64, + data, + }, + ]; + return false; + } + validate79.errors = vErrors; + return errors === 0; +} +exports.validateSendSignalingMessageBody = validate80; +const schema65 = { + title: 'Sig Message', + anyOf: [ + { + title: 'Create Peerconnection Message', + allOf: [ + { + title: 'Command Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'command' }, + command: { type: 'string' }, + }, + required: ['messageType', 'command'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + command: { const: 'createPeerconnection' }, + connectionType: { type: 'string', enum: ['webrtc', 'websocket', 'local'] }, + connectionUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + type: 'object', + required: ['serviceType', 'serviceId', 'remoteServiceId'], + title: 'Service Config', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + additionalProperties: true, + }, + }, + tiebreaker: { type: 'boolean' }, + config: { type: 'object', additionalProperties: true }, + }, + required: [ + 'command', + 'connectionType', + 'connectionUrl', + 'services', + 'tiebreaker', + ], + }, + ], + 'x-typeguard': true, + }, + { + title: 'Close Peerconnection Message', + allOf: [ + { + title: 'Command Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'command' }, + command: { type: 'string' }, + }, + required: ['messageType', 'command'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + command: { const: 'closePeerconnection' }, + connectionUrl: { type: 'string', format: 'uri' }, + }, + required: ['command', 'connectionUrl'], + }, + ], + 'x-typeguard': true, + }, + { + title: 'Signaling Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'signaling' }, + signalingType: { type: 'string' }, + connectionUrl: { type: 'string', format: 'uri' }, + content: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'signalingType', 'connectionUrl', 'content'], + }, + ], + 'x-typeguard': true, + }, + { + title: 'Configuration Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'configuration' }, + configuration: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'configuration'], + }, + ], + 'x-typeguard': true, + }, + { + title: 'Experiment Status Changed Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'experiment-status-changed' }, + status: { type: 'string' }, + message: { type: 'string' }, + }, + required: ['messageType', 'status'], + }, + ], + 'x-typeguard': true, + }, + { + title: 'Logging Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'logging' }, + content: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'content'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-standalone': false, + 'x-name': 'sendSignalingMessageBody', + 'x-location': + '#/paths//devices/{device_id}/signaling/post/requestBody/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate80( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + const _errs3 = errors; + if (errors === _errs3) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema65.anyOf[0].allOf[0].allOf[0].required, + parentSchema: schema65.anyOf[0].allOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + const err1 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/0/allOf/0/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema65.anyOf[0].allOf[0].allOf[0].properties.messageType.type, + parentSchema: schema65.anyOf[0].allOf[0].allOf[0].properties.messageType, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } + } + } else { + const err2 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema65.anyOf[0].allOf[0].allOf[0].type, + parentSchema: schema65.anyOf[0].allOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + var valid2 = _errs3 === errors; + if (valid2) { + const _errs8 = errors; + if (errors === _errs8) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.command === undefined && (missing1 = 'command')) + ) { + const err3 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema65.anyOf[0].allOf[0].allOf[1].required, + parentSchema: schema65.anyOf[0].allOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs10 = errors; + if ('command' !== data1) { + const err4 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/0/allOf/0/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'command' }, + message: 'must be equal to constant', + schema: 'command', + parentSchema: schema65.anyOf[0].allOf[0].allOf[1].properties.messageType, + data: data1, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid4 = _errs10 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.command !== undefined) { + let data2 = data.command; + const _errs11 = errors; + if (typeof data2 !== 'string') { + const err5 = { + instancePath: instancePath + '/command', + schemaPath: '#/anyOf/0/allOf/0/allOf/1/properties/command/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema65.anyOf[0].allOf[0].allOf[1].properties.command.type, + parentSchema: schema65.anyOf[0].allOf[0].allOf[1].properties.command, + data: data2, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + var valid4 = _errs11 === errors; + } else { + var valid4 = true; + } + } + } + } else { + const err6 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema65.anyOf[0].allOf[0].allOf[1].type, + parentSchema: schema65.anyOf[0].allOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + var valid2 = _errs8 === errors; + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs13 = errors; + if (errors === _errs13) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.command === undefined && (missing2 = 'command')) || + (data.connectionType === undefined && (missing2 = 'connectionType')) || + (data.connectionUrl === undefined && (missing2 = 'connectionUrl')) || + (data.services === undefined && (missing2 = 'services')) || + (data.tiebreaker === undefined && (missing2 = 'tiebreaker')) + ) { + const err7 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema65.anyOf[0].allOf[1].required, + parentSchema: schema65.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } else { + if (data.command !== undefined) { + let data3 = data.command; + const _errs15 = errors; + if ('createPeerconnection' !== data3) { + const err8 = { + instancePath: instancePath + '/command', + schemaPath: '#/anyOf/0/allOf/1/properties/command/const', + keyword: 'const', + params: { allowedValue: 'createPeerconnection' }, + message: 'must be equal to constant', + schema: 'createPeerconnection', + parentSchema: schema65.anyOf[0].allOf[1].properties.command, + data: data3, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + var valid5 = _errs15 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data.connectionType !== undefined) { + let data4 = data.connectionType; + const _errs16 = errors; + if (typeof data4 !== 'string') { + const err9 = { + instancePath: instancePath + '/connectionType', + schemaPath: '#/anyOf/0/allOf/1/properties/connectionType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema65.anyOf[0].allOf[1].properties.connectionType.type, + parentSchema: schema65.anyOf[0].allOf[1].properties.connectionType, + data: data4, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + if (!(data4 === 'webrtc' || data4 === 'websocket' || data4 === 'local')) { + const err10 = { + instancePath: instancePath + '/connectionType', + schemaPath: '#/anyOf/0/allOf/1/properties/connectionType/enum', + keyword: 'enum', + params: { + allowedValues: + schema65.anyOf[0].allOf[1].properties.connectionType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema65.anyOf[0].allOf[1].properties.connectionType.enum, + parentSchema: schema65.anyOf[0].allOf[1].properties.connectionType, + data: data4, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + var valid5 = _errs16 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data.connectionUrl !== undefined) { + let data5 = data.connectionUrl; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + const err11 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema65.anyOf[0].allOf[1].properties.connectionUrl, + data: data5, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } else { + const err12 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema65.anyOf[0].allOf[1].properties.connectionUrl.type, + parentSchema: schema65.anyOf[0].allOf[1].properties.connectionUrl, + data: data5, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } + } + var valid5 = _errs18 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data.services !== undefined) { + let data6 = data.services; + const _errs20 = errors; + if (errors === _errs20) { + if (Array.isArray(data6)) { + var valid6 = true; + const len0 = data6.length; + for (let i0 = 0; i0 < len0; i0++) { + let data7 = data6[i0]; + const _errs22 = errors; + if (errors === _errs22) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing3; + if ( + (data7.serviceType === undefined && + (missing3 = 'serviceType')) || + (data7.serviceId === undefined && + (missing3 = 'serviceId')) || + (data7.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + const err13 = { + instancePath: instancePath + '/services/' + i0, + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: + schema65.anyOf[0].allOf[1].properties.services.items + .required, + parentSchema: + schema65.anyOf[0].allOf[1].properties.services.items, + data: data7, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } else { + if (data7.serviceType !== undefined) { + let data8 = data7.serviceType; + const _errs25 = errors; + if (errors === _errs25) { + if (errors === _errs25) { + if (typeof data8 === 'string') { + if (!formats0(data8)) { + const err14 = { + instancePath: + instancePath + + '/services/' + + i0 + + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema65.anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data8, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } else { + const err15 = { + instancePath: + instancePath + + '/services/' + + i0 + + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema65.anyOf[0].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema65.anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data8, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + } + var valid7 = _errs25 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data7.serviceId !== undefined) { + let data9 = data7.serviceId; + const _errs27 = errors; + if (typeof data9 !== 'string') { + const err16 = { + instancePath: + instancePath + '/services/' + i0 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema65.anyOf[0].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema65.anyOf[0].allOf[1].properties.services + .items.properties.serviceId, + data: data9, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data7.remoteServiceId !== undefined) { + let data10 = data7.remoteServiceId; + const _errs29 = errors; + if (typeof data10 !== 'string') { + const err17 = { + instancePath: + instancePath + + '/services/' + + i0 + + '/remoteServiceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema65.anyOf[0].allOf[1].properties.services + .items.properties.remoteServiceId.type, + parentSchema: + schema65.anyOf[0].allOf[1].properties.services + .items.properties.remoteServiceId, + data: data10, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + const err18 = { + instancePath: instancePath + '/services/' + i0, + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema65.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema65.anyOf[0].allOf[1].properties.services.items, + data: data7, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } + var valid6 = _errs22 === errors; + if (!valid6) { + break; + } + } + } else { + const err19 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema65.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema65.anyOf[0].allOf[1].properties.services, + data: data6, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + } + var valid5 = _errs20 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data.tiebreaker !== undefined) { + let data11 = data.tiebreaker; + const _errs31 = errors; + if (typeof data11 !== 'boolean') { + const err20 = { + instancePath: instancePath + '/tiebreaker', + schemaPath: '#/anyOf/0/allOf/1/properties/tiebreaker/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema65.anyOf[0].allOf[1].properties.tiebreaker.type, + parentSchema: schema65.anyOf[0].allOf[1].properties.tiebreaker, + data: data11, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + var valid5 = _errs31 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data.config !== undefined) { + let data12 = data.config; + const _errs33 = errors; + if (errors === _errs33) { + if ( + data12 && + typeof data12 == 'object' && + !Array.isArray(data12) + ) { + } else { + const err21 = { + instancePath: instancePath + '/config', + schemaPath: '#/anyOf/0/allOf/1/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema65.anyOf[0].allOf[1].properties.config.type, + parentSchema: schema65.anyOf[0].allOf[1].properties.config, + data: data12, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + var valid5 = _errs33 === errors; + } else { + var valid5 = true; + } + } + } + } + } + } + } + } else { + const err22 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema65.anyOf[0].allOf[1].type, + parentSchema: schema65.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } + var valid1 = _errs13 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs36 = errors; + const _errs37 = errors; + const _errs38 = errors; + if (errors === _errs38) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing4; + if (data.messageType === undefined && (missing4 = 'messageType')) { + const err23 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: "must have required property '" + missing4 + "'", + schema: schema65.anyOf[1].allOf[0].allOf[0].required, + parentSchema: schema65.anyOf[1].allOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data13 = data.messageType; + if (typeof data13 !== 'string') { + const err24 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/1/allOf/0/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema65.anyOf[1].allOf[0].allOf[0].properties.messageType.type, + parentSchema: schema65.anyOf[1].allOf[0].allOf[0].properties.messageType, + data: data13, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + } + } + } else { + const err25 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema65.anyOf[1].allOf[0].allOf[0].type, + parentSchema: schema65.anyOf[1].allOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + var valid9 = _errs38 === errors; + if (valid9) { + const _errs43 = errors; + if (errors === _errs43) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing5; + if ( + (data.messageType === undefined && (missing5 = 'messageType')) || + (data.command === undefined && (missing5 = 'command')) + ) { + const err26 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: "must have required property '" + missing5 + "'", + schema: schema65.anyOf[1].allOf[0].allOf[1].required, + parentSchema: schema65.anyOf[1].allOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data14 = data.messageType; + const _errs45 = errors; + if ('command' !== data14) { + const err27 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/1/allOf/0/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'command' }, + message: 'must be equal to constant', + schema: 'command', + parentSchema: + schema65.anyOf[1].allOf[0].allOf[1].properties.messageType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.command !== undefined) { + let data15 = data.command; + const _errs46 = errors; + if (typeof data15 !== 'string') { + const err28 = { + instancePath: instancePath + '/command', + schemaPath: '#/anyOf/1/allOf/0/allOf/1/properties/command/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema65.anyOf[1].allOf[0].allOf[1].properties.command.type, + parentSchema: schema65.anyOf[1].allOf[0].allOf[1].properties.command, + data: data15, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + var valid11 = _errs46 === errors; + } else { + var valid11 = true; + } + } + } + } else { + const err29 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema65.anyOf[1].allOf[0].allOf[1].type, + parentSchema: schema65.anyOf[1].allOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + } + var valid9 = _errs43 === errors; + } + var valid8 = _errs37 === errors; + if (valid8) { + const _errs48 = errors; + if (errors === _errs48) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.command === undefined && (missing6 = 'command')) || + (data.connectionUrl === undefined && (missing6 = 'connectionUrl')) + ) { + const err30 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema65.anyOf[1].allOf[1].required, + parentSchema: schema65.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } else { + if (data.command !== undefined) { + let data16 = data.command; + const _errs50 = errors; + if ('closePeerconnection' !== data16) { + const err31 = { + instancePath: instancePath + '/command', + schemaPath: '#/anyOf/1/allOf/1/properties/command/const', + keyword: 'const', + params: { allowedValue: 'closePeerconnection' }, + message: 'must be equal to constant', + schema: 'closePeerconnection', + parentSchema: schema65.anyOf[1].allOf[1].properties.command, + data: data16, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + var valid12 = _errs50 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if (data.connectionUrl !== undefined) { + let data17 = data.connectionUrl; + const _errs51 = errors; + if (errors === _errs51) { + if (errors === _errs51) { + if (typeof data17 === 'string') { + if (!formats0(data17)) { + const err32 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/anyOf/1/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema65.anyOf[1].allOf[1].properties.connectionUrl, + data: data17, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } else { + const err33 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/anyOf/1/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema65.anyOf[1].allOf[1].properties.connectionUrl.type, + parentSchema: schema65.anyOf[1].allOf[1].properties.connectionUrl, + data: data17, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + } + } + var valid12 = _errs51 === errors; + } else { + var valid12 = true; + } + } + } + } else { + const err34 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema65.anyOf[1].allOf[1].type, + parentSchema: schema65.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + } + var valid8 = _errs48 === errors; + } + var _valid0 = _errs36 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs53 = errors; + const _errs54 = errors; + if (errors === _errs54) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing7; + if (data.messageType === undefined && (missing7 = 'messageType')) { + const err35 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: "must have required property '" + missing7 + "'", + schema: schema65.anyOf[2].allOf[0].required, + parentSchema: schema65.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data18 = data.messageType; + if (typeof data18 !== 'string') { + const err36 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/2/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema65.anyOf[2].allOf[0].properties.messageType.type, + parentSchema: schema65.anyOf[2].allOf[0].properties.messageType, + data: data18, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + } + } else { + const err37 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema65.anyOf[2].allOf[0].type, + parentSchema: schema65.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + var valid13 = _errs54 === errors; + if (valid13) { + const _errs59 = errors; + if (errors === _errs59) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing8; + if ( + (data.messageType === undefined && (missing8 = 'messageType')) || + (data.signalingType === undefined && (missing8 = 'signalingType')) || + (data.connectionUrl === undefined && (missing8 = 'connectionUrl')) || + (data.content === undefined && (missing8 = 'content')) + ) { + const err38 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: "must have required property '" + missing8 + "'", + schema: schema65.anyOf[2].allOf[1].required, + parentSchema: schema65.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data19 = data.messageType; + const _errs61 = errors; + if ('signaling' !== data19) { + const err39 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/2/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'signaling' }, + message: 'must be equal to constant', + schema: 'signaling', + parentSchema: schema65.anyOf[2].allOf[1].properties.messageType, + data: data19, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + var valid15 = _errs61 === errors; + } else { + var valid15 = true; + } + if (valid15) { + if (data.signalingType !== undefined) { + let data20 = data.signalingType; + const _errs62 = errors; + if (typeof data20 !== 'string') { + const err40 = { + instancePath: instancePath + '/signalingType', + schemaPath: '#/anyOf/2/allOf/1/properties/signalingType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema65.anyOf[2].allOf[1].properties.signalingType.type, + parentSchema: schema65.anyOf[2].allOf[1].properties.signalingType, + data: data20, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + var valid15 = _errs62 === errors; + } else { + var valid15 = true; + } + if (valid15) { + if (data.connectionUrl !== undefined) { + let data21 = data.connectionUrl; + const _errs64 = errors; + if (errors === _errs64) { + if (errors === _errs64) { + if (typeof data21 === 'string') { + if (!formats0(data21)) { + const err41 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: + '#/anyOf/2/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema65.anyOf[2].allOf[1].properties.connectionUrl, + data: data21, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } else { + const err42 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema65.anyOf[2].allOf[1].properties.connectionUrl.type, + parentSchema: + schema65.anyOf[2].allOf[1].properties.connectionUrl, + data: data21, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + } + var valid15 = _errs64 === errors; + } else { + var valid15 = true; + } + if (valid15) { + if (data.content !== undefined) { + let data22 = data.content; + const _errs66 = errors; + if (errors === _errs66) { + if ( + data22 && + typeof data22 == 'object' && + !Array.isArray(data22) + ) { + } else { + const err43 = { + instancePath: instancePath + '/content', + schemaPath: '#/anyOf/2/allOf/1/properties/content/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema65.anyOf[2].allOf[1].properties.content.type, + parentSchema: schema65.anyOf[2].allOf[1].properties.content, + data: data22, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + } + var valid15 = _errs66 === errors; + } else { + var valid15 = true; + } + } + } + } + } + } else { + const err44 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema65.anyOf[2].allOf[1].type, + parentSchema: schema65.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var valid13 = _errs59 === errors; + } + var _valid0 = _errs53 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs69 = errors; + const _errs70 = errors; + if (errors === _errs70) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if (data.messageType === undefined && (missing9 = 'messageType')) { + const err45 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema65.anyOf[3].allOf[0].required, + parentSchema: schema65.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data23 = data.messageType; + if (typeof data23 !== 'string') { + const err46 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/3/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema65.anyOf[3].allOf[0].properties.messageType.type, + parentSchema: schema65.anyOf[3].allOf[0].properties.messageType, + data: data23, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } + } + } else { + const err47 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema65.anyOf[3].allOf[0].type, + parentSchema: schema65.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var valid16 = _errs70 === errors; + if (valid16) { + const _errs75 = errors; + if (errors === _errs75) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing10; + if ( + (data.messageType === undefined && (missing10 = 'messageType')) || + (data.configuration === undefined && (missing10 = 'configuration')) + ) { + const err48 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: "must have required property '" + missing10 + "'", + schema: schema65.anyOf[3].allOf[1].required, + parentSchema: schema65.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data24 = data.messageType; + const _errs77 = errors; + if ('configuration' !== data24) { + const err49 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/3/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'configuration' }, + message: 'must be equal to constant', + schema: 'configuration', + parentSchema: schema65.anyOf[3].allOf[1].properties.messageType, + data: data24, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + var valid18 = _errs77 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data.configuration !== undefined) { + let data25 = data.configuration; + const _errs78 = errors; + if (errors === _errs78) { + if (data25 && typeof data25 == 'object' && !Array.isArray(data25)) { + } else { + const err50 = { + instancePath: instancePath + '/configuration', + schemaPath: '#/anyOf/3/allOf/1/properties/configuration/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema65.anyOf[3].allOf[1].properties.configuration.type, + parentSchema: + schema65.anyOf[3].allOf[1].properties.configuration, + data: data25, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + } + var valid18 = _errs78 === errors; + } else { + var valid18 = true; + } + } + } + } else { + const err51 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema65.anyOf[3].allOf[1].type, + parentSchema: schema65.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } + var valid16 = _errs75 === errors; + } + var _valid0 = _errs69 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs81 = errors; + const _errs82 = errors; + if (errors === _errs82) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing11; + if (data.messageType === undefined && (missing11 = 'messageType')) { + const err52 = { + instancePath, + schemaPath: '#/anyOf/4/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: "must have required property '" + missing11 + "'", + schema: schema65.anyOf[4].allOf[0].required, + parentSchema: schema65.anyOf[4].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data26 = data.messageType; + if (typeof data26 !== 'string') { + const err53 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/4/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema65.anyOf[4].allOf[0].properties.messageType.type, + parentSchema: schema65.anyOf[4].allOf[0].properties.messageType, + data: data26, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + } + } else { + const err54 = { + instancePath, + schemaPath: '#/anyOf/4/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema65.anyOf[4].allOf[0].type, + parentSchema: schema65.anyOf[4].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + var valid19 = _errs82 === errors; + if (valid19) { + const _errs87 = errors; + if (errors === _errs87) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if ( + (data.messageType === undefined && (missing12 = 'messageType')) || + (data.status === undefined && (missing12 = 'status')) + ) { + const err55 = { + instancePath, + schemaPath: '#/anyOf/4/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema65.anyOf[4].allOf[1].required, + parentSchema: schema65.anyOf[4].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data27 = data.messageType; + const _errs89 = errors; + if ('experiment-status-changed' !== data27) { + const err56 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/4/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'experiment-status-changed' }, + message: 'must be equal to constant', + schema: 'experiment-status-changed', + parentSchema: schema65.anyOf[4].allOf[1].properties.messageType, + data: data27, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + var valid21 = _errs89 === errors; + } else { + var valid21 = true; + } + if (valid21) { + if (data.status !== undefined) { + let data28 = data.status; + const _errs90 = errors; + if (typeof data28 !== 'string') { + const err57 = { + instancePath: instancePath + '/status', + schemaPath: '#/anyOf/4/allOf/1/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema65.anyOf[4].allOf[1].properties.status.type, + parentSchema: schema65.anyOf[4].allOf[1].properties.status, + data: data28, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + var valid21 = _errs90 === errors; + } else { + var valid21 = true; + } + if (valid21) { + if (data.message !== undefined) { + let data29 = data.message; + const _errs92 = errors; + if (typeof data29 !== 'string') { + const err58 = { + instancePath: instancePath + '/message', + schemaPath: '#/anyOf/4/allOf/1/properties/message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema65.anyOf[4].allOf[1].properties.message.type, + parentSchema: schema65.anyOf[4].allOf[1].properties.message, + data: data29, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + var valid21 = _errs92 === errors; + } else { + var valid21 = true; + } + } + } + } + } else { + const err59 = { + instancePath, + schemaPath: '#/anyOf/4/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema65.anyOf[4].allOf[1].type, + parentSchema: schema65.anyOf[4].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } + var valid19 = _errs87 === errors; + } + var _valid0 = _errs81 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs94 = errors; + const _errs95 = errors; + if (errors === _errs95) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing13; + if (data.messageType === undefined && (missing13 = 'messageType')) { + const err60 = { + instancePath, + schemaPath: '#/anyOf/5/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: "must have required property '" + missing13 + "'", + schema: schema65.anyOf[5].allOf[0].required, + parentSchema: schema65.anyOf[5].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data30 = data.messageType; + if (typeof data30 !== 'string') { + const err61 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/5/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema65.anyOf[5].allOf[0].properties.messageType.type, + parentSchema: schema65.anyOf[5].allOf[0].properties.messageType, + data: data30, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + } + } + } else { + const err62 = { + instancePath, + schemaPath: '#/anyOf/5/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema65.anyOf[5].allOf[0].type, + parentSchema: schema65.anyOf[5].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + } + var valid22 = _errs95 === errors; + if (valid22) { + const _errs100 = errors; + if (errors === _errs100) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing14; + if ( + (data.messageType === undefined && (missing14 = 'messageType')) || + (data.content === undefined && (missing14 = 'content')) + ) { + const err63 = { + instancePath, + schemaPath: '#/anyOf/5/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing14 }, + message: "must have required property '" + missing14 + "'", + schema: schema65.anyOf[5].allOf[1].required, + parentSchema: schema65.anyOf[5].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data31 = data.messageType; + const _errs102 = errors; + if ('logging' !== data31) { + const err64 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/5/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'logging' }, + message: 'must be equal to constant', + schema: 'logging', + parentSchema: schema65.anyOf[5].allOf[1].properties.messageType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + var valid24 = _errs102 === errors; + } else { + var valid24 = true; + } + if (valid24) { + if (data.content !== undefined) { + let data32 = data.content; + const _errs103 = errors; + if (errors === _errs103) { + if ( + data32 && + typeof data32 == 'object' && + !Array.isArray(data32) + ) { + } else { + const err65 = { + instancePath: instancePath + '/content', + schemaPath: '#/anyOf/5/allOf/1/properties/content/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema65.anyOf[5].allOf[1].properties.content.type, + parentSchema: schema65.anyOf[5].allOf[1].properties.content, + data: data32, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid24 = _errs103 === errors; + } else { + var valid24 = true; + } + } + } + } else { + const err66 = { + instancePath, + schemaPath: '#/anyOf/5/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema65.anyOf[5].allOf[1].type, + parentSchema: schema65.anyOf[5].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid22 = _errs100 === errors; + } + var _valid0 = _errs94 === errors; + valid0 = valid0 || _valid0; + } + } + } + } + } + if (!valid0) { + const err67 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema65.anyOf, + parentSchema: schema65, + data, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + validate80.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate80.errors = vErrors; + return errors === 0; +} +exports.validateListPeerconnectionsResponse200 = validate81; +const schema66 = { + type: 'array', + items: { + title: 'Peerconnection Overview', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + }, + 'x-standalone': false, + 'x-name': 'listPeerconnectionsResponse200', + 'x-location': + '#/paths//peerconnections/get/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate81( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if ( + (data0.url === undefined && (missing0 = 'url')) || + (data0.type === undefined && (missing0 = 'type')) || + (data0.status === undefined && (missing0 = 'status')) + ) { + validate81.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema66.items.allOf[0].required, + parentSchema: schema66.items.allOf[0], + data: data0, + }, + ]; + return false; + } else { + if (data0.url !== undefined) { + let data1 = data0.url; + const _errs4 = errors; + if (errors === _errs4) { + if (errors === _errs4) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate81.errors = [ + { + instancePath: instancePath + '/' + i0 + '/url', + schemaPath: '#/items/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema66.items.allOf[0].properties.url, + data: data1, + }, + ]; + return false; + } + } else { + validate81.errors = [ + { + instancePath: instancePath + '/' + i0 + '/url', + schemaPath: '#/items/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema66.items.allOf[0].properties.url.type, + parentSchema: schema66.items.allOf[0].properties.url, + data: data1, + }, + ]; + return false; + } + } + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.type !== undefined) { + let data2 = data0.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate81.errors = [ + { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema66.items.allOf[0].properties.type.type, + parentSchema: schema66.items.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if (!(data2 === 'local' || data2 === 'webrtc')) { + validate81.errors = [ + { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema66.items.allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema66.items.allOf[0].properties.type.enum, + parentSchema: schema66.items.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.status !== undefined) { + let data3 = data0.status; + const _errs8 = errors; + if (typeof data3 !== 'string') { + validate81.errors = [ + { + instancePath: instancePath + '/' + i0 + '/status', + schemaPath: '#/items/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema66.items.allOf[0].properties.status.type, + parentSchema: schema66.items.allOf[0].properties.status, + data: data3, + }, + ]; + return false; + } + if ( + !( + data3 === 'new' || + data3 === 'connecting' || + data3 === 'connected' || + data3 === 'disconnected' || + data3 === 'failed' || + data3 === 'closed' + ) + ) { + validate81.errors = [ + { + instancePath: instancePath + '/' + i0 + '/status', + schemaPath: '#/items/allOf/0/properties/status/enum', + keyword: 'enum', + params: { + allowedValues: schema66.items.allOf[0].properties.status.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema66.items.allOf[0].properties.status.enum, + parentSchema: schema66.items.allOf[0].properties.status, + data: data3, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + } + } + } + } else { + validate81.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema66.items.allOf[0].type, + parentSchema: schema66.items.allOf[0], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs10 = errors; + if (errors === _errs10) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if (data0.devices === undefined && (missing1 = 'devices')) { + validate81.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema66.items.allOf[1].required, + parentSchema: schema66.items.allOf[1], + data: data0, + }, + ]; + return false; + } else { + if (data0.devices !== undefined) { + let data4 = data0.devices; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data4)) { + if (data4.length > 2) { + validate81.errors = [ + { + instancePath: instancePath + '/' + i0 + '/devices', + schemaPath: '#/items/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema66.items.allOf[1].properties.devices, + data: data4, + }, + ]; + return false; + } else { + if (data4.length < 2) { + validate81.errors = [ + { + instancePath: instancePath + '/' + i0 + '/devices', + schemaPath: '#/items/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema66.items.allOf[1].properties.devices, + data: data4, + }, + ]; + return false; + } else { + var valid4 = true; + const len1 = data4.length; + for (let i1 = 0; i1 < len1; i1++) { + let data5 = data4[i1]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing2; + if (data5.url === undefined && (missing2 = 'url')) { + validate81.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/devices/' + i1, + schemaPath: + '#/items/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema66.items.allOf[1].properties.devices.items + .required, + parentSchema: + schema66.items.allOf[1].properties.devices.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate81.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/devices/' + + i1 + + '/url', + schemaPath: + '#/items/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema66.items.allOf[1].properties + .devices.items.properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate81.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/devices/' + + i1 + + '/url', + schemaPath: + '#/items/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema66.items.allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema66.items.allOf[1].properties.devices + .items.properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate81.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/devices/' + i1, + schemaPath: + '#/items/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema66.items.allOf[1].properties.devices.items + .type, + parentSchema: + schema66.items.allOf[1].properties.devices.items, + data: data5, + }, + ]; + return false; + } + } + var valid4 = _errs14 === errors; + if (!valid4) { + break; + } + } + } + } + } else { + validate81.errors = [ + { + instancePath: instancePath + '/' + i0 + '/devices', + schemaPath: '#/items/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema66.items.allOf[1].properties.devices.type, + parentSchema: schema66.items.allOf[1].properties.devices, + data: data4, + }, + ]; + return false; + } + } + } + } + } else { + validate81.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema66.items.allOf[1].type, + parentSchema: schema66.items.allOf[1], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate81.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema66.type, + parentSchema: schema66, + data, + }, + ]; + return false; + } + } + validate81.errors = vErrors; + return errors === 0; +} +exports.validateCreatePeerconnectionBody = validate82; +const schema67 = { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'createPeerconnectionBody', + 'x-location': + '#/paths//peerconnections/post/requestBody/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate82( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.status === undefined && (missing0 = 'status')) + ) { + validate82.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema67.allOf[0].required, + parentSchema: schema67.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate82.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema67.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate82.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema67.allOf[0].properties.url.type, + parentSchema: schema67.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data1 = data.type; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate82.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema67.allOf[0].properties.type.type, + parentSchema: schema67.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'local' || data1 === 'webrtc')) { + validate82.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema67.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema67.allOf[0].properties.type.enum, + parentSchema: schema67.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.status !== undefined) { + let data2 = data.status; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate82.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema67.allOf[0].properties.status.type, + parentSchema: schema67.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'new' || + data2 === 'connecting' || + data2 === 'connected' || + data2 === 'disconnected' || + data2 === 'failed' || + data2 === 'closed' + ) + ) { + validate82.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema67.allOf[0].properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema67.allOf[0].properties.status.enum, + parentSchema: schema67.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate82.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema67.allOf[0].type, + parentSchema: schema67.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs8 = errors; + if (errors === _errs8) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate82.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema67.allOf[1].required, + parentSchema: schema67.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data3 = data.devices; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data3)) { + if (data3.length > 2) { + validate82.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema67.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + if (data3.length < 2) { + validate82.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema67.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data3.length; + for (let i0 = 0; i0 < len0; i0++) { + let data4 = data3[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing2; + if (data4.url === undefined && (missing2 = 'url')) { + validate82.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema67.allOf[1].properties.devices.items.required, + parentSchema: schema67.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate82.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema67.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } else { + validate82.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema67.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema67.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } + } + var valid4 = _errs14 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data4.config !== undefined) { + let data6 = data4.config; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + if (data6.services !== undefined) { + let data7 = data6.services; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid6 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing3; + if ( + (data8.serviceType === undefined && + (missing3 = 'serviceType')) || + (data8.serviceId === undefined && + (missing3 = 'serviceId')) || + (data8.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate82.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: missing3, + }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema67.allOf[1].properties + .devices.items.properties.config + .properties.services.items + .required, + parentSchema: + schema67.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.serviceType !== undefined) { + let data9 = data8.serviceType; + const _errs23 = errors; + if (errors === _errs23) { + if (errors === _errs23) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate82.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema67.allOf[1] + .properties.devices + .items.properties + .config.properties + .services.items + .properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } else { + validate82.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema67.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType.type, + parentSchema: + schema67.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } + } + var valid7 = _errs23 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data8.serviceId !== undefined) { + let data10 = data8.serviceId; + const _errs25 = errors; + if (typeof data10 !== 'string') { + validate82.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema67.allOf[1].properties + .devices.items.properties + .config.properties + .services.items.properties + .serviceId.type, + parentSchema: + schema67.allOf[1].properties + .devices.items.properties + .config.properties + .services.items.properties + .serviceId, + data: data10, + }, + ]; + return false; + } + var valid7 = _errs25 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if ( + data8.remoteServiceId !== + undefined + ) { + let data11 = + data8.remoteServiceId; + const _errs27 = errors; + if (typeof data11 !== 'string') { + validate82.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema67.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId.type, + parentSchema: + schema67.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId, + data: data11, + }, + ]; + return false; + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + validate82.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema67.allOf[1].properties.devices + .items.properties.config + .properties.services.items.type, + parentSchema: + schema67.allOf[1].properties.devices + .items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } + } + var valid6 = _errs20 === errors; + if (!valid6) { + break; + } + } + } else { + validate82.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema67.allOf[1].properties.devices.items + .properties.config.properties.services + .type, + parentSchema: + schema67.allOf[1].properties.devices.items + .properties.config.properties.services, + data: data7, + }, + ]; + return false; + } + } + } + } else { + validate82.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/config', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema67.allOf[1].properties.devices.items + .properties.config.type, + parentSchema: + schema67.allOf[1].properties.devices.items + .properties.config, + data: data6, + }, + ]; + return false; + } + } + var valid4 = _errs16 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate82.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema67.allOf[1].properties.devices.items.type, + parentSchema: schema67.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } + } + var valid3 = _errs12 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate82.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema67.allOf[1].properties.devices.type, + parentSchema: schema67.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } + } + } + } + } else { + validate82.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema67.allOf[1].type, + parentSchema: schema67.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs8 === errors; + } + validate82.errors = vErrors; + return errors === 0; +} +exports.validateCreatePeerconnectionResponse201 = validate83; +const schema68 = { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'createPeerconnectionResponse201', + 'x-location': + '#/paths//peerconnections/post/responses/201/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate83( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.status === undefined && (missing0 = 'status')) + ) { + validate83.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema68.allOf[0].required, + parentSchema: schema68.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate83.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema68.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate83.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema68.allOf[0].properties.url.type, + parentSchema: schema68.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data1 = data.type; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate83.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema68.allOf[0].properties.type.type, + parentSchema: schema68.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'local' || data1 === 'webrtc')) { + validate83.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema68.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema68.allOf[0].properties.type.enum, + parentSchema: schema68.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.status !== undefined) { + let data2 = data.status; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate83.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema68.allOf[0].properties.status.type, + parentSchema: schema68.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'new' || + data2 === 'connecting' || + data2 === 'connected' || + data2 === 'disconnected' || + data2 === 'failed' || + data2 === 'closed' + ) + ) { + validate83.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema68.allOf[0].properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema68.allOf[0].properties.status.enum, + parentSchema: schema68.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate83.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema68.allOf[0].type, + parentSchema: schema68.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs8 = errors; + if (errors === _errs8) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate83.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema68.allOf[1].required, + parentSchema: schema68.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data3 = data.devices; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data3)) { + if (data3.length > 2) { + validate83.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema68.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + if (data3.length < 2) { + validate83.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema68.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data3.length; + for (let i0 = 0; i0 < len0; i0++) { + let data4 = data3[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing2; + if (data4.url === undefined && (missing2 = 'url')) { + validate83.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema68.allOf[1].properties.devices.items.required, + parentSchema: schema68.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate83.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema68.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } else { + validate83.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema68.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema68.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } + } + var valid4 = _errs14 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data4.config !== undefined) { + let data6 = data4.config; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + if (data6.services !== undefined) { + let data7 = data6.services; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid6 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing3; + if ( + (data8.serviceType === undefined && + (missing3 = 'serviceType')) || + (data8.serviceId === undefined && + (missing3 = 'serviceId')) || + (data8.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate83.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: missing3, + }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema68.allOf[1].properties + .devices.items.properties.config + .properties.services.items + .required, + parentSchema: + schema68.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.serviceType !== undefined) { + let data9 = data8.serviceType; + const _errs23 = errors; + if (errors === _errs23) { + if (errors === _errs23) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate83.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema68.allOf[1] + .properties.devices + .items.properties + .config.properties + .services.items + .properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } else { + validate83.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema68.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType.type, + parentSchema: + schema68.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } + } + var valid7 = _errs23 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data8.serviceId !== undefined) { + let data10 = data8.serviceId; + const _errs25 = errors; + if (typeof data10 !== 'string') { + validate83.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema68.allOf[1].properties + .devices.items.properties + .config.properties + .services.items.properties + .serviceId.type, + parentSchema: + schema68.allOf[1].properties + .devices.items.properties + .config.properties + .services.items.properties + .serviceId, + data: data10, + }, + ]; + return false; + } + var valid7 = _errs25 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if ( + data8.remoteServiceId !== + undefined + ) { + let data11 = + data8.remoteServiceId; + const _errs27 = errors; + if (typeof data11 !== 'string') { + validate83.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema68.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId.type, + parentSchema: + schema68.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId, + data: data11, + }, + ]; + return false; + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + validate83.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema68.allOf[1].properties.devices + .items.properties.config + .properties.services.items.type, + parentSchema: + schema68.allOf[1].properties.devices + .items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } + } + var valid6 = _errs20 === errors; + if (!valid6) { + break; + } + } + } else { + validate83.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema68.allOf[1].properties.devices.items + .properties.config.properties.services + .type, + parentSchema: + schema68.allOf[1].properties.devices.items + .properties.config.properties.services, + data: data7, + }, + ]; + return false; + } + } + } + } else { + validate83.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/config', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema68.allOf[1].properties.devices.items + .properties.config.type, + parentSchema: + schema68.allOf[1].properties.devices.items + .properties.config, + data: data6, + }, + ]; + return false; + } + } + var valid4 = _errs16 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate83.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema68.allOf[1].properties.devices.items.type, + parentSchema: schema68.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } + } + var valid3 = _errs12 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate83.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema68.allOf[1].properties.devices.type, + parentSchema: schema68.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } + } + } + } + } else { + validate83.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema68.allOf[1].type, + parentSchema: schema68.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs8 === errors; + } + validate83.errors = vErrors; + return errors === 0; +} +exports.validateCreatePeerconnectionResponse202 = validate84; +const schema69 = { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'createPeerconnectionResponse202', + 'x-location': + '#/paths//peerconnections/post/responses/202/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate84( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.status === undefined && (missing0 = 'status')) + ) { + validate84.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema69.allOf[0].required, + parentSchema: schema69.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate84.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema69.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate84.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema69.allOf[0].properties.url.type, + parentSchema: schema69.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data1 = data.type; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate84.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema69.allOf[0].properties.type.type, + parentSchema: schema69.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'local' || data1 === 'webrtc')) { + validate84.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema69.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema69.allOf[0].properties.type.enum, + parentSchema: schema69.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.status !== undefined) { + let data2 = data.status; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate84.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema69.allOf[0].properties.status.type, + parentSchema: schema69.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'new' || + data2 === 'connecting' || + data2 === 'connected' || + data2 === 'disconnected' || + data2 === 'failed' || + data2 === 'closed' + ) + ) { + validate84.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema69.allOf[0].properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema69.allOf[0].properties.status.enum, + parentSchema: schema69.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate84.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema69.allOf[0].type, + parentSchema: schema69.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs8 = errors; + if (errors === _errs8) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate84.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema69.allOf[1].required, + parentSchema: schema69.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data3 = data.devices; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data3)) { + if (data3.length > 2) { + validate84.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema69.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + if (data3.length < 2) { + validate84.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema69.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data3.length; + for (let i0 = 0; i0 < len0; i0++) { + let data4 = data3[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing2; + if (data4.url === undefined && (missing2 = 'url')) { + validate84.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema69.allOf[1].properties.devices.items.required, + parentSchema: schema69.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate84.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema69.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } else { + validate84.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema69.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema69.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } + } + var valid4 = _errs14 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data4.config !== undefined) { + let data6 = data4.config; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + if (data6.services !== undefined) { + let data7 = data6.services; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid6 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing3; + if ( + (data8.serviceType === undefined && + (missing3 = 'serviceType')) || + (data8.serviceId === undefined && + (missing3 = 'serviceId')) || + (data8.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate84.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: missing3, + }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema69.allOf[1].properties + .devices.items.properties.config + .properties.services.items + .required, + parentSchema: + schema69.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.serviceType !== undefined) { + let data9 = data8.serviceType; + const _errs23 = errors; + if (errors === _errs23) { + if (errors === _errs23) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate84.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema69.allOf[1] + .properties.devices + .items.properties + .config.properties + .services.items + .properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } else { + validate84.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema69.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType.type, + parentSchema: + schema69.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } + } + var valid7 = _errs23 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data8.serviceId !== undefined) { + let data10 = data8.serviceId; + const _errs25 = errors; + if (typeof data10 !== 'string') { + validate84.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema69.allOf[1].properties + .devices.items.properties + .config.properties + .services.items.properties + .serviceId.type, + parentSchema: + schema69.allOf[1].properties + .devices.items.properties + .config.properties + .services.items.properties + .serviceId, + data: data10, + }, + ]; + return false; + } + var valid7 = _errs25 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if ( + data8.remoteServiceId !== + undefined + ) { + let data11 = + data8.remoteServiceId; + const _errs27 = errors; + if (typeof data11 !== 'string') { + validate84.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema69.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId.type, + parentSchema: + schema69.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId, + data: data11, + }, + ]; + return false; + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + validate84.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema69.allOf[1].properties.devices + .items.properties.config + .properties.services.items.type, + parentSchema: + schema69.allOf[1].properties.devices + .items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } + } + var valid6 = _errs20 === errors; + if (!valid6) { + break; + } + } + } else { + validate84.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema69.allOf[1].properties.devices.items + .properties.config.properties.services + .type, + parentSchema: + schema69.allOf[1].properties.devices.items + .properties.config.properties.services, + data: data7, + }, + ]; + return false; + } + } + } + } else { + validate84.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/config', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema69.allOf[1].properties.devices.items + .properties.config.type, + parentSchema: + schema69.allOf[1].properties.devices.items + .properties.config, + data: data6, + }, + ]; + return false; + } + } + var valid4 = _errs16 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate84.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema69.allOf[1].properties.devices.items.type, + parentSchema: schema69.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } + } + var valid3 = _errs12 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate84.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema69.allOf[1].properties.devices.type, + parentSchema: schema69.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } + } + } + } + } else { + validate84.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema69.allOf[1].type, + parentSchema: schema69.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs8 === errors; + } + validate84.errors = vErrors; + return errors === 0; +} +exports.validateGetPeerconnectionResponse200 = validate85; +const schema70 = { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'getPeerconnectionResponse200', + 'x-location': + '#/paths//peerconnections/{peerconnection_id}/get/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate85( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.status === undefined && (missing0 = 'status')) + ) { + validate85.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema70.allOf[0].required, + parentSchema: schema70.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate85.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema70.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate85.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema70.allOf[0].properties.url.type, + parentSchema: schema70.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data1 = data.type; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate85.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema70.allOf[0].properties.type.type, + parentSchema: schema70.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'local' || data1 === 'webrtc')) { + validate85.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema70.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema70.allOf[0].properties.type.enum, + parentSchema: schema70.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.status !== undefined) { + let data2 = data.status; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate85.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema70.allOf[0].properties.status.type, + parentSchema: schema70.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'new' || + data2 === 'connecting' || + data2 === 'connected' || + data2 === 'disconnected' || + data2 === 'failed' || + data2 === 'closed' + ) + ) { + validate85.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema70.allOf[0].properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema70.allOf[0].properties.status.enum, + parentSchema: schema70.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate85.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema70.allOf[0].type, + parentSchema: schema70.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs8 = errors; + if (errors === _errs8) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate85.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema70.allOf[1].required, + parentSchema: schema70.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data3 = data.devices; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data3)) { + if (data3.length > 2) { + validate85.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema70.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + if (data3.length < 2) { + validate85.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema70.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data3.length; + for (let i0 = 0; i0 < len0; i0++) { + let data4 = data3[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing2; + if (data4.url === undefined && (missing2 = 'url')) { + validate85.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema70.allOf[1].properties.devices.items.required, + parentSchema: schema70.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate85.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema70.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } else { + validate85.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema70.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema70.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } + } + var valid4 = _errs14 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data4.config !== undefined) { + let data6 = data4.config; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + if (data6.services !== undefined) { + let data7 = data6.services; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid6 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing3; + if ( + (data8.serviceType === undefined && + (missing3 = 'serviceType')) || + (data8.serviceId === undefined && + (missing3 = 'serviceId')) || + (data8.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate85.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: missing3, + }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema70.allOf[1].properties + .devices.items.properties.config + .properties.services.items + .required, + parentSchema: + schema70.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.serviceType !== undefined) { + let data9 = data8.serviceType; + const _errs23 = errors; + if (errors === _errs23) { + if (errors === _errs23) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate85.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema70.allOf[1] + .properties.devices + .items.properties + .config.properties + .services.items + .properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } else { + validate85.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema70.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType.type, + parentSchema: + schema70.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } + } + var valid7 = _errs23 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data8.serviceId !== undefined) { + let data10 = data8.serviceId; + const _errs25 = errors; + if (typeof data10 !== 'string') { + validate85.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema70.allOf[1].properties + .devices.items.properties + .config.properties + .services.items.properties + .serviceId.type, + parentSchema: + schema70.allOf[1].properties + .devices.items.properties + .config.properties + .services.items.properties + .serviceId, + data: data10, + }, + ]; + return false; + } + var valid7 = _errs25 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if ( + data8.remoteServiceId !== + undefined + ) { + let data11 = + data8.remoteServiceId; + const _errs27 = errors; + if (typeof data11 !== 'string') { + validate85.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema70.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId.type, + parentSchema: + schema70.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId, + data: data11, + }, + ]; + return false; + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + validate85.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema70.allOf[1].properties.devices + .items.properties.config + .properties.services.items.type, + parentSchema: + schema70.allOf[1].properties.devices + .items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } + } + var valid6 = _errs20 === errors; + if (!valid6) { + break; + } + } + } else { + validate85.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema70.allOf[1].properties.devices.items + .properties.config.properties.services + .type, + parentSchema: + schema70.allOf[1].properties.devices.items + .properties.config.properties.services, + data: data7, + }, + ]; + return false; + } + } + } + } else { + validate85.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/config', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema70.allOf[1].properties.devices.items + .properties.config.type, + parentSchema: + schema70.allOf[1].properties.devices.items + .properties.config, + data: data6, + }, + ]; + return false; + } + } + var valid4 = _errs16 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate85.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema70.allOf[1].properties.devices.items.type, + parentSchema: schema70.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } + } + var valid3 = _errs12 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate85.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema70.allOf[1].properties.devices.type, + parentSchema: schema70.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } + } + } + } + } else { + validate85.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema70.allOf[1].type, + parentSchema: schema70.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs8 === errors; + } + validate85.errors = vErrors; + return errors === 0; +} +exports.validatePatchPeerconnectionDeviceStatusBody = validate86; +const schema71 = { + type: 'object', + properties: { + status: { + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['status'], + 'x-standalone': false, + 'x-name': 'patchPeerconnectionDeviceStatusBody', + 'x-location': + '#/paths//peerconnections/{peerconnection_id}/device_status/patch/requestBody/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate86( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.status === undefined && (missing0 = 'status')) { + validate86.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema71.required, + parentSchema: schema71, + data, + }, + ]; + return false; + } else { + if (data.status !== undefined) { + let data0 = data.status; + if (typeof data0 !== 'string') { + validate86.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema71.properties.status.type, + parentSchema: schema71.properties.status, + data: data0, + }, + ]; + return false; + } + if ( + !( + data0 === 'new' || + data0 === 'connecting' || + data0 === 'connected' || + data0 === 'disconnected' || + data0 === 'failed' || + data0 === 'closed' + ) + ) { + validate86.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema71.properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema71.properties.status.enum, + parentSchema: schema71.properties.status, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate86.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema71.type, + parentSchema: schema71, + data, + }, + ]; + return false; + } + } + validate86.errors = vErrors; + return errors === 0; +} +exports.validateAuthenticationMessageRequest = validate87; +const schema72 = { + title: 'Authentication Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'authenticate' }, + token: { type: 'string' }, + authenticated: { type: 'boolean' }, + }, + required: ['messageType'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'AuthenticationMessageRequest', + 'x-location': '#/components/schemas/authentication_message_request', + 'x-schema-type': 'request', +}; +function validate87( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate87.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema72.allOf[0].required, + parentSchema: schema72.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate87.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema72.allOf[0].properties.messageType.type, + parentSchema: schema72.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate87.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema72.allOf[0].type, + parentSchema: schema72.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.messageType === undefined && (missing1 = 'messageType')) { + validate87.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema72.allOf[1].required, + parentSchema: schema72.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('authenticate' !== data1) { + validate87.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'authenticate' }, + message: 'must be equal to constant', + schema: 'authenticate', + parentSchema: schema72.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.token !== undefined) { + let data2 = data.token; + const _errs8 = errors; + if (typeof data2 !== 'string') { + validate87.errors = [ + { + instancePath: instancePath + '/token', + schemaPath: '#/allOf/1/properties/token/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema72.allOf[1].properties.token.type, + parentSchema: schema72.allOf[1].properties.token, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.authenticated !== undefined) { + let data3 = data.authenticated; + const _errs10 = errors; + if (typeof data3 !== 'boolean') { + validate87.errors = [ + { + instancePath: instancePath + '/authenticated', + schemaPath: '#/allOf/1/properties/authenticated/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema72.allOf[1].properties.authenticated.type, + parentSchema: schema72.allOf[1].properties.authenticated, + data: data3, + }, + ]; + return false; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + } + } + } + } else { + validate87.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema72.allOf[1].type, + parentSchema: schema72.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate87.errors = vErrors; + return errors === 0; +} +exports.validateAuthenticationMessageResponse = validate88; +const schema73 = { + title: 'Authentication Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'authenticate' }, + token: { type: 'string' }, + authenticated: { type: 'boolean' }, + }, + required: ['messageType'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'AuthenticationMessageResponse', + 'x-location': '#/components/schemas/authentication_message_response', + 'x-schema-type': 'response', +}; +function validate88( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate88.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema73.allOf[0].required, + parentSchema: schema73.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate88.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema73.allOf[0].properties.messageType.type, + parentSchema: schema73.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate88.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema73.allOf[0].type, + parentSchema: schema73.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.messageType === undefined && (missing1 = 'messageType')) { + validate88.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema73.allOf[1].required, + parentSchema: schema73.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('authenticate' !== data1) { + validate88.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'authenticate' }, + message: 'must be equal to constant', + schema: 'authenticate', + parentSchema: schema73.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.token !== undefined) { + let data2 = data.token; + const _errs8 = errors; + if (typeof data2 !== 'string') { + validate88.errors = [ + { + instancePath: instancePath + '/token', + schemaPath: '#/allOf/1/properties/token/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema73.allOf[1].properties.token.type, + parentSchema: schema73.allOf[1].properties.token, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.authenticated !== undefined) { + let data3 = data.authenticated; + const _errs10 = errors; + if (typeof data3 !== 'boolean') { + validate88.errors = [ + { + instancePath: instancePath + '/authenticated', + schemaPath: '#/allOf/1/properties/authenticated/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema73.allOf[1].properties.authenticated.type, + parentSchema: schema73.allOf[1].properties.authenticated, + data: data3, + }, + ]; + return false; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + } + } + } + } else { + validate88.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema73.allOf[1].type, + parentSchema: schema73.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate88.errors = vErrors; + return errors === 0; +} +exports.validateConnectionStateChangedMessageRequest = validate89; +const schema74 = { + title: 'Connection State Changed Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'connection-state-changed' }, + connectionUrl: { type: 'string', format: 'uri' }, + status: { + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['connectionUrl', 'status'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'ConnectionStateChangedMessageRequest', + 'x-location': '#/components/schemas/connection_state_changed_message_request', + 'x-schema-type': 'request', +}; +function validate89( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate89.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema74.allOf[0].required, + parentSchema: schema74.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate89.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema74.allOf[0].properties.messageType.type, + parentSchema: schema74.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate89.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema74.allOf[0].type, + parentSchema: schema74.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.connectionUrl === undefined && (missing1 = 'connectionUrl')) || + (data.status === undefined && (missing1 = 'status')) + ) { + validate89.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema74.allOf[1].required, + parentSchema: schema74.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('connection-state-changed' !== data1) { + validate89.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'connection-state-changed' }, + message: 'must be equal to constant', + schema: 'connection-state-changed', + parentSchema: schema74.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.connectionUrl !== undefined) { + let data2 = data.connectionUrl; + const _errs8 = errors; + if (errors === _errs8) { + if (errors === _errs8) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate89.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema74.allOf[1].properties.connectionUrl, + data: data2, + }, + ]; + return false; + } + } else { + validate89.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema74.allOf[1].properties.connectionUrl.type, + parentSchema: schema74.allOf[1].properties.connectionUrl, + data: data2, + }, + ]; + return false; + } + } + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.status !== undefined) { + let data3 = data.status; + const _errs10 = errors; + if (typeof data3 !== 'string') { + validate89.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/1/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema74.allOf[1].properties.status.type, + parentSchema: schema74.allOf[1].properties.status, + data: data3, + }, + ]; + return false; + } + if ( + !( + data3 === 'new' || + data3 === 'connecting' || + data3 === 'connected' || + data3 === 'disconnected' || + data3 === 'failed' || + data3 === 'closed' + ) + ) { + validate89.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/1/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema74.allOf[1].properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema74.allOf[1].properties.status.enum, + parentSchema: schema74.allOf[1].properties.status, + data: data3, + }, + ]; + return false; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + } + } + } + } else { + validate89.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema74.allOf[1].type, + parentSchema: schema74.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate89.errors = vErrors; + return errors === 0; +} +exports.validateConnectionStateChangedMessageResponse = validate90; +const schema75 = { + title: 'Connection State Changed Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'connection-state-changed' }, + connectionUrl: { type: 'string', format: 'uri' }, + status: { + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['connectionUrl', 'status'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'ConnectionStateChangedMessageResponse', + 'x-location': '#/components/schemas/connection_state_changed_message_response', + 'x-schema-type': 'response', +}; +function validate90( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate90.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema75.allOf[0].required, + parentSchema: schema75.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate90.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema75.allOf[0].properties.messageType.type, + parentSchema: schema75.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate90.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema75.allOf[0].type, + parentSchema: schema75.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.connectionUrl === undefined && (missing1 = 'connectionUrl')) || + (data.status === undefined && (missing1 = 'status')) + ) { + validate90.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema75.allOf[1].required, + parentSchema: schema75.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('connection-state-changed' !== data1) { + validate90.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'connection-state-changed' }, + message: 'must be equal to constant', + schema: 'connection-state-changed', + parentSchema: schema75.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.connectionUrl !== undefined) { + let data2 = data.connectionUrl; + const _errs8 = errors; + if (errors === _errs8) { + if (errors === _errs8) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate90.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema75.allOf[1].properties.connectionUrl, + data: data2, + }, + ]; + return false; + } + } else { + validate90.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema75.allOf[1].properties.connectionUrl.type, + parentSchema: schema75.allOf[1].properties.connectionUrl, + data: data2, + }, + ]; + return false; + } + } + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.status !== undefined) { + let data3 = data.status; + const _errs10 = errors; + if (typeof data3 !== 'string') { + validate90.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/1/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema75.allOf[1].properties.status.type, + parentSchema: schema75.allOf[1].properties.status, + data: data3, + }, + ]; + return false; + } + if ( + !( + data3 === 'new' || + data3 === 'connecting' || + data3 === 'connected' || + data3 === 'disconnected' || + data3 === 'failed' || + data3 === 'closed' + ) + ) { + validate90.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/1/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema75.allOf[1].properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema75.allOf[1].properties.status.enum, + parentSchema: schema75.allOf[1].properties.status, + data: data3, + }, + ]; + return false; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + } + } + } + } else { + validate90.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema75.allOf[1].type, + parentSchema: schema75.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate90.errors = vErrors; + return errors === 0; +} +exports.validateUserReferenceRequest = validate91; +const schema76 = { + title: 'User Reference', + type: 'object', + properties: { url: { type: 'string', description: 'URL of the user', format: 'uri' } }, + required: ['url'], + 'x-standalone': true, + 'x-name': 'UserReferenceRequest', + 'x-location': '#/components/schemas/user_reference_request', + 'x-schema-type': 'request', +}; +function validate91( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.url === undefined && (missing0 = 'url')) { + validate91.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema76.required, + parentSchema: schema76, + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate91.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema76.properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate91.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema76.properties.url.type, + parentSchema: schema76.properties.url, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate91.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema76.type, + parentSchema: schema76, + data, + }, + ]; + return false; + } + } + validate91.errors = vErrors; + return errors === 0; +} +exports.validateUserReferenceResponse = validate92; +const schema77 = { + title: 'User Reference', + type: 'object', + properties: { url: { type: 'string', description: 'URL of the user', format: 'uri' } }, + required: ['url'], + 'x-standalone': true, + 'x-name': 'UserReferenceResponse', + 'x-location': '#/components/schemas/user_reference_response', + 'x-schema-type': 'response', +}; +function validate92( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.url === undefined && (missing0 = 'url')) { + validate92.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema77.required, + parentSchema: schema77, + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate92.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema77.properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate92.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema77.properties.url.type, + parentSchema: schema77.properties.url, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate92.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema77.type, + parentSchema: schema77, + data, + }, + ]; + return false; + } + } + validate92.errors = vErrors; + return errors === 0; +} +exports.validateDeviceOverviewRequest = validate93; +const schema78 = { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'DeviceOverviewRequest', + 'x-location': '#/components/schemas/device_overview_request', + 'x-schema-type': 'request', +}; +function validate93( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate93.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema78.required, + parentSchema: schema78, + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs1 = errors; + if (typeof data0 !== 'string') { + validate93.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema78.properties.name.type, + parentSchema: schema78.properties.name, + data: data0, + }, + ]; + return false; + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs3 = errors; + if (typeof data1 !== 'string') { + validate93.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema78.properties.description.type, + parentSchema: schema78.properties.description, + data: data1, + }, + ]; + return false; + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs5 = errors; + if (typeof data2 !== 'string') { + validate93.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema78.properties.type.type, + parentSchema: schema78.properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate93.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema78.properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema78.properties.type.enum, + parentSchema: schema78.properties.type, + data: data2, + }, + ]; + return false; + } + var valid0 = _errs5 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs7 = errors; + if (typeof data3 !== 'boolean') { + validate93.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema78.properties.isPublic.type, + parentSchema: schema78.properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid1 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate93.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: schema78.properties.viewer.items.required, + parentSchema: schema78.properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate93.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema78.properties.viewer.items.properties + .url, + data: data6, + }, + ]; + return false; + } + } else { + validate93.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema78.properties.viewer.items.properties + .url.type, + parentSchema: + schema78.properties.viewer.items.properties + .url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate93.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema78.properties.viewer.items.type, + parentSchema: schema78.properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs11 === errors; + if (!valid1) { + break; + } + } + } else { + validate93.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema78.properties.viewer.type, + parentSchema: schema78.properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs15 = errors; + if (errors === _errs15) { + if (Array.isArray(data7)) { + var valid3 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs17 = errors; + if (errors === _errs17) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate93.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: schema78.properties.owner.items.required, + parentSchema: schema78.properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs19 = errors; + if (errors === _errs19) { + if (errors === _errs19) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate93.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema78.properties.owner.items.properties + .url, + data: data9, + }, + ]; + return false; + } + } else { + validate93.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema78.properties.owner.items.properties + .url.type, + parentSchema: + schema78.properties.owner.items.properties + .url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate93.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema78.properties.owner.items.type, + parentSchema: schema78.properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid3 = _errs17 === errors; + if (!valid3) { + break; + } + } + } else { + validate93.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema78.properties.owner.type, + parentSchema: schema78.properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } else { + validate93.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema78.type, + parentSchema: schema78, + data, + }, + ]; + return false; + } + } + validate93.errors = vErrors; + return errors === 0; +} +exports.validateDeviceOverviewResponse = validate94; +const schema79 = { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'DeviceOverviewResponse', + 'x-location': '#/components/schemas/device_overview_response', + 'x-schema-type': 'response', +}; +function validate94( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate94.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema79.required, + parentSchema: schema79, + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate94.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema79.properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate94.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema79.properties.url.type, + parentSchema: schema79.properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs3 = errors; + if (typeof data1 !== 'string') { + validate94.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema79.properties.name.type, + parentSchema: schema79.properties.name, + data: data1, + }, + ]; + return false; + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs5 = errors; + if (typeof data2 !== 'string') { + validate94.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema79.properties.description.type, + parentSchema: schema79.properties.description, + data: data2, + }, + ]; + return false; + } + var valid0 = _errs5 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate94.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema79.properties.type.type, + parentSchema: schema79.properties.type, + data: data3, + }, + ]; + return false; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + validate94.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema79.properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema79.properties.type.enum, + parentSchema: schema79.properties.type, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs9 = errors; + if (typeof data4 !== 'boolean') { + validate94.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema79.properties.isPublic.type, + parentSchema: schema79.properties.isPublic, + data: data4, + }, + ]; + return false; + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs11 = errors; + if (errors === _errs11) { + if (Array.isArray(data5)) { + var valid1 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs13 = errors; + if (errors === _errs13) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + validate94.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: schema79.properties.viewer.items.required, + parentSchema: schema79.properties.viewer.items, + data: data6, + }, + ]; + return false; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs15 = errors; + if (errors === _errs15) { + if (errors === _errs15) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + validate94.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema79.properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } else { + validate94.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema79.properties.viewer.items.properties + .url.type, + parentSchema: + schema79.properties.viewer.items.properties + .url, + data: data7, + }, + ]; + return false; + } + } + } + } + } + } else { + validate94.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema79.properties.viewer.items.type, + parentSchema: schema79.properties.viewer.items, + data: data6, + }, + ]; + return false; + } + } + var valid1 = _errs13 === errors; + if (!valid1) { + break; + } + } + } else { + validate94.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema79.properties.viewer.type, + parentSchema: schema79.properties.viewer, + data: data5, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs17 = errors; + if (errors === _errs17) { + if (Array.isArray(data8)) { + var valid3 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs19 = errors; + if (errors === _errs19) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + validate94.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: schema79.properties.owner.items.required, + parentSchema: schema79.properties.owner.items, + data: data9, + }, + ]; + return false; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs21 = errors; + if (errors === _errs21) { + if (errors === _errs21) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + validate94.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema79.properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } else { + validate94.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema79.properties.owner.items.properties + .url.type, + parentSchema: + schema79.properties.owner.items.properties + .url, + data: data10, + }, + ]; + return false; + } + } + } + } + } + } else { + validate94.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema79.properties.owner.items.type, + parentSchema: schema79.properties.owner.items, + data: data9, + }, + ]; + return false; + } + } + var valid3 = _errs19 === errors; + if (!valid3) { + break; + } + } + } else { + validate94.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema79.properties.owner.type, + parentSchema: schema79.properties.owner, + data: data8, + }, + ]; + return false; + } + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } else { + validate94.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema79.type, + parentSchema: schema79, + data, + }, + ]; + return false; + } + } + validate94.errors = vErrors; + return errors === 0; +} +exports.validateServiceDescriptionRequest = validate95; +const schema80 = { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { type: 'string', enum: ['consumer', 'producer', 'prosumer'] }, + }, + additionalProperties: true, + 'x-standalone': true, + 'x-name': 'ServiceDescriptionRequest', + 'x-location': '#/components/schemas/service_description_request', + 'x-schema-type': 'request', +}; +function validate95( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.serviceType !== undefined) { + let data0 = data.serviceType; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate95.errors = [ + { + instancePath: instancePath + '/serviceType', + schemaPath: '#/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema80.properties.serviceType, + data: data0, + }, + ]; + return false; + } + } else { + validate95.errors = [ + { + instancePath: instancePath + '/serviceType', + schemaPath: '#/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema80.properties.serviceType.type, + parentSchema: schema80.properties.serviceType, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs2 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.serviceId !== undefined) { + let data1 = data.serviceId; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate95.errors = [ + { + instancePath: instancePath + '/serviceId', + schemaPath: '#/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema80.properties.serviceId.type, + parentSchema: schema80.properties.serviceId, + data: data1, + }, + ]; + return false; + } + var valid0 = _errs4 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.serviceDirection !== undefined) { + let data2 = data.serviceDirection; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate95.errors = [ + { + instancePath: instancePath + '/serviceDirection', + schemaPath: '#/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema80.properties.serviceDirection.type, + parentSchema: schema80.properties.serviceDirection, + data: data2, + }, + ]; + return false; + } + if (!(data2 === 'consumer' || data2 === 'producer' || data2 === 'prosumer')) { + validate95.errors = [ + { + instancePath: instancePath + '/serviceDirection', + schemaPath: '#/properties/serviceDirection/enum', + keyword: 'enum', + params: { allowedValues: schema80.properties.serviceDirection.enum }, + message: 'must be equal to one of the allowed values', + schema: schema80.properties.serviceDirection.enum, + parentSchema: schema80.properties.serviceDirection, + data: data2, + }, + ]; + return false; + } + var valid0 = _errs6 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate95.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema80.type, + parentSchema: schema80, + data, + }, + ]; + return false; + } + } + validate95.errors = vErrors; + return errors === 0; +} +exports.validateServiceDescriptionResponse = validate96; +const schema81 = { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { type: 'string', enum: ['consumer', 'producer', 'prosumer'] }, + }, + additionalProperties: true, + 'x-standalone': true, + 'x-name': 'ServiceDescriptionResponse', + 'x-location': '#/components/schemas/service_description_response', + 'x-schema-type': 'response', +}; +function validate96( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.serviceType !== undefined) { + let data0 = data.serviceType; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate96.errors = [ + { + instancePath: instancePath + '/serviceType', + schemaPath: '#/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema81.properties.serviceType, + data: data0, + }, + ]; + return false; + } + } else { + validate96.errors = [ + { + instancePath: instancePath + '/serviceType', + schemaPath: '#/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema81.properties.serviceType.type, + parentSchema: schema81.properties.serviceType, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs2 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.serviceId !== undefined) { + let data1 = data.serviceId; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate96.errors = [ + { + instancePath: instancePath + '/serviceId', + schemaPath: '#/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema81.properties.serviceId.type, + parentSchema: schema81.properties.serviceId, + data: data1, + }, + ]; + return false; + } + var valid0 = _errs4 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.serviceDirection !== undefined) { + let data2 = data.serviceDirection; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate96.errors = [ + { + instancePath: instancePath + '/serviceDirection', + schemaPath: '#/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema81.properties.serviceDirection.type, + parentSchema: schema81.properties.serviceDirection, + data: data2, + }, + ]; + return false; + } + if (!(data2 === 'consumer' || data2 === 'producer' || data2 === 'prosumer')) { + validate96.errors = [ + { + instancePath: instancePath + '/serviceDirection', + schemaPath: '#/properties/serviceDirection/enum', + keyword: 'enum', + params: { allowedValues: schema81.properties.serviceDirection.enum }, + message: 'must be equal to one of the allowed values', + schema: schema81.properties.serviceDirection.enum, + parentSchema: schema81.properties.serviceDirection, + data: data2, + }, + ]; + return false; + } + var valid0 = _errs6 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate96.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema81.type, + parentSchema: schema81, + data, + }, + ]; + return false; + } + } + validate96.errors = vErrors; + return errors === 0; +} +exports.validateInstantiableCloudDeviceRequest = validate97; +const schema82 = { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'InstantiableCloudDeviceRequest', + 'x-location': '#/components/schemas/device_cloud_instantiable_request', + 'x-schema-type': 'request', +}; +function validate97( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate97.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema82.allOf[0].required, + parentSchema: schema82.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs2 = errors; + if (typeof data0 !== 'string') { + validate97.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema82.allOf[0].properties.name.type, + parentSchema: schema82.allOf[0].properties.name, + data: data0, + }, + ]; + return false; + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate97.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema82.allOf[0].properties.description.type, + parentSchema: schema82.allOf[0].properties.description, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate97.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema82.allOf[0].properties.type.type, + parentSchema: schema82.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate97.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema82.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema82.allOf[0].properties.type.enum, + parentSchema: schema82.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs8 = errors; + if (typeof data3 !== 'boolean') { + validate97.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema82.allOf[0].properties.isPublic.type, + parentSchema: schema82.allOf[0].properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate97.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema82.allOf[0].properties.viewer.items.required, + parentSchema: schema82.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate97.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema82.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate97.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema82.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema82.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate97.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema82.allOf[0].properties.viewer.items.type, + parentSchema: schema82.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + if (!valid2) { + break; + } + } + } else { + validate97.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema82.allOf[0].properties.viewer.type, + parentSchema: schema82.allOf[0].properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs16 = errors; + if (errors === _errs16) { + if (Array.isArray(data7)) { + var valid4 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs18 = errors; + if (errors === _errs18) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate97.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema82.allOf[0].properties.owner.items.required, + parentSchema: + schema82.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate97.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema82.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate97.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema82.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema82.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate97.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema82.allOf[0].properties.owner.items.type, + parentSchema: schema82.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + if (!valid4) { + break; + } + } + } else { + validate97.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema82.allOf[0].properties.owner.type, + parentSchema: schema82.allOf[0].properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid1 = _errs16 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } else { + validate97.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema82.allOf[0].type, + parentSchema: schema82.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs22 = errors; + if (errors === _errs22) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs24 = errors; + if ('cloud instantiable' !== data10) { + validate97.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema82.allOf[1].properties.type, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs24 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.instantiateUrl !== undefined) { + let data11 = data.instantiateUrl; + const _errs25 = errors; + if (errors === _errs25) { + if (errors === _errs25) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + validate97.errors = [ + { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema82.allOf[1].properties.instantiateUrl, + data: data11, + }, + ]; + return false; + } + } else { + validate97.errors = [ + { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema82.allOf[1].properties.instantiateUrl.type, + parentSchema: schema82.allOf[1].properties.instantiateUrl, + data: data11, + }, + ]; + return false; + } + } + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs27 = errors; + if (errors === _errs27) { + if (Array.isArray(data12)) { + var valid7 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs29 = errors; + if (errors === _errs29) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs32 = errors; + if (errors === _errs32) { + if (errors === _errs32) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + validate97.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema82.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } else { + validate97.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema82.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema82.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } + } + var valid8 = _errs32 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs34 = errors; + if (typeof data15 !== 'string') { + validate97.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema82.allOf[1].properties.services.items.properties + .serviceId.type, + parentSchema: + schema82.allOf[1].properties.services.items.properties + .serviceId, + data: data15, + }, + ]; + return false; + } + var valid8 = _errs34 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs36 = errors; + if (typeof data16 !== 'string') { + validate97.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema82.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema82.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + validate97.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema82.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema82.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema82.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + var valid8 = _errs36 === errors; + } else { + var valid8 = true; + } + } + } + } else { + validate97.errors = [ + { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema82.allOf[1].properties.services.items.type, + parentSchema: schema82.allOf[1].properties.services.items, + data: data13, + }, + ]; + return false; + } + } + var valid7 = _errs29 === errors; + if (!valid7) { + break; + } + } + } else { + validate97.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema82.allOf[1].properties.services.type, + parentSchema: schema82.allOf[1].properties.services, + data: data12, + }, + ]; + return false; + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate97.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema82.allOf[1].type, + parentSchema: schema82.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs22 === errors; + } + validate97.errors = vErrors; + return errors === 0; +} +exports.validateInstantiableCloudDeviceResponse = validate98; +const schema83 = { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'InstantiableCloudDeviceResponse', + 'x-location': '#/components/schemas/device_cloud_instantiable_response', + 'x-schema-type': 'response', +}; +function validate98( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate98.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema83.allOf[0].required, + parentSchema: schema83.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate98.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema83.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate98.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema83.allOf[0].properties.url.type, + parentSchema: schema83.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate98.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema83.allOf[0].properties.name.type, + parentSchema: schema83.allOf[0].properties.name, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate98.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema83.allOf[0].properties.description.type, + parentSchema: schema83.allOf[0].properties.description, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs8 = errors; + if (typeof data3 !== 'string') { + validate98.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema83.allOf[0].properties.type.type, + parentSchema: schema83.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + validate98.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema83.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema83.allOf[0].properties.type.enum, + parentSchema: schema83.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs10 = errors; + if (typeof data4 !== 'boolean') { + validate98.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema83.allOf[0].properties.isPublic.type, + parentSchema: schema83.allOf[0].properties.isPublic, + data: data4, + }, + ]; + return false; + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data5)) { + var valid2 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + validate98.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema83.allOf[0].properties.viewer.items.required, + parentSchema: + schema83.allOf[0].properties.viewer.items, + data: data6, + }, + ]; + return false; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + validate98.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema83.allOf[0].properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } else { + validate98.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema83.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema83.allOf[0].properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } + } + } + } + } else { + validate98.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema83.allOf[0].properties.viewer.items.type, + parentSchema: schema83.allOf[0].properties.viewer.items, + data: data6, + }, + ]; + return false; + } + } + var valid2 = _errs14 === errors; + if (!valid2) { + break; + } + } + } else { + validate98.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema83.allOf[0].properties.viewer.type, + parentSchema: schema83.allOf[0].properties.viewer, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs12 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data8)) { + var valid4 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + validate98.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema83.allOf[0].properties.owner.items.required, + parentSchema: + schema83.allOf[0].properties.owner.items, + data: data9, + }, + ]; + return false; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + validate98.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema83.allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } else { + validate98.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema83.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema83.allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } + } + } + } + } else { + validate98.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema83.allOf[0].properties.owner.items.type, + parentSchema: + schema83.allOf[0].properties.owner.items, + data: data9, + }, + ]; + return false; + } + } + var valid4 = _errs20 === errors; + if (!valid4) { + break; + } + } + } else { + validate98.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema83.allOf[0].properties.owner.type, + parentSchema: schema83.allOf[0].properties.owner, + data: data8, + }, + ]; + return false; + } + } + var valid1 = _errs18 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } + } else { + validate98.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema83.allOf[0].type, + parentSchema: schema83.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data11 = data.type; + const _errs26 = errors; + if ('cloud instantiable' !== data11) { + validate98.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema83.allOf[1].properties.type, + data: data11, + }, + ]; + return false; + } + var valid6 = _errs26 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.instantiateUrl !== undefined) { + let data12 = data.instantiateUrl; + const _errs27 = errors; + if (errors === _errs27) { + if (errors === _errs27) { + if (typeof data12 === 'string') { + if (!formats0(data12)) { + validate98.errors = [ + { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema83.allOf[1].properties.instantiateUrl, + data: data12, + }, + ]; + return false; + } + } else { + validate98.errors = [ + { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema83.allOf[1].properties.instantiateUrl.type, + parentSchema: schema83.allOf[1].properties.instantiateUrl, + data: data12, + }, + ]; + return false; + } + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data13 = data.services; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data13)) { + var valid7 = true; + const len2 = data13.length; + for (let i2 = 0; i2 < len2; i2++) { + let data14 = data13[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if (data14 && typeof data14 == 'object' && !Array.isArray(data14)) { + if (data14.serviceType !== undefined) { + let data15 = data14.serviceType; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data15 === 'string') { + if (!formats0(data15)) { + validate98.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema83.allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }, + ]; + return false; + } + } else { + validate98.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema83.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema83.allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }, + ]; + return false; + } + } + } + var valid8 = _errs34 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data14.serviceId !== undefined) { + let data16 = data14.serviceId; + const _errs36 = errors; + if (typeof data16 !== 'string') { + validate98.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema83.allOf[1].properties.services.items.properties + .serviceId.type, + parentSchema: + schema83.allOf[1].properties.services.items.properties + .serviceId, + data: data16, + }, + ]; + return false; + } + var valid8 = _errs36 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data14.serviceDirection !== undefined) { + let data17 = data14.serviceDirection; + const _errs38 = errors; + if (typeof data17 !== 'string') { + validate98.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema83.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema83.allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }, + ]; + return false; + } + if ( + !( + data17 === 'consumer' || + data17 === 'producer' || + data17 === 'prosumer' + ) + ) { + validate98.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema83.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema83.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema83.allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }, + ]; + return false; + } + var valid8 = _errs38 === errors; + } else { + var valid8 = true; + } + } + } + } else { + validate98.errors = [ + { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema83.allOf[1].properties.services.items.type, + parentSchema: schema83.allOf[1].properties.services.items, + data: data14, + }, + ]; + return false; + } + } + var valid7 = _errs31 === errors; + if (!valid7) { + break; + } + } + } else { + validate98.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema83.allOf[1].properties.services.type, + parentSchema: schema83.allOf[1].properties.services, + data: data13, + }, + ]; + return false; + } + } + var valid6 = _errs29 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate98.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema83.allOf[1].type, + parentSchema: schema83.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs24 === errors; + } + validate98.errors = vErrors; + return errors === 0; +} +exports.validateTimeSlotRequest = validate99; +const schema84 = { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'TimeSlotRequest', + 'x-location': '#/components/schemas/time_slot_request', + 'x-schema-type': 'request', +}; +function validate99( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.start !== undefined) { + let data0 = data.start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats22.validate(data0)) { + validate99.errors = [ + { + instancePath: instancePath + '/start', + schemaPath: '#/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema84.properties.start, + data: data0, + }, + ]; + return false; + } + } else { + validate99.errors = [ + { + instancePath: instancePath + '/start', + schemaPath: '#/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema84.properties.start.type, + parentSchema: schema84.properties.start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.end !== undefined) { + let data1 = data.end; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate99.errors = [ + { + instancePath: instancePath + '/end', + schemaPath: '#/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema84.properties.end, + data: data1, + }, + ]; + return false; + } + } else { + validate99.errors = [ + { + instancePath: instancePath + '/end', + schemaPath: '#/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema84.properties.end.type, + parentSchema: schema84.properties.end, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } else { + validate99.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema84.type, + parentSchema: schema84, + data, + }, + ]; + return false; + } + } + validate99.errors = vErrors; + return errors === 0; +} +exports.validateTimeSlotResponse = validate100; +const schema85 = { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'TimeSlotResponse', + 'x-location': '#/components/schemas/time_slot_response', + 'x-schema-type': 'response', +}; +function validate100( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.start !== undefined) { + let data0 = data.start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats22.validate(data0)) { + validate100.errors = [ + { + instancePath: instancePath + '/start', + schemaPath: '#/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema85.properties.start, + data: data0, + }, + ]; + return false; + } + } else { + validate100.errors = [ + { + instancePath: instancePath + '/start', + schemaPath: '#/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema85.properties.start.type, + parentSchema: schema85.properties.start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.end !== undefined) { + let data1 = data.end; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate100.errors = [ + { + instancePath: instancePath + '/end', + schemaPath: '#/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema85.properties.end, + data: data1, + }, + ]; + return false; + } + } else { + validate100.errors = [ + { + instancePath: instancePath + '/end', + schemaPath: '#/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema85.properties.end.type, + parentSchema: schema85.properties.end, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } else { + validate100.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema85.type, + parentSchema: schema85, + data, + }, + ]; + return false; + } + } + validate100.errors = vErrors; + return errors === 0; +} +exports.validateAvailabilityRequest = validate101; +const schema86 = { + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + 'x-standalone': true, + 'x-name': 'AvailabilityRequest', + 'x-location': '#/components/schemas/availability_request', + 'x-schema-type': 'request', +}; +function validate101( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.start !== undefined) { + let data1 = data0.start; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate101.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema86.items.properties.start, + data: data1, + }, + ]; + return false; + } + } else { + validate101.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema86.items.properties.start.type, + parentSchema: schema86.items.properties.start, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.end !== undefined) { + let data2 = data0.end; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats22.validate(data2)) { + validate101.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema86.items.properties.end, + data: data2, + }, + ]; + return false; + } + } else { + validate101.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema86.items.properties.end.type, + parentSchema: schema86.items.properties.end, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + validate101.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema86.items.type, + parentSchema: schema86.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate101.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema86.type, + parentSchema: schema86, + data, + }, + ]; + return false; + } + } + validate101.errors = vErrors; + return errors === 0; +} +exports.validateAvailabilityResponse = validate102; +const schema87 = { + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + 'x-standalone': true, + 'x-name': 'AvailabilityResponse', + 'x-location': '#/components/schemas/availability_response', + 'x-schema-type': 'response', +}; +function validate102( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.start !== undefined) { + let data1 = data0.start; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate102.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema87.items.properties.start, + data: data1, + }, + ]; + return false; + } + } else { + validate102.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema87.items.properties.start.type, + parentSchema: schema87.items.properties.start, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.end !== undefined) { + let data2 = data0.end; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats22.validate(data2)) { + validate102.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema87.items.properties.end, + data: data2, + }, + ]; + return false; + } + } else { + validate102.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema87.items.properties.end.type, + parentSchema: schema87.items.properties.end, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + validate102.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema87.items.type, + parentSchema: schema87.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate102.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema87.type, + parentSchema: schema87, + data, + }, + ]; + return false; + } + } + validate102.errors = vErrors; + return errors === 0; +} +exports.validateConcreteDeviceRequest = validate103; +const schema88 = { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'ConcreteDeviceRequest', + 'x-location': '#/components/schemas/device_concrete_request', + 'x-schema-type': 'request', +}; +function validate103( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate103.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema88.allOf[0].required, + parentSchema: schema88.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs2 = errors; + if (typeof data0 !== 'string') { + validate103.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema88.allOf[0].properties.name.type, + parentSchema: schema88.allOf[0].properties.name, + data: data0, + }, + ]; + return false; + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate103.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema88.allOf[0].properties.description.type, + parentSchema: schema88.allOf[0].properties.description, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate103.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema88.allOf[0].properties.type.type, + parentSchema: schema88.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate103.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema88.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema88.allOf[0].properties.type.enum, + parentSchema: schema88.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs8 = errors; + if (typeof data3 !== 'boolean') { + validate103.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema88.allOf[0].properties.isPublic.type, + parentSchema: schema88.allOf[0].properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate103.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema88.allOf[0].properties.viewer.items.required, + parentSchema: schema88.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate103.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema88.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate103.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema88.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema88.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate103.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema88.allOf[0].properties.viewer.items.type, + parentSchema: schema88.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + if (!valid2) { + break; + } + } + } else { + validate103.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema88.allOf[0].properties.viewer.type, + parentSchema: schema88.allOf[0].properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs16 = errors; + if (errors === _errs16) { + if (Array.isArray(data7)) { + var valid4 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs18 = errors; + if (errors === _errs18) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate103.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema88.allOf[0].properties.owner.items.required, + parentSchema: + schema88.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate103.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema88.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate103.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema88.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema88.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate103.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema88.allOf[0].properties.owner.items.type, + parentSchema: schema88.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + if (!valid4) { + break; + } + } + } else { + validate103.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema88.allOf[0].properties.owner.type, + parentSchema: schema88.allOf[0].properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid1 = _errs16 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } else { + validate103.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema88.allOf[0].type, + parentSchema: schema88.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs22 = errors; + if (errors === _errs22) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs24 = errors; + if ('device' !== data10) { + validate103.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema88.allOf[1].properties.type, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs24 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.experiment !== undefined) { + let data11 = data.experiment; + const _errs25 = errors; + if (errors === _errs25) { + if (errors === _errs25) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + validate103.errors = [ + { + instancePath: instancePath + '/experiment', + schemaPath: '#/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema88.allOf[1].properties.experiment, + data: data11, + }, + ]; + return false; + } + } else { + validate103.errors = [ + { + instancePath: instancePath + '/experiment', + schemaPath: '#/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema88.allOf[1].properties.experiment.type, + parentSchema: schema88.allOf[1].properties.experiment, + data: data11, + }, + ]; + return false; + } + } + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs27 = errors; + if (errors === _errs27) { + if (Array.isArray(data12)) { + var valid7 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs29 = errors; + if (errors === _errs29) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs32 = errors; + if (errors === _errs32) { + if (errors === _errs32) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + validate103.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema88.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } else { + validate103.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema88.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema88.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } + } + var valid8 = _errs32 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs34 = errors; + if (typeof data15 !== 'string') { + validate103.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema88.allOf[1].properties.services.items.properties + .serviceId.type, + parentSchema: + schema88.allOf[1].properties.services.items.properties + .serviceId, + data: data15, + }, + ]; + return false; + } + var valid8 = _errs34 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs36 = errors; + if (typeof data16 !== 'string') { + validate103.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema88.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema88.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + validate103.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema88.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema88.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema88.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + var valid8 = _errs36 === errors; + } else { + var valid8 = true; + } + } + } + } else { + validate103.errors = [ + { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema88.allOf[1].properties.services.items.type, + parentSchema: schema88.allOf[1].properties.services.items, + data: data13, + }, + ]; + return false; + } + } + var valid7 = _errs29 === errors; + if (!valid7) { + break; + } + } + } else { + validate103.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema88.allOf[1].properties.services.type, + parentSchema: schema88.allOf[1].properties.services, + data: data12, + }, + ]; + return false; + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate103.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema88.allOf[1].type, + parentSchema: schema88.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs22 === errors; + } + validate103.errors = vErrors; + return errors === 0; +} +exports.validateConcreteDeviceResponse = validate104; +const schema89 = { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + connected: { + description: + 'If true, the device is connected to the service and can be used.\n', + type: 'boolean', + readOnly: true, + }, + announcedAvailability: { + readOnly: true, + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'ConcreteDeviceResponse', + 'x-location': '#/components/schemas/device_concrete_response', + 'x-schema-type': 'response', +}; +function validate104( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate104.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema89.allOf[0].required, + parentSchema: schema89.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate104.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema89.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate104.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema89.allOf[0].properties.url.type, + parentSchema: schema89.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate104.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema89.allOf[0].properties.name.type, + parentSchema: schema89.allOf[0].properties.name, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate104.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema89.allOf[0].properties.description.type, + parentSchema: schema89.allOf[0].properties.description, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs8 = errors; + if (typeof data3 !== 'string') { + validate104.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema89.allOf[0].properties.type.type, + parentSchema: schema89.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + validate104.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema89.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema89.allOf[0].properties.type.enum, + parentSchema: schema89.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs10 = errors; + if (typeof data4 !== 'boolean') { + validate104.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema89.allOf[0].properties.isPublic.type, + parentSchema: schema89.allOf[0].properties.isPublic, + data: data4, + }, + ]; + return false; + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data5)) { + var valid2 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + validate104.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema89.allOf[0].properties.viewer.items.required, + parentSchema: + schema89.allOf[0].properties.viewer.items, + data: data6, + }, + ]; + return false; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + validate104.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema89.allOf[0].properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } else { + validate104.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema89.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema89.allOf[0].properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } + } + } + } + } else { + validate104.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema89.allOf[0].properties.viewer.items.type, + parentSchema: schema89.allOf[0].properties.viewer.items, + data: data6, + }, + ]; + return false; + } + } + var valid2 = _errs14 === errors; + if (!valid2) { + break; + } + } + } else { + validate104.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema89.allOf[0].properties.viewer.type, + parentSchema: schema89.allOf[0].properties.viewer, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs12 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data8)) { + var valid4 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + validate104.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema89.allOf[0].properties.owner.items.required, + parentSchema: + schema89.allOf[0].properties.owner.items, + data: data9, + }, + ]; + return false; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + validate104.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema89.allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } else { + validate104.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema89.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema89.allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } + } + } + } + } else { + validate104.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema89.allOf[0].properties.owner.items.type, + parentSchema: + schema89.allOf[0].properties.owner.items, + data: data9, + }, + ]; + return false; + } + } + var valid4 = _errs20 === errors; + if (!valid4) { + break; + } + } + } else { + validate104.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema89.allOf[0].properties.owner.type, + parentSchema: schema89.allOf[0].properties.owner, + data: data8, + }, + ]; + return false; + } + } + var valid1 = _errs18 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } + } else { + validate104.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema89.allOf[0].type, + parentSchema: schema89.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data11 = data.type; + const _errs26 = errors; + if ('device' !== data11) { + validate104.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema89.allOf[1].properties.type, + data: data11, + }, + ]; + return false; + } + var valid6 = _errs26 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.connected !== undefined) { + let data12 = data.connected; + const _errs27 = errors; + if (typeof data12 !== 'boolean') { + validate104.errors = [ + { + instancePath: instancePath + '/connected', + schemaPath: '#/allOf/1/properties/connected/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema89.allOf[1].properties.connected.type, + parentSchema: schema89.allOf[1].properties.connected, + data: data12, + }, + ]; + return false; + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.announcedAvailability !== undefined) { + let data13 = data.announcedAvailability; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data13)) { + var valid7 = true; + const len2 = data13.length; + for (let i2 = 0; i2 < len2; i2++) { + let data14 = data13[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if (data14 && typeof data14 == 'object' && !Array.isArray(data14)) { + if (data14.start !== undefined) { + let data15 = data14.start; + const _errs33 = errors; + if (errors === _errs33) { + if (errors === _errs33) { + if (typeof data15 === 'string') { + if (!formats22.validate(data15)) { + validate104.errors = [ + { + instancePath: + instancePath + + '/announcedAvailability/' + + i2 + + '/start', + schemaPath: + '#/allOf/1/properties/announcedAvailability/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema89.allOf[1].properties.announcedAvailability + .items.properties.start, + data: data15, + }, + ]; + return false; + } + } else { + validate104.errors = [ + { + instancePath: + instancePath + + '/announcedAvailability/' + + i2 + + '/start', + schemaPath: + '#/allOf/1/properties/announcedAvailability/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema89.allOf[1].properties.announcedAvailability + .items.properties.start.type, + parentSchema: + schema89.allOf[1].properties.announcedAvailability + .items.properties.start, + data: data15, + }, + ]; + return false; + } + } + } + var valid8 = _errs33 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data14.end !== undefined) { + let data16 = data14.end; + const _errs35 = errors; + if (errors === _errs35) { + if (errors === _errs35) { + if (typeof data16 === 'string') { + if (!formats22.validate(data16)) { + validate104.errors = [ + { + instancePath: + instancePath + + '/announcedAvailability/' + + i2 + + '/end', + schemaPath: + '#/allOf/1/properties/announcedAvailability/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema89.allOf[1].properties + .announcedAvailability.items.properties.end, + data: data16, + }, + ]; + return false; + } + } else { + validate104.errors = [ + { + instancePath: + instancePath + + '/announcedAvailability/' + + i2 + + '/end', + schemaPath: + '#/allOf/1/properties/announcedAvailability/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema89.allOf[1].properties.announcedAvailability + .items.properties.end.type, + parentSchema: + schema89.allOf[1].properties.announcedAvailability + .items.properties.end, + data: data16, + }, + ]; + return false; + } + } + } + var valid8 = _errs35 === errors; + } else { + var valid8 = true; + } + } + } else { + validate104.errors = [ + { + instancePath: instancePath + '/announcedAvailability/' + i2, + schemaPath: + '#/allOf/1/properties/announcedAvailability/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema89.allOf[1].properties.announcedAvailability.items + .type, + parentSchema: + schema89.allOf[1].properties.announcedAvailability.items, + data: data14, + }, + ]; + return false; + } + } + var valid7 = _errs31 === errors; + if (!valid7) { + break; + } + } + } else { + validate104.errors = [ + { + instancePath: instancePath + '/announcedAvailability', + schemaPath: '#/allOf/1/properties/announcedAvailability/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema89.allOf[1].properties.announcedAvailability.type, + parentSchema: schema89.allOf[1].properties.announcedAvailability, + data: data13, + }, + ]; + return false; + } + } + var valid6 = _errs29 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.experiment !== undefined) { + let data17 = data.experiment; + const _errs37 = errors; + if (errors === _errs37) { + if (errors === _errs37) { + if (typeof data17 === 'string') { + if (!formats0(data17)) { + validate104.errors = [ + { + instancePath: instancePath + '/experiment', + schemaPath: '#/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema89.allOf[1].properties.experiment, + data: data17, + }, + ]; + return false; + } + } else { + validate104.errors = [ + { + instancePath: instancePath + '/experiment', + schemaPath: '#/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema89.allOf[1].properties.experiment.type, + parentSchema: schema89.allOf[1].properties.experiment, + data: data17, + }, + ]; + return false; + } + } + } + var valid6 = _errs37 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data18 = data.services; + const _errs39 = errors; + if (errors === _errs39) { + if (Array.isArray(data18)) { + var valid9 = true; + const len3 = data18.length; + for (let i3 = 0; i3 < len3; i3++) { + let data19 = data18[i3]; + const _errs41 = errors; + if (errors === _errs41) { + if ( + data19 && + typeof data19 == 'object' && + !Array.isArray(data19) + ) { + if (data19.serviceType !== undefined) { + let data20 = data19.serviceType; + const _errs44 = errors; + if (errors === _errs44) { + if (errors === _errs44) { + if (typeof data20 === 'string') { + if (!formats0(data20)) { + validate104.errors = [ + { + instancePath: + instancePath + + '/services/' + + i3 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema89.allOf[1].properties.services.items + .properties.serviceType, + data: data20, + }, + ]; + return false; + } + } else { + validate104.errors = [ + { + instancePath: + instancePath + + '/services/' + + i3 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema89.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema89.allOf[1].properties.services.items + .properties.serviceType, + data: data20, + }, + ]; + return false; + } + } + } + var valid10 = _errs44 === errors; + } else { + var valid10 = true; + } + if (valid10) { + if (data19.serviceId !== undefined) { + let data21 = data19.serviceId; + const _errs46 = errors; + if (typeof data21 !== 'string') { + validate104.errors = [ + { + instancePath: + instancePath + '/services/' + i3 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema89.allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema89.allOf[1].properties.services.items + .properties.serviceId, + data: data21, + }, + ]; + return false; + } + var valid10 = _errs46 === errors; + } else { + var valid10 = true; + } + if (valid10) { + if (data19.serviceDirection !== undefined) { + let data22 = data19.serviceDirection; + const _errs48 = errors; + if (typeof data22 !== 'string') { + validate104.errors = [ + { + instancePath: + instancePath + + '/services/' + + i3 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema89.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema89.allOf[1].properties.services.items + .properties.serviceDirection, + data: data22, + }, + ]; + return false; + } + if ( + !( + data22 === 'consumer' || + data22 === 'producer' || + data22 === 'prosumer' + ) + ) { + validate104.errors = [ + { + instancePath: + instancePath + + '/services/' + + i3 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema89.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema89.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema89.allOf[1].properties.services.items + .properties.serviceDirection, + data: data22, + }, + ]; + return false; + } + var valid10 = _errs48 === errors; + } else { + var valid10 = true; + } + } + } + } else { + validate104.errors = [ + { + instancePath: instancePath + '/services/' + i3, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema89.allOf[1].properties.services.items.type, + parentSchema: schema89.allOf[1].properties.services.items, + data: data19, + }, + ]; + return false; + } + } + var valid9 = _errs41 === errors; + if (!valid9) { + break; + } + } + } else { + validate104.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema89.allOf[1].properties.services.type, + parentSchema: schema89.allOf[1].properties.services, + data: data18, + }, + ]; + return false; + } + } + var valid6 = _errs39 === errors; + } else { + var valid6 = true; + } + } + } + } + } + } else { + validate104.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema89.allOf[1].type, + parentSchema: schema89.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs24 === errors; + } + validate104.errors = vErrors; + return errors === 0; +} +exports.validateInstantiableBrowserDeviceRequest = validate105; +const schema90 = { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'InstantiableBrowserDeviceRequest', + 'x-location': '#/components/schemas/device_edge_instantiable_request', + 'x-schema-type': 'request', +}; +function validate105( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate105.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema90.allOf[0].required, + parentSchema: schema90.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs2 = errors; + if (typeof data0 !== 'string') { + validate105.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema90.allOf[0].properties.name.type, + parentSchema: schema90.allOf[0].properties.name, + data: data0, + }, + ]; + return false; + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate105.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema90.allOf[0].properties.description.type, + parentSchema: schema90.allOf[0].properties.description, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate105.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema90.allOf[0].properties.type.type, + parentSchema: schema90.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate105.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema90.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema90.allOf[0].properties.type.enum, + parentSchema: schema90.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs8 = errors; + if (typeof data3 !== 'boolean') { + validate105.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema90.allOf[0].properties.isPublic.type, + parentSchema: schema90.allOf[0].properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate105.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema90.allOf[0].properties.viewer.items.required, + parentSchema: schema90.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate105.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema90.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate105.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema90.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema90.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate105.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema90.allOf[0].properties.viewer.items.type, + parentSchema: schema90.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + if (!valid2) { + break; + } + } + } else { + validate105.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema90.allOf[0].properties.viewer.type, + parentSchema: schema90.allOf[0].properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs16 = errors; + if (errors === _errs16) { + if (Array.isArray(data7)) { + var valid4 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs18 = errors; + if (errors === _errs18) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate105.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema90.allOf[0].properties.owner.items.required, + parentSchema: + schema90.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate105.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema90.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate105.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema90.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema90.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate105.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema90.allOf[0].properties.owner.items.type, + parentSchema: schema90.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + if (!valid4) { + break; + } + } + } else { + validate105.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema90.allOf[0].properties.owner.type, + parentSchema: schema90.allOf[0].properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid1 = _errs16 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } else { + validate105.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema90.allOf[0].type, + parentSchema: schema90.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs22 = errors; + if (errors === _errs22) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs24 = errors; + if ('edge instantiable' !== data10) { + validate105.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema90.allOf[1].properties.type, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs24 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.codeUrl !== undefined) { + let data11 = data.codeUrl; + const _errs25 = errors; + if (errors === _errs25) { + if (errors === _errs25) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + validate105.errors = [ + { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema90.allOf[1].properties.codeUrl, + data: data11, + }, + ]; + return false; + } + } else { + validate105.errors = [ + { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema90.allOf[1].properties.codeUrl.type, + parentSchema: schema90.allOf[1].properties.codeUrl, + data: data11, + }, + ]; + return false; + } + } + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs27 = errors; + if (errors === _errs27) { + if (Array.isArray(data12)) { + var valid7 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs29 = errors; + if (errors === _errs29) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs32 = errors; + if (errors === _errs32) { + if (errors === _errs32) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + validate105.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema90.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } else { + validate105.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema90.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema90.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } + } + var valid8 = _errs32 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs34 = errors; + if (typeof data15 !== 'string') { + validate105.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema90.allOf[1].properties.services.items.properties + .serviceId.type, + parentSchema: + schema90.allOf[1].properties.services.items.properties + .serviceId, + data: data15, + }, + ]; + return false; + } + var valid8 = _errs34 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs36 = errors; + if (typeof data16 !== 'string') { + validate105.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema90.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema90.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + validate105.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema90.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema90.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema90.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + var valid8 = _errs36 === errors; + } else { + var valid8 = true; + } + } + } + } else { + validate105.errors = [ + { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema90.allOf[1].properties.services.items.type, + parentSchema: schema90.allOf[1].properties.services.items, + data: data13, + }, + ]; + return false; + } + } + var valid7 = _errs29 === errors; + if (!valid7) { + break; + } + } + } else { + validate105.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema90.allOf[1].properties.services.type, + parentSchema: schema90.allOf[1].properties.services, + data: data12, + }, + ]; + return false; + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate105.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema90.allOf[1].type, + parentSchema: schema90.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs22 === errors; + } + validate105.errors = vErrors; + return errors === 0; +} +exports.validateInstantiableBrowserDeviceResponse = validate106; +const schema91 = { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'InstantiableBrowserDeviceResponse', + 'x-location': '#/components/schemas/device_edge_instantiable_response', + 'x-schema-type': 'response', +}; +function validate106( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate106.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema91.allOf[0].required, + parentSchema: schema91.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate106.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema91.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate106.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema91.allOf[0].properties.url.type, + parentSchema: schema91.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate106.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema91.allOf[0].properties.name.type, + parentSchema: schema91.allOf[0].properties.name, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate106.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema91.allOf[0].properties.description.type, + parentSchema: schema91.allOf[0].properties.description, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs8 = errors; + if (typeof data3 !== 'string') { + validate106.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema91.allOf[0].properties.type.type, + parentSchema: schema91.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + validate106.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema91.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema91.allOf[0].properties.type.enum, + parentSchema: schema91.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs10 = errors; + if (typeof data4 !== 'boolean') { + validate106.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema91.allOf[0].properties.isPublic.type, + parentSchema: schema91.allOf[0].properties.isPublic, + data: data4, + }, + ]; + return false; + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data5)) { + var valid2 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + validate106.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema91.allOf[0].properties.viewer.items.required, + parentSchema: + schema91.allOf[0].properties.viewer.items, + data: data6, + }, + ]; + return false; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + validate106.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema91.allOf[0].properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } else { + validate106.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema91.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema91.allOf[0].properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } + } + } + } + } else { + validate106.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema91.allOf[0].properties.viewer.items.type, + parentSchema: schema91.allOf[0].properties.viewer.items, + data: data6, + }, + ]; + return false; + } + } + var valid2 = _errs14 === errors; + if (!valid2) { + break; + } + } + } else { + validate106.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema91.allOf[0].properties.viewer.type, + parentSchema: schema91.allOf[0].properties.viewer, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs12 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data8)) { + var valid4 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + validate106.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema91.allOf[0].properties.owner.items.required, + parentSchema: + schema91.allOf[0].properties.owner.items, + data: data9, + }, + ]; + return false; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + validate106.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema91.allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } else { + validate106.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema91.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema91.allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } + } + } + } + } else { + validate106.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema91.allOf[0].properties.owner.items.type, + parentSchema: + schema91.allOf[0].properties.owner.items, + data: data9, + }, + ]; + return false; + } + } + var valid4 = _errs20 === errors; + if (!valid4) { + break; + } + } + } else { + validate106.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema91.allOf[0].properties.owner.type, + parentSchema: schema91.allOf[0].properties.owner, + data: data8, + }, + ]; + return false; + } + } + var valid1 = _errs18 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } + } else { + validate106.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema91.allOf[0].type, + parentSchema: schema91.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data11 = data.type; + const _errs26 = errors; + if ('edge instantiable' !== data11) { + validate106.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema91.allOf[1].properties.type, + data: data11, + }, + ]; + return false; + } + var valid6 = _errs26 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.codeUrl !== undefined) { + let data12 = data.codeUrl; + const _errs27 = errors; + if (errors === _errs27) { + if (errors === _errs27) { + if (typeof data12 === 'string') { + if (!formats0(data12)) { + validate106.errors = [ + { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema91.allOf[1].properties.codeUrl, + data: data12, + }, + ]; + return false; + } + } else { + validate106.errors = [ + { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema91.allOf[1].properties.codeUrl.type, + parentSchema: schema91.allOf[1].properties.codeUrl, + data: data12, + }, + ]; + return false; + } + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data13 = data.services; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data13)) { + var valid7 = true; + const len2 = data13.length; + for (let i2 = 0; i2 < len2; i2++) { + let data14 = data13[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if (data14 && typeof data14 == 'object' && !Array.isArray(data14)) { + if (data14.serviceType !== undefined) { + let data15 = data14.serviceType; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data15 === 'string') { + if (!formats0(data15)) { + validate106.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema91.allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }, + ]; + return false; + } + } else { + validate106.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema91.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema91.allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }, + ]; + return false; + } + } + } + var valid8 = _errs34 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data14.serviceId !== undefined) { + let data16 = data14.serviceId; + const _errs36 = errors; + if (typeof data16 !== 'string') { + validate106.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema91.allOf[1].properties.services.items.properties + .serviceId.type, + parentSchema: + schema91.allOf[1].properties.services.items.properties + .serviceId, + data: data16, + }, + ]; + return false; + } + var valid8 = _errs36 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data14.serviceDirection !== undefined) { + let data17 = data14.serviceDirection; + const _errs38 = errors; + if (typeof data17 !== 'string') { + validate106.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema91.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema91.allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }, + ]; + return false; + } + if ( + !( + data17 === 'consumer' || + data17 === 'producer' || + data17 === 'prosumer' + ) + ) { + validate106.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema91.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema91.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema91.allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }, + ]; + return false; + } + var valid8 = _errs38 === errors; + } else { + var valid8 = true; + } + } + } + } else { + validate106.errors = [ + { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema91.allOf[1].properties.services.items.type, + parentSchema: schema91.allOf[1].properties.services.items, + data: data14, + }, + ]; + return false; + } + } + var valid7 = _errs31 === errors; + if (!valid7) { + break; + } + } + } else { + validate106.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema91.allOf[1].properties.services.type, + parentSchema: schema91.allOf[1].properties.services, + data: data13, + }, + ]; + return false; + } + } + var valid6 = _errs29 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate106.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema91.allOf[1].type, + parentSchema: schema91.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs24 === errors; + } + validate106.errors = vErrors; + return errors === 0; +} +exports.validateDeviceReferenceRequest = validate107; +const schema92 = { + title: 'Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + }, + required: ['url'], + 'x-standalone': true, + 'x-name': 'DeviceReferenceRequest', + 'x-location': '#/components/schemas/device_reference_request', + 'x-schema-type': 'request', +}; +function validate107( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.url === undefined && (missing0 = 'url')) { + validate107.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema92.required, + parentSchema: schema92, + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate107.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema92.properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate107.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema92.properties.url.type, + parentSchema: schema92.properties.url, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate107.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema92.type, + parentSchema: schema92, + data, + }, + ]; + return false; + } + } + validate107.errors = vErrors; + return errors === 0; +} +exports.validateDeviceReferenceResponse = validate108; +const schema93 = { + title: 'Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + }, + required: ['url'], + 'x-standalone': true, + 'x-name': 'DeviceReferenceResponse', + 'x-location': '#/components/schemas/device_reference_response', + 'x-schema-type': 'response', +}; +function validate108( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.url === undefined && (missing0 = 'url')) { + validate108.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema93.required, + parentSchema: schema93, + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate108.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema93.properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate108.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema93.properties.url.type, + parentSchema: schema93.properties.url, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate108.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema93.type, + parentSchema: schema93, + data, + }, + ]; + return false; + } + } + validate108.errors = vErrors; + return errors === 0; +} +exports.validateDeviceGroupRequest = validate109; +const schema94 = { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'DeviceGroupRequest', + 'x-location': '#/components/schemas/device_group_request', + 'x-schema-type': 'request', +}; +function validate109( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate109.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema94.allOf[0].required, + parentSchema: schema94.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs2 = errors; + if (typeof data0 !== 'string') { + validate109.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema94.allOf[0].properties.name.type, + parentSchema: schema94.allOf[0].properties.name, + data: data0, + }, + ]; + return false; + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate109.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema94.allOf[0].properties.description.type, + parentSchema: schema94.allOf[0].properties.description, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate109.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema94.allOf[0].properties.type.type, + parentSchema: schema94.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate109.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema94.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema94.allOf[0].properties.type.enum, + parentSchema: schema94.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs8 = errors; + if (typeof data3 !== 'boolean') { + validate109.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema94.allOf[0].properties.isPublic.type, + parentSchema: schema94.allOf[0].properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate109.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema94.allOf[0].properties.viewer.items.required, + parentSchema: schema94.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate109.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema94.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate109.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema94.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema94.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate109.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema94.allOf[0].properties.viewer.items.type, + parentSchema: schema94.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + if (!valid2) { + break; + } + } + } else { + validate109.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema94.allOf[0].properties.viewer.type, + parentSchema: schema94.allOf[0].properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs16 = errors; + if (errors === _errs16) { + if (Array.isArray(data7)) { + var valid4 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs18 = errors; + if (errors === _errs18) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate109.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema94.allOf[0].properties.owner.items.required, + parentSchema: + schema94.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate109.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema94.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate109.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema94.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema94.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate109.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema94.allOf[0].properties.owner.items.type, + parentSchema: schema94.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + if (!valid4) { + break; + } + } + } else { + validate109.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema94.allOf[0].properties.owner.type, + parentSchema: schema94.allOf[0].properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid1 = _errs16 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } else { + validate109.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema94.allOf[0].type, + parentSchema: schema94.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs22 = errors; + if (errors === _errs22) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if (data.devices === undefined && (missing3 = 'devices')) { + validate109.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema94.allOf[1].required, + parentSchema: schema94.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.type !== undefined) { + let data10 = data.type; + const _errs24 = errors; + if ('group' !== data10) { + validate109.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema94.allOf[1].properties.type, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs24 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.devices !== undefined) { + let data11 = data.devices; + const _errs25 = errors; + if (errors === _errs25) { + if (Array.isArray(data11)) { + var valid7 = true; + const len2 = data11.length; + for (let i2 = 0; i2 < len2; i2++) { + let data12 = data11[i2]; + const _errs27 = errors; + if (errors === _errs27) { + if (data12 && typeof data12 == 'object' && !Array.isArray(data12)) { + let missing4; + if (data12.url === undefined && (missing4 = 'url')) { + validate109.errors = [ + { + instancePath: instancePath + '/devices/' + i2, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: "must have required property '" + missing4 + "'", + schema: schema94.allOf[1].properties.devices.items.required, + parentSchema: schema94.allOf[1].properties.devices.items, + data: data12, + }, + ]; + return false; + } else { + if (data12.url !== undefined) { + let data13 = data12.url; + const _errs29 = errors; + if (errors === _errs29) { + if (errors === _errs29) { + if (typeof data13 === 'string') { + if (!formats0(data13)) { + validate109.errors = [ + { + instancePath: + instancePath + '/devices/' + i2 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema94.allOf[1].properties.devices.items + .properties.url, + data: data13, + }, + ]; + return false; + } + } else { + validate109.errors = [ + { + instancePath: + instancePath + '/devices/' + i2 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema94.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema94.allOf[1].properties.devices.items + .properties.url, + data: data13, + }, + ]; + return false; + } + } + } + } + } + } else { + validate109.errors = [ + { + instancePath: instancePath + '/devices/' + i2, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema94.allOf[1].properties.devices.items.type, + parentSchema: schema94.allOf[1].properties.devices.items, + data: data12, + }, + ]; + return false; + } + } + var valid7 = _errs27 === errors; + if (!valid7) { + break; + } + } + } else { + validate109.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema94.allOf[1].properties.devices.type, + parentSchema: schema94.allOf[1].properties.devices, + data: data11, + }, + ]; + return false; + } + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate109.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema94.allOf[1].type, + parentSchema: schema94.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs22 === errors; + } + validate109.errors = vErrors; + return errors === 0; +} +exports.validateDeviceGroupResponse = validate110; +const schema95 = { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'DeviceGroupResponse', + 'x-location': '#/components/schemas/device_group_response', + 'x-schema-type': 'response', +}; +function validate110( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate110.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema95.allOf[0].required, + parentSchema: schema95.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate110.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema95.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate110.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema95.allOf[0].properties.url.type, + parentSchema: schema95.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate110.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema95.allOf[0].properties.name.type, + parentSchema: schema95.allOf[0].properties.name, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate110.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema95.allOf[0].properties.description.type, + parentSchema: schema95.allOf[0].properties.description, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs8 = errors; + if (typeof data3 !== 'string') { + validate110.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema95.allOf[0].properties.type.type, + parentSchema: schema95.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + validate110.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema95.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema95.allOf[0].properties.type.enum, + parentSchema: schema95.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs10 = errors; + if (typeof data4 !== 'boolean') { + validate110.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema95.allOf[0].properties.isPublic.type, + parentSchema: schema95.allOf[0].properties.isPublic, + data: data4, + }, + ]; + return false; + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data5)) { + var valid2 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + validate110.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema95.allOf[0].properties.viewer.items.required, + parentSchema: + schema95.allOf[0].properties.viewer.items, + data: data6, + }, + ]; + return false; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + validate110.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema95.allOf[0].properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } else { + validate110.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema95.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema95.allOf[0].properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } + } + } + } + } else { + validate110.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema95.allOf[0].properties.viewer.items.type, + parentSchema: schema95.allOf[0].properties.viewer.items, + data: data6, + }, + ]; + return false; + } + } + var valid2 = _errs14 === errors; + if (!valid2) { + break; + } + } + } else { + validate110.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema95.allOf[0].properties.viewer.type, + parentSchema: schema95.allOf[0].properties.viewer, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs12 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data8)) { + var valid4 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + validate110.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema95.allOf[0].properties.owner.items.required, + parentSchema: + schema95.allOf[0].properties.owner.items, + data: data9, + }, + ]; + return false; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + validate110.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema95.allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } else { + validate110.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema95.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema95.allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } + } + } + } + } else { + validate110.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema95.allOf[0].properties.owner.items.type, + parentSchema: + schema95.allOf[0].properties.owner.items, + data: data9, + }, + ]; + return false; + } + } + var valid4 = _errs20 === errors; + if (!valid4) { + break; + } + } + } else { + validate110.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema95.allOf[0].properties.owner.type, + parentSchema: schema95.allOf[0].properties.owner, + data: data8, + }, + ]; + return false; + } + } + var valid1 = _errs18 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } + } else { + validate110.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema95.allOf[0].type, + parentSchema: schema95.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if (data.devices === undefined && (missing3 = 'devices')) { + validate110.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema95.allOf[1].required, + parentSchema: schema95.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.type !== undefined) { + let data11 = data.type; + const _errs26 = errors; + if ('group' !== data11) { + validate110.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema95.allOf[1].properties.type, + data: data11, + }, + ]; + return false; + } + var valid6 = _errs26 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.devices !== undefined) { + let data12 = data.devices; + const _errs27 = errors; + if (errors === _errs27) { + if (Array.isArray(data12)) { + var valid7 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs29 = errors; + if (errors === _errs29) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + let missing4; + if (data13.url === undefined && (missing4 = 'url')) { + validate110.errors = [ + { + instancePath: instancePath + '/devices/' + i2, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: "must have required property '" + missing4 + "'", + schema: schema95.allOf[1].properties.devices.items.required, + parentSchema: schema95.allOf[1].properties.devices.items, + data: data13, + }, + ]; + return false; + } else { + if (data13.url !== undefined) { + let data14 = data13.url; + const _errs31 = errors; + if (errors === _errs31) { + if (errors === _errs31) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + validate110.errors = [ + { + instancePath: + instancePath + '/devices/' + i2 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema95.allOf[1].properties.devices.items + .properties.url, + data: data14, + }, + ]; + return false; + } + } else { + validate110.errors = [ + { + instancePath: + instancePath + '/devices/' + i2 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema95.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema95.allOf[1].properties.devices.items + .properties.url, + data: data14, + }, + ]; + return false; + } + } + } + } + } + } else { + validate110.errors = [ + { + instancePath: instancePath + '/devices/' + i2, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema95.allOf[1].properties.devices.items.type, + parentSchema: schema95.allOf[1].properties.devices.items, + data: data13, + }, + ]; + return false; + } + } + var valid7 = _errs29 === errors; + if (!valid7) { + break; + } + } + } else { + validate110.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema95.allOf[1].properties.devices.type, + parentSchema: schema95.allOf[1].properties.devices, + data: data12, + }, + ]; + return false; + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate110.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema95.allOf[1].type, + parentSchema: schema95.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs24 === errors; + } + validate110.errors = vErrors; + return errors === 0; +} +exports.validateDeviceRequest = validate111; +const schema96 = { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'DeviceRequest', + 'x-location': '#/components/schemas/device_request', + 'x-schema-type': 'request', +}; +function validate111( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema96.anyOf[0].allOf[0].required, + parentSchema: schema96.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs4 = errors; + if (typeof data0 !== 'string') { + const err1 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema96.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema96.anyOf[0].allOf[0].properties.name, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err2 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema96.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema96.anyOf[0].allOf[0].properties.description, + data: data1, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err3 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema96.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema96.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + const err4 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema96.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema96.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema96.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs10 = errors; + if (typeof data3 !== 'boolean') { + const err5 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema96.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema96.anyOf[0].allOf[0].properties.isPublic, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data4)) { + var valid3 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + const err6 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: + schema96.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema96.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + const err7 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema96.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema96.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } + } else { + const err9 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema96.anyOf[0].allOf[0].properties.viewer.items.type, + parentSchema: + schema96.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var valid3 = _errs14 === errors; + if (!valid3) { + break; + } + } + } else { + const err10 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema96.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema96.anyOf[0].allOf[0].properties.viewer, + data: data4, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid5 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + const err11 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema96.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema96.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + const err12 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema96.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } else { + const err13 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema96.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + } + } + } + } + } else { + const err14 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema96.anyOf[0].allOf[0].properties.owner.items.type, + parentSchema: + schema96.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } + var valid5 = _errs20 === errors; + if (!valid5) { + break; + } + } + } else { + const err15 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema96.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema96.anyOf[0].allOf[0].properties.owner, + data: data7, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + var valid2 = _errs18 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } else { + const err16 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema96.anyOf[0].allOf[0].type, + parentSchema: schema96.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs26 = errors; + if ('cloud instantiable' !== data10) { + const err17 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema96.anyOf[0].allOf[1].properties.type, + data: data10, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var valid7 = _errs26 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data11 = data.instantiateUrl; + const _errs27 = errors; + if (errors === _errs27) { + if (errors === _errs27) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + const err18 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema96.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } else { + const err19 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema96.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema96.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + } + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data12)) { + var valid8 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + const err20 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema96.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema96.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid9 = _errs34 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs36 = errors; + if (typeof data15 !== 'string') { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema96.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err23 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema96.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + const err24 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema96.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema96.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema96.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err25 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema96.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema96.anyOf[0].allOf[1].properties.services.items, + data: data13, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + var valid8 = _errs31 === errors; + if (!valid8) { + break; + } + } + } else { + const err26 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema96.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema96.anyOf[0].allOf[1].properties.services, + data: data12, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err27 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema96.anyOf[0].allOf[1].type, + parentSchema: schema96.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid1 = _errs24 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs40 = errors; + const _errs41 = errors; + if (errors === _errs41) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if ( + (data.type === undefined && (missing3 = 'type')) || + (data.name === undefined && (missing3 = 'name')) || + (data.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err28 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema96.anyOf[1].allOf[0].required, + parentSchema: schema96.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } else { + if (data.name !== undefined) { + let data17 = data.name; + const _errs43 = errors; + if (typeof data17 !== 'string') { + const err29 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema96.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema96.anyOf[1].allOf[0].properties.name, + data: data17, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + var valid11 = _errs43 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data18 = data.description; + const _errs45 = errors; + if (typeof data18 !== 'string') { + const err30 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema96.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema96.anyOf[1].allOf[0].properties.description, + data: data18, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data19 = data.type; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err31 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema96.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema96.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + if ( + !( + data19 === 'device' || + data19 === 'group' || + data19 === 'edge instantiable' || + data19 === 'cloud instantiable' + ) + ) { + const err32 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema96.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema96.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema96.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data20 = data.isPublic; + const _errs49 = errors; + if (typeof data20 !== 'boolean') { + const err33 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema96.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema96.anyOf[1].allOf[0].properties.isPublic, + data: data20, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data21 = data.viewer; + const _errs51 = errors; + if (errors === _errs51) { + if (Array.isArray(data21)) { + var valid12 = true; + const len3 = data21.length; + for (let i3 = 0; i3 < len3; i3++) { + let data22 = data21[i3]; + const _errs53 = errors; + if (errors === _errs53) { + if ( + data22 && + typeof data22 == 'object' && + !Array.isArray(data22) + ) { + let missing4; + if (data22.url === undefined && (missing4 = 'url')) { + const err34 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema96.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema96.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } else { + if (data22.url !== undefined) { + let data23 = data22.url; + const _errs55 = errors; + if (errors === _errs55) { + if (errors === _errs55) { + if (typeof data23 === 'string') { + if (!formats0(data23)) { + const err35 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema96.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } else { + const err36 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[1].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema96.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + } + } + } + } else { + const err37 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema96.anyOf[1].allOf[0].properties.viewer.items.type, + parentSchema: + schema96.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + var valid12 = _errs53 === errors; + if (!valid12) { + break; + } + } + } else { + const err38 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema96.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema96.anyOf[1].allOf[0].properties.viewer, + data: data21, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data24 = data.owner; + const _errs57 = errors; + if (errors === _errs57) { + if (Array.isArray(data24)) { + var valid14 = true; + const len4 = data24.length; + for (let i4 = 0; i4 < len4; i4++) { + let data25 = data24[i4]; + const _errs59 = errors; + if (errors === _errs59) { + if ( + data25 && + typeof data25 == 'object' && + !Array.isArray(data25) + ) { + let missing5; + if (data25.url === undefined && (missing5 = 'url')) { + const err39 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema96.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema96.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } else { + if (data25.url !== undefined) { + let data26 = data25.url; + const _errs61 = errors; + if (errors === _errs61) { + if (errors === _errs61) { + if (typeof data26 === 'string') { + if (!formats0(data26)) { + const err40 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema96.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } else { + const err41 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[1].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema96.anyOf[1].allOf[0].properties.owner + .items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + } + } + } + } else { + const err42 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema96.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema96.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid14 = _errs59 === errors; + if (!valid14) { + break; + } + } + } else { + const err43 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema96.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema96.anyOf[1].allOf[0].properties.owner, + data: data24, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + } + var valid11 = _errs57 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } else { + const err44 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema96.anyOf[1].allOf[0].type, + parentSchema: schema96.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var valid10 = _errs41 === errors; + if (valid10) { + const _errs63 = errors; + if (errors === _errs63) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data27 = data.type; + const _errs65 = errors; + if ('device' !== data27) { + const err45 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema96.anyOf[1].allOf[1].properties.type, + data: data27, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + var valid16 = _errs65 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data28 = data.experiment; + const _errs66 = errors; + if (errors === _errs66) { + if (errors === _errs66) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err46 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema96.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } else { + const err47 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema96.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema96.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + } + var valid16 = _errs66 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data29 = data.services; + const _errs68 = errors; + if (errors === _errs68) { + if (Array.isArray(data29)) { + var valid17 = true; + const len5 = data29.length; + for (let i5 = 0; i5 < len5; i5++) { + let data30 = data29[i5]; + const _errs70 = errors; + if (errors === _errs70) { + if ( + data30 && + typeof data30 == 'object' && + !Array.isArray(data30) + ) { + if (data30.serviceType !== undefined) { + let data31 = data30.serviceType; + const _errs73 = errors; + if (errors === _errs73) { + if (errors === _errs73) { + if (typeof data31 === 'string') { + if (!formats0(data31)) { + const err48 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema96.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } else { + const err49 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[1].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema96.anyOf[1].allOf[1].properties.services.items + .properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + } + } + var valid18 = _errs73 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceId !== undefined) { + let data32 = data30.serviceId; + const _errs75 = errors; + if (typeof data32 !== 'string') { + const err50 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[1].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema96.anyOf[1].allOf[1].properties.services.items + .properties.serviceId, + data: data32, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid18 = _errs75 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceDirection !== undefined) { + let data33 = data30.serviceDirection; + const _errs77 = errors; + if (typeof data33 !== 'string') { + const err51 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[1].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema96.anyOf[1].allOf[1].properties.services.items + .properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + if ( + !( + data33 === 'consumer' || + data33 === 'producer' || + data33 === 'prosumer' + ) + ) { + const err52 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema96.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema96.anyOf[1].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema96.anyOf[1].allOf[1].properties.services.items + .properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + var valid18 = _errs77 === errors; + } else { + var valid18 = true; + } + } + } + } else { + const err53 = { + instancePath: instancePath + '/services/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema96.anyOf[1].allOf[1].properties.services.items.type, + parentSchema: + schema96.anyOf[1].allOf[1].properties.services.items, + data: data30, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + var valid17 = _errs70 === errors; + if (!valid17) { + break; + } + } + } else { + const err54 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema96.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema96.anyOf[1].allOf[1].properties.services, + data: data29, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + var valid16 = _errs68 === errors; + } else { + var valid16 = true; + } + } + } + } else { + const err55 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema96.anyOf[1].allOf[1].type, + parentSchema: schema96.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid10 = _errs63 === errors; + } + var _valid0 = _errs40 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs79 = errors; + const _errs80 = errors; + if (errors === _errs80) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.type === undefined && (missing6 = 'type')) || + (data.name === undefined && (missing6 = 'name')) || + (data.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err56 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema96.anyOf[2].allOf[0].required, + parentSchema: schema96.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } else { + if (data.name !== undefined) { + let data34 = data.name; + const _errs82 = errors; + if (typeof data34 !== 'string') { + const err57 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema96.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema96.anyOf[2].allOf[0].properties.name, + data: data34, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + var valid20 = _errs82 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.description !== undefined) { + let data35 = data.description; + const _errs84 = errors; + if (typeof data35 !== 'string') { + const err58 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema96.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema96.anyOf[2].allOf[0].properties.description, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + var valid20 = _errs84 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.type !== undefined) { + let data36 = data.type; + const _errs86 = errors; + if (typeof data36 !== 'string') { + const err59 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema96.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema96.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + if ( + !( + data36 === 'device' || + data36 === 'group' || + data36 === 'edge instantiable' || + data36 === 'cloud instantiable' + ) + ) { + const err60 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema96.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema96.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema96.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + var valid20 = _errs86 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.isPublic !== undefined) { + let data37 = data.isPublic; + const _errs88 = errors; + if (typeof data37 !== 'boolean') { + const err61 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema96.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema96.anyOf[2].allOf[0].properties.isPublic, + data: data37, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs88 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.viewer !== undefined) { + let data38 = data.viewer; + const _errs90 = errors; + if (errors === _errs90) { + if (Array.isArray(data38)) { + var valid21 = true; + const len6 = data38.length; + for (let i6 = 0; i6 < len6; i6++) { + let data39 = data38[i6]; + const _errs92 = errors; + if (errors === _errs92) { + if ( + data39 && + typeof data39 == 'object' && + !Array.isArray(data39) + ) { + let missing7; + if (data39.url === undefined && (missing7 = 'url')) { + const err62 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema96.anyOf[2].allOf[0].properties.viewer.items + .required, + parentSchema: + schema96.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } else { + if (data39.url !== undefined) { + let data40 = data39.url; + const _errs94 = errors; + if (errors === _errs94) { + if (errors === _errs94) { + if (typeof data40 === 'string') { + if (!formats0(data40)) { + const err63 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema96.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + } else { + const err64 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[2].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema96.anyOf[2].allOf[0].properties.viewer + .items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + } + } + } + } else { + const err65 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema96.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema96.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid21 = _errs92 === errors; + if (!valid21) { + break; + } + } + } else { + const err66 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema96.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema96.anyOf[2].allOf[0].properties.viewer, + data: data38, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid20 = _errs90 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.owner !== undefined) { + let data41 = data.owner; + const _errs96 = errors; + if (errors === _errs96) { + if (Array.isArray(data41)) { + var valid23 = true; + const len7 = data41.length; + for (let i7 = 0; i7 < len7; i7++) { + let data42 = data41[i7]; + const _errs98 = errors; + if (errors === _errs98) { + if ( + data42 && + typeof data42 == 'object' && + !Array.isArray(data42) + ) { + let missing8; + if (data42.url === undefined && (missing8 = 'url')) { + const err67 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + missing8 + "'", + schema: + schema96.anyOf[2].allOf[0].properties.owner.items + .required, + parentSchema: + schema96.anyOf[2].allOf[0].properties.owner.items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data42.url !== undefined) { + let data43 = data42.url; + const _errs100 = errors; + if (errors === _errs100) { + if (errors === _errs100) { + if (typeof data43 === 'string') { + if (!formats0(data43)) { + const err68 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema96.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema96.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + } + } + } else { + const err70 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema96.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema96.anyOf[2].allOf[0].properties.owner.items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + } + var valid23 = _errs98 === errors; + if (!valid23) { + break; + } + } + } else { + const err71 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema96.anyOf[2].allOf[0].properties.owner.type, + parentSchema: schema96.anyOf[2].allOf[0].properties.owner, + data: data41, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + } + var valid20 = _errs96 === errors; + } else { + var valid20 = true; + } + } + } + } + } + } + } + } else { + const err72 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema96.anyOf[2].allOf[0].type, + parentSchema: schema96.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + var valid19 = _errs80 === errors; + if (valid19) { + const _errs102 = errors; + if (errors === _errs102) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs104 = errors; + if ('edge instantiable' !== data44) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema96.anyOf[2].allOf[1].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid25 = _errs104 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.codeUrl !== undefined) { + let data45 = data.codeUrl; + const _errs105 = errors; + if (errors === _errs105) { + if (errors === _errs105) { + if (typeof data45 === 'string') { + if (!formats0(data45)) { + const err74 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema96.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } else { + const err75 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema96.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema96.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + } + var valid25 = _errs105 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.services !== undefined) { + let data46 = data.services; + const _errs107 = errors; + if (errors === _errs107) { + if (Array.isArray(data46)) { + var valid26 = true; + const len8 = data46.length; + for (let i8 = 0; i8 < len8; i8++) { + let data47 = data46[i8]; + const _errs109 = errors; + if (errors === _errs109) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + if (data47.serviceType !== undefined) { + let data48 = data47.serviceType; + const _errs112 = errors; + if (errors === _errs112) { + if (errors === _errs112) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema96.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema96.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + var valid27 = _errs112 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceId !== undefined) { + let data49 = data47.serviceId; + const _errs114 = errors; + if (typeof data49 !== 'string') { + const err78 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[2].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema96.anyOf[2].allOf[1].properties.services.items + .properties.serviceId, + data: data49, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + var valid27 = _errs114 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceDirection !== undefined) { + let data50 = data47.serviceDirection; + const _errs116 = errors; + if (typeof data50 !== 'string') { + const err79 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema96.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + if ( + !( + data50 === 'consumer' || + data50 === 'producer' || + data50 === 'prosumer' + ) + ) { + const err80 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema96.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema96.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema96.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + var valid27 = _errs116 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err81 = { + instancePath: instancePath + '/services/' + i8, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema96.anyOf[2].allOf[1].properties.services.items.type, + parentSchema: + schema96.anyOf[2].allOf[1].properties.services.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + var valid26 = _errs109 === errors; + if (!valid26) { + break; + } + } + } else { + const err82 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema96.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema96.anyOf[2].allOf[1].properties.services, + data: data46, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + var valid25 = _errs107 === errors; + } else { + var valid25 = true; + } + } + } + } else { + const err83 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema96.anyOf[2].allOf[1].type, + parentSchema: schema96.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid19 = _errs102 === errors; + } + var _valid0 = _errs79 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs118 = errors; + const _errs119 = errors; + if (errors === _errs119) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if ( + (data.type === undefined && (missing9 = 'type')) || + (data.name === undefined && (missing9 = 'name')) || + (data.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err84 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema96.anyOf[3].allOf[0].required, + parentSchema: schema96.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } else { + if (data.name !== undefined) { + let data51 = data.name; + const _errs121 = errors; + if (typeof data51 !== 'string') { + const err85 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema96.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema96.anyOf[3].allOf[0].properties.name, + data: data51, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + var valid29 = _errs121 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.description !== undefined) { + let data52 = data.description; + const _errs123 = errors; + if (typeof data52 !== 'string') { + const err86 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema96.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema96.anyOf[3].allOf[0].properties.description, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid29 = _errs123 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.type !== undefined) { + let data53 = data.type; + const _errs125 = errors; + if (typeof data53 !== 'string') { + const err87 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema96.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema96.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + if ( + !( + data53 === 'device' || + data53 === 'group' || + data53 === 'edge instantiable' || + data53 === 'cloud instantiable' + ) + ) { + const err88 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema96.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema96.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema96.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + var valid29 = _errs125 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.isPublic !== undefined) { + let data54 = data.isPublic; + const _errs127 = errors; + if (typeof data54 !== 'boolean') { + const err89 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema96.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema96.anyOf[3].allOf[0].properties.isPublic, + data: data54, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + var valid29 = _errs127 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.viewer !== undefined) { + let data55 = data.viewer; + const _errs129 = errors; + if (errors === _errs129) { + if (Array.isArray(data55)) { + var valid30 = true; + const len9 = data55.length; + for (let i9 = 0; i9 < len9; i9++) { + let data56 = data55[i9]; + const _errs131 = errors; + if (errors === _errs131) { + if ( + data56 && + typeof data56 == 'object' && + !Array.isArray(data56) + ) { + let missing10; + if (data56.url === undefined && (missing10 = 'url')) { + const err90 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + missing10 + "'", + schema: + schema96.anyOf[3].allOf[0].properties.viewer.items + .required, + parentSchema: + schema96.anyOf[3].allOf[0].properties.viewer + .items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } else { + if (data56.url !== undefined) { + let data57 = data56.url; + const _errs133 = errors; + if (errors === _errs133) { + if (errors === _errs133) { + if (typeof data57 === 'string') { + if (!formats0(data57)) { + const err91 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema96.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + } else { + const err92 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema96.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + } + } + } + } + } else { + const err93 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema96.anyOf[3].allOf[0].properties.viewer.items + .type, + parentSchema: + schema96.anyOf[3].allOf[0].properties.viewer.items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + var valid30 = _errs131 === errors; + if (!valid30) { + break; + } + } + } else { + const err94 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema96.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: schema96.anyOf[3].allOf[0].properties.viewer, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid29 = _errs129 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.owner !== undefined) { + let data58 = data.owner; + const _errs135 = errors; + if (errors === _errs135) { + if (Array.isArray(data58)) { + var valid32 = true; + const len10 = data58.length; + for (let i10 = 0; i10 < len10; i10++) { + let data59 = data58[i10]; + const _errs137 = errors; + if (errors === _errs137) { + if ( + data59 && + typeof data59 == 'object' && + !Array.isArray(data59) + ) { + let missing11; + if (data59.url === undefined && (missing11 = 'url')) { + const err95 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema96.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema96.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } else { + if (data59.url !== undefined) { + let data60 = data59.url; + const _errs139 = errors; + if (errors === _errs139) { + if (errors === _errs139) { + if (typeof data60 === 'string') { + if (!formats0(data60)) { + const err96 = { + instancePath: + instancePath + + '/owner/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema96.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } else { + const err97 = { + instancePath: + instancePath + '/owner/' + i10 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema96.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + } + } + } + } + } else { + const err98 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema96.anyOf[3].allOf[0].properties.owner.items + .type, + parentSchema: + schema96.anyOf[3].allOf[0].properties.owner.items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } + var valid32 = _errs137 === errors; + if (!valid32) { + break; + } + } + } else { + const err99 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema96.anyOf[3].allOf[0].properties.owner.type, + parentSchema: schema96.anyOf[3].allOf[0].properties.owner, + data: data58, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + var valid29 = _errs135 === errors; + } else { + var valid29 = true; + } + } + } + } + } + } + } + } else { + const err100 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema96.anyOf[3].allOf[0].type, + parentSchema: schema96.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + } + var valid28 = _errs119 === errors; + if (valid28) { + const _errs141 = errors; + if (errors === _errs141) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if (data.devices === undefined && (missing12 = 'devices')) { + const err101 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema96.anyOf[3].allOf[1].required, + parentSchema: schema96.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } else { + if (data.type !== undefined) { + let data61 = data.type; + const _errs143 = errors; + if ('group' !== data61) { + const err102 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema96.anyOf[3].allOf[1].properties.type, + data: data61, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + var valid34 = _errs143 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data.devices !== undefined) { + let data62 = data.devices; + const _errs144 = errors; + if (errors === _errs144) { + if (Array.isArray(data62)) { + var valid35 = true; + const len11 = data62.length; + for (let i11 = 0; i11 < len11; i11++) { + let data63 = data62[i11]; + const _errs146 = errors; + if (errors === _errs146) { + if ( + data63 && + typeof data63 == 'object' && + !Array.isArray(data63) + ) { + let missing13; + if (data63.url === undefined && (missing13 = 'url')) { + const err103 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: + "must have required property '" + missing13 + "'", + schema: + schema96.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema96.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } else { + if (data63.url !== undefined) { + let data64 = data63.url; + const _errs148 = errors; + if (errors === _errs148) { + if (errors === _errs148) { + if (typeof data64 === 'string') { + if (!formats0(data64)) { + const err104 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema96.anyOf[3].allOf[1].properties + .devices.items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + } else { + const err105 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema96.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema96.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } + } + } + } + } + } else { + const err106 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema96.anyOf[3].allOf[1].properties.devices.items + .type, + parentSchema: + schema96.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } + var valid35 = _errs146 === errors; + if (!valid35) { + break; + } + } + } else { + const err107 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema96.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema96.anyOf[3].allOf[1].properties.devices, + data: data62, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + var valid34 = _errs144 === errors; + } else { + var valid34 = true; + } + } + } + } else { + const err108 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema96.anyOf[3].allOf[1].type, + parentSchema: schema96.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid28 = _errs141 === errors; + } + var _valid0 = _errs118 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err109 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema96.anyOf, + parentSchema: schema96, + data, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + validate111.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate111.errors = vErrors; + return errors === 0; +} +exports.validateDeviceResponse = validate112; +const schema97 = { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + connected: { + description: + 'If true, the device is connected to the service and can be used.\n', + type: 'boolean', + readOnly: true, + }, + announcedAvailability: { + readOnly: true, + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'DeviceResponse', + 'x-location': '#/components/schemas/device_response', + 'x-schema-type': 'response', +}; +function validate112( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema97.anyOf[0].allOf[0].required, + parentSchema: schema97.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs4 = errors; + if (errors === _errs4) { + if (errors === _errs4) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + const err1 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema97.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } else { + const err2 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[0].allOf[0].properties.url.type, + parentSchema: schema97.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err3 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema97.anyOf[0].allOf[0].properties.name, + data: data1, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err4 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema97.anyOf[0].allOf[0].properties.description, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs10 = errors; + if (typeof data3 !== 'string') { + const err5 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema97.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + const err6 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema97.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema97.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema97.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs12 = errors; + if (typeof data4 !== 'boolean') { + const err7 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema97.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema97.anyOf[0].allOf[0].properties.isPublic, + data: data4, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs14 = errors; + if (errors === _errs14) { + if (Array.isArray(data5)) { + var valid3 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + const err8 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema97.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema97.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + const err9 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema97.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } else { + const err10 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema97.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + } + } + } + } else { + const err11 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema97.anyOf[0].allOf[0].properties.viewer.items.type, + parentSchema: + schema97.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } + var valid3 = _errs16 === errors; + if (!valid3) { + break; + } + } + } else { + const err12 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema97.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema97.anyOf[0].allOf[0].properties.viewer, + data: data5, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } + var valid2 = _errs14 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs20 = errors; + if (errors === _errs20) { + if (Array.isArray(data8)) { + var valid5 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs22 = errors; + if (errors === _errs22) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + const err13 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema97.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema97.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs24 = errors; + if (errors === _errs24) { + if (errors === _errs24) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + const err14 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema97.anyOf[0].allOf[0].properties + .owner.items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } else { + const err15 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema97.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + } + } + } + } else { + const err16 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema97.anyOf[0].allOf[0].properties.owner.items + .type, + parentSchema: + schema97.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid5 = _errs22 === errors; + if (!valid5) { + break; + } + } + } else { + const err17 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema97.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema97.anyOf[0].allOf[0].properties.owner, + data: data8, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + } + var valid2 = _errs20 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } + } else { + const err18 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema97.anyOf[0].allOf[0].type, + parentSchema: schema97.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs26 = errors; + if (errors === _errs26) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data11 = data.type; + const _errs28 = errors; + if ('cloud instantiable' !== data11) { + const err19 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema97.anyOf[0].allOf[1].properties.type, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + var valid7 = _errs28 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data12 = data.instantiateUrl; + const _errs29 = errors; + if (errors === _errs29) { + if (errors === _errs29) { + if (typeof data12 === 'string') { + if (!formats0(data12)) { + const err20 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema97.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema97.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data13 = data.services; + const _errs31 = errors; + if (errors === _errs31) { + if (Array.isArray(data13)) { + var valid8 = true; + const len2 = data13.length; + for (let i2 = 0; i2 < len2; i2++) { + let data14 = data13[i2]; + const _errs33 = errors; + if (errors === _errs33) { + if (data14 && typeof data14 == 'object' && !Array.isArray(data14)) { + if (data14.serviceType !== undefined) { + let data15 = data14.serviceType; + const _errs36 = errors; + if (errors === _errs36) { + if (errors === _errs36) { + if (typeof data15 === 'string') { + if (!formats0(data15)) { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema97.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } else { + const err23 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema97.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + } + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceId !== undefined) { + let data16 = data14.serviceId; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err24 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema97.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceDirection !== undefined) { + let data17 = data14.serviceDirection; + const _errs40 = errors; + if (typeof data17 !== 'string') { + const err25 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema97.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + if ( + !( + data17 === 'consumer' || + data17 === 'producer' || + data17 === 'prosumer' + ) + ) { + const err26 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema97.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema97.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema97.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + var valid9 = _errs40 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err27 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema97.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema97.anyOf[0].allOf[1].properties.services.items, + data: data14, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid8 = _errs33 === errors; + if (!valid8) { + break; + } + } + } else { + const err28 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema97.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema97.anyOf[0].allOf[1].properties.services, + data: data13, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + } + var valid7 = _errs31 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err29 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema97.anyOf[0].allOf[1].type, + parentSchema: schema97.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + } + var valid1 = _errs26 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs42 = errors; + const _errs43 = errors; + if (errors === _errs43) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if ( + (data.url === undefined && (missing3 = 'url')) || + (data.type === undefined && (missing3 = 'type')) || + (data.name === undefined && (missing3 = 'name')) || + (data.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err30 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema97.anyOf[1].allOf[0].required, + parentSchema: schema97.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } else { + if (data.url !== undefined) { + let data18 = data.url; + const _errs45 = errors; + if (errors === _errs45) { + if (errors === _errs45) { + if (typeof data18 === 'string') { + if (!formats0(data18)) { + const err31 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema97.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } else { + const err32 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[1].allOf[0].properties.url.type, + parentSchema: schema97.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.name !== undefined) { + let data19 = data.name; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err33 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema97.anyOf[1].allOf[0].properties.name, + data: data19, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data20 = data.description; + const _errs49 = errors; + if (typeof data20 !== 'string') { + const err34 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema97.anyOf[1].allOf[0].properties.description, + data: data20, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data21 = data.type; + const _errs51 = errors; + if (typeof data21 !== 'string') { + const err35 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema97.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + if ( + !( + data21 === 'device' || + data21 === 'group' || + data21 === 'edge instantiable' || + data21 === 'cloud instantiable' + ) + ) { + const err36 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema97.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema97.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema97.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data22 = data.isPublic; + const _errs53 = errors; + if (typeof data22 !== 'boolean') { + const err37 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema97.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema97.anyOf[1].allOf[0].properties.isPublic, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + var valid11 = _errs53 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data23 = data.viewer; + const _errs55 = errors; + if (errors === _errs55) { + if (Array.isArray(data23)) { + var valid12 = true; + const len3 = data23.length; + for (let i3 = 0; i3 < len3; i3++) { + let data24 = data23[i3]; + const _errs57 = errors; + if (errors === _errs57) { + if ( + data24 && + typeof data24 == 'object' && + !Array.isArray(data24) + ) { + let missing4; + if (data24.url === undefined && (missing4 = 'url')) { + const err38 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema97.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema97.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } else { + if (data24.url !== undefined) { + let data25 = data24.url; + const _errs59 = errors; + if (errors === _errs59) { + if (errors === _errs59) { + if (typeof data25 === 'string') { + if (!formats0(data25)) { + const err39 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema97.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } else { + const err40 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[1].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema97.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + } + } + } + } else { + const err41 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema97.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema97.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + var valid12 = _errs57 === errors; + if (!valid12) { + break; + } + } + } else { + const err42 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema97.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema97.anyOf[1].allOf[0].properties.viewer, + data: data23, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid11 = _errs55 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data26 = data.owner; + const _errs61 = errors; + if (errors === _errs61) { + if (Array.isArray(data26)) { + var valid14 = true; + const len4 = data26.length; + for (let i4 = 0; i4 < len4; i4++) { + let data27 = data26[i4]; + const _errs63 = errors; + if (errors === _errs63) { + if ( + data27 && + typeof data27 == 'object' && + !Array.isArray(data27) + ) { + let missing5; + if (data27.url === undefined && (missing5 = 'url')) { + const err43 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema97.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema97.anyOf[1].allOf[0].properties.owner.items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } else { + if (data27.url !== undefined) { + let data28 = data27.url; + const _errs65 = errors; + if (errors === _errs65) { + if (errors === _errs65) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err44 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema97.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } else { + const err45 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[1].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema97.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + } + } + } + } + } else { + const err46 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema97.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema97.anyOf[1].allOf[0].properties.owner.items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } + var valid14 = _errs63 === errors; + if (!valid14) { + break; + } + } + } else { + const err47 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema97.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema97.anyOf[1].allOf[0].properties.owner, + data: data26, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var valid11 = _errs61 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } + } else { + const err48 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema97.anyOf[1].allOf[0].type, + parentSchema: schema97.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } + var valid10 = _errs43 === errors; + if (valid10) { + const _errs67 = errors; + if (errors === _errs67) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data29 = data.type; + const _errs69 = errors; + if ('device' !== data29) { + const err49 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema97.anyOf[1].allOf[1].properties.type, + data: data29, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + var valid16 = _errs69 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.connected !== undefined) { + let data30 = data.connected; + const _errs70 = errors; + if (typeof data30 !== 'boolean') { + const err50 = { + instancePath: instancePath + '/connected', + schemaPath: '#/anyOf/1/allOf/1/properties/connected/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema97.anyOf[1].allOf[1].properties.connected.type, + parentSchema: schema97.anyOf[1].allOf[1].properties.connected, + data: data30, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid16 = _errs70 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.announcedAvailability !== undefined) { + let data31 = data.announcedAvailability; + const _errs72 = errors; + if (errors === _errs72) { + if (Array.isArray(data31)) { + var valid17 = true; + const len5 = data31.length; + for (let i5 = 0; i5 < len5; i5++) { + let data32 = data31[i5]; + const _errs74 = errors; + if (errors === _errs74) { + if ( + data32 && + typeof data32 == 'object' && + !Array.isArray(data32) + ) { + if (data32.start !== undefined) { + let data33 = data32.start; + const _errs76 = errors; + if (errors === _errs76) { + if (errors === _errs76) { + if (typeof data33 === 'string') { + if (!formats22.validate(data33)) { + const err51 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema97.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } else { + const err52 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start + .type, + parentSchema: + schema97.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + } + } + var valid18 = _errs76 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data32.end !== undefined) { + let data34 = data32.end; + const _errs78 = errors; + if (errors === _errs78) { + if (errors === _errs78) { + if (typeof data34 === 'string') { + if (!formats22.validate(data34)) { + const err53 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema97.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } else { + const err54 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end + .type, + parentSchema: + schema97.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + } + var valid18 = _errs78 === errors; + } else { + var valid18 = true; + } + } + } else { + const err55 = { + instancePath: instancePath + '/announcedAvailability/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema97.anyOf[1].allOf[1].properties.announcedAvailability + .items.type, + parentSchema: + schema97.anyOf[1].allOf[1].properties.announcedAvailability + .items, + data: data32, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid17 = _errs74 === errors; + if (!valid17) { + break; + } + } + } else { + const err56 = { + instancePath: instancePath + '/announcedAvailability', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema97.anyOf[1].allOf[1].properties.announcedAvailability.type, + parentSchema: + schema97.anyOf[1].allOf[1].properties.announcedAvailability, + data: data31, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + var valid16 = _errs72 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data35 = data.experiment; + const _errs80 = errors; + if (errors === _errs80) { + if (errors === _errs80) { + if (typeof data35 === 'string') { + if (!formats0(data35)) { + const err57 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema97.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } else { + const err58 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema97.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + } + } + var valid16 = _errs80 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data36 = data.services; + const _errs82 = errors; + if (errors === _errs82) { + if (Array.isArray(data36)) { + var valid19 = true; + const len6 = data36.length; + for (let i6 = 0; i6 < len6; i6++) { + let data37 = data36[i6]; + const _errs84 = errors; + if (errors === _errs84) { + if ( + data37 && + typeof data37 == 'object' && + !Array.isArray(data37) + ) { + if (data37.serviceType !== undefined) { + let data38 = data37.serviceType; + const _errs87 = errors; + if (errors === _errs87) { + if (errors === _errs87) { + if (typeof data38 === 'string') { + if (!formats0(data38)) { + const err59 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema97.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } else { + const err60 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema97.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + } + var valid20 = _errs87 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceId !== undefined) { + let data39 = data37.serviceId; + const _errs89 = errors; + if (typeof data39 !== 'string') { + const err61 = { + instancePath: + instancePath + '/services/' + i6 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[1].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema97.anyOf[1].allOf[1].properties.services + .items.properties.serviceId, + data: data39, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs89 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceDirection !== undefined) { + let data40 = data37.serviceDirection; + const _errs91 = errors; + if (typeof data40 !== 'string') { + const err62 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema97.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + if ( + !( + data40 === 'consumer' || + data40 === 'producer' || + data40 === 'prosumer' + ) + ) { + const err63 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema97.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema97.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema97.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + var valid20 = _errs91 === errors; + } else { + var valid20 = true; + } + } + } + } else { + const err64 = { + instancePath: instancePath + '/services/' + i6, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema97.anyOf[1].allOf[1].properties.services.items + .type, + parentSchema: + schema97.anyOf[1].allOf[1].properties.services.items, + data: data37, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + var valid19 = _errs84 === errors; + if (!valid19) { + break; + } + } + } else { + const err65 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema97.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema97.anyOf[1].allOf[1].properties.services, + data: data36, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid16 = _errs82 === errors; + } else { + var valid16 = true; + } + } + } + } + } + } else { + const err66 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema97.anyOf[1].allOf[1].type, + parentSchema: schema97.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid10 = _errs67 === errors; + } + var _valid0 = _errs42 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs93 = errors; + const _errs94 = errors; + if (errors === _errs94) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.url === undefined && (missing6 = 'url')) || + (data.type === undefined && (missing6 = 'type')) || + (data.name === undefined && (missing6 = 'name')) || + (data.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err67 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema97.anyOf[2].allOf[0].required, + parentSchema: schema97.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data.url !== undefined) { + let data41 = data.url; + const _errs96 = errors; + if (errors === _errs96) { + if (errors === _errs96) { + if (typeof data41 === 'string') { + if (!formats0(data41)) { + const err68 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema97.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[2].allOf[0].properties.url.type, + parentSchema: schema97.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + var valid22 = _errs96 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.name !== undefined) { + let data42 = data.name; + const _errs98 = errors; + if (typeof data42 !== 'string') { + const err70 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema97.anyOf[2].allOf[0].properties.name, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var valid22 = _errs98 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.description !== undefined) { + let data43 = data.description; + const _errs100 = errors; + if (typeof data43 !== 'string') { + const err71 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema97.anyOf[2].allOf[0].properties.description, + data: data43, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + var valid22 = _errs100 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs102 = errors; + if (typeof data44 !== 'string') { + const err72 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema97.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + if ( + !( + data44 === 'device' || + data44 === 'group' || + data44 === 'edge instantiable' || + data44 === 'cloud instantiable' + ) + ) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema97.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema97.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema97.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid22 = _errs102 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.isPublic !== undefined) { + let data45 = data.isPublic; + const _errs104 = errors; + if (typeof data45 !== 'boolean') { + const err74 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema97.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema97.anyOf[2].allOf[0].properties.isPublic, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + var valid22 = _errs104 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.viewer !== undefined) { + let data46 = data.viewer; + const _errs106 = errors; + if (errors === _errs106) { + if (Array.isArray(data46)) { + var valid23 = true; + const len7 = data46.length; + for (let i7 = 0; i7 < len7; i7++) { + let data47 = data46[i7]; + const _errs108 = errors; + if (errors === _errs108) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + let missing7; + if (data47.url === undefined && (missing7 = 'url')) { + const err75 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema97.anyOf[2].allOf[0].properties.viewer.items + .required, + parentSchema: + schema97.anyOf[2].allOf[0].properties.viewer + .items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } else { + if (data47.url !== undefined) { + let data48 = data47.url; + const _errs110 = errors; + if (errors === _errs110) { + if (errors === _errs110) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema97.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema97.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + } + } + } else { + const err78 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema97.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema97.anyOf[2].allOf[0].properties.viewer.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + var valid23 = _errs108 === errors; + if (!valid23) { + break; + } + } + } else { + const err79 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema97.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema97.anyOf[2].allOf[0].properties.viewer, + data: data46, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + var valid22 = _errs106 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.owner !== undefined) { + let data49 = data.owner; + const _errs112 = errors; + if (errors === _errs112) { + if (Array.isArray(data49)) { + var valid25 = true; + const len8 = data49.length; + for (let i8 = 0; i8 < len8; i8++) { + let data50 = data49[i8]; + const _errs114 = errors; + if (errors === _errs114) { + if ( + data50 && + typeof data50 == 'object' && + !Array.isArray(data50) + ) { + let missing8; + if (data50.url === undefined && (missing8 = 'url')) { + const err80 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + + missing8 + + "'", + schema: + schema97.anyOf[2].allOf[0].properties.owner + .items.required, + parentSchema: + schema97.anyOf[2].allOf[0].properties.owner + .items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } else { + if (data50.url !== undefined) { + let data51 = data50.url; + const _errs116 = errors; + if (errors === _errs116) { + if (errors === _errs116) { + if (typeof data51 === 'string') { + if (!formats0(data51)) { + const err81 = { + instancePath: + instancePath + + '/owner/' + + i8 + + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema97.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } else { + const err82 = { + instancePath: + instancePath + '/owner/' + i8 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema97.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + } + } + } + } else { + const err83 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema97.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema97.anyOf[2].allOf[0].properties.owner.items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid25 = _errs114 === errors; + if (!valid25) { + break; + } + } + } else { + const err84 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema97.anyOf[2].allOf[0].properties.owner.type, + parentSchema: schema97.anyOf[2].allOf[0].properties.owner, + data: data49, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + var valid22 = _errs112 === errors; + } else { + var valid22 = true; + } + } + } + } + } + } + } + } + } else { + const err85 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema97.anyOf[2].allOf[0].type, + parentSchema: schema97.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + } + var valid21 = _errs94 === errors; + if (valid21) { + const _errs118 = errors; + if (errors === _errs118) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data52 = data.type; + const _errs120 = errors; + if ('edge instantiable' !== data52) { + const err86 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema97.anyOf[2].allOf[1].properties.type, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid27 = _errs120 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.codeUrl !== undefined) { + let data53 = data.codeUrl; + const _errs121 = errors; + if (errors === _errs121) { + if (errors === _errs121) { + if (typeof data53 === 'string') { + if (!formats0(data53)) { + const err87 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema97.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + } else { + const err88 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema97.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + } + } + var valid27 = _errs121 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.services !== undefined) { + let data54 = data.services; + const _errs123 = errors; + if (errors === _errs123) { + if (Array.isArray(data54)) { + var valid28 = true; + const len9 = data54.length; + for (let i9 = 0; i9 < len9; i9++) { + let data55 = data54[i9]; + const _errs125 = errors; + if (errors === _errs125) { + if ( + data55 && + typeof data55 == 'object' && + !Array.isArray(data55) + ) { + if (data55.serviceType !== undefined) { + let data56 = data55.serviceType; + const _errs128 = errors; + if (errors === _errs128) { + if (errors === _errs128) { + if (typeof data56 === 'string') { + if (!formats0(data56)) { + const err89 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema97.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } else { + const err90 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema97.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + } + var valid29 = _errs128 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceId !== undefined) { + let data57 = data55.serviceId; + const _errs130 = errors; + if (typeof data57 !== 'string') { + const err91 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[2].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema97.anyOf[2].allOf[1].properties.services.items + .properties.serviceId, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + var valid29 = _errs130 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceDirection !== undefined) { + let data58 = data55.serviceDirection; + const _errs132 = errors; + if (typeof data58 !== 'string') { + const err92 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema97.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + if ( + !( + data58 === 'consumer' || + data58 === 'producer' || + data58 === 'prosumer' + ) + ) { + const err93 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema97.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema97.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema97.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + var valid29 = _errs132 === errors; + } else { + var valid29 = true; + } + } + } + } else { + const err94 = { + instancePath: instancePath + '/services/' + i9, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema97.anyOf[2].allOf[1].properties.services.items.type, + parentSchema: + schema97.anyOf[2].allOf[1].properties.services.items, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid28 = _errs125 === errors; + if (!valid28) { + break; + } + } + } else { + const err95 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema97.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema97.anyOf[2].allOf[1].properties.services, + data: data54, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + var valid27 = _errs123 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err96 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema97.anyOf[2].allOf[1].type, + parentSchema: schema97.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + var valid21 = _errs118 === errors; + } + var _valid0 = _errs93 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs134 = errors; + const _errs135 = errors; + if (errors === _errs135) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if ( + (data.url === undefined && (missing9 = 'url')) || + (data.type === undefined && (missing9 = 'type')) || + (data.name === undefined && (missing9 = 'name')) || + (data.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err97 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema97.anyOf[3].allOf[0].required, + parentSchema: schema97.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } else { + if (data.url !== undefined) { + let data59 = data.url; + const _errs137 = errors; + if (errors === _errs137) { + if (errors === _errs137) { + if (typeof data59 === 'string') { + if (!formats0(data59)) { + const err98 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema97.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } else { + const err99 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[3].allOf[0].properties.url.type, + parentSchema: schema97.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + } + var valid31 = _errs137 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.name !== undefined) { + let data60 = data.name; + const _errs139 = errors; + if (typeof data60 !== 'string') { + const err100 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema97.anyOf[3].allOf[0].properties.name, + data: data60, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + var valid31 = _errs139 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.description !== undefined) { + let data61 = data.description; + const _errs141 = errors; + if (typeof data61 !== 'string') { + const err101 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema97.anyOf[3].allOf[0].properties.description, + data: data61, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid31 = _errs141 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.type !== undefined) { + let data62 = data.type; + const _errs143 = errors; + if (typeof data62 !== 'string') { + const err102 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema97.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema97.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + if ( + !( + data62 === 'device' || + data62 === 'group' || + data62 === 'edge instantiable' || + data62 === 'cloud instantiable' + ) + ) { + const err103 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema97.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema97.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema97.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + var valid31 = _errs143 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.isPublic !== undefined) { + let data63 = data.isPublic; + const _errs145 = errors; + if (typeof data63 !== 'boolean') { + const err104 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema97.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema97.anyOf[3].allOf[0].properties.isPublic, + data: data63, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + var valid31 = _errs145 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.viewer !== undefined) { + let data64 = data.viewer; + const _errs147 = errors; + if (errors === _errs147) { + if (Array.isArray(data64)) { + var valid32 = true; + const len10 = data64.length; + for (let i10 = 0; i10 < len10; i10++) { + let data65 = data64[i10]; + const _errs149 = errors; + if (errors === _errs149) { + if ( + data65 && + typeof data65 == 'object' && + !Array.isArray(data65) + ) { + let missing10; + if (data65.url === undefined && (missing10 = 'url')) { + const err105 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + + missing10 + + "'", + schema: + schema97.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema97.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } else { + if (data65.url !== undefined) { + let data66 = data65.url; + const _errs151 = errors; + if (errors === _errs151) { + if (errors === _errs151) { + if (typeof data66 === 'string') { + if (!formats0(data66)) { + const err106 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema97.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } else { + const err107 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema97.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + } + } + } + } else { + const err108 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema97.anyOf[3].allOf[0].properties.viewer.items + .type, + parentSchema: + schema97.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid32 = _errs149 === errors; + if (!valid32) { + break; + } + } + } else { + const err109 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema97.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: + schema97.anyOf[3].allOf[0].properties.viewer, + data: data64, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + } + } + var valid31 = _errs147 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.owner !== undefined) { + let data67 = data.owner; + const _errs153 = errors; + if (errors === _errs153) { + if (Array.isArray(data67)) { + var valid34 = true; + const len11 = data67.length; + for (let i11 = 0; i11 < len11; i11++) { + let data68 = data67[i11]; + const _errs155 = errors; + if (errors === _errs155) { + if ( + data68 && + typeof data68 == 'object' && + !Array.isArray(data68) + ) { + let missing11; + if ( + data68.url === undefined && + (missing11 = 'url') + ) { + const err110 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema97.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema97.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err110]; + } else { + vErrors.push(err110); + } + errors++; + } else { + if (data68.url !== undefined) { + let data69 = data68.url; + const _errs157 = errors; + if (errors === _errs157) { + if (errors === _errs157) { + if (typeof data69 === 'string') { + if (!formats0(data69)) { + const err111 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema97.anyOf[3].allOf[0] + .properties.owner.items.properties + .url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err111]; + } else { + vErrors.push(err111); + } + errors++; + } + } else { + const err112 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema97.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err112]; + } else { + vErrors.push(err112); + } + errors++; + } + } + } + } + } + } else { + const err113 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema97.anyOf[3].allOf[0].properties.owner + .items.type, + parentSchema: + schema97.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err113]; + } else { + vErrors.push(err113); + } + errors++; + } + } + var valid34 = _errs155 === errors; + if (!valid34) { + break; + } + } + } else { + const err114 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema97.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema97.anyOf[3].allOf[0].properties.owner, + data: data67, + }; + if (vErrors === null) { + vErrors = [err114]; + } else { + vErrors.push(err114); + } + errors++; + } + } + var valid31 = _errs153 === errors; + } else { + var valid31 = true; + } + } + } + } + } + } + } + } + } else { + const err115 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema97.anyOf[3].allOf[0].type, + parentSchema: schema97.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err115]; + } else { + vErrors.push(err115); + } + errors++; + } + } + var valid30 = _errs135 === errors; + if (valid30) { + const _errs159 = errors; + if (errors === _errs159) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if (data.devices === undefined && (missing12 = 'devices')) { + const err116 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema97.anyOf[3].allOf[1].required, + parentSchema: schema97.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err116]; + } else { + vErrors.push(err116); + } + errors++; + } else { + if (data.type !== undefined) { + let data70 = data.type; + const _errs161 = errors; + if ('group' !== data70) { + const err117 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema97.anyOf[3].allOf[1].properties.type, + data: data70, + }; + if (vErrors === null) { + vErrors = [err117]; + } else { + vErrors.push(err117); + } + errors++; + } + var valid36 = _errs161 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data.devices !== undefined) { + let data71 = data.devices; + const _errs162 = errors; + if (errors === _errs162) { + if (Array.isArray(data71)) { + var valid37 = true; + const len12 = data71.length; + for (let i12 = 0; i12 < len12; i12++) { + let data72 = data71[i12]; + const _errs164 = errors; + if (errors === _errs164) { + if ( + data72 && + typeof data72 == 'object' && + !Array.isArray(data72) + ) { + let missing13; + if (data72.url === undefined && (missing13 = 'url')) { + const err118 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: + "must have required property '" + missing13 + "'", + schema: + schema97.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema97.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err118]; + } else { + vErrors.push(err118); + } + errors++; + } else { + if (data72.url !== undefined) { + let data73 = data72.url; + const _errs166 = errors; + if (errors === _errs166) { + if (errors === _errs166) { + if (typeof data73 === 'string') { + if (!formats0(data73)) { + const err119 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema97.anyOf[3].allOf[1].properties + .devices.items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err119]; + } else { + vErrors.push(err119); + } + errors++; + } + } else { + const err120 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema97.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema97.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err120]; + } else { + vErrors.push(err120); + } + errors++; + } + } + } + } + } + } else { + const err121 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema97.anyOf[3].allOf[1].properties.devices.items + .type, + parentSchema: + schema97.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err121]; + } else { + vErrors.push(err121); + } + errors++; + } + } + var valid37 = _errs164 === errors; + if (!valid37) { + break; + } + } + } else { + const err122 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema97.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema97.anyOf[3].allOf[1].properties.devices, + data: data71, + }; + if (vErrors === null) { + vErrors = [err122]; + } else { + vErrors.push(err122); + } + errors++; + } + } + var valid36 = _errs162 === errors; + } else { + var valid36 = true; + } + } + } + } else { + const err123 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema97.anyOf[3].allOf[1].type, + parentSchema: schema97.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err123]; + } else { + vErrors.push(err123); + } + errors++; + } + } + var valid30 = _errs159 === errors; + } + var _valid0 = _errs134 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err124 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema97.anyOf, + parentSchema: schema97, + data, + }; + if (vErrors === null) { + vErrors = [err124]; + } else { + vErrors.push(err124); + } + errors++; + validate112.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate112.errors = vErrors; + return errors === 0; +} +exports.validateCallbackRequest = validate113; +const schema98 = { + title: 'Callback', + type: 'object', + properties: { callbackType: { type: 'string' } }, + required: ['callbackType'], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'CallbackRequest', + 'x-location': '#/components/schemas/callback_request', + 'x-schema-type': 'request', +}; +function validate113( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.callbackType === undefined && (missing0 = 'callbackType')) { + validate113.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema98.required, + parentSchema: schema98, + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data0 = data.callbackType; + if (typeof data0 !== 'string') { + validate113.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema98.properties.callbackType.type, + parentSchema: schema98.properties.callbackType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate113.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema98.type, + parentSchema: schema98, + data, + }, + ]; + return false; + } + } + validate113.errors = vErrors; + return errors === 0; +} +exports.validateCallbackResponse = validate114; +const schema99 = { + title: 'Callback', + type: 'object', + properties: { callbackType: { type: 'string' } }, + required: ['callbackType'], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'CallbackResponse', + 'x-location': '#/components/schemas/callback_response', + 'x-schema-type': 'response', +}; +function validate114( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.callbackType === undefined && (missing0 = 'callbackType')) { + validate114.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema99.required, + parentSchema: schema99, + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data0 = data.callbackType; + if (typeof data0 !== 'string') { + validate114.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema99.properties.callbackType.type, + parentSchema: schema99.properties.callbackType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate114.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema99.type, + parentSchema: schema99, + data, + }, + ]; + return false; + } + } + validate114.errors = vErrors; + return errors === 0; +} +exports.validateEventCallbackRequest = validate115; +const schema100 = { + title: 'Event Callback', + allOf: [ + { + title: 'Callback', + type: 'object', + properties: { callbackType: { type: 'string' } }, + required: ['callbackType'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + callbackType: { type: 'string', enum: ['event'] }, + eventType: { type: 'string' }, + }, + required: ['callbackType', 'eventType'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'EventCallbackRequest', + 'x-location': '#/components/schemas/event_callback_request', + 'x-schema-type': 'request', +}; +function validate115( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.callbackType === undefined && (missing0 = 'callbackType')) { + validate115.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema100.allOf[0].required, + parentSchema: schema100.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data0 = data.callbackType; + if (typeof data0 !== 'string') { + validate115.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema100.allOf[0].properties.callbackType.type, + parentSchema: schema100.allOf[0].properties.callbackType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate115.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema100.allOf[0].type, + parentSchema: schema100.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs4 = errors; + if (errors === _errs4) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.callbackType === undefined && (missing1 = 'callbackType')) || + (data.eventType === undefined && (missing1 = 'eventType')) + ) { + validate115.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema100.allOf[1].required, + parentSchema: schema100.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data1 = data.callbackType; + const _errs6 = errors; + if (typeof data1 !== 'string') { + validate115.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/1/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema100.allOf[1].properties.callbackType.type, + parentSchema: schema100.allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'event')) { + validate115.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/1/properties/callbackType/enum', + keyword: 'enum', + params: { + allowedValues: schema100.allOf[1].properties.callbackType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema100.allOf[1].properties.callbackType.enum, + parentSchema: schema100.allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.eventType !== undefined) { + let data2 = data.eventType; + const _errs8 = errors; + if (typeof data2 !== 'string') { + validate115.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema100.allOf[1].properties.eventType.type, + parentSchema: schema100.allOf[1].properties.eventType, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate115.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema100.allOf[1].type, + parentSchema: schema100.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs4 === errors; + } + validate115.errors = vErrors; + return errors === 0; +} +exports.validateEventCallbackResponse = validate116; +const schema101 = { + title: 'Event Callback', + allOf: [ + { + title: 'Callback', + type: 'object', + properties: { callbackType: { type: 'string' } }, + required: ['callbackType'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + callbackType: { type: 'string', enum: ['event'] }, + eventType: { type: 'string' }, + }, + required: ['callbackType', 'eventType'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'EventCallbackResponse', + 'x-location': '#/components/schemas/event_callback_response', + 'x-schema-type': 'response', +}; +function validate116( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.callbackType === undefined && (missing0 = 'callbackType')) { + validate116.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema101.allOf[0].required, + parentSchema: schema101.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data0 = data.callbackType; + if (typeof data0 !== 'string') { + validate116.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema101.allOf[0].properties.callbackType.type, + parentSchema: schema101.allOf[0].properties.callbackType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate116.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema101.allOf[0].type, + parentSchema: schema101.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs4 = errors; + if (errors === _errs4) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.callbackType === undefined && (missing1 = 'callbackType')) || + (data.eventType === undefined && (missing1 = 'eventType')) + ) { + validate116.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema101.allOf[1].required, + parentSchema: schema101.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data1 = data.callbackType; + const _errs6 = errors; + if (typeof data1 !== 'string') { + validate116.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/1/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema101.allOf[1].properties.callbackType.type, + parentSchema: schema101.allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'event')) { + validate116.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/1/properties/callbackType/enum', + keyword: 'enum', + params: { + allowedValues: schema101.allOf[1].properties.callbackType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema101.allOf[1].properties.callbackType.enum, + parentSchema: schema101.allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.eventType !== undefined) { + let data2 = data.eventType; + const _errs8 = errors; + if (typeof data2 !== 'string') { + validate116.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema101.allOf[1].properties.eventType.type, + parentSchema: schema101.allOf[1].properties.eventType, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate116.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema101.allOf[1].type, + parentSchema: schema101.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs4 === errors; + } + validate116.errors = vErrors; + return errors === 0; +} +exports.validateDeviceChangedEventCallbackRequest = validate117; +const schema102 = { + title: 'Device Changed Event Callback', + allOf: [ + { + title: 'Event Callback', + allOf: [ + { + title: 'Callback', + type: 'object', + properties: { callbackType: { type: 'string' } }, + required: ['callbackType'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + callbackType: { type: 'string', enum: ['event'] }, + eventType: { type: 'string' }, + }, + required: ['callbackType', 'eventType'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + eventType: { type: 'string', enum: ['device-changed'] }, + device: { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: [ + 'device', + 'group', + 'edge instantiable', + 'cloud instantiable', + ], + }, + isPublic: { + type: 'boolean', + description: + 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: [ + 'device', + 'group', + 'edge instantiable', + 'cloud instantiable', + ], + }, + isPublic: { + type: 'boolean', + description: + 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: [ + 'device', + 'group', + 'edge instantiable', + 'cloud instantiable', + ], + }, + isPublic: { + type: 'boolean', + description: + 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: [ + 'device', + 'group', + 'edge instantiable', + 'cloud instantiable', + ], + }, + isPublic: { + type: 'boolean', + description: + 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + }, + }, + required: ['eventType', 'device'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'DeviceChangedEventCallbackRequest', + 'x-location': '#/components/schemas/device_changed_request', + 'x-schema-type': 'request', +}; +function validate117( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.callbackType === undefined && (missing0 = 'callbackType')) { + validate117.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema102.allOf[0].allOf[0].required, + parentSchema: schema102.allOf[0].allOf[0], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data0 = data.callbackType; + if (typeof data0 !== 'string') { + validate117.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/0/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema102.allOf[0].allOf[0].properties.callbackType.type, + parentSchema: schema102.allOf[0].allOf[0].properties.callbackType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate117.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema102.allOf[0].allOf[0].type, + parentSchema: schema102.allOf[0].allOf[0], + data, + }, + ]; + return false; + } + } + var valid1 = _errs1 === errors; + if (valid1) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.callbackType === undefined && (missing1 = 'callbackType')) || + (data.eventType === undefined && (missing1 = 'eventType')) + ) { + validate117.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema102.allOf[0].allOf[1].required, + parentSchema: schema102.allOf[0].allOf[1], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data1 = data.callbackType; + const _errs7 = errors; + if (typeof data1 !== 'string') { + validate117.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema102.allOf[0].allOf[1].properties.callbackType.type, + parentSchema: schema102.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'event')) { + validate117.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/enum', + keyword: 'enum', + params: { + allowedValues: + schema102.allOf[0].allOf[1].properties.callbackType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema102.allOf[0].allOf[1].properties.callbackType.enum, + parentSchema: schema102.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + var valid3 = _errs7 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data.eventType !== undefined) { + let data2 = data.eventType; + const _errs9 = errors; + if (typeof data2 !== 'string') { + validate117.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/0/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema102.allOf[0].allOf[1].properties.eventType.type, + parentSchema: schema102.allOf[0].allOf[1].properties.eventType, + data: data2, + }, + ]; + return false; + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate117.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema102.allOf[0].allOf[1].type, + parentSchema: schema102.allOf[0].allOf[1], + data, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.eventType === undefined && (missing2 = 'eventType')) || + (data.device === undefined && (missing2 = 'device')) + ) { + validate117.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema102.allOf[1].required, + parentSchema: schema102.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.eventType !== undefined) { + let data3 = data.eventType; + const _errs13 = errors; + if (typeof data3 !== 'string') { + validate117.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema102.allOf[1].properties.eventType.type, + parentSchema: schema102.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + if (!(data3 === 'device-changed')) { + validate117.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/enum', + keyword: 'enum', + params: { allowedValues: schema102.allOf[1].properties.eventType.enum }, + message: 'must be equal to one of the allowed values', + schema: schema102.allOf[1].properties.eventType.enum, + parentSchema: schema102.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.device !== undefined) { + let data4 = data.device; + const _errs15 = errors; + const _errs16 = errors; + let valid5 = false; + const _errs17 = errors; + const _errs18 = errors; + if (errors === _errs18) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing3; + if ( + (data4.type === undefined && (missing3 = 'type')) || + (data4.name === undefined && (missing3 = 'name')) || + (data4.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err0 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: + schema102.allOf[1].properties.device.anyOf[0].allOf[0].required, + parentSchema: + schema102.allOf[1].properties.device.anyOf[0].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data4.name !== undefined) { + let data5 = data4.name; + const _errs20 = errors; + if (typeof data5 !== 'string') { + const err1 = { + instancePath: instancePath + '/device/name', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.name.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.name, + data: data5, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + var valid7 = _errs20 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data4.description !== undefined) { + let data6 = data4.description; + const _errs22 = errors; + if (typeof data6 !== 'string') { + const err2 = { + instancePath: instancePath + '/device/description', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.description.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.description, + data: data6, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + var valid7 = _errs22 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data4.type !== undefined) { + let data7 = data4.type; + const _errs24 = errors; + if (typeof data7 !== 'string') { + const err3 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.type.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.type, + data: data7, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + if ( + !( + data7 === 'device' || + data7 === 'group' || + data7 === 'edge instantiable' || + data7 === 'cloud instantiable' + ) + ) { + const err4 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema102.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema102.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.type.enum, + parentSchema: + schema102.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.type, + data: data7, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid7 = _errs24 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data4.isPublic !== undefined) { + let data8 = data4.isPublic; + const _errs26 = errors; + if (typeof data8 !== 'boolean') { + const err5 = { + instancePath: instancePath + '/device/isPublic', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema102.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.isPublic.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.isPublic, + data: data8, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + var valid7 = _errs26 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data4.viewer !== undefined) { + let data9 = data4.viewer; + const _errs28 = errors; + if (errors === _errs28) { + if (Array.isArray(data9)) { + var valid8 = true; + const len0 = data9.length; + for (let i0 = 0; i0 < len0; i0++) { + let data10 = data9[i0]; + const _errs30 = errors; + if (errors === _errs30) { + if ( + data10 && + typeof data10 == 'object' && + !Array.isArray(data10) + ) { + let missing4; + if ( + data10.url === undefined && + (missing4 = 'url') + ) { + const err6 = { + instancePath: + instancePath + '/device/viewer/' + i0, + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + + missing4 + + "'", + schema: + schema102.allOf[1].properties.device + .anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[0].allOf[0].properties.viewer + .items, + data: data10, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } else { + if (data10.url !== undefined) { + let data11 = data10.url; + const _errs32 = errors; + if (errors === _errs32) { + if (errors === _errs32) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + const err7 = { + instancePath: + instancePath + + '/device/viewer/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema102.allOf[1].properties + .device.anyOf[0].allOf[0] + .properties.viewer.items + .properties.url, + data: data11, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: + instancePath + + '/device/viewer/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device + .anyOf[0].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[0].allOf[0].properties + .viewer.items.properties.url, + data: data11, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } + } else { + const err9 = { + instancePath: + instancePath + '/device/viewer/' + i0, + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema102.allOf[1].properties.device.anyOf[0] + .allOf[0].properties.viewer.items.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[0] + .allOf[0].properties.viewer.items, + data: data10, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var valid8 = _errs30 === errors; + if (!valid8) { + break; + } + } + } else { + const err10 = { + instancePath: instancePath + '/device/viewer', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema102.allOf[1].properties.device.anyOf[0] + .allOf[0].properties.viewer.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[0] + .allOf[0].properties.viewer, + data: data9, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + var valid7 = _errs28 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data4.owner !== undefined) { + let data12 = data4.owner; + const _errs34 = errors; + if (errors === _errs34) { + if (Array.isArray(data12)) { + var valid10 = true; + const len1 = data12.length; + for (let i1 = 0; i1 < len1; i1++) { + let data13 = data12[i1]; + const _errs36 = errors; + if (errors === _errs36) { + if ( + data13 && + typeof data13 == 'object' && + !Array.isArray(data13) + ) { + let missing5; + if ( + data13.url === undefined && + (missing5 = 'url') + ) { + const err11 = { + instancePath: + instancePath + '/device/owner/' + i1, + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + + missing5 + + "'", + schema: + schema102.allOf[1].properties.device + .anyOf[0].allOf[0].properties.owner + .items.required, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[0].allOf[0].properties.owner + .items, + data: data13, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } else { + if (data13.url !== undefined) { + let data14 = data13.url; + const _errs38 = errors; + if (errors === _errs38) { + if (errors === _errs38) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + const err12 = { + instancePath: + instancePath + + '/device/owner/' + + i1 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema102.allOf[1].properties + .device.anyOf[0].allOf[0] + .properties.owner.items + .properties.url, + data: data14, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } else { + const err13 = { + instancePath: + instancePath + + '/device/owner/' + + i1 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties + .device.anyOf[0].allOf[0] + .properties.owner.items + .properties.url.type, + parentSchema: + schema102.allOf[1].properties + .device.anyOf[0].allOf[0] + .properties.owner.items + .properties.url, + data: data14, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + } + } + } + } + } else { + const err14 = { + instancePath: + instancePath + '/device/owner/' + i1, + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema102.allOf[1].properties.device + .anyOf[0].allOf[0].properties.owner.items + .type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[0].allOf[0].properties.owner.items, + data: data13, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } + var valid10 = _errs36 === errors; + if (!valid10) { + break; + } + } + } else { + const err15 = { + instancePath: instancePath + '/device/owner', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema102.allOf[1].properties.device.anyOf[0] + .allOf[0].properties.owner.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[0] + .allOf[0].properties.owner, + data: data12, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + var valid7 = _errs34 === errors; + } else { + var valid7 = true; + } + } + } + } + } + } + } + } else { + const err16 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema102.allOf[1].properties.device.anyOf[0].allOf[0].type, + parentSchema: schema102.allOf[1].properties.device.anyOf[0].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid6 = _errs18 === errors; + if (valid6) { + const _errs40 = errors; + if (errors === _errs40) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + if (data4.type !== undefined) { + let data15 = data4.type; + const _errs42 = errors; + if ('cloud instantiable' !== data15) { + const err17 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: + schema102.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.type, + data: data15, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var valid12 = _errs42 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if (data4.instantiateUrl !== undefined) { + let data16 = data4.instantiateUrl; + const _errs43 = errors; + if (errors === _errs43) { + if (errors === _errs43) { + if (typeof data16 === 'string') { + if (!formats0(data16)) { + const err18 = { + instancePath: instancePath + '/device/instantiateUrl', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema102.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.instantiateUrl, + data: data16, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } else { + const err19 = { + instancePath: instancePath + '/device/instantiateUrl', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.instantiateUrl.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.instantiateUrl, + data: data16, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + } + } + var valid12 = _errs43 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if (data4.services !== undefined) { + let data17 = data4.services; + const _errs45 = errors; + if (errors === _errs45) { + if (Array.isArray(data17)) { + var valid13 = true; + const len2 = data17.length; + for (let i2 = 0; i2 < len2; i2++) { + let data18 = data17[i2]; + const _errs47 = errors; + if (errors === _errs47) { + if ( + data18 && + typeof data18 == 'object' && + !Array.isArray(data18) + ) { + if (data18.serviceType !== undefined) { + let data19 = data18.serviceType; + const _errs50 = errors; + if (errors === _errs50) { + if (errors === _errs50) { + if (typeof data19 === 'string') { + if (!formats0(data19)) { + const err20 = { + instancePath: + instancePath + + '/device/services/' + + i2 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema102.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data19, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: + instancePath + + '/device/services/' + + i2 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data19, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid14 = _errs50 === errors; + } else { + var valid14 = true; + } + if (valid14) { + if (data18.serviceId !== undefined) { + let data20 = data18.serviceId; + const _errs52 = errors; + if (typeof data20 !== 'string') { + const err22 = { + instancePath: + instancePath + + '/device/services/' + + i2 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceId, + data: data20, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + var valid14 = _errs52 === errors; + } else { + var valid14 = true; + } + if (valid14) { + if (data18.serviceDirection !== undefined) { + let data21 = data18.serviceDirection; + const _errs54 = errors; + if (typeof data21 !== 'string') { + const err23 = { + instancePath: + instancePath + + '/device/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection, + data: data21, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data21 === 'consumer' || + data21 === 'producer' || + data21 === 'prosumer' + ) + ) { + const err24 = { + instancePath: + instancePath + + '/device/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema102.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection + .enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema102.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection, + data: data21, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid14 = _errs54 === errors; + } else { + var valid14 = true; + } + } + } + } else { + const err25 = { + instancePath: + instancePath + '/device/services/' + i2, + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema102.allOf[1].properties.device.anyOf[0] + .allOf[1].properties.services.items.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[0] + .allOf[1].properties.services.items, + data: data18, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + var valid13 = _errs47 === errors; + if (!valid13) { + break; + } + } + } else { + const err26 = { + instancePath: instancePath + '/device/services', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema102.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.services.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.services, + data: data17, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + var valid12 = _errs45 === errors; + } else { + var valid12 = true; + } + } + } + } else { + const err27 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema102.allOf[1].properties.device.anyOf[0].allOf[1].type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[0].allOf[1], + data: data4, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid6 = _errs40 === errors; + } + var _valid0 = _errs17 === errors; + valid5 = valid5 || _valid0; + if (!valid5) { + const _errs56 = errors; + const _errs57 = errors; + if (errors === _errs57) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing6; + if ( + (data4.type === undefined && (missing6 = 'type')) || + (data4.name === undefined && (missing6 = 'name')) || + (data4.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err28 = { + instancePath: instancePath + '/device', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: + schema102.allOf[1].properties.device.anyOf[1].allOf[0].required, + parentSchema: + schema102.allOf[1].properties.device.anyOf[1].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } else { + if (data4.name !== undefined) { + let data22 = data4.name; + const _errs59 = errors; + if (typeof data22 !== 'string') { + const err29 = { + instancePath: instancePath + '/device/name', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.name.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.name, + data: data22, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + var valid16 = _errs59 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data4.description !== undefined) { + let data23 = data4.description; + const _errs61 = errors; + if (typeof data23 !== 'string') { + const err30 = { + instancePath: instancePath + '/device/description', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.description.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.description, + data: data23, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + var valid16 = _errs61 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data4.type !== undefined) { + let data24 = data4.type; + const _errs63 = errors; + if (typeof data24 !== 'string') { + const err31 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.type.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.type, + data: data24, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + if ( + !( + data24 === 'device' || + data24 === 'group' || + data24 === 'edge instantiable' || + data24 === 'cloud instantiable' + ) + ) { + const err32 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema102.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema102.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.type.enum, + parentSchema: + schema102.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.type, + data: data24, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + var valid16 = _errs63 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data4.isPublic !== undefined) { + let data25 = data4.isPublic; + const _errs65 = errors; + if (typeof data25 !== 'boolean') { + const err33 = { + instancePath: instancePath + '/device/isPublic', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema102.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.isPublic.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.isPublic, + data: data25, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid16 = _errs65 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data4.viewer !== undefined) { + let data26 = data4.viewer; + const _errs67 = errors; + if (errors === _errs67) { + if (Array.isArray(data26)) { + var valid17 = true; + const len3 = data26.length; + for (let i3 = 0; i3 < len3; i3++) { + let data27 = data26[i3]; + const _errs69 = errors; + if (errors === _errs69) { + if ( + data27 && + typeof data27 == 'object' && + !Array.isArray(data27) + ) { + let missing7; + if ( + data27.url === undefined && + (missing7 = 'url') + ) { + const err34 = { + instancePath: + instancePath + '/device/viewer/' + i3, + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + + missing7 + + "'", + schema: + schema102.allOf[1].properties.device + .anyOf[1].allOf[0].properties.viewer + .items.required, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[1].allOf[0].properties.viewer + .items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } else { + if (data27.url !== undefined) { + let data28 = data27.url; + const _errs71 = errors; + if (errors === _errs71) { + if (errors === _errs71) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err35 = { + instancePath: + instancePath + + '/device/viewer/' + + i3 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema102.allOf[1].properties + .device.anyOf[1].allOf[0] + .properties.viewer.items + .properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } else { + const err36 = { + instancePath: + instancePath + + '/device/viewer/' + + i3 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties + .device.anyOf[1].allOf[0] + .properties.viewer.items + .properties.url.type, + parentSchema: + schema102.allOf[1].properties + .device.anyOf[1].allOf[0] + .properties.viewer.items + .properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + } + } + } + } else { + const err37 = { + instancePath: + instancePath + '/device/viewer/' + i3, + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema102.allOf[1].properties.device + .anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[1].allOf[0].properties.viewer + .items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + var valid17 = _errs69 === errors; + if (!valid17) { + break; + } + } + } else { + const err38 = { + instancePath: instancePath + '/device/viewer', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema102.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.viewer.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.viewer, + data: data26, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + var valid16 = _errs67 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data4.owner !== undefined) { + let data29 = data4.owner; + const _errs73 = errors; + if (errors === _errs73) { + if (Array.isArray(data29)) { + var valid19 = true; + const len4 = data29.length; + for (let i4 = 0; i4 < len4; i4++) { + let data30 = data29[i4]; + const _errs75 = errors; + if (errors === _errs75) { + if ( + data30 && + typeof data30 == 'object' && + !Array.isArray(data30) + ) { + let missing8; + if ( + data30.url === undefined && + (missing8 = 'url') + ) { + const err39 = { + instancePath: + instancePath + '/device/owner/' + i4, + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + + missing8 + + "'", + schema: + schema102.allOf[1].properties.device + .anyOf[1].allOf[0].properties.owner + .items.required, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[1].allOf[0].properties.owner + .items, + data: data30, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } else { + if (data30.url !== undefined) { + let data31 = data30.url; + const _errs77 = errors; + if (errors === _errs77) { + if (errors === _errs77) { + if (typeof data31 === 'string') { + if (!formats0(data31)) { + const err40 = { + instancePath: + instancePath + + '/device/owner/' + + i4 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema102.allOf[1].properties + .device.anyOf[1].allOf[0] + .properties.owner.items + .properties.url, + data: data31, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } else { + const err41 = { + instancePath: + instancePath + + '/device/owner/' + + i4 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties + .device.anyOf[1].allOf[0] + .properties.owner.items + .properties.url.type, + parentSchema: + schema102.allOf[1].properties + .device.anyOf[1].allOf[0] + .properties.owner.items + .properties.url, + data: data31, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + } + } + } + } else { + const err42 = { + instancePath: + instancePath + '/device/owner/' + i4, + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema102.allOf[1].properties.device + .anyOf[1].allOf[0].properties.owner + .items.type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[1].allOf[0].properties.owner + .items, + data: data30, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid19 = _errs75 === errors; + if (!valid19) { + break; + } + } + } else { + const err43 = { + instancePath: instancePath + '/device/owner', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema102.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.owner.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.owner, + data: data29, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + } + var valid16 = _errs73 === errors; + } else { + var valid16 = true; + } + } + } + } + } + } + } + } else { + const err44 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema102.allOf[1].properties.device.anyOf[1].allOf[0].type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[1].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var valid15 = _errs57 === errors; + if (valid15) { + const _errs79 = errors; + if (errors === _errs79) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + if (data4.type !== undefined) { + let data32 = data4.type; + const _errs81 = errors; + if ('device' !== data32) { + const err45 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: + schema102.allOf[1].properties.device.anyOf[1].allOf[1] + .properties.type, + data: data32, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + var valid21 = _errs81 === errors; + } else { + var valid21 = true; + } + if (valid21) { + if (data4.experiment !== undefined) { + let data33 = data4.experiment; + const _errs82 = errors; + if (errors === _errs82) { + if (errors === _errs82) { + if (typeof data33 === 'string') { + if (!formats0(data33)) { + const err46 = { + instancePath: instancePath + '/device/experiment', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema102.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.experiment, + data: data33, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } else { + const err47 = { + instancePath: instancePath + '/device/experiment', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device.anyOf[1].allOf[1] + .properties.experiment.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[1].allOf[1] + .properties.experiment, + data: data33, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + } + var valid21 = _errs82 === errors; + } else { + var valid21 = true; + } + if (valid21) { + if (data4.services !== undefined) { + let data34 = data4.services; + const _errs84 = errors; + if (errors === _errs84) { + if (Array.isArray(data34)) { + var valid22 = true; + const len5 = data34.length; + for (let i5 = 0; i5 < len5; i5++) { + let data35 = data34[i5]; + const _errs86 = errors; + if (errors === _errs86) { + if ( + data35 && + typeof data35 == 'object' && + !Array.isArray(data35) + ) { + if (data35.serviceType !== undefined) { + let data36 = data35.serviceType; + const _errs89 = errors; + if (errors === _errs89) { + if (errors === _errs89) { + if (typeof data36 === 'string') { + if (!formats0(data36)) { + const err48 = { + instancePath: + instancePath + + '/device/services/' + + i5 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema102.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties + .serviceType, + data: data36, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } else { + const err49 = { + instancePath: + instancePath + + '/device/services/' + + i5 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device + .anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data36, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + } + } + var valid23 = _errs89 === errors; + } else { + var valid23 = true; + } + if (valid23) { + if (data35.serviceId !== undefined) { + let data37 = data35.serviceId; + const _errs91 = errors; + if (typeof data37 !== 'string') { + const err50 = { + instancePath: + instancePath + + '/device/services/' + + i5 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device + .anyOf[1].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[1].allOf[1].properties.services + .items.properties.serviceId, + data: data37, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid23 = _errs91 === errors; + } else { + var valid23 = true; + } + if (valid23) { + if (data35.serviceDirection !== undefined) { + let data38 = data35.serviceDirection; + const _errs93 = errors; + if (typeof data38 !== 'string') { + const err51 = { + instancePath: + instancePath + + '/device/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device + .anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection + .type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data38, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + if ( + !( + data38 === 'consumer' || + data38 === 'producer' || + data38 === 'prosumer' + ) + ) { + const err52 = { + instancePath: + instancePath + + '/device/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema102.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties + .serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema102.allOf[1].properties.device + .anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection + .enum, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data38, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + var valid23 = _errs93 === errors; + } else { + var valid23 = true; + } + } + } + } else { + const err53 = { + instancePath: + instancePath + '/device/services/' + i5, + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema102.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.services.items.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.services.items, + data: data35, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + var valid22 = _errs86 === errors; + if (!valid22) { + break; + } + } + } else { + const err54 = { + instancePath: instancePath + '/device/services', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema102.allOf[1].properties.device.anyOf[1].allOf[1] + .properties.services.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[1].allOf[1] + .properties.services, + data: data34, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + var valid21 = _errs84 === errors; + } else { + var valid21 = true; + } + } + } + } else { + const err55 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema102.allOf[1].properties.device.anyOf[1].allOf[1].type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[1].allOf[1], + data: data4, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid15 = _errs79 === errors; + } + var _valid0 = _errs56 === errors; + valid5 = valid5 || _valid0; + if (!valid5) { + const _errs95 = errors; + const _errs96 = errors; + if (errors === _errs96) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing9; + if ( + (data4.type === undefined && (missing9 = 'type')) || + (data4.name === undefined && (missing9 = 'name')) || + (data4.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err56 = { + instancePath: instancePath + '/device', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: + schema102.allOf[1].properties.device.anyOf[2].allOf[0] + .required, + parentSchema: + schema102.allOf[1].properties.device.anyOf[2].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } else { + if (data4.name !== undefined) { + let data39 = data4.name; + const _errs98 = errors; + if (typeof data39 !== 'string') { + const err57 = { + instancePath: instancePath + '/device/name', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.name.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.name, + data: data39, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + var valid25 = _errs98 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data4.description !== undefined) { + let data40 = data4.description; + const _errs100 = errors; + if (typeof data40 !== 'string') { + const err58 = { + instancePath: instancePath + '/device/description', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.description.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.description, + data: data40, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + var valid25 = _errs100 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data4.type !== undefined) { + let data41 = data4.type; + const _errs102 = errors; + if (typeof data41 !== 'string') { + const err59 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.type.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.type, + data: data41, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + if ( + !( + data41 === 'device' || + data41 === 'group' || + data41 === 'edge instantiable' || + data41 === 'cloud instantiable' + ) + ) { + const err60 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema102.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema102.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.type.enum, + parentSchema: + schema102.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.type, + data: data41, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + var valid25 = _errs102 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data4.isPublic !== undefined) { + let data42 = data4.isPublic; + const _errs104 = errors; + if (typeof data42 !== 'boolean') { + const err61 = { + instancePath: instancePath + '/device/isPublic', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema102.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.isPublic.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.isPublic, + data: data42, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid25 = _errs104 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data4.viewer !== undefined) { + let data43 = data4.viewer; + const _errs106 = errors; + if (errors === _errs106) { + if (Array.isArray(data43)) { + var valid26 = true; + const len6 = data43.length; + for (let i6 = 0; i6 < len6; i6++) { + let data44 = data43[i6]; + const _errs108 = errors; + if (errors === _errs108) { + if ( + data44 && + typeof data44 == 'object' && + !Array.isArray(data44) + ) { + let missing10; + if ( + data44.url === undefined && + (missing10 = 'url') + ) { + const err62 = { + instancePath: + instancePath + '/device/viewer/' + i6, + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + + missing10 + + "'", + schema: + schema102.allOf[1].properties.device + .anyOf[2].allOf[0].properties.viewer + .items.required, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[2].allOf[0].properties.viewer + .items, + data: data44, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } else { + if (data44.url !== undefined) { + let data45 = data44.url; + const _errs110 = errors; + if (errors === _errs110) { + if (errors === _errs110) { + if (typeof data45 === 'string') { + if (!formats0(data45)) { + const err63 = { + instancePath: + instancePath + + '/device/viewer/' + + i6 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema102.allOf[1].properties + .device.anyOf[2].allOf[0] + .properties.viewer.items + .properties.url, + data: data45, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + } else { + const err64 = { + instancePath: + instancePath + + '/device/viewer/' + + i6 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties + .device.anyOf[2].allOf[0] + .properties.viewer.items + .properties.url.type, + parentSchema: + schema102.allOf[1].properties + .device.anyOf[2].allOf[0] + .properties.viewer.items + .properties.url, + data: data45, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + } + } + } + } else { + const err65 = { + instancePath: + instancePath + '/device/viewer/' + i6, + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema102.allOf[1].properties.device + .anyOf[2].allOf[0].properties.viewer + .items.type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[2].allOf[0].properties.viewer + .items, + data: data44, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid26 = _errs108 === errors; + if (!valid26) { + break; + } + } + } else { + const err66 = { + instancePath: instancePath + '/device/viewer', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema102.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.viewer.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.viewer, + data: data43, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid25 = _errs106 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data4.owner !== undefined) { + let data46 = data4.owner; + const _errs112 = errors; + if (errors === _errs112) { + if (Array.isArray(data46)) { + var valid28 = true; + const len7 = data46.length; + for (let i7 = 0; i7 < len7; i7++) { + let data47 = data46[i7]; + const _errs114 = errors; + if (errors === _errs114) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + let missing11; + if ( + data47.url === undefined && + (missing11 = 'url') + ) { + const err67 = { + instancePath: + instancePath + '/device/owner/' + i7, + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema102.allOf[1].properties.device + .anyOf[2].allOf[0].properties.owner + .items.required, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[2].allOf[0].properties.owner + .items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data47.url !== undefined) { + let data48 = data47.url; + const _errs116 = errors; + if (errors === _errs116) { + if (errors === _errs116) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err68 = { + instancePath: + instancePath + + '/device/owner/' + + i7 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema102.allOf[1] + .properties.device + .anyOf[2].allOf[0] + .properties.owner.items + .properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: + instancePath + + '/device/owner/' + + i7 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties + .device.anyOf[2].allOf[0] + .properties.owner.items + .properties.url.type, + parentSchema: + schema102.allOf[1].properties + .device.anyOf[2].allOf[0] + .properties.owner.items + .properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + } + } + } else { + const err70 = { + instancePath: + instancePath + '/device/owner/' + i7, + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema102.allOf[1].properties.device + .anyOf[2].allOf[0].properties.owner + .items.type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[2].allOf[0].properties.owner + .items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + } + var valid28 = _errs114 === errors; + if (!valid28) { + break; + } + } + } else { + const err71 = { + instancePath: instancePath + '/device/owner', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema102.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.owner.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.owner, + data: data46, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + } + var valid25 = _errs112 === errors; + } else { + var valid25 = true; + } + } + } + } + } + } + } + } else { + const err72 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema102.allOf[1].properties.device.anyOf[2].allOf[0].type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[2].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + var valid24 = _errs96 === errors; + if (valid24) { + const _errs118 = errors; + if (errors === _errs118) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + if (data4.type !== undefined) { + let data49 = data4.type; + const _errs120 = errors; + if ('edge instantiable' !== data49) { + const err73 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: + schema102.allOf[1].properties.device.anyOf[2].allOf[1] + .properties.type, + data: data49, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid30 = _errs120 === errors; + } else { + var valid30 = true; + } + if (valid30) { + if (data4.codeUrl !== undefined) { + let data50 = data4.codeUrl; + const _errs121 = errors; + if (errors === _errs121) { + if (errors === _errs121) { + if (typeof data50 === 'string') { + if (!formats0(data50)) { + const err74 = { + instancePath: instancePath + '/device/codeUrl', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema102.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.codeUrl, + data: data50, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } else { + const err75 = { + instancePath: instancePath + '/device/codeUrl', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.codeUrl.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.codeUrl, + data: data50, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + } + var valid30 = _errs121 === errors; + } else { + var valid30 = true; + } + if (valid30) { + if (data4.services !== undefined) { + let data51 = data4.services; + const _errs123 = errors; + if (errors === _errs123) { + if (Array.isArray(data51)) { + var valid31 = true; + const len8 = data51.length; + for (let i8 = 0; i8 < len8; i8++) { + let data52 = data51[i8]; + const _errs125 = errors; + if (errors === _errs125) { + if ( + data52 && + typeof data52 == 'object' && + !Array.isArray(data52) + ) { + if (data52.serviceType !== undefined) { + let data53 = data52.serviceType; + const _errs128 = errors; + if (errors === _errs128) { + if (errors === _errs128) { + if (typeof data53 === 'string') { + if (!formats0(data53)) { + const err76 = { + instancePath: + instancePath + + '/device/services/' + + i8 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema102.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceType, + data: data53, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + + '/device/services/' + + i8 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceType.type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceType, + data: data53, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + var valid32 = _errs128 === errors; + } else { + var valid32 = true; + } + if (valid32) { + if (data52.serviceId !== undefined) { + let data54 = data52.serviceId; + const _errs130 = errors; + if (typeof data54 !== 'string') { + const err78 = { + instancePath: + instancePath + + '/device/services/' + + i8 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device + .anyOf[2].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[2].allOf[1].properties.services + .items.properties.serviceId, + data: data54, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + var valid32 = _errs130 === errors; + } else { + var valid32 = true; + } + if (valid32) { + if (data52.serviceDirection !== undefined) { + let data55 = data52.serviceDirection; + const _errs132 = errors; + if (typeof data55 !== 'string') { + const err79 = { + instancePath: + instancePath + + '/device/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceDirection.type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceDirection, + data: data55, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + if ( + !( + data55 === 'consumer' || + data55 === 'producer' || + data55 === 'prosumer' + ) + ) { + const err80 = { + instancePath: + instancePath + + '/device/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema102.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema102.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceDirection.enum, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceDirection, + data: data55, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + var valid32 = _errs132 === errors; + } else { + var valid32 = true; + } + } + } + } else { + const err81 = { + instancePath: + instancePath + '/device/services/' + i8, + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema102.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.services.items.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.services.items, + data: data52, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + var valid31 = _errs125 === errors; + if (!valid31) { + break; + } + } + } else { + const err82 = { + instancePath: instancePath + '/device/services', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema102.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.services.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.services, + data: data51, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + var valid30 = _errs123 === errors; + } else { + var valid30 = true; + } + } + } + } else { + const err83 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema102.allOf[1].properties.device.anyOf[2].allOf[1].type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[2].allOf[1], + data: data4, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid24 = _errs118 === errors; + } + var _valid0 = _errs95 === errors; + valid5 = valid5 || _valid0; + if (!valid5) { + const _errs134 = errors; + const _errs135 = errors; + if (errors === _errs135) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing12; + if ( + (data4.type === undefined && (missing12 = 'type')) || + (data4.name === undefined && (missing12 = 'name')) || + (data4.isPublic === undefined && (missing12 = 'isPublic')) + ) { + const err84 = { + instancePath: instancePath + '/device', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: + schema102.allOf[1].properties.device.anyOf[3].allOf[0] + .required, + parentSchema: + schema102.allOf[1].properties.device.anyOf[3].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } else { + if (data4.name !== undefined) { + let data56 = data4.name; + const _errs137 = errors; + if (typeof data56 !== 'string') { + const err85 = { + instancePath: instancePath + '/device/name', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device.anyOf[3].allOf[0] + .properties.name.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[3].allOf[0] + .properties.name, + data: data56, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + var valid34 = _errs137 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data4.description !== undefined) { + let data57 = data4.description; + const _errs139 = errors; + if (typeof data57 !== 'string') { + const err86 = { + instancePath: instancePath + '/device/description', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device.anyOf[3].allOf[0] + .properties.description.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[3].allOf[0] + .properties.description, + data: data57, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid34 = _errs139 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data4.type !== undefined) { + let data58 = data4.type; + const _errs141 = errors; + if (typeof data58 !== 'string') { + const err87 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.type.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.type, + data: data58, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + if ( + !( + data58 === 'device' || + data58 === 'group' || + data58 === 'edge instantiable' || + data58 === 'cloud instantiable' + ) + ) { + const err88 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema102.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema102.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.type.enum, + parentSchema: + schema102.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.type, + data: data58, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + var valid34 = _errs141 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data4.isPublic !== undefined) { + let data59 = data4.isPublic; + const _errs143 = errors; + if (typeof data59 !== 'boolean') { + const err89 = { + instancePath: instancePath + '/device/isPublic', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema102.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.isPublic.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.isPublic, + data: data59, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + var valid34 = _errs143 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data4.viewer !== undefined) { + let data60 = data4.viewer; + const _errs145 = errors; + if (errors === _errs145) { + if (Array.isArray(data60)) { + var valid35 = true; + const len9 = data60.length; + for (let i9 = 0; i9 < len9; i9++) { + let data61 = data60[i9]; + const _errs147 = errors; + if (errors === _errs147) { + if ( + data61 && + typeof data61 == 'object' && + !Array.isArray(data61) + ) { + let missing13; + if ( + data61.url === undefined && + (missing13 = 'url') + ) { + const err90 = { + instancePath: + instancePath + '/device/viewer/' + i9, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: + "must have required property '" + + missing13 + + "'", + schema: + schema102.allOf[1].properties.device + .anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[3].allOf[0].properties.viewer + .items, + data: data61, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } else { + if (data61.url !== undefined) { + let data62 = data61.url; + const _errs149 = errors; + if (errors === _errs149) { + if (errors === _errs149) { + if (typeof data62 === 'string') { + if (!formats0(data62)) { + const err91 = { + instancePath: + instancePath + + '/device/viewer/' + + i9 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema102.allOf[1] + .properties.device + .anyOf[3].allOf[0] + .properties.viewer.items + .properties.url, + data: data62, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + } else { + const err92 = { + instancePath: + instancePath + + '/device/viewer/' + + i9 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties + .device.anyOf[3].allOf[0] + .properties.viewer.items + .properties.url.type, + parentSchema: + schema102.allOf[1].properties + .device.anyOf[3].allOf[0] + .properties.viewer.items + .properties.url, + data: data62, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + } + } + } + } + } else { + const err93 = { + instancePath: + instancePath + '/device/viewer/' + i9, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema102.allOf[1].properties.device + .anyOf[3].allOf[0].properties.viewer + .items.type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[3].allOf[0].properties.viewer + .items, + data: data61, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + var valid35 = _errs147 === errors; + if (!valid35) { + break; + } + } + } else { + const err94 = { + instancePath: instancePath + '/device/viewer', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema102.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.viewer.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.viewer, + data: data60, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid34 = _errs145 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data4.owner !== undefined) { + let data63 = data4.owner; + const _errs151 = errors; + if (errors === _errs151) { + if (Array.isArray(data63)) { + var valid37 = true; + const len10 = data63.length; + for (let i10 = 0; i10 < len10; i10++) { + let data64 = data63[i10]; + const _errs153 = errors; + if (errors === _errs153) { + if ( + data64 && + typeof data64 == 'object' && + !Array.isArray(data64) + ) { + let missing14; + if ( + data64.url === undefined && + (missing14 = 'url') + ) { + const err95 = { + instancePath: + instancePath + + '/device/owner/' + + i10, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { + missingProperty: missing14, + }, + message: + "must have required property '" + + missing14 + + "'", + schema: + schema102.allOf[1].properties.device + .anyOf[3].allOf[0].properties + .owner.items.required, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[3].allOf[0].properties + .owner.items, + data: data64, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } else { + if (data64.url !== undefined) { + let data65 = data64.url; + const _errs155 = errors; + if (errors === _errs155) { + if (errors === _errs155) { + if (typeof data65 === 'string') { + if (!formats0(data65)) { + const err96 = { + instancePath: + instancePath + + '/device/owner/' + + i10 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema102.allOf[1] + .properties.device + .anyOf[3].allOf[0] + .properties.owner.items + .properties.url, + data: data65, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } else { + const err97 = { + instancePath: + instancePath + + '/device/owner/' + + i10 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1] + .properties.device + .anyOf[3].allOf[0] + .properties.owner.items + .properties.url.type, + parentSchema: + schema102.allOf[1] + .properties.device + .anyOf[3].allOf[0] + .properties.owner.items + .properties.url, + data: data65, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + } + } + } + } + } else { + const err98 = { + instancePath: + instancePath + '/device/owner/' + i10, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema102.allOf[1].properties.device + .anyOf[3].allOf[0].properties.owner + .items.type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[3].allOf[0].properties.owner + .items, + data: data64, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } + var valid37 = _errs153 === errors; + if (!valid37) { + break; + } + } + } else { + const err99 = { + instancePath: instancePath + '/device/owner', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema102.allOf[1].properties.device + .anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[3].allOf[0].properties.owner, + data: data63, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + var valid34 = _errs151 === errors; + } else { + var valid34 = true; + } + } + } + } + } + } + } + } else { + const err100 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema102.allOf[1].properties.device.anyOf[3].allOf[0].type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[3].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + } + var valid33 = _errs135 === errors; + if (valid33) { + const _errs157 = errors; + if (errors === _errs157) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing15; + if (data4.devices === undefined && (missing15 = 'devices')) { + const err101 = { + instancePath: instancePath + '/device', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing15 }, + message: "must have required property '" + missing15 + "'", + schema: + schema102.allOf[1].properties.device.anyOf[3].allOf[1] + .required, + parentSchema: + schema102.allOf[1].properties.device.anyOf[3].allOf[1], + data: data4, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } else { + if (data4.type !== undefined) { + let data66 = data4.type; + const _errs159 = errors; + if ('group' !== data66) { + const err102 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: + schema102.allOf[1].properties.device.anyOf[3].allOf[1] + .properties.type, + data: data66, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + var valid39 = _errs159 === errors; + } else { + var valid39 = true; + } + if (valid39) { + if (data4.devices !== undefined) { + let data67 = data4.devices; + const _errs160 = errors; + if (errors === _errs160) { + if (Array.isArray(data67)) { + var valid40 = true; + const len11 = data67.length; + for (let i11 = 0; i11 < len11; i11++) { + let data68 = data67[i11]; + const _errs162 = errors; + if (errors === _errs162) { + if ( + data68 && + typeof data68 == 'object' && + !Array.isArray(data68) + ) { + let missing16; + if ( + data68.url === undefined && + (missing16 = 'url') + ) { + const err103 = { + instancePath: + instancePath + '/device/devices/' + i11, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing16 }, + message: + "must have required property '" + + missing16 + + "'", + schema: + schema102.allOf[1].properties.device + .anyOf[3].allOf[1].properties.devices + .items.required, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[3].allOf[1].properties.devices + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } else { + if (data68.url !== undefined) { + let data69 = data68.url; + const _errs164 = errors; + if (errors === _errs164) { + if (errors === _errs164) { + if (typeof data69 === 'string') { + if (!formats0(data69)) { + const err104 = { + instancePath: + instancePath + + '/device/devices/' + + i11 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema102.allOf[1].properties + .device.anyOf[3].allOf[1] + .properties.devices.items + .properties.url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + } else { + const err105 = { + instancePath: + instancePath + + '/device/devices/' + + i11 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema102.allOf[1].properties + .device.anyOf[3].allOf[1] + .properties.devices.items + .properties.url.type, + parentSchema: + schema102.allOf[1].properties + .device.anyOf[3].allOf[1] + .properties.devices.items + .properties.url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } + } + } + } + } + } else { + const err106 = { + instancePath: + instancePath + '/device/devices/' + i11, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema102.allOf[1].properties.device + .anyOf[3].allOf[1].properties.devices + .items.type, + parentSchema: + schema102.allOf[1].properties.device + .anyOf[3].allOf[1].properties.devices + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } + var valid40 = _errs162 === errors; + if (!valid40) { + break; + } + } + } else { + const err107 = { + instancePath: instancePath + '/device/devices', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema102.allOf[1].properties.device.anyOf[3] + .allOf[1].properties.devices.type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[3] + .allOf[1].properties.devices, + data: data67, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + var valid39 = _errs160 === errors; + } else { + var valid39 = true; + } + } + } + } else { + const err108 = { + instancePath: instancePath + '/device', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema102.allOf[1].properties.device.anyOf[3].allOf[1].type, + parentSchema: + schema102.allOf[1].properties.device.anyOf[3].allOf[1], + data: data4, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid33 = _errs157 === errors; + } + var _valid0 = _errs134 === errors; + valid5 = valid5 || _valid0; + } + } + } + if (!valid5) { + const err109 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema102.allOf[1].properties.device.anyOf, + parentSchema: schema102.allOf[1].properties.device, + data: data4, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + validate117.errors = vErrors; + return false; + } else { + errors = _errs16; + if (vErrors !== null) { + if (_errs16) { + vErrors.length = _errs16; + } else { + vErrors = null; + } + } + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate117.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema102.allOf[1].type, + parentSchema: schema102.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } + validate117.errors = vErrors; + return errors === 0; +} +exports.validateDeviceChangedEventCallbackResponse = validate118; +const schema103 = { + title: 'Device Changed Event Callback', + allOf: [ + { + title: 'Event Callback', + allOf: [ + { + title: 'Callback', + type: 'object', + properties: { callbackType: { type: 'string' } }, + required: ['callbackType'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + callbackType: { type: 'string', enum: ['event'] }, + eventType: { type: 'string' }, + }, + required: ['callbackType', 'eventType'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + eventType: { type: 'string', enum: ['device-changed'] }, + device: { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: [ + 'device', + 'group', + 'edge instantiable', + 'cloud instantiable', + ], + }, + isPublic: { + type: 'boolean', + description: + 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: [ + 'device', + 'group', + 'edge instantiable', + 'cloud instantiable', + ], + }, + isPublic: { + type: 'boolean', + description: + 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + connected: { + description: + 'If true, the device is connected to the service and can be used.\n', + type: 'boolean', + readOnly: true, + }, + announcedAvailability: { + readOnly: true, + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: [ + 'device', + 'group', + 'edge instantiable', + 'cloud instantiable', + ], + }, + isPublic: { + type: 'boolean', + description: + 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: [ + 'device', + 'group', + 'edge instantiable', + 'cloud instantiable', + ], + }, + isPublic: { + type: 'boolean', + description: + 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the user', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + }, + }, + required: ['eventType', 'device'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'DeviceChangedEventCallbackResponse', + 'x-location': '#/components/schemas/device_changed_response', + 'x-schema-type': 'response', +}; +function validate118( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.callbackType === undefined && (missing0 = 'callbackType')) { + validate118.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema103.allOf[0].allOf[0].required, + parentSchema: schema103.allOf[0].allOf[0], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data0 = data.callbackType; + if (typeof data0 !== 'string') { + validate118.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/0/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema103.allOf[0].allOf[0].properties.callbackType.type, + parentSchema: schema103.allOf[0].allOf[0].properties.callbackType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate118.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema103.allOf[0].allOf[0].type, + parentSchema: schema103.allOf[0].allOf[0], + data, + }, + ]; + return false; + } + } + var valid1 = _errs1 === errors; + if (valid1) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.callbackType === undefined && (missing1 = 'callbackType')) || + (data.eventType === undefined && (missing1 = 'eventType')) + ) { + validate118.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema103.allOf[0].allOf[1].required, + parentSchema: schema103.allOf[0].allOf[1], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data1 = data.callbackType; + const _errs7 = errors; + if (typeof data1 !== 'string') { + validate118.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema103.allOf[0].allOf[1].properties.callbackType.type, + parentSchema: schema103.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'event')) { + validate118.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/enum', + keyword: 'enum', + params: { + allowedValues: + schema103.allOf[0].allOf[1].properties.callbackType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema103.allOf[0].allOf[1].properties.callbackType.enum, + parentSchema: schema103.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + var valid3 = _errs7 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data.eventType !== undefined) { + let data2 = data.eventType; + const _errs9 = errors; + if (typeof data2 !== 'string') { + validate118.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/0/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema103.allOf[0].allOf[1].properties.eventType.type, + parentSchema: schema103.allOf[0].allOf[1].properties.eventType, + data: data2, + }, + ]; + return false; + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate118.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema103.allOf[0].allOf[1].type, + parentSchema: schema103.allOf[0].allOf[1], + data, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.eventType === undefined && (missing2 = 'eventType')) || + (data.device === undefined && (missing2 = 'device')) + ) { + validate118.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema103.allOf[1].required, + parentSchema: schema103.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.eventType !== undefined) { + let data3 = data.eventType; + const _errs13 = errors; + if (typeof data3 !== 'string') { + validate118.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema103.allOf[1].properties.eventType.type, + parentSchema: schema103.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + if (!(data3 === 'device-changed')) { + validate118.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/enum', + keyword: 'enum', + params: { allowedValues: schema103.allOf[1].properties.eventType.enum }, + message: 'must be equal to one of the allowed values', + schema: schema103.allOf[1].properties.eventType.enum, + parentSchema: schema103.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.device !== undefined) { + let data4 = data.device; + const _errs15 = errors; + const _errs16 = errors; + let valid5 = false; + const _errs17 = errors; + const _errs18 = errors; + if (errors === _errs18) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing3; + if ( + (data4.url === undefined && (missing3 = 'url')) || + (data4.type === undefined && (missing3 = 'type')) || + (data4.name === undefined && (missing3 = 'name')) || + (data4.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err0 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: + schema103.allOf[1].properties.device.anyOf[0].allOf[0].required, + parentSchema: + schema103.allOf[1].properties.device.anyOf[0].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + const err1 = { + instancePath: instancePath + '/device/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.url, + data: data5, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } else { + const err2 = { + instancePath: instancePath + '/device/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.url.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.url, + data: data5, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + } + var valid7 = _errs20 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data4.name !== undefined) { + let data6 = data4.name; + const _errs22 = errors; + if (typeof data6 !== 'string') { + const err3 = { + instancePath: instancePath + '/device/name', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.name.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.name, + data: data6, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + var valid7 = _errs22 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data4.description !== undefined) { + let data7 = data4.description; + const _errs24 = errors; + if (typeof data7 !== 'string') { + const err4 = { + instancePath: instancePath + '/device/description', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.description.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.description, + data: data7, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid7 = _errs24 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data4.type !== undefined) { + let data8 = data4.type; + const _errs26 = errors; + if (typeof data8 !== 'string') { + const err5 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.type.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.type, + data: data8, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + if ( + !( + data8 === 'device' || + data8 === 'group' || + data8 === 'edge instantiable' || + data8 === 'cloud instantiable' + ) + ) { + const err6 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema103.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema103.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.type.enum, + parentSchema: + schema103.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.type, + data: data8, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + var valid7 = _errs26 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data4.isPublic !== undefined) { + let data9 = data4.isPublic; + const _errs28 = errors; + if (typeof data9 !== 'boolean') { + const err7 = { + instancePath: instancePath + '/device/isPublic', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema103.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.isPublic.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[0].allOf[0] + .properties.isPublic, + data: data9, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + var valid7 = _errs28 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data4.viewer !== undefined) { + let data10 = data4.viewer; + const _errs30 = errors; + if (errors === _errs30) { + if (Array.isArray(data10)) { + var valid8 = true; + const len0 = data10.length; + for (let i0 = 0; i0 < len0; i0++) { + let data11 = data10[i0]; + const _errs32 = errors; + if (errors === _errs32) { + if ( + data11 && + typeof data11 == 'object' && + !Array.isArray(data11) + ) { + let missing4; + if ( + data11.url === undefined && + (missing4 = 'url') + ) { + const err8 = { + instancePath: + instancePath + '/device/viewer/' + i0, + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + + missing4 + + "'", + schema: + schema103.allOf[1].properties.device + .anyOf[0].allOf[0].properties.viewer + .items.required, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[0].allOf[0].properties.viewer + .items, + data: data11, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } else { + if (data11.url !== undefined) { + let data12 = data11.url; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data12 === 'string') { + if (!formats0(data12)) { + const err9 = { + instancePath: + instancePath + + '/device/viewer/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1].properties + .device.anyOf[0].allOf[0] + .properties.viewer.items + .properties.url, + data: data12, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } else { + const err10 = { + instancePath: + instancePath + + '/device/viewer/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties + .device.anyOf[0].allOf[0] + .properties.viewer.items + .properties.url.type, + parentSchema: + schema103.allOf[1].properties + .device.anyOf[0].allOf[0] + .properties.viewer.items + .properties.url, + data: data12, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + } + } + } + } else { + const err11 = { + instancePath: + instancePath + '/device/viewer/' + i0, + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device + .anyOf[0].allOf[0].properties.viewer.items + .type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[0].allOf[0].properties.viewer + .items, + data: data11, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } + var valid8 = _errs32 === errors; + if (!valid8) { + break; + } + } + } else { + const err12 = { + instancePath: instancePath + '/device/viewer', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema103.allOf[1].properties.device.anyOf[0] + .allOf[0].properties.viewer.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[0] + .allOf[0].properties.viewer, + data: data10, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } + var valid7 = _errs30 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data4.owner !== undefined) { + let data13 = data4.owner; + const _errs36 = errors; + if (errors === _errs36) { + if (Array.isArray(data13)) { + var valid10 = true; + const len1 = data13.length; + for (let i1 = 0; i1 < len1; i1++) { + let data14 = data13[i1]; + const _errs38 = errors; + if (errors === _errs38) { + if ( + data14 && + typeof data14 == 'object' && + !Array.isArray(data14) + ) { + let missing5; + if ( + data14.url === undefined && + (missing5 = 'url') + ) { + const err13 = { + instancePath: + instancePath + '/device/owner/' + i1, + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + + missing5 + + "'", + schema: + schema103.allOf[1].properties.device + .anyOf[0].allOf[0].properties.owner + .items.required, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[0].allOf[0].properties.owner + .items, + data: data14, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } else { + if (data14.url !== undefined) { + let data15 = data14.url; + const _errs40 = errors; + if (errors === _errs40) { + if (errors === _errs40) { + if (typeof data15 === 'string') { + if (!formats0(data15)) { + const err14 = { + instancePath: + instancePath + + '/device/owner/' + + i1 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1].properties + .device.anyOf[0].allOf[0] + .properties.owner.items + .properties.url, + data: data15, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } else { + const err15 = { + instancePath: + instancePath + + '/device/owner/' + + i1 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties + .device.anyOf[0].allOf[0] + .properties.owner.items + .properties.url.type, + parentSchema: + schema103.allOf[1].properties + .device.anyOf[0].allOf[0] + .properties.owner.items + .properties.url, + data: data15, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + } + } + } + } else { + const err16 = { + instancePath: + instancePath + '/device/owner/' + i1, + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device + .anyOf[0].allOf[0].properties.owner + .items.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[0].allOf[0].properties.owner + .items, + data: data14, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid10 = _errs38 === errors; + if (!valid10) { + break; + } + } + } else { + const err17 = { + instancePath: instancePath + '/device/owner', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema103.allOf[1].properties.device.anyOf[0] + .allOf[0].properties.owner.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[0] + .allOf[0].properties.owner, + data: data13, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + } + var valid7 = _errs36 === errors; + } else { + var valid7 = true; + } + } + } + } + } + } + } + } + } else { + const err18 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema103.allOf[1].properties.device.anyOf[0].allOf[0].type, + parentSchema: schema103.allOf[1].properties.device.anyOf[0].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } + var valid6 = _errs18 === errors; + if (valid6) { + const _errs42 = errors; + if (errors === _errs42) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + if (data4.type !== undefined) { + let data16 = data4.type; + const _errs44 = errors; + if ('cloud instantiable' !== data16) { + const err19 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: + schema103.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.type, + data: data16, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + var valid12 = _errs44 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if (data4.instantiateUrl !== undefined) { + let data17 = data4.instantiateUrl; + const _errs45 = errors; + if (errors === _errs45) { + if (errors === _errs45) { + if (typeof data17 === 'string') { + if (!formats0(data17)) { + const err20 = { + instancePath: instancePath + '/device/instantiateUrl', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.instantiateUrl, + data: data17, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: instancePath + '/device/instantiateUrl', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.instantiateUrl.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.instantiateUrl, + data: data17, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid12 = _errs45 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if (data4.services !== undefined) { + let data18 = data4.services; + const _errs47 = errors; + if (errors === _errs47) { + if (Array.isArray(data18)) { + var valid13 = true; + const len2 = data18.length; + for (let i2 = 0; i2 < len2; i2++) { + let data19 = data18[i2]; + const _errs49 = errors; + if (errors === _errs49) { + if ( + data19 && + typeof data19 == 'object' && + !Array.isArray(data19) + ) { + if (data19.serviceType !== undefined) { + let data20 = data19.serviceType; + const _errs52 = errors; + if (errors === _errs52) { + if (errors === _errs52) { + if (typeof data20 === 'string') { + if (!formats0(data20)) { + const err22 = { + instancePath: + instancePath + + '/device/services/' + + i2 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data20, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } else { + const err23 = { + instancePath: + instancePath + + '/device/services/' + + i2 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data20, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + } + } + var valid14 = _errs52 === errors; + } else { + var valid14 = true; + } + if (valid14) { + if (data19.serviceId !== undefined) { + let data21 = data19.serviceId; + const _errs54 = errors; + if (typeof data21 !== 'string') { + const err24 = { + instancePath: + instancePath + + '/device/services/' + + i2 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceId, + data: data21, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid14 = _errs54 === errors; + } else { + var valid14 = true; + } + if (valid14) { + if (data19.serviceDirection !== undefined) { + let data22 = data19.serviceDirection; + const _errs56 = errors; + if (typeof data22 !== 'string') { + const err25 = { + instancePath: + instancePath + + '/device/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection, + data: data22, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + if ( + !( + data22 === 'consumer' || + data22 === 'producer' || + data22 === 'prosumer' + ) + ) { + const err26 = { + instancePath: + instancePath + + '/device/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema103.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection + .enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema103.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection, + data: data22, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + var valid14 = _errs56 === errors; + } else { + var valid14 = true; + } + } + } + } else { + const err27 = { + instancePath: + instancePath + '/device/services/' + i2, + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device.anyOf[0] + .allOf[1].properties.services.items.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[0] + .allOf[1].properties.services.items, + data: data19, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid13 = _errs49 === errors; + if (!valid13) { + break; + } + } + } else { + const err28 = { + instancePath: instancePath + '/device/services', + schemaPath: + '#/allOf/1/properties/device/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema103.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.services.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[0].allOf[1] + .properties.services, + data: data18, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + } + var valid12 = _errs47 === errors; + } else { + var valid12 = true; + } + } + } + } else { + const err29 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema103.allOf[1].properties.device.anyOf[0].allOf[1].type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[0].allOf[1], + data: data4, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + } + var valid6 = _errs42 === errors; + } + var _valid0 = _errs17 === errors; + valid5 = valid5 || _valid0; + if (!valid5) { + const _errs58 = errors; + const _errs59 = errors; + if (errors === _errs59) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing6; + if ( + (data4.url === undefined && (missing6 = 'url')) || + (data4.type === undefined && (missing6 = 'type')) || + (data4.name === undefined && (missing6 = 'name')) || + (data4.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err30 = { + instancePath: instancePath + '/device', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: + schema103.allOf[1].properties.device.anyOf[1].allOf[0].required, + parentSchema: + schema103.allOf[1].properties.device.anyOf[1].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } else { + if (data4.url !== undefined) { + let data23 = data4.url; + const _errs61 = errors; + if (errors === _errs61) { + if (errors === _errs61) { + if (typeof data23 === 'string') { + if (!formats0(data23)) { + const err31 = { + instancePath: instancePath + '/device/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } else { + const err32 = { + instancePath: instancePath + '/device/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.url.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + } + var valid16 = _errs61 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data4.name !== undefined) { + let data24 = data4.name; + const _errs63 = errors; + if (typeof data24 !== 'string') { + const err33 = { + instancePath: instancePath + '/device/name', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.name.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.name, + data: data24, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid16 = _errs63 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data4.description !== undefined) { + let data25 = data4.description; + const _errs65 = errors; + if (typeof data25 !== 'string') { + const err34 = { + instancePath: instancePath + '/device/description', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.description.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.description, + data: data25, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + var valid16 = _errs65 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data4.type !== undefined) { + let data26 = data4.type; + const _errs67 = errors; + if (typeof data26 !== 'string') { + const err35 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.type.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.type, + data: data26, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + if ( + !( + data26 === 'device' || + data26 === 'group' || + data26 === 'edge instantiable' || + data26 === 'cloud instantiable' + ) + ) { + const err36 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema103.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema103.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.type.enum, + parentSchema: + schema103.allOf[1].properties.device.anyOf[1].allOf[0] + .properties.type, + data: data26, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + var valid16 = _errs67 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data4.isPublic !== undefined) { + let data27 = data4.isPublic; + const _errs69 = errors; + if (typeof data27 !== 'boolean') { + const err37 = { + instancePath: instancePath + '/device/isPublic', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema103.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.isPublic.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.isPublic, + data: data27, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + var valid16 = _errs69 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data4.viewer !== undefined) { + let data28 = data4.viewer; + const _errs71 = errors; + if (errors === _errs71) { + if (Array.isArray(data28)) { + var valid17 = true; + const len3 = data28.length; + for (let i3 = 0; i3 < len3; i3++) { + let data29 = data28[i3]; + const _errs73 = errors; + if (errors === _errs73) { + if ( + data29 && + typeof data29 == 'object' && + !Array.isArray(data29) + ) { + let missing7; + if ( + data29.url === undefined && + (missing7 = 'url') + ) { + const err38 = { + instancePath: + instancePath + '/device/viewer/' + i3, + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + + missing7 + + "'", + schema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[0].properties.viewer + .items.required, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[0].properties.viewer + .items, + data: data29, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } else { + if (data29.url !== undefined) { + let data30 = data29.url; + const _errs75 = errors; + if (errors === _errs75) { + if (errors === _errs75) { + if (typeof data30 === 'string') { + if (!formats0(data30)) { + const err39 = { + instancePath: + instancePath + + '/device/viewer/' + + i3 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1].properties + .device.anyOf[1].allOf[0] + .properties.viewer.items + .properties.url, + data: data30, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } else { + const err40 = { + instancePath: + instancePath + + '/device/viewer/' + + i3 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties + .device.anyOf[1].allOf[0] + .properties.viewer.items + .properties.url.type, + parentSchema: + schema103.allOf[1].properties + .device.anyOf[1].allOf[0] + .properties.viewer.items + .properties.url, + data: data30, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + } + } + } + } else { + const err41 = { + instancePath: + instancePath + '/device/viewer/' + i3, + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[0].properties.viewer + .items.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[0].properties.viewer + .items, + data: data29, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + var valid17 = _errs73 === errors; + if (!valid17) { + break; + } + } + } else { + const err42 = { + instancePath: instancePath + '/device/viewer', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema103.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.viewer.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.viewer, + data: data28, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid16 = _errs71 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data4.owner !== undefined) { + let data31 = data4.owner; + const _errs77 = errors; + if (errors === _errs77) { + if (Array.isArray(data31)) { + var valid19 = true; + const len4 = data31.length; + for (let i4 = 0; i4 < len4; i4++) { + let data32 = data31[i4]; + const _errs79 = errors; + if (errors === _errs79) { + if ( + data32 && + typeof data32 == 'object' && + !Array.isArray(data32) + ) { + let missing8; + if ( + data32.url === undefined && + (missing8 = 'url') + ) { + const err43 = { + instancePath: + instancePath + '/device/owner/' + i4, + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + + missing8 + + "'", + schema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[0].properties.owner + .items.required, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[0].properties.owner + .items, + data: data32, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } else { + if (data32.url !== undefined) { + let data33 = data32.url; + const _errs81 = errors; + if (errors === _errs81) { + if (errors === _errs81) { + if (typeof data33 === 'string') { + if (!formats0(data33)) { + const err44 = { + instancePath: + instancePath + + '/device/owner/' + + i4 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1] + .properties.device + .anyOf[1].allOf[0] + .properties.owner.items + .properties.url, + data: data33, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } else { + const err45 = { + instancePath: + instancePath + + '/device/owner/' + + i4 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties + .device.anyOf[1].allOf[0] + .properties.owner.items + .properties.url.type, + parentSchema: + schema103.allOf[1].properties + .device.anyOf[1].allOf[0] + .properties.owner.items + .properties.url, + data: data33, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + } + } + } + } + } else { + const err46 = { + instancePath: + instancePath + '/device/owner/' + i4, + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[0].properties.owner + .items.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[0].properties.owner + .items, + data: data32, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } + var valid19 = _errs79 === errors; + if (!valid19) { + break; + } + } + } else { + const err47 = { + instancePath: instancePath + '/device/owner', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema103.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.owner.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[1] + .allOf[0].properties.owner, + data: data31, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var valid16 = _errs77 === errors; + } else { + var valid16 = true; + } + } + } + } + } + } + } + } + } else { + const err48 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema103.allOf[1].properties.device.anyOf[1].allOf[0].type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[1].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } + var valid15 = _errs59 === errors; + if (valid15) { + const _errs83 = errors; + if (errors === _errs83) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + if (data4.type !== undefined) { + let data34 = data4.type; + const _errs85 = errors; + if ('device' !== data34) { + const err49 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: + schema103.allOf[1].properties.device.anyOf[1].allOf[1] + .properties.type, + data: data34, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + var valid21 = _errs85 === errors; + } else { + var valid21 = true; + } + if (valid21) { + if (data4.connected !== undefined) { + let data35 = data4.connected; + const _errs86 = errors; + if (typeof data35 !== 'boolean') { + const err50 = { + instancePath: instancePath + '/device/connected', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/connected/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema103.allOf[1].properties.device.anyOf[1].allOf[1] + .properties.connected.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[1].allOf[1] + .properties.connected, + data: data35, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid21 = _errs86 === errors; + } else { + var valid21 = true; + } + if (valid21) { + if (data4.announcedAvailability !== undefined) { + let data36 = data4.announcedAvailability; + const _errs88 = errors; + if (errors === _errs88) { + if (Array.isArray(data36)) { + var valid22 = true; + const len5 = data36.length; + for (let i5 = 0; i5 < len5; i5++) { + let data37 = data36[i5]; + const _errs90 = errors; + if (errors === _errs90) { + if ( + data37 && + typeof data37 == 'object' && + !Array.isArray(data37) + ) { + if (data37.start !== undefined) { + let data38 = data37.start; + const _errs92 = errors; + if (errors === _errs92) { + if (errors === _errs92) { + if (typeof data38 === 'string') { + if (!formats22.validate(data38)) { + const err51 = { + instancePath: + instancePath + + '/device/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + + 'date-time' + + '"', + schema: 'date-time', + parentSchema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .announcedAvailability.items + .properties.start, + data: data38, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } else { + const err52 = { + instancePath: + instancePath + + '/device/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .announcedAvailability.items + .properties.start.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .announcedAvailability.items + .properties.start, + data: data38, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + } + } + var valid23 = _errs92 === errors; + } else { + var valid23 = true; + } + if (valid23) { + if (data37.end !== undefined) { + let data39 = data37.end; + const _errs94 = errors; + if (errors === _errs94) { + if (errors === _errs94) { + if (typeof data39 === 'string') { + if (!formats22.validate(data39)) { + const err53 = { + instancePath: + instancePath + + '/device/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + + 'date-time' + + '"', + schema: 'date-time', + parentSchema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .announcedAvailability.items + .properties.end, + data: data39, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } else { + const err54 = { + instancePath: + instancePath + + '/device/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .announcedAvailability.items + .properties.end.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .announcedAvailability.items + .properties.end, + data: data39, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + } + var valid23 = _errs94 === errors; + } else { + var valid23 = true; + } + } + } else { + const err55 = { + instancePath: + instancePath + + '/device/announcedAvailability/' + + i5, + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/announcedAvailability/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.announcedAvailability + .items.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.announcedAvailability + .items, + data: data37, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid22 = _errs90 === errors; + if (!valid22) { + break; + } + } + } else { + const err56 = { + instancePath: + instancePath + '/device/announcedAvailability', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/announcedAvailability/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema103.allOf[1].properties.device.anyOf[1].allOf[1] + .properties.announcedAvailability.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[1].allOf[1] + .properties.announcedAvailability, + data: data36, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + var valid21 = _errs88 === errors; + } else { + var valid21 = true; + } + if (valid21) { + if (data4.experiment !== undefined) { + let data40 = data4.experiment; + const _errs96 = errors; + if (errors === _errs96) { + if (errors === _errs96) { + if (typeof data40 === 'string') { + if (!formats0(data40)) { + const err57 = { + instancePath: instancePath + '/device/experiment', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.experiment, + data: data40, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } else { + const err58 = { + instancePath: instancePath + '/device/experiment', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.experiment.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.experiment, + data: data40, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + } + } + var valid21 = _errs96 === errors; + } else { + var valid21 = true; + } + if (valid21) { + if (data4.services !== undefined) { + let data41 = data4.services; + const _errs98 = errors; + if (errors === _errs98) { + if (Array.isArray(data41)) { + var valid24 = true; + const len6 = data41.length; + for (let i6 = 0; i6 < len6; i6++) { + let data42 = data41[i6]; + const _errs100 = errors; + if (errors === _errs100) { + if ( + data42 && + typeof data42 == 'object' && + !Array.isArray(data42) + ) { + if (data42.serviceType !== undefined) { + let data43 = data42.serviceType; + const _errs103 = errors; + if (errors === _errs103) { + if (errors === _errs103) { + if (typeof data43 === 'string') { + if (!formats0(data43)) { + const err59 = { + instancePath: + instancePath + + '/device/services/' + + i6 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1].properties + .device.anyOf[1].allOf[1] + .properties.services.items + .properties.serviceType, + data: data43, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } else { + const err60 = { + instancePath: + instancePath + + '/device/services/' + + i6 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties + .serviceType.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties + .serviceType, + data: data43, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + } + var valid25 = _errs103 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data42.serviceId !== undefined) { + let data44 = data42.serviceId; + const _errs105 = errors; + if (typeof data44 !== 'string') { + const err61 = { + instancePath: + instancePath + + '/device/services/' + + i6 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties.serviceId + .type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties + .serviceId, + data: data44, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid25 = _errs105 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data42.serviceDirection !== undefined) { + let data45 = data42.serviceDirection; + const _errs107 = errors; + if (typeof data45 !== 'string') { + const err62 = { + instancePath: + instancePath + + '/device/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties + .serviceDirection.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties + .serviceDirection, + data: data45, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + if ( + !( + data45 === 'consumer' || + data45 === 'producer' || + data45 === 'prosumer' + ) + ) { + const err63 = { + instancePath: + instancePath + + '/device/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema103.allOf[1].properties + .device.anyOf[1].allOf[1] + .properties.services.items + .properties.serviceDirection + .enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties + .serviceDirection.enum, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[1].properties + .services.items.properties + .serviceDirection, + data: data45, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + var valid25 = _errs107 === errors; + } else { + var valid25 = true; + } + } + } + } else { + const err64 = { + instancePath: + instancePath + '/device/services/' + i6, + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[1].properties.services + .items.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[1].allOf[1].properties.services + .items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + var valid24 = _errs100 === errors; + if (!valid24) { + break; + } + } + } else { + const err65 = { + instancePath: instancePath + '/device/services', + schemaPath: + '#/allOf/1/properties/device/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema103.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.services.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[1] + .allOf[1].properties.services, + data: data41, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid21 = _errs98 === errors; + } else { + var valid21 = true; + } + } + } + } + } + } else { + const err66 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device.anyOf[1].allOf[1].type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[1].allOf[1], + data: data4, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid15 = _errs83 === errors; + } + var _valid0 = _errs58 === errors; + valid5 = valid5 || _valid0; + if (!valid5) { + const _errs109 = errors; + const _errs110 = errors; + if (errors === _errs110) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing9; + if ( + (data4.url === undefined && (missing9 = 'url')) || + (data4.type === undefined && (missing9 = 'type')) || + (data4.name === undefined && (missing9 = 'name')) || + (data4.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err67 = { + instancePath: instancePath + '/device', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: + schema103.allOf[1].properties.device.anyOf[2].allOf[0] + .required, + parentSchema: + schema103.allOf[1].properties.device.anyOf[2].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data4.url !== undefined) { + let data46 = data4.url; + const _errs112 = errors; + if (errors === _errs112) { + if (errors === _errs112) { + if (typeof data46 === 'string') { + if (!formats0(data46)) { + const err68 = { + instancePath: instancePath + '/device/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.url, + data: data46, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: instancePath + '/device/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.url.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.url, + data: data46, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + var valid27 = _errs112 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data4.name !== undefined) { + let data47 = data4.name; + const _errs114 = errors; + if (typeof data47 !== 'string') { + const err70 = { + instancePath: instancePath + '/device/name', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.name.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.name, + data: data47, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var valid27 = _errs114 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data4.description !== undefined) { + let data48 = data4.description; + const _errs116 = errors; + if (typeof data48 !== 'string') { + const err71 = { + instancePath: instancePath + '/device/description', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.description.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[2].allOf[0] + .properties.description, + data: data48, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + var valid27 = _errs116 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data4.type !== undefined) { + let data49 = data4.type; + const _errs118 = errors; + if (typeof data49 !== 'string') { + const err72 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.type.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.type, + data: data49, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + if ( + !( + data49 === 'device' || + data49 === 'group' || + data49 === 'edge instantiable' || + data49 === 'cloud instantiable' + ) + ) { + const err73 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema103.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema103.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.type.enum, + parentSchema: + schema103.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.type, + data: data49, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid27 = _errs118 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data4.isPublic !== undefined) { + let data50 = data4.isPublic; + const _errs120 = errors; + if (typeof data50 !== 'boolean') { + const err74 = { + instancePath: instancePath + '/device/isPublic', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema103.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.isPublic.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.isPublic, + data: data50, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + var valid27 = _errs120 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data4.viewer !== undefined) { + let data51 = data4.viewer; + const _errs122 = errors; + if (errors === _errs122) { + if (Array.isArray(data51)) { + var valid28 = true; + const len7 = data51.length; + for (let i7 = 0; i7 < len7; i7++) { + let data52 = data51[i7]; + const _errs124 = errors; + if (errors === _errs124) { + if ( + data52 && + typeof data52 == 'object' && + !Array.isArray(data52) + ) { + let missing10; + if ( + data52.url === undefined && + (missing10 = 'url') + ) { + const err75 = { + instancePath: + instancePath + '/device/viewer/' + i7, + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + + missing10 + + "'", + schema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[0].properties.viewer + .items.required, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[0].properties.viewer + .items, + data: data52, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } else { + if (data52.url !== undefined) { + let data53 = data52.url; + const _errs126 = errors; + if (errors === _errs126) { + if (errors === _errs126) { + if (typeof data53 === 'string') { + if (!formats0(data53)) { + const err76 = { + instancePath: + instancePath + + '/device/viewer/' + + i7 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1] + .properties.device + .anyOf[2].allOf[0] + .properties.viewer.items + .properties.url, + data: data53, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + + '/device/viewer/' + + i7 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties + .device.anyOf[2].allOf[0] + .properties.viewer.items + .properties.url.type, + parentSchema: + schema103.allOf[1].properties + .device.anyOf[2].allOf[0] + .properties.viewer.items + .properties.url, + data: data53, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + } + } + } else { + const err78 = { + instancePath: + instancePath + '/device/viewer/' + i7, + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[0].properties.viewer + .items.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[0].properties.viewer + .items, + data: data52, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + var valid28 = _errs124 === errors; + if (!valid28) { + break; + } + } + } else { + const err79 = { + instancePath: instancePath + '/device/viewer', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema103.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.viewer.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[2] + .allOf[0].properties.viewer, + data: data51, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + var valid27 = _errs122 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data4.owner !== undefined) { + let data54 = data4.owner; + const _errs128 = errors; + if (errors === _errs128) { + if (Array.isArray(data54)) { + var valid30 = true; + const len8 = data54.length; + for (let i8 = 0; i8 < len8; i8++) { + let data55 = data54[i8]; + const _errs130 = errors; + if (errors === _errs130) { + if ( + data55 && + typeof data55 == 'object' && + !Array.isArray(data55) + ) { + let missing11; + if ( + data55.url === undefined && + (missing11 = 'url') + ) { + const err80 = { + instancePath: + instancePath + + '/device/owner/' + + i8, + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { + missingProperty: missing11, + }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[0].properties + .owner.items.required, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[0].properties + .owner.items, + data: data55, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } else { + if (data55.url !== undefined) { + let data56 = data55.url; + const _errs132 = errors; + if (errors === _errs132) { + if (errors === _errs132) { + if (typeof data56 === 'string') { + if (!formats0(data56)) { + const err81 = { + instancePath: + instancePath + + '/device/owner/' + + i8 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1] + .properties.device + .anyOf[2].allOf[0] + .properties.owner.items + .properties.url, + data: data56, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } else { + const err82 = { + instancePath: + instancePath + + '/device/owner/' + + i8 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1] + .properties.device + .anyOf[2].allOf[0] + .properties.owner.items + .properties.url.type, + parentSchema: + schema103.allOf[1] + .properties.device + .anyOf[2].allOf[0] + .properties.owner.items + .properties.url, + data: data56, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + } + } + } + } else { + const err83 = { + instancePath: + instancePath + '/device/owner/' + i8, + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[0].properties.owner + .items.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[0].properties.owner + .items, + data: data55, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid30 = _errs130 === errors; + if (!valid30) { + break; + } + } + } else { + const err84 = { + instancePath: instancePath + '/device/owner', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[0].properties.owner.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[0].properties.owner, + data: data54, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + var valid27 = _errs128 === errors; + } else { + var valid27 = true; + } + } + } + } + } + } + } + } + } else { + const err85 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device.anyOf[2].allOf[0].type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[2].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + } + var valid26 = _errs110 === errors; + if (valid26) { + const _errs134 = errors; + if (errors === _errs134) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + if (data4.type !== undefined) { + let data57 = data4.type; + const _errs136 = errors; + if ('edge instantiable' !== data57) { + const err86 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: + schema103.allOf[1].properties.device.anyOf[2].allOf[1] + .properties.type, + data: data57, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid32 = _errs136 === errors; + } else { + var valid32 = true; + } + if (valid32) { + if (data4.codeUrl !== undefined) { + let data58 = data4.codeUrl; + const _errs137 = errors; + if (errors === _errs137) { + if (errors === _errs137) { + if (typeof data58 === 'string') { + if (!formats0(data58)) { + const err87 = { + instancePath: instancePath + '/device/codeUrl', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.codeUrl, + data: data58, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + } else { + const err88 = { + instancePath: instancePath + '/device/codeUrl', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.codeUrl.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.codeUrl, + data: data58, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + } + } + var valid32 = _errs137 === errors; + } else { + var valid32 = true; + } + if (valid32) { + if (data4.services !== undefined) { + let data59 = data4.services; + const _errs139 = errors; + if (errors === _errs139) { + if (Array.isArray(data59)) { + var valid33 = true; + const len9 = data59.length; + for (let i9 = 0; i9 < len9; i9++) { + let data60 = data59[i9]; + const _errs141 = errors; + if (errors === _errs141) { + if ( + data60 && + typeof data60 == 'object' && + !Array.isArray(data60) + ) { + if (data60.serviceType !== undefined) { + let data61 = data60.serviceType; + const _errs144 = errors; + if (errors === _errs144) { + if (errors === _errs144) { + if (typeof data61 === 'string') { + if (!formats0(data61)) { + const err89 = { + instancePath: + instancePath + + '/device/services/' + + i9 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceType, + data: data61, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } else { + const err90 = { + instancePath: + instancePath + + '/device/services/' + + i9 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceType.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceType, + data: data61, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + } + var valid34 = _errs144 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data60.serviceId !== undefined) { + let data62 = data60.serviceId; + const _errs146 = errors; + if (typeof data62 !== 'string') { + const err91 = { + instancePath: + instancePath + + '/device/services/' + + i9 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[1].properties.services + .items.properties.serviceId, + data: data62, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + var valid34 = _errs146 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data60.serviceDirection !== undefined) { + let data63 = data60.serviceDirection; + const _errs148 = errors; + if (typeof data63 !== 'string') { + const err92 = { + instancePath: + instancePath + + '/device/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceDirection.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceDirection, + data: data63, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + if ( + !( + data63 === 'consumer' || + data63 === 'producer' || + data63 === 'prosumer' + ) + ) { + const err93 = { + instancePath: + instancePath + + '/device/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema103.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceDirection.enum, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[2].allOf[1].properties + .services.items.properties + .serviceDirection, + data: data63, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + var valid34 = _errs148 === errors; + } else { + var valid34 = true; + } + } + } + } else { + const err94 = { + instancePath: + instancePath + '/device/services/' + i9, + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.services.items.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.services.items, + data: data60, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid33 = _errs141 === errors; + if (!valid33) { + break; + } + } + } else { + const err95 = { + instancePath: instancePath + '/device/services', + schemaPath: + '#/allOf/1/properties/device/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema103.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.services.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[2] + .allOf[1].properties.services, + data: data59, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + var valid32 = _errs139 === errors; + } else { + var valid32 = true; + } + } + } + } else { + const err96 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device.anyOf[2].allOf[1].type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[2].allOf[1], + data: data4, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + var valid26 = _errs134 === errors; + } + var _valid0 = _errs109 === errors; + valid5 = valid5 || _valid0; + if (!valid5) { + const _errs150 = errors; + const _errs151 = errors; + if (errors === _errs151) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing12; + if ( + (data4.url === undefined && (missing12 = 'url')) || + (data4.type === undefined && (missing12 = 'type')) || + (data4.name === undefined && (missing12 = 'name')) || + (data4.isPublic === undefined && (missing12 = 'isPublic')) + ) { + const err97 = { + instancePath: instancePath + '/device', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: + schema103.allOf[1].properties.device.anyOf[3].allOf[0] + .required, + parentSchema: + schema103.allOf[1].properties.device.anyOf[3].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } else { + if (data4.url !== undefined) { + let data64 = data4.url; + const _errs153 = errors; + if (errors === _errs153) { + if (errors === _errs153) { + if (typeof data64 === 'string') { + if (!formats0(data64)) { + const err98 = { + instancePath: instancePath + '/device/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } else { + const err99 = { + instancePath: instancePath + '/device/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.url.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + } + var valid36 = _errs153 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data4.name !== undefined) { + let data65 = data4.name; + const _errs155 = errors; + if (typeof data65 !== 'string') { + const err100 = { + instancePath: instancePath + '/device/name', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[3].allOf[0] + .properties.name.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[3].allOf[0] + .properties.name, + data: data65, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + var valid36 = _errs155 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data4.description !== undefined) { + let data66 = data4.description; + const _errs157 = errors; + if (typeof data66 !== 'string') { + const err101 = { + instancePath: instancePath + '/device/description', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.description.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.description, + data: data66, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid36 = _errs157 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data4.type !== undefined) { + let data67 = data4.type; + const _errs159 = errors; + if (typeof data67 !== 'string') { + const err102 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.type.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.type, + data: data67, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + if ( + !( + data67 === 'device' || + data67 === 'group' || + data67 === 'edge instantiable' || + data67 === 'cloud instantiable' + ) + ) { + const err103 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema103.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.type.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema103.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.type.enum, + parentSchema: + schema103.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.type, + data: data67, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + var valid36 = _errs159 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data4.isPublic !== undefined) { + let data68 = data4.isPublic; + const _errs161 = errors; + if (typeof data68 !== 'boolean') { + const err104 = { + instancePath: instancePath + '/device/isPublic', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema103.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.isPublic.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[3] + .allOf[0].properties.isPublic, + data: data68, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + var valid36 = _errs161 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data4.viewer !== undefined) { + let data69 = data4.viewer; + const _errs163 = errors; + if (errors === _errs163) { + if (Array.isArray(data69)) { + var valid37 = true; + const len10 = data69.length; + for (let i10 = 0; i10 < len10; i10++) { + let data70 = data69[i10]; + const _errs165 = errors; + if (errors === _errs165) { + if ( + data70 && + typeof data70 == 'object' && + !Array.isArray(data70) + ) { + let missing13; + if ( + data70.url === undefined && + (missing13 = 'url') + ) { + const err105 = { + instancePath: + instancePath + + '/device/viewer/' + + i10, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { + missingProperty: missing13, + }, + message: + "must have required property '" + + missing13 + + "'", + schema: + schema103.allOf[1].properties.device + .anyOf[3].allOf[0].properties + .viewer.items.required, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[3].allOf[0].properties + .viewer.items, + data: data70, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } else { + if (data70.url !== undefined) { + let data71 = data70.url; + const _errs167 = errors; + if (errors === _errs167) { + if (errors === _errs167) { + if (typeof data71 === 'string') { + if (!formats0(data71)) { + const err106 = { + instancePath: + instancePath + + '/device/viewer/' + + i10 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1] + .properties.device + .anyOf[3].allOf[0] + .properties.viewer.items + .properties.url, + data: data71, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } else { + const err107 = { + instancePath: + instancePath + + '/device/viewer/' + + i10 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1] + .properties.device + .anyOf[3].allOf[0] + .properties.viewer.items + .properties.url.type, + parentSchema: + schema103.allOf[1] + .properties.device + .anyOf[3].allOf[0] + .properties.viewer.items + .properties.url, + data: data71, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + } + } + } + } else { + const err108 = { + instancePath: + instancePath + + '/device/viewer/' + + i10, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device + .anyOf[3].allOf[0].properties.viewer + .items.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[3].allOf[0].properties.viewer + .items, + data: data70, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid37 = _errs165 === errors; + if (!valid37) { + break; + } + } + } else { + const err109 = { + instancePath: instancePath + '/device/viewer', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema103.allOf[1].properties.device + .anyOf[3].allOf[0].properties.viewer.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[3].allOf[0].properties.viewer, + data: data69, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + } + } + var valid36 = _errs163 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data4.owner !== undefined) { + let data72 = data4.owner; + const _errs169 = errors; + if (errors === _errs169) { + if (Array.isArray(data72)) { + var valid39 = true; + const len11 = data72.length; + for (let i11 = 0; i11 < len11; i11++) { + let data73 = data72[i11]; + const _errs171 = errors; + if (errors === _errs171) { + if ( + data73 && + typeof data73 == 'object' && + !Array.isArray(data73) + ) { + let missing14; + if ( + data73.url === undefined && + (missing14 = 'url') + ) { + const err110 = { + instancePath: + instancePath + + '/device/owner/' + + i11, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { + missingProperty: missing14, + }, + message: + "must have required property '" + + missing14 + + "'", + schema: + schema103.allOf[1].properties + .device.anyOf[3].allOf[0] + .properties.owner.items + .required, + parentSchema: + schema103.allOf[1].properties + .device.anyOf[3].allOf[0] + .properties.owner.items, + data: data73, + }; + if (vErrors === null) { + vErrors = [err110]; + } else { + vErrors.push(err110); + } + errors++; + } else { + if (data73.url !== undefined) { + let data74 = data73.url; + const _errs173 = errors; + if (errors === _errs173) { + if (errors === _errs173) { + if ( + typeof data74 === 'string' + ) { + if (!formats0(data74)) { + const err111 = { + instancePath: + instancePath + + '/device/owner/' + + i11 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1] + .properties.device + .anyOf[3].allOf[0] + .properties.owner + .items.properties.url, + data: data74, + }; + if (vErrors === null) { + vErrors = [err111]; + } else { + vErrors.push(err111); + } + errors++; + } + } else { + const err112 = { + instancePath: + instancePath + + '/device/owner/' + + i11 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1] + .properties.device + .anyOf[3].allOf[0] + .properties.owner.items + .properties.url.type, + parentSchema: + schema103.allOf[1] + .properties.device + .anyOf[3].allOf[0] + .properties.owner.items + .properties.url, + data: data74, + }; + if (vErrors === null) { + vErrors = [err112]; + } else { + vErrors.push(err112); + } + errors++; + } + } + } + } + } + } else { + const err113 = { + instancePath: + instancePath + + '/device/owner/' + + i11, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device + .anyOf[3].allOf[0].properties + .owner.items.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[3].allOf[0].properties + .owner.items, + data: data73, + }; + if (vErrors === null) { + vErrors = [err113]; + } else { + vErrors.push(err113); + } + errors++; + } + } + var valid39 = _errs171 === errors; + if (!valid39) { + break; + } + } + } else { + const err114 = { + instancePath: + instancePath + '/device/owner', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema103.allOf[1].properties.device + .anyOf[3].allOf[0].properties.owner + .type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[3].allOf[0].properties.owner, + data: data72, + }; + if (vErrors === null) { + vErrors = [err114]; + } else { + vErrors.push(err114); + } + errors++; + } + } + var valid36 = _errs169 === errors; + } else { + var valid36 = true; + } + } + } + } + } + } + } + } + } else { + const err115 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device.anyOf[3].allOf[0].type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[3].allOf[0], + data: data4, + }; + if (vErrors === null) { + vErrors = [err115]; + } else { + vErrors.push(err115); + } + errors++; + } + } + var valid35 = _errs151 === errors; + if (valid35) { + const _errs175 = errors; + if (errors === _errs175) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing15; + if (data4.devices === undefined && (missing15 = 'devices')) { + const err116 = { + instancePath: instancePath + '/device', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing15 }, + message: "must have required property '" + missing15 + "'", + schema: + schema103.allOf[1].properties.device.anyOf[3].allOf[1] + .required, + parentSchema: + schema103.allOf[1].properties.device.anyOf[3].allOf[1], + data: data4, + }; + if (vErrors === null) { + vErrors = [err116]; + } else { + vErrors.push(err116); + } + errors++; + } else { + if (data4.type !== undefined) { + let data75 = data4.type; + const _errs177 = errors; + if ('group' !== data75) { + const err117 = { + instancePath: instancePath + '/device/type', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: + schema103.allOf[1].properties.device.anyOf[3].allOf[1] + .properties.type, + data: data75, + }; + if (vErrors === null) { + vErrors = [err117]; + } else { + vErrors.push(err117); + } + errors++; + } + var valid41 = _errs177 === errors; + } else { + var valid41 = true; + } + if (valid41) { + if (data4.devices !== undefined) { + let data76 = data4.devices; + const _errs178 = errors; + if (errors === _errs178) { + if (Array.isArray(data76)) { + var valid42 = true; + const len12 = data76.length; + for (let i12 = 0; i12 < len12; i12++) { + let data77 = data76[i12]; + const _errs180 = errors; + if (errors === _errs180) { + if ( + data77 && + typeof data77 == 'object' && + !Array.isArray(data77) + ) { + let missing16; + if ( + data77.url === undefined && + (missing16 = 'url') + ) { + const err118 = { + instancePath: + instancePath + '/device/devices/' + i12, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing16 }, + message: + "must have required property '" + + missing16 + + "'", + schema: + schema103.allOf[1].properties.device + .anyOf[3].allOf[1].properties.devices + .items.required, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[3].allOf[1].properties.devices + .items, + data: data77, + }; + if (vErrors === null) { + vErrors = [err118]; + } else { + vErrors.push(err118); + } + errors++; + } else { + if (data77.url !== undefined) { + let data78 = data77.url; + const _errs182 = errors; + if (errors === _errs182) { + if (errors === _errs182) { + if (typeof data78 === 'string') { + if (!formats0(data78)) { + const err119 = { + instancePath: + instancePath + + '/device/devices/' + + i12 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema103.allOf[1].properties + .device.anyOf[3].allOf[1] + .properties.devices.items + .properties.url, + data: data78, + }; + if (vErrors === null) { + vErrors = [err119]; + } else { + vErrors.push(err119); + } + errors++; + } + } else { + const err120 = { + instancePath: + instancePath + + '/device/devices/' + + i12 + + '/url', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema103.allOf[1].properties + .device.anyOf[3].allOf[1] + .properties.devices.items + .properties.url.type, + parentSchema: + schema103.allOf[1].properties + .device.anyOf[3].allOf[1] + .properties.devices.items + .properties.url, + data: data78, + }; + if (vErrors === null) { + vErrors = [err120]; + } else { + vErrors.push(err120); + } + errors++; + } + } + } + } + } + } else { + const err121 = { + instancePath: + instancePath + '/device/devices/' + i12, + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device + .anyOf[3].allOf[1].properties.devices + .items.type, + parentSchema: + schema103.allOf[1].properties.device + .anyOf[3].allOf[1].properties.devices + .items, + data: data77, + }; + if (vErrors === null) { + vErrors = [err121]; + } else { + vErrors.push(err121); + } + errors++; + } + } + var valid42 = _errs180 === errors; + if (!valid42) { + break; + } + } + } else { + const err122 = { + instancePath: instancePath + '/device/devices', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema103.allOf[1].properties.device.anyOf[3] + .allOf[1].properties.devices.type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[3] + .allOf[1].properties.devices, + data: data76, + }; + if (vErrors === null) { + vErrors = [err122]; + } else { + vErrors.push(err122); + } + errors++; + } + } + var valid41 = _errs178 === errors; + } else { + var valid41 = true; + } + } + } + } else { + const err123 = { + instancePath: instancePath + '/device', + schemaPath: + '#/allOf/1/properties/device/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema103.allOf[1].properties.device.anyOf[3].allOf[1].type, + parentSchema: + schema103.allOf[1].properties.device.anyOf[3].allOf[1], + data: data4, + }; + if (vErrors === null) { + vErrors = [err123]; + } else { + vErrors.push(err123); + } + errors++; + } + } + var valid35 = _errs175 === errors; + } + var _valid0 = _errs150 === errors; + valid5 = valid5 || _valid0; + } + } + } + if (!valid5) { + const err124 = { + instancePath: instancePath + '/device', + schemaPath: '#/allOf/1/properties/device/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema103.allOf[1].properties.device.anyOf, + parentSchema: schema103.allOf[1].properties.device, + data: data4, + }; + if (vErrors === null) { + vErrors = [err124]; + } else { + vErrors.push(err124); + } + errors++; + validate118.errors = vErrors; + return false; + } else { + errors = _errs16; + if (vErrors !== null) { + if (_errs16) { + vErrors.length = _errs16; + } else { + vErrors = null; + } + } + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate118.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema103.allOf[1].type, + parentSchema: schema103.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } + validate118.errors = vErrors; + return errors === 0; +} +exports.validateDeviceOverviewUpdateRequest = validate119; +const schema104 = { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + 'x-standalone': true, + 'x-name': 'DeviceOverviewUpdateRequest', + 'x-location': '#/components/schemas/device_overview_update_request', + 'x-schema-type': 'request', +}; +function validate119( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate119.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema104.required, + parentSchema: schema104, + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs1 = errors; + if (typeof data0 !== 'string') { + validate119.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema104.properties.name.type, + parentSchema: schema104.properties.name, + data: data0, + }, + ]; + return false; + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs3 = errors; + if (typeof data1 !== 'string') { + validate119.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema104.properties.description.type, + parentSchema: schema104.properties.description, + data: data1, + }, + ]; + return false; + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs5 = errors; + if (typeof data2 !== 'string') { + validate119.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema104.properties.type.type, + parentSchema: schema104.properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate119.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema104.properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema104.properties.type.enum, + parentSchema: schema104.properties.type, + data: data2, + }, + ]; + return false; + } + var valid0 = _errs5 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs7 = errors; + if (typeof data3 !== 'boolean') { + validate119.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema104.properties.isPublic.type, + parentSchema: schema104.properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid1 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate119.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: schema104.properties.viewer.items.required, + parentSchema: schema104.properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate119.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema104.properties.viewer.items.properties + .url, + data: data6, + }, + ]; + return false; + } + } else { + validate119.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema104.properties.viewer.items.properties + .url.type, + parentSchema: + schema104.properties.viewer.items.properties + .url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate119.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema104.properties.viewer.items.type, + parentSchema: schema104.properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs11 === errors; + if (!valid1) { + break; + } + } + } else { + validate119.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema104.properties.viewer.type, + parentSchema: schema104.properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs15 = errors; + if (errors === _errs15) { + if (Array.isArray(data7)) { + var valid3 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs17 = errors; + if (errors === _errs17) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate119.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: schema104.properties.owner.items.required, + parentSchema: schema104.properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs19 = errors; + if (errors === _errs19) { + if (errors === _errs19) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate119.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema104.properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate119.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema104.properties.owner.items.properties + .url.type, + parentSchema: + schema104.properties.owner.items.properties + .url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate119.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema104.properties.owner.items.type, + parentSchema: schema104.properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid3 = _errs17 === errors; + if (!valid3) { + break; + } + } + } else { + validate119.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema104.properties.owner.type, + parentSchema: schema104.properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } else { + validate119.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema104.type, + parentSchema: schema104, + data, + }, + ]; + return false; + } + } + validate119.errors = vErrors; + return errors === 0; +} +exports.validateDeviceOverviewUpdateResponse = validate120; +const schema105 = { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + 'x-standalone': true, + 'x-name': 'DeviceOverviewUpdateResponse', + 'x-location': '#/components/schemas/device_overview_update_response', + 'x-schema-type': 'response', +}; +function validate120( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate120.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema105.required, + parentSchema: schema105, + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs1 = errors; + if (typeof data0 !== 'string') { + validate120.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema105.properties.name.type, + parentSchema: schema105.properties.name, + data: data0, + }, + ]; + return false; + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs3 = errors; + if (typeof data1 !== 'string') { + validate120.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema105.properties.description.type, + parentSchema: schema105.properties.description, + data: data1, + }, + ]; + return false; + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs5 = errors; + if (typeof data2 !== 'string') { + validate120.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema105.properties.type.type, + parentSchema: schema105.properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate120.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema105.properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema105.properties.type.enum, + parentSchema: schema105.properties.type, + data: data2, + }, + ]; + return false; + } + var valid0 = _errs5 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs7 = errors; + if (typeof data3 !== 'boolean') { + validate120.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema105.properties.isPublic.type, + parentSchema: schema105.properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid1 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate120.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: schema105.properties.viewer.items.required, + parentSchema: schema105.properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate120.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema105.properties.viewer.items.properties + .url, + data: data6, + }, + ]; + return false; + } + } else { + validate120.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema105.properties.viewer.items.properties + .url.type, + parentSchema: + schema105.properties.viewer.items.properties + .url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate120.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema105.properties.viewer.items.type, + parentSchema: schema105.properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs11 === errors; + if (!valid1) { + break; + } + } + } else { + validate120.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema105.properties.viewer.type, + parentSchema: schema105.properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs15 = errors; + if (errors === _errs15) { + if (Array.isArray(data7)) { + var valid3 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs17 = errors; + if (errors === _errs17) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate120.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: schema105.properties.owner.items.required, + parentSchema: schema105.properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs19 = errors; + if (errors === _errs19) { + if (errors === _errs19) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate120.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema105.properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate120.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema105.properties.owner.items.properties + .url.type, + parentSchema: + schema105.properties.owner.items.properties + .url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate120.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema105.properties.owner.items.type, + parentSchema: schema105.properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid3 = _errs17 === errors; + if (!valid3) { + break; + } + } + } else { + validate120.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema105.properties.owner.type, + parentSchema: schema105.properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } else { + validate120.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema105.type, + parentSchema: schema105, + data, + }, + ]; + return false; + } + } + validate120.errors = vErrors; + return errors === 0; +} +exports.validateInstantiableCloudDeviceUpdateRequest = validate121; +const schema106 = { + title: 'Instantiable Cloud Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-standalone': true, + 'x-name': 'InstantiableCloudDeviceUpdateRequest', + 'x-location': '#/components/schemas/device_cloud_instantiable_update_request', + 'x-schema-type': 'request', +}; +function validate121( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate121.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema106.allOf[0].required, + parentSchema: schema106.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs2 = errors; + if (typeof data0 !== 'string') { + validate121.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema106.allOf[0].properties.name.type, + parentSchema: schema106.allOf[0].properties.name, + data: data0, + }, + ]; + return false; + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate121.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema106.allOf[0].properties.description.type, + parentSchema: schema106.allOf[0].properties.description, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate121.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema106.allOf[0].properties.type.type, + parentSchema: schema106.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate121.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema106.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema106.allOf[0].properties.type.enum, + parentSchema: schema106.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs8 = errors; + if (typeof data3 !== 'boolean') { + validate121.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema106.allOf[0].properties.isPublic.type, + parentSchema: schema106.allOf[0].properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate121.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema106.allOf[0].properties.viewer.items.required, + parentSchema: + schema106.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate121.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema106.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate121.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema106.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema106.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate121.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema106.allOf[0].properties.viewer.items.type, + parentSchema: schema106.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + if (!valid2) { + break; + } + } + } else { + validate121.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema106.allOf[0].properties.viewer.type, + parentSchema: schema106.allOf[0].properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs16 = errors; + if (errors === _errs16) { + if (Array.isArray(data7)) { + var valid4 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs18 = errors; + if (errors === _errs18) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate121.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema106.allOf[0].properties.owner.items.required, + parentSchema: + schema106.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate121.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema106.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate121.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema106.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema106.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate121.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema106.allOf[0].properties.owner.items.type, + parentSchema: schema106.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + if (!valid4) { + break; + } + } + } else { + validate121.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema106.allOf[0].properties.owner.type, + parentSchema: schema106.allOf[0].properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid1 = _errs16 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } else { + validate121.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema106.allOf[0].type, + parentSchema: schema106.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs22 = errors; + if (errors === _errs22) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs24 = errors; + if ('cloud instantiable' !== data10) { + validate121.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema106.allOf[1].properties.type, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs24 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.instantiateUrl !== undefined) { + let data11 = data.instantiateUrl; + const _errs25 = errors; + if (errors === _errs25) { + if (errors === _errs25) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + validate121.errors = [ + { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema106.allOf[1].properties.instantiateUrl, + data: data11, + }, + ]; + return false; + } + } else { + validate121.errors = [ + { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema106.allOf[1].properties.instantiateUrl.type, + parentSchema: schema106.allOf[1].properties.instantiateUrl, + data: data11, + }, + ]; + return false; + } + } + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs27 = errors; + if (errors === _errs27) { + if (Array.isArray(data12)) { + var valid7 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs29 = errors; + if (errors === _errs29) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs32 = errors; + if (errors === _errs32) { + if (errors === _errs32) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + validate121.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema106.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } else { + validate121.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema106.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema106.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } + } + var valid8 = _errs32 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs34 = errors; + if (typeof data15 !== 'string') { + validate121.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema106.allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema106.allOf[1].properties.services.items + .properties.serviceId, + data: data15, + }, + ]; + return false; + } + var valid8 = _errs34 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs36 = errors; + if (typeof data16 !== 'string') { + validate121.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema106.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema106.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + validate121.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema106.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema106.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema106.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + var valid8 = _errs36 === errors; + } else { + var valid8 = true; + } + } + } + } else { + validate121.errors = [ + { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema106.allOf[1].properties.services.items.type, + parentSchema: schema106.allOf[1].properties.services.items, + data: data13, + }, + ]; + return false; + } + } + var valid7 = _errs29 === errors; + if (!valid7) { + break; + } + } + } else { + validate121.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema106.allOf[1].properties.services.type, + parentSchema: schema106.allOf[1].properties.services, + data: data12, + }, + ]; + return false; + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate121.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema106.allOf[1].type, + parentSchema: schema106.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs22 === errors; + } + validate121.errors = vErrors; + return errors === 0; +} +exports.validateInstantiableCloudDeviceUpdateResponse = validate122; +const schema107 = { + title: 'Instantiable Cloud Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-standalone': true, + 'x-name': 'InstantiableCloudDeviceUpdateResponse', + 'x-location': '#/components/schemas/device_cloud_instantiable_update_response', + 'x-schema-type': 'response', +}; +function validate122( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate122.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema107.allOf[0].required, + parentSchema: schema107.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs2 = errors; + if (typeof data0 !== 'string') { + validate122.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema107.allOf[0].properties.name.type, + parentSchema: schema107.allOf[0].properties.name, + data: data0, + }, + ]; + return false; + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate122.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema107.allOf[0].properties.description.type, + parentSchema: schema107.allOf[0].properties.description, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate122.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema107.allOf[0].properties.type.type, + parentSchema: schema107.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate122.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema107.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema107.allOf[0].properties.type.enum, + parentSchema: schema107.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs8 = errors; + if (typeof data3 !== 'boolean') { + validate122.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema107.allOf[0].properties.isPublic.type, + parentSchema: schema107.allOf[0].properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate122.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema107.allOf[0].properties.viewer.items.required, + parentSchema: + schema107.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate122.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema107.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate122.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema107.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema107.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate122.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema107.allOf[0].properties.viewer.items.type, + parentSchema: schema107.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + if (!valid2) { + break; + } + } + } else { + validate122.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema107.allOf[0].properties.viewer.type, + parentSchema: schema107.allOf[0].properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs16 = errors; + if (errors === _errs16) { + if (Array.isArray(data7)) { + var valid4 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs18 = errors; + if (errors === _errs18) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate122.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema107.allOf[0].properties.owner.items.required, + parentSchema: + schema107.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate122.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema107.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate122.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema107.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema107.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate122.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema107.allOf[0].properties.owner.items.type, + parentSchema: schema107.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + if (!valid4) { + break; + } + } + } else { + validate122.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema107.allOf[0].properties.owner.type, + parentSchema: schema107.allOf[0].properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid1 = _errs16 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } else { + validate122.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema107.allOf[0].type, + parentSchema: schema107.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs22 = errors; + if (errors === _errs22) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs24 = errors; + if ('cloud instantiable' !== data10) { + validate122.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema107.allOf[1].properties.type, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs24 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.instantiateUrl !== undefined) { + let data11 = data.instantiateUrl; + const _errs25 = errors; + if (errors === _errs25) { + if (errors === _errs25) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + validate122.errors = [ + { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema107.allOf[1].properties.instantiateUrl, + data: data11, + }, + ]; + return false; + } + } else { + validate122.errors = [ + { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema107.allOf[1].properties.instantiateUrl.type, + parentSchema: schema107.allOf[1].properties.instantiateUrl, + data: data11, + }, + ]; + return false; + } + } + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs27 = errors; + if (errors === _errs27) { + if (Array.isArray(data12)) { + var valid7 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs29 = errors; + if (errors === _errs29) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs32 = errors; + if (errors === _errs32) { + if (errors === _errs32) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + validate122.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema107.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } else { + validate122.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema107.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema107.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } + } + var valid8 = _errs32 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs34 = errors; + if (typeof data15 !== 'string') { + validate122.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema107.allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema107.allOf[1].properties.services.items + .properties.serviceId, + data: data15, + }, + ]; + return false; + } + var valid8 = _errs34 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs36 = errors; + if (typeof data16 !== 'string') { + validate122.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema107.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema107.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + validate122.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema107.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema107.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema107.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + var valid8 = _errs36 === errors; + } else { + var valid8 = true; + } + } + } + } else { + validate122.errors = [ + { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema107.allOf[1].properties.services.items.type, + parentSchema: schema107.allOf[1].properties.services.items, + data: data13, + }, + ]; + return false; + } + } + var valid7 = _errs29 === errors; + if (!valid7) { + break; + } + } + } else { + validate122.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema107.allOf[1].properties.services.type, + parentSchema: schema107.allOf[1].properties.services, + data: data12, + }, + ]; + return false; + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate122.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema107.allOf[1].type, + parentSchema: schema107.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs22 === errors; + } + validate122.errors = vErrors; + return errors === 0; +} +exports.validateConcreteDeviceUpdateRequest = validate123; +const schema108 = { + title: 'Concrete Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-standalone': true, + 'x-name': 'ConcreteDeviceUpdateRequest', + 'x-location': '#/components/schemas/device_concrete_update_request', + 'x-schema-type': 'request', +}; +function validate123( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate123.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema108.allOf[0].required, + parentSchema: schema108.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs2 = errors; + if (typeof data0 !== 'string') { + validate123.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema108.allOf[0].properties.name.type, + parentSchema: schema108.allOf[0].properties.name, + data: data0, + }, + ]; + return false; + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate123.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema108.allOf[0].properties.description.type, + parentSchema: schema108.allOf[0].properties.description, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate123.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema108.allOf[0].properties.type.type, + parentSchema: schema108.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate123.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema108.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema108.allOf[0].properties.type.enum, + parentSchema: schema108.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs8 = errors; + if (typeof data3 !== 'boolean') { + validate123.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema108.allOf[0].properties.isPublic.type, + parentSchema: schema108.allOf[0].properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate123.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema108.allOf[0].properties.viewer.items.required, + parentSchema: + schema108.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate123.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema108.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate123.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema108.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema108.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate123.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema108.allOf[0].properties.viewer.items.type, + parentSchema: schema108.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + if (!valid2) { + break; + } + } + } else { + validate123.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema108.allOf[0].properties.viewer.type, + parentSchema: schema108.allOf[0].properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs16 = errors; + if (errors === _errs16) { + if (Array.isArray(data7)) { + var valid4 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs18 = errors; + if (errors === _errs18) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate123.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema108.allOf[0].properties.owner.items.required, + parentSchema: + schema108.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate123.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema108.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate123.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema108.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema108.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate123.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema108.allOf[0].properties.owner.items.type, + parentSchema: schema108.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + if (!valid4) { + break; + } + } + } else { + validate123.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema108.allOf[0].properties.owner.type, + parentSchema: schema108.allOf[0].properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid1 = _errs16 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } else { + validate123.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema108.allOf[0].type, + parentSchema: schema108.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs22 = errors; + if (errors === _errs22) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs24 = errors; + if ('device' !== data10) { + validate123.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema108.allOf[1].properties.type, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs24 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.experiment !== undefined) { + let data11 = data.experiment; + const _errs25 = errors; + if (errors === _errs25) { + if (errors === _errs25) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + validate123.errors = [ + { + instancePath: instancePath + '/experiment', + schemaPath: '#/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema108.allOf[1].properties.experiment, + data: data11, + }, + ]; + return false; + } + } else { + validate123.errors = [ + { + instancePath: instancePath + '/experiment', + schemaPath: '#/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema108.allOf[1].properties.experiment.type, + parentSchema: schema108.allOf[1].properties.experiment, + data: data11, + }, + ]; + return false; + } + } + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs27 = errors; + if (errors === _errs27) { + if (Array.isArray(data12)) { + var valid7 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs29 = errors; + if (errors === _errs29) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs32 = errors; + if (errors === _errs32) { + if (errors === _errs32) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + validate123.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema108.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } else { + validate123.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema108.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema108.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } + } + var valid8 = _errs32 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs34 = errors; + if (typeof data15 !== 'string') { + validate123.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema108.allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema108.allOf[1].properties.services.items + .properties.serviceId, + data: data15, + }, + ]; + return false; + } + var valid8 = _errs34 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs36 = errors; + if (typeof data16 !== 'string') { + validate123.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema108.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema108.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + validate123.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema108.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema108.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema108.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + var valid8 = _errs36 === errors; + } else { + var valid8 = true; + } + } + } + } else { + validate123.errors = [ + { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema108.allOf[1].properties.services.items.type, + parentSchema: schema108.allOf[1].properties.services.items, + data: data13, + }, + ]; + return false; + } + } + var valid7 = _errs29 === errors; + if (!valid7) { + break; + } + } + } else { + validate123.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema108.allOf[1].properties.services.type, + parentSchema: schema108.allOf[1].properties.services, + data: data12, + }, + ]; + return false; + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate123.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema108.allOf[1].type, + parentSchema: schema108.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs22 === errors; + } + validate123.errors = vErrors; + return errors === 0; +} +exports.validateConcreteDeviceUpdateResponse = validate124; +const schema109 = { + title: 'Concrete Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-standalone': true, + 'x-name': 'ConcreteDeviceUpdateResponse', + 'x-location': '#/components/schemas/device_concrete_update_response', + 'x-schema-type': 'response', +}; +function validate124( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate124.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema109.allOf[0].required, + parentSchema: schema109.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs2 = errors; + if (typeof data0 !== 'string') { + validate124.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema109.allOf[0].properties.name.type, + parentSchema: schema109.allOf[0].properties.name, + data: data0, + }, + ]; + return false; + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate124.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema109.allOf[0].properties.description.type, + parentSchema: schema109.allOf[0].properties.description, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate124.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema109.allOf[0].properties.type.type, + parentSchema: schema109.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate124.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema109.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema109.allOf[0].properties.type.enum, + parentSchema: schema109.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs8 = errors; + if (typeof data3 !== 'boolean') { + validate124.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema109.allOf[0].properties.isPublic.type, + parentSchema: schema109.allOf[0].properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate124.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema109.allOf[0].properties.viewer.items.required, + parentSchema: + schema109.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate124.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema109.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate124.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema109.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema109.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate124.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema109.allOf[0].properties.viewer.items.type, + parentSchema: schema109.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + if (!valid2) { + break; + } + } + } else { + validate124.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema109.allOf[0].properties.viewer.type, + parentSchema: schema109.allOf[0].properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs16 = errors; + if (errors === _errs16) { + if (Array.isArray(data7)) { + var valid4 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs18 = errors; + if (errors === _errs18) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate124.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema109.allOf[0].properties.owner.items.required, + parentSchema: + schema109.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate124.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema109.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate124.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema109.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema109.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate124.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema109.allOf[0].properties.owner.items.type, + parentSchema: schema109.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + if (!valid4) { + break; + } + } + } else { + validate124.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema109.allOf[0].properties.owner.type, + parentSchema: schema109.allOf[0].properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid1 = _errs16 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } else { + validate124.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema109.allOf[0].type, + parentSchema: schema109.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs22 = errors; + if (errors === _errs22) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs24 = errors; + if ('device' !== data10) { + validate124.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema109.allOf[1].properties.type, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs24 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.experiment !== undefined) { + let data11 = data.experiment; + const _errs25 = errors; + if (errors === _errs25) { + if (errors === _errs25) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + validate124.errors = [ + { + instancePath: instancePath + '/experiment', + schemaPath: '#/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema109.allOf[1].properties.experiment, + data: data11, + }, + ]; + return false; + } + } else { + validate124.errors = [ + { + instancePath: instancePath + '/experiment', + schemaPath: '#/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema109.allOf[1].properties.experiment.type, + parentSchema: schema109.allOf[1].properties.experiment, + data: data11, + }, + ]; + return false; + } + } + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs27 = errors; + if (errors === _errs27) { + if (Array.isArray(data12)) { + var valid7 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs29 = errors; + if (errors === _errs29) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs32 = errors; + if (errors === _errs32) { + if (errors === _errs32) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + validate124.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema109.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } else { + validate124.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema109.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema109.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } + } + var valid8 = _errs32 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs34 = errors; + if (typeof data15 !== 'string') { + validate124.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema109.allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema109.allOf[1].properties.services.items + .properties.serviceId, + data: data15, + }, + ]; + return false; + } + var valid8 = _errs34 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs36 = errors; + if (typeof data16 !== 'string') { + validate124.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema109.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema109.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + validate124.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema109.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema109.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema109.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + var valid8 = _errs36 === errors; + } else { + var valid8 = true; + } + } + } + } else { + validate124.errors = [ + { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema109.allOf[1].properties.services.items.type, + parentSchema: schema109.allOf[1].properties.services.items, + data: data13, + }, + ]; + return false; + } + } + var valid7 = _errs29 === errors; + if (!valid7) { + break; + } + } + } else { + validate124.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema109.allOf[1].properties.services.type, + parentSchema: schema109.allOf[1].properties.services, + data: data12, + }, + ]; + return false; + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate124.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema109.allOf[1].type, + parentSchema: schema109.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs22 === errors; + } + validate124.errors = vErrors; + return errors === 0; +} +exports.validateInstantiableBrowserDeviceUpdateRequest = validate125; +const schema110 = { + title: 'Instantiable Browser Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-standalone': true, + 'x-name': 'InstantiableBrowserDeviceUpdateRequest', + 'x-location': '#/components/schemas/device_edge_instantiable_update_request', + 'x-schema-type': 'request', +}; +function validate125( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate125.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema110.allOf[0].required, + parentSchema: schema110.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs2 = errors; + if (typeof data0 !== 'string') { + validate125.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema110.allOf[0].properties.name.type, + parentSchema: schema110.allOf[0].properties.name, + data: data0, + }, + ]; + return false; + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate125.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema110.allOf[0].properties.description.type, + parentSchema: schema110.allOf[0].properties.description, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate125.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema110.allOf[0].properties.type.type, + parentSchema: schema110.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate125.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema110.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema110.allOf[0].properties.type.enum, + parentSchema: schema110.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs8 = errors; + if (typeof data3 !== 'boolean') { + validate125.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema110.allOf[0].properties.isPublic.type, + parentSchema: schema110.allOf[0].properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate125.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema110.allOf[0].properties.viewer.items.required, + parentSchema: + schema110.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate125.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema110.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate125.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema110.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema110.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate125.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema110.allOf[0].properties.viewer.items.type, + parentSchema: schema110.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + if (!valid2) { + break; + } + } + } else { + validate125.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema110.allOf[0].properties.viewer.type, + parentSchema: schema110.allOf[0].properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs16 = errors; + if (errors === _errs16) { + if (Array.isArray(data7)) { + var valid4 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs18 = errors; + if (errors === _errs18) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate125.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema110.allOf[0].properties.owner.items.required, + parentSchema: + schema110.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate125.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema110.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate125.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema110.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema110.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate125.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema110.allOf[0].properties.owner.items.type, + parentSchema: schema110.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + if (!valid4) { + break; + } + } + } else { + validate125.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema110.allOf[0].properties.owner.type, + parentSchema: schema110.allOf[0].properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid1 = _errs16 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } else { + validate125.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema110.allOf[0].type, + parentSchema: schema110.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs22 = errors; + if (errors === _errs22) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs24 = errors; + if ('edge instantiable' !== data10) { + validate125.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema110.allOf[1].properties.type, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs24 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.codeUrl !== undefined) { + let data11 = data.codeUrl; + const _errs25 = errors; + if (errors === _errs25) { + if (errors === _errs25) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + validate125.errors = [ + { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema110.allOf[1].properties.codeUrl, + data: data11, + }, + ]; + return false; + } + } else { + validate125.errors = [ + { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema110.allOf[1].properties.codeUrl.type, + parentSchema: schema110.allOf[1].properties.codeUrl, + data: data11, + }, + ]; + return false; + } + } + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs27 = errors; + if (errors === _errs27) { + if (Array.isArray(data12)) { + var valid7 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs29 = errors; + if (errors === _errs29) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs32 = errors; + if (errors === _errs32) { + if (errors === _errs32) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + validate125.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema110.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } else { + validate125.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema110.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema110.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } + } + var valid8 = _errs32 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs34 = errors; + if (typeof data15 !== 'string') { + validate125.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema110.allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema110.allOf[1].properties.services.items + .properties.serviceId, + data: data15, + }, + ]; + return false; + } + var valid8 = _errs34 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs36 = errors; + if (typeof data16 !== 'string') { + validate125.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema110.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema110.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + validate125.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema110.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema110.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema110.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + var valid8 = _errs36 === errors; + } else { + var valid8 = true; + } + } + } + } else { + validate125.errors = [ + { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema110.allOf[1].properties.services.items.type, + parentSchema: schema110.allOf[1].properties.services.items, + data: data13, + }, + ]; + return false; + } + } + var valid7 = _errs29 === errors; + if (!valid7) { + break; + } + } + } else { + validate125.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema110.allOf[1].properties.services.type, + parentSchema: schema110.allOf[1].properties.services, + data: data12, + }, + ]; + return false; + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate125.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema110.allOf[1].type, + parentSchema: schema110.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs22 === errors; + } + validate125.errors = vErrors; + return errors === 0; +} +exports.validateInstantiableBrowserDeviceUpdateResponse = validate126; +const schema111 = { + title: 'Instantiable Browser Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-standalone': true, + 'x-name': 'InstantiableBrowserDeviceUpdateResponse', + 'x-location': '#/components/schemas/device_edge_instantiable_update_response', + 'x-schema-type': 'response', +}; +function validate126( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate126.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema111.allOf[0].required, + parentSchema: schema111.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs2 = errors; + if (typeof data0 !== 'string') { + validate126.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema111.allOf[0].properties.name.type, + parentSchema: schema111.allOf[0].properties.name, + data: data0, + }, + ]; + return false; + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate126.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema111.allOf[0].properties.description.type, + parentSchema: schema111.allOf[0].properties.description, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate126.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema111.allOf[0].properties.type.type, + parentSchema: schema111.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate126.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema111.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema111.allOf[0].properties.type.enum, + parentSchema: schema111.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs8 = errors; + if (typeof data3 !== 'boolean') { + validate126.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema111.allOf[0].properties.isPublic.type, + parentSchema: schema111.allOf[0].properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate126.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema111.allOf[0].properties.viewer.items.required, + parentSchema: + schema111.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate126.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema111.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate126.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema111.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema111.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate126.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema111.allOf[0].properties.viewer.items.type, + parentSchema: schema111.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + if (!valid2) { + break; + } + } + } else { + validate126.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema111.allOf[0].properties.viewer.type, + parentSchema: schema111.allOf[0].properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs16 = errors; + if (errors === _errs16) { + if (Array.isArray(data7)) { + var valid4 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs18 = errors; + if (errors === _errs18) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate126.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema111.allOf[0].properties.owner.items.required, + parentSchema: + schema111.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate126.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema111.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate126.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema111.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema111.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate126.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema111.allOf[0].properties.owner.items.type, + parentSchema: schema111.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + if (!valid4) { + break; + } + } + } else { + validate126.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema111.allOf[0].properties.owner.type, + parentSchema: schema111.allOf[0].properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid1 = _errs16 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } else { + validate126.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema111.allOf[0].type, + parentSchema: schema111.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs22 = errors; + if (errors === _errs22) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs24 = errors; + if ('edge instantiable' !== data10) { + validate126.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema111.allOf[1].properties.type, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs24 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.codeUrl !== undefined) { + let data11 = data.codeUrl; + const _errs25 = errors; + if (errors === _errs25) { + if (errors === _errs25) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + validate126.errors = [ + { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema111.allOf[1].properties.codeUrl, + data: data11, + }, + ]; + return false; + } + } else { + validate126.errors = [ + { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema111.allOf[1].properties.codeUrl.type, + parentSchema: schema111.allOf[1].properties.codeUrl, + data: data11, + }, + ]; + return false; + } + } + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs27 = errors; + if (errors === _errs27) { + if (Array.isArray(data12)) { + var valid7 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs29 = errors; + if (errors === _errs29) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs32 = errors; + if (errors === _errs32) { + if (errors === _errs32) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + validate126.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema111.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } else { + validate126.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema111.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema111.allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }, + ]; + return false; + } + } + } + var valid8 = _errs32 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs34 = errors; + if (typeof data15 !== 'string') { + validate126.errors = [ + { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema111.allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema111.allOf[1].properties.services.items + .properties.serviceId, + data: data15, + }, + ]; + return false; + } + var valid8 = _errs34 === errors; + } else { + var valid8 = true; + } + if (valid8) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs36 = errors; + if (typeof data16 !== 'string') { + validate126.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema111.allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema111.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + validate126.errors = [ + { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema111.allOf[1].properties.services.items + .properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema111.allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema111.allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }, + ]; + return false; + } + var valid8 = _errs36 === errors; + } else { + var valid8 = true; + } + } + } + } else { + validate126.errors = [ + { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema111.allOf[1].properties.services.items.type, + parentSchema: schema111.allOf[1].properties.services.items, + data: data13, + }, + ]; + return false; + } + } + var valid7 = _errs29 === errors; + if (!valid7) { + break; + } + } + } else { + validate126.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema111.allOf[1].properties.services.type, + parentSchema: schema111.allOf[1].properties.services, + data: data12, + }, + ]; + return false; + } + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + } + } + } else { + validate126.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema111.allOf[1].type, + parentSchema: schema111.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs22 === errors; + } + validate126.errors = vErrors; + return errors === 0; +} +exports.validateDeviceGroupUpdateRequest = validate127; +const schema112 = { + title: 'Device Group Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + }, + ], + 'x-standalone': true, + 'x-name': 'DeviceGroupUpdateRequest', + 'x-location': '#/components/schemas/device_group_update_request', + 'x-schema-type': 'request', +}; +function validate127( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate127.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema112.allOf[0].required, + parentSchema: schema112.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs2 = errors; + if (typeof data0 !== 'string') { + validate127.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema112.allOf[0].properties.name.type, + parentSchema: schema112.allOf[0].properties.name, + data: data0, + }, + ]; + return false; + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate127.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema112.allOf[0].properties.description.type, + parentSchema: schema112.allOf[0].properties.description, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate127.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema112.allOf[0].properties.type.type, + parentSchema: schema112.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate127.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema112.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema112.allOf[0].properties.type.enum, + parentSchema: schema112.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs8 = errors; + if (typeof data3 !== 'boolean') { + validate127.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema112.allOf[0].properties.isPublic.type, + parentSchema: schema112.allOf[0].properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate127.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema112.allOf[0].properties.viewer.items.required, + parentSchema: + schema112.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate127.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema112.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate127.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema112.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema112.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate127.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema112.allOf[0].properties.viewer.items.type, + parentSchema: schema112.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + if (!valid2) { + break; + } + } + } else { + validate127.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema112.allOf[0].properties.viewer.type, + parentSchema: schema112.allOf[0].properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs16 = errors; + if (errors === _errs16) { + if (Array.isArray(data7)) { + var valid4 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs18 = errors; + if (errors === _errs18) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate127.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema112.allOf[0].properties.owner.items.required, + parentSchema: + schema112.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate127.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema112.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate127.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema112.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema112.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate127.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema112.allOf[0].properties.owner.items.type, + parentSchema: schema112.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + if (!valid4) { + break; + } + } + } else { + validate127.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema112.allOf[0].properties.owner.type, + parentSchema: schema112.allOf[0].properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid1 = _errs16 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } else { + validate127.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema112.allOf[0].type, + parentSchema: schema112.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs22 = errors; + if (errors === _errs22) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs24 = errors; + if ('group' !== data10) { + validate127.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema112.allOf[1].properties.type, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs24 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.devices !== undefined) { + let data11 = data.devices; + const _errs25 = errors; + if (errors === _errs25) { + if (Array.isArray(data11)) { + var valid7 = true; + const len2 = data11.length; + for (let i2 = 0; i2 < len2; i2++) { + let data12 = data11[i2]; + const _errs27 = errors; + if (errors === _errs27) { + if (data12 && typeof data12 == 'object' && !Array.isArray(data12)) { + let missing3; + if (data12.url === undefined && (missing3 = 'url')) { + validate127.errors = [ + { + instancePath: instancePath + '/devices/' + i2, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema112.allOf[1].properties.devices.items.required, + parentSchema: schema112.allOf[1].properties.devices.items, + data: data12, + }, + ]; + return false; + } else { + if (data12.url !== undefined) { + let data13 = data12.url; + const _errs29 = errors; + if (errors === _errs29) { + if (errors === _errs29) { + if (typeof data13 === 'string') { + if (!formats0(data13)) { + validate127.errors = [ + { + instancePath: + instancePath + '/devices/' + i2 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema112.allOf[1].properties.devices.items + .properties.url, + data: data13, + }, + ]; + return false; + } + } else { + validate127.errors = [ + { + instancePath: + instancePath + '/devices/' + i2 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema112.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema112.allOf[1].properties.devices.items + .properties.url, + data: data13, + }, + ]; + return false; + } + } + } + } + } + } else { + validate127.errors = [ + { + instancePath: instancePath + '/devices/' + i2, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema112.allOf[1].properties.devices.items.type, + parentSchema: schema112.allOf[1].properties.devices.items, + data: data12, + }, + ]; + return false; + } + } + var valid7 = _errs27 === errors; + if (!valid7) { + break; + } + } + } else { + validate127.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema112.allOf[1].properties.devices.type, + parentSchema: schema112.allOf[1].properties.devices, + data: data11, + }, + ]; + return false; + } + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + } + } else { + validate127.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema112.allOf[1].type, + parentSchema: schema112.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs22 === errors; + } + validate127.errors = vErrors; + return errors === 0; +} +exports.validateDeviceGroupUpdateResponse = validate128; +const schema113 = { + title: 'Device Group Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + }, + ], + 'x-standalone': true, + 'x-name': 'DeviceGroupUpdateResponse', + 'x-location': '#/components/schemas/device_group_update_response', + 'x-schema-type': 'response', +}; +function validate128( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate128.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema113.allOf[0].required, + parentSchema: schema113.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs2 = errors; + if (typeof data0 !== 'string') { + validate128.errors = [ + { + instancePath: instancePath + '/name', + schemaPath: '#/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema113.allOf[0].properties.name.type, + parentSchema: schema113.allOf[0].properties.name, + data: data0, + }, + ]; + return false; + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate128.errors = [ + { + instancePath: instancePath + '/description', + schemaPath: '#/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema113.allOf[0].properties.description.type, + parentSchema: schema113.allOf[0].properties.description, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate128.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema113.allOf[0].properties.type.type, + parentSchema: schema113.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + validate128.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema113.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema113.allOf[0].properties.type.enum, + parentSchema: schema113.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs8 = errors; + if (typeof data3 !== 'boolean') { + validate128.errors = [ + { + instancePath: instancePath + '/isPublic', + schemaPath: '#/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema113.allOf[0].properties.isPublic.type, + parentSchema: schema113.allOf[0].properties.isPublic, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs8 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + validate128.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema113.allOf[0].properties.viewer.items.required, + parentSchema: + schema113.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate128.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema113.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate128.errors = [ + { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema113.allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema113.allOf[0].properties.viewer.items + .properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate128.errors = [ + { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: '#/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema113.allOf[0].properties.viewer.items.type, + parentSchema: schema113.allOf[0].properties.viewer.items, + data: data5, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + if (!valid2) { + break; + } + } + } else { + validate128.errors = [ + { + instancePath: instancePath + '/viewer', + schemaPath: '#/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema113.allOf[0].properties.viewer.type, + parentSchema: schema113.allOf[0].properties.viewer, + data: data4, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs16 = errors; + if (errors === _errs16) { + if (Array.isArray(data7)) { + var valid4 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs18 = errors; + if (errors === _errs18) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + validate128.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema113.allOf[0].properties.owner.items.required, + parentSchema: + schema113.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs20 = errors; + if (errors === _errs20) { + if (errors === _errs20) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate128.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema113.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } else { + validate128.errors = [ + { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema113.allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema113.allOf[0].properties.owner.items + .properties.url, + data: data9, + }, + ]; + return false; + } + } + } + } + } + } else { + validate128.errors = [ + { + instancePath: instancePath + '/owner/' + i1, + schemaPath: '#/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema113.allOf[0].properties.owner.items.type, + parentSchema: schema113.allOf[0].properties.owner.items, + data: data8, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + if (!valid4) { + break; + } + } + } else { + validate128.errors = [ + { + instancePath: instancePath + '/owner', + schemaPath: '#/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema113.allOf[0].properties.owner.type, + parentSchema: schema113.allOf[0].properties.owner, + data: data7, + }, + ]; + return false; + } + } + var valid1 = _errs16 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } else { + validate128.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema113.allOf[0].type, + parentSchema: schema113.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs22 = errors; + if (errors === _errs22) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs24 = errors; + if ('group' !== data10) { + validate128.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema113.allOf[1].properties.type, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs24 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data.devices !== undefined) { + let data11 = data.devices; + const _errs25 = errors; + if (errors === _errs25) { + if (Array.isArray(data11)) { + var valid7 = true; + const len2 = data11.length; + for (let i2 = 0; i2 < len2; i2++) { + let data12 = data11[i2]; + const _errs27 = errors; + if (errors === _errs27) { + if (data12 && typeof data12 == 'object' && !Array.isArray(data12)) { + let missing3; + if (data12.url === undefined && (missing3 = 'url')) { + validate128.errors = [ + { + instancePath: instancePath + '/devices/' + i2, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema113.allOf[1].properties.devices.items.required, + parentSchema: schema113.allOf[1].properties.devices.items, + data: data12, + }, + ]; + return false; + } else { + if (data12.url !== undefined) { + let data13 = data12.url; + const _errs29 = errors; + if (errors === _errs29) { + if (errors === _errs29) { + if (typeof data13 === 'string') { + if (!formats0(data13)) { + validate128.errors = [ + { + instancePath: + instancePath + '/devices/' + i2 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema113.allOf[1].properties.devices.items + .properties.url, + data: data13, + }, + ]; + return false; + } + } else { + validate128.errors = [ + { + instancePath: + instancePath + '/devices/' + i2 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema113.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema113.allOf[1].properties.devices.items + .properties.url, + data: data13, + }, + ]; + return false; + } + } + } + } + } + } else { + validate128.errors = [ + { + instancePath: instancePath + '/devices/' + i2, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema113.allOf[1].properties.devices.items.type, + parentSchema: schema113.allOf[1].properties.devices.items, + data: data12, + }, + ]; + return false; + } + } + var valid7 = _errs27 === errors; + if (!valid7) { + break; + } + } + } else { + validate128.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema113.allOf[1].properties.devices.type, + parentSchema: schema113.allOf[1].properties.devices, + data: data11, + }, + ]; + return false; + } + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + } + } else { + validate128.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema113.allOf[1].type, + parentSchema: schema113.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs22 === errors; + } + validate128.errors = vErrors; + return errors === 0; +} +exports.validateDeviceUpdateRequest = validate129; +const schema114 = { + title: 'Device Update', + anyOf: [ + { + title: 'Instantiable Cloud Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Concrete Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Instantiable Browser Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Device Group Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + }, + ], + }, + ], + 'x-standalone': true, + 'x-name': 'DeviceUpdateRequest', + 'x-location': '#/components/schemas/device_update_request', + 'x-schema-type': 'request', +}; +function validate129( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema114.anyOf[0].allOf[0].required, + parentSchema: schema114.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs4 = errors; + if (typeof data0 !== 'string') { + const err1 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema114.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema114.anyOf[0].allOf[0].properties.name, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err2 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema114.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema114.anyOf[0].allOf[0].properties.description, + data: data1, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err3 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema114.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema114.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + const err4 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema114.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema114.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema114.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs10 = errors; + if (typeof data3 !== 'boolean') { + const err5 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema114.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema114.anyOf[0].allOf[0].properties.isPublic, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data4)) { + var valid3 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + const err6 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: + schema114.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema114.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + const err7 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema114.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema114.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } + } else { + const err9 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema114.anyOf[0].allOf[0].properties.viewer.items.type, + parentSchema: + schema114.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var valid3 = _errs14 === errors; + if (!valid3) { + break; + } + } + } else { + const err10 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema114.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema114.anyOf[0].allOf[0].properties.viewer, + data: data4, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid5 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + const err11 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema114.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema114.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + const err12 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema114.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } else { + const err13 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema114.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + } + } + } + } + } else { + const err14 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema114.anyOf[0].allOf[0].properties.owner.items.type, + parentSchema: + schema114.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } + var valid5 = _errs20 === errors; + if (!valid5) { + break; + } + } + } else { + const err15 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema114.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema114.anyOf[0].allOf[0].properties.owner, + data: data7, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + var valid2 = _errs18 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } else { + const err16 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema114.anyOf[0].allOf[0].type, + parentSchema: schema114.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs26 = errors; + if ('cloud instantiable' !== data10) { + const err17 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema114.anyOf[0].allOf[1].properties.type, + data: data10, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var valid7 = _errs26 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data11 = data.instantiateUrl; + const _errs27 = errors; + if (errors === _errs27) { + if (errors === _errs27) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + const err18 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema114.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } else { + const err19 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema114.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema114.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + } + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data12)) { + var valid8 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + const err20 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema114.anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema114.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid9 = _errs34 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs36 = errors; + if (typeof data15 !== 'string') { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema114.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err23 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema114.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + const err24 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema114.anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema114.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema114.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err25 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema114.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema114.anyOf[0].allOf[1].properties.services.items, + data: data13, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + var valid8 = _errs31 === errors; + if (!valid8) { + break; + } + } + } else { + const err26 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema114.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema114.anyOf[0].allOf[1].properties.services, + data: data12, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err27 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema114.anyOf[0].allOf[1].type, + parentSchema: schema114.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid1 = _errs24 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs40 = errors; + const _errs41 = errors; + if (errors === _errs41) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if (data.type === undefined && (missing3 = 'type')) { + const err28 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema114.anyOf[1].allOf[0].required, + parentSchema: schema114.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } else { + if (data.name !== undefined) { + let data17 = data.name; + const _errs43 = errors; + if (typeof data17 !== 'string') { + const err29 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema114.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema114.anyOf[1].allOf[0].properties.name, + data: data17, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + var valid11 = _errs43 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data18 = data.description; + const _errs45 = errors; + if (typeof data18 !== 'string') { + const err30 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema114.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema114.anyOf[1].allOf[0].properties.description, + data: data18, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data19 = data.type; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err31 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema114.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema114.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + if ( + !( + data19 === 'device' || + data19 === 'group' || + data19 === 'edge instantiable' || + data19 === 'cloud instantiable' + ) + ) { + const err32 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema114.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema114.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema114.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data20 = data.isPublic; + const _errs49 = errors; + if (typeof data20 !== 'boolean') { + const err33 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema114.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema114.anyOf[1].allOf[0].properties.isPublic, + data: data20, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data21 = data.viewer; + const _errs51 = errors; + if (errors === _errs51) { + if (Array.isArray(data21)) { + var valid12 = true; + const len3 = data21.length; + for (let i3 = 0; i3 < len3; i3++) { + let data22 = data21[i3]; + const _errs53 = errors; + if (errors === _errs53) { + if ( + data22 && + typeof data22 == 'object' && + !Array.isArray(data22) + ) { + let missing4; + if (data22.url === undefined && (missing4 = 'url')) { + const err34 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema114.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema114.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } else { + if (data22.url !== undefined) { + let data23 = data22.url; + const _errs55 = errors; + if (errors === _errs55) { + if (errors === _errs55) { + if (typeof data23 === 'string') { + if (!formats0(data23)) { + const err35 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema114.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } else { + const err36 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[1].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema114.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + } + } + } + } else { + const err37 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema114.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema114.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + var valid12 = _errs53 === errors; + if (!valid12) { + break; + } + } + } else { + const err38 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema114.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema114.anyOf[1].allOf[0].properties.viewer, + data: data21, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data24 = data.owner; + const _errs57 = errors; + if (errors === _errs57) { + if (Array.isArray(data24)) { + var valid14 = true; + const len4 = data24.length; + for (let i4 = 0; i4 < len4; i4++) { + let data25 = data24[i4]; + const _errs59 = errors; + if (errors === _errs59) { + if ( + data25 && + typeof data25 == 'object' && + !Array.isArray(data25) + ) { + let missing5; + if (data25.url === undefined && (missing5 = 'url')) { + const err39 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema114.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema114.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } else { + if (data25.url !== undefined) { + let data26 = data25.url; + const _errs61 = errors; + if (errors === _errs61) { + if (errors === _errs61) { + if (typeof data26 === 'string') { + if (!formats0(data26)) { + const err40 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema114.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } else { + const err41 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[1].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema114.anyOf[1].allOf[0].properties.owner + .items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + } + } + } + } else { + const err42 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema114.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema114.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid14 = _errs59 === errors; + if (!valid14) { + break; + } + } + } else { + const err43 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema114.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema114.anyOf[1].allOf[0].properties.owner, + data: data24, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + } + var valid11 = _errs57 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } else { + const err44 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema114.anyOf[1].allOf[0].type, + parentSchema: schema114.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var valid10 = _errs41 === errors; + if (valid10) { + const _errs63 = errors; + if (errors === _errs63) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data27 = data.type; + const _errs65 = errors; + if ('device' !== data27) { + const err45 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema114.anyOf[1].allOf[1].properties.type, + data: data27, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + var valid16 = _errs65 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data28 = data.experiment; + const _errs66 = errors; + if (errors === _errs66) { + if (errors === _errs66) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err46 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema114.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } else { + const err47 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema114.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema114.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + } + var valid16 = _errs66 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data29 = data.services; + const _errs68 = errors; + if (errors === _errs68) { + if (Array.isArray(data29)) { + var valid17 = true; + const len5 = data29.length; + for (let i5 = 0; i5 < len5; i5++) { + let data30 = data29[i5]; + const _errs70 = errors; + if (errors === _errs70) { + if ( + data30 && + typeof data30 == 'object' && + !Array.isArray(data30) + ) { + if (data30.serviceType !== undefined) { + let data31 = data30.serviceType; + const _errs73 = errors; + if (errors === _errs73) { + if (errors === _errs73) { + if (typeof data31 === 'string') { + if (!formats0(data31)) { + const err48 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema114.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } else { + const err49 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema114.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + } + } + var valid18 = _errs73 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceId !== undefined) { + let data32 = data30.serviceId; + const _errs75 = errors; + if (typeof data32 !== 'string') { + const err50 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[1].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema114.anyOf[1].allOf[1].properties.services.items + .properties.serviceId, + data: data32, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid18 = _errs75 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceDirection !== undefined) { + let data33 = data30.serviceDirection; + const _errs77 = errors; + if (typeof data33 !== 'string') { + const err51 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema114.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + if ( + !( + data33 === 'consumer' || + data33 === 'producer' || + data33 === 'prosumer' + ) + ) { + const err52 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema114.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema114.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema114.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + var valid18 = _errs77 === errors; + } else { + var valid18 = true; + } + } + } + } else { + const err53 = { + instancePath: instancePath + '/services/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema114.anyOf[1].allOf[1].properties.services.items.type, + parentSchema: + schema114.anyOf[1].allOf[1].properties.services.items, + data: data30, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + var valid17 = _errs70 === errors; + if (!valid17) { + break; + } + } + } else { + const err54 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema114.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema114.anyOf[1].allOf[1].properties.services, + data: data29, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + var valid16 = _errs68 === errors; + } else { + var valid16 = true; + } + } + } + } else { + const err55 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema114.anyOf[1].allOf[1].type, + parentSchema: schema114.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid10 = _errs63 === errors; + } + var _valid0 = _errs40 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs79 = errors; + const _errs80 = errors; + if (errors === _errs80) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if (data.type === undefined && (missing6 = 'type')) { + const err56 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema114.anyOf[2].allOf[0].required, + parentSchema: schema114.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } else { + if (data.name !== undefined) { + let data34 = data.name; + const _errs82 = errors; + if (typeof data34 !== 'string') { + const err57 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema114.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema114.anyOf[2].allOf[0].properties.name, + data: data34, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + var valid20 = _errs82 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.description !== undefined) { + let data35 = data.description; + const _errs84 = errors; + if (typeof data35 !== 'string') { + const err58 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema114.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema114.anyOf[2].allOf[0].properties.description, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + var valid20 = _errs84 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.type !== undefined) { + let data36 = data.type; + const _errs86 = errors; + if (typeof data36 !== 'string') { + const err59 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema114.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema114.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + if ( + !( + data36 === 'device' || + data36 === 'group' || + data36 === 'edge instantiable' || + data36 === 'cloud instantiable' + ) + ) { + const err60 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema114.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema114.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema114.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + var valid20 = _errs86 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.isPublic !== undefined) { + let data37 = data.isPublic; + const _errs88 = errors; + if (typeof data37 !== 'boolean') { + const err61 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema114.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema114.anyOf[2].allOf[0].properties.isPublic, + data: data37, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs88 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.viewer !== undefined) { + let data38 = data.viewer; + const _errs90 = errors; + if (errors === _errs90) { + if (Array.isArray(data38)) { + var valid21 = true; + const len6 = data38.length; + for (let i6 = 0; i6 < len6; i6++) { + let data39 = data38[i6]; + const _errs92 = errors; + if (errors === _errs92) { + if ( + data39 && + typeof data39 == 'object' && + !Array.isArray(data39) + ) { + let missing7; + if (data39.url === undefined && (missing7 = 'url')) { + const err62 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema114.anyOf[2].allOf[0].properties.viewer.items + .required, + parentSchema: + schema114.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } else { + if (data39.url !== undefined) { + let data40 = data39.url; + const _errs94 = errors; + if (errors === _errs94) { + if (errors === _errs94) { + if (typeof data40 === 'string') { + if (!formats0(data40)) { + const err63 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema114.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + } else { + const err64 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema114.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + } + } + } + } else { + const err65 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema114.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema114.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid21 = _errs92 === errors; + if (!valid21) { + break; + } + } + } else { + const err66 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema114.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema114.anyOf[2].allOf[0].properties.viewer, + data: data38, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid20 = _errs90 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.owner !== undefined) { + let data41 = data.owner; + const _errs96 = errors; + if (errors === _errs96) { + if (Array.isArray(data41)) { + var valid23 = true; + const len7 = data41.length; + for (let i7 = 0; i7 < len7; i7++) { + let data42 = data41[i7]; + const _errs98 = errors; + if (errors === _errs98) { + if ( + data42 && + typeof data42 == 'object' && + !Array.isArray(data42) + ) { + let missing8; + if (data42.url === undefined && (missing8 = 'url')) { + const err67 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + missing8 + "'", + schema: + schema114.anyOf[2].allOf[0].properties.owner.items + .required, + parentSchema: + schema114.anyOf[2].allOf[0].properties.owner + .items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data42.url !== undefined) { + let data43 = data42.url; + const _errs100 = errors; + if (errors === _errs100) { + if (errors === _errs100) { + if (typeof data43 === 'string') { + if (!formats0(data43)) { + const err68 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema114.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema114.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + } + } + } else { + const err70 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema114.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema114.anyOf[2].allOf[0].properties.owner.items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + } + var valid23 = _errs98 === errors; + if (!valid23) { + break; + } + } + } else { + const err71 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema114.anyOf[2].allOf[0].properties.owner.type, + parentSchema: schema114.anyOf[2].allOf[0].properties.owner, + data: data41, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + } + var valid20 = _errs96 === errors; + } else { + var valid20 = true; + } + } + } + } + } + } + } + } else { + const err72 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema114.anyOf[2].allOf[0].type, + parentSchema: schema114.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + var valid19 = _errs80 === errors; + if (valid19) { + const _errs102 = errors; + if (errors === _errs102) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs104 = errors; + if ('edge instantiable' !== data44) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema114.anyOf[2].allOf[1].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid25 = _errs104 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.codeUrl !== undefined) { + let data45 = data.codeUrl; + const _errs105 = errors; + if (errors === _errs105) { + if (errors === _errs105) { + if (typeof data45 === 'string') { + if (!formats0(data45)) { + const err74 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema114.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } else { + const err75 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema114.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema114.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + } + var valid25 = _errs105 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.services !== undefined) { + let data46 = data.services; + const _errs107 = errors; + if (errors === _errs107) { + if (Array.isArray(data46)) { + var valid26 = true; + const len8 = data46.length; + for (let i8 = 0; i8 < len8; i8++) { + let data47 = data46[i8]; + const _errs109 = errors; + if (errors === _errs109) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + if (data47.serviceType !== undefined) { + let data48 = data47.serviceType; + const _errs112 = errors; + if (errors === _errs112) { + if (errors === _errs112) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema114.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema114.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + var valid27 = _errs112 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceId !== undefined) { + let data49 = data47.serviceId; + const _errs114 = errors; + if (typeof data49 !== 'string') { + const err78 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[2].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema114.anyOf[2].allOf[1].properties.services + .items.properties.serviceId, + data: data49, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + var valid27 = _errs114 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceDirection !== undefined) { + let data50 = data47.serviceDirection; + const _errs116 = errors; + if (typeof data50 !== 'string') { + const err79 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema114.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + if ( + !( + data50 === 'consumer' || + data50 === 'producer' || + data50 === 'prosumer' + ) + ) { + const err80 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema114.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema114.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema114.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + var valid27 = _errs116 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err81 = { + instancePath: instancePath + '/services/' + i8, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema114.anyOf[2].allOf[1].properties.services.items + .type, + parentSchema: + schema114.anyOf[2].allOf[1].properties.services.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + var valid26 = _errs109 === errors; + if (!valid26) { + break; + } + } + } else { + const err82 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema114.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema114.anyOf[2].allOf[1].properties.services, + data: data46, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + var valid25 = _errs107 === errors; + } else { + var valid25 = true; + } + } + } + } else { + const err83 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema114.anyOf[2].allOf[1].type, + parentSchema: schema114.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid19 = _errs102 === errors; + } + var _valid0 = _errs79 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs118 = errors; + const _errs119 = errors; + if (errors === _errs119) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if (data.type === undefined && (missing9 = 'type')) { + const err84 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema114.anyOf[3].allOf[0].required, + parentSchema: schema114.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } else { + if (data.name !== undefined) { + let data51 = data.name; + const _errs121 = errors; + if (typeof data51 !== 'string') { + const err85 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema114.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema114.anyOf[3].allOf[0].properties.name, + data: data51, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + var valid29 = _errs121 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.description !== undefined) { + let data52 = data.description; + const _errs123 = errors; + if (typeof data52 !== 'string') { + const err86 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema114.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema114.anyOf[3].allOf[0].properties.description, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid29 = _errs123 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.type !== undefined) { + let data53 = data.type; + const _errs125 = errors; + if (typeof data53 !== 'string') { + const err87 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema114.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema114.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + if ( + !( + data53 === 'device' || + data53 === 'group' || + data53 === 'edge instantiable' || + data53 === 'cloud instantiable' + ) + ) { + const err88 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema114.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema114.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema114.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + var valid29 = _errs125 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.isPublic !== undefined) { + let data54 = data.isPublic; + const _errs127 = errors; + if (typeof data54 !== 'boolean') { + const err89 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema114.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema114.anyOf[3].allOf[0].properties.isPublic, + data: data54, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + var valid29 = _errs127 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.viewer !== undefined) { + let data55 = data.viewer; + const _errs129 = errors; + if (errors === _errs129) { + if (Array.isArray(data55)) { + var valid30 = true; + const len9 = data55.length; + for (let i9 = 0; i9 < len9; i9++) { + let data56 = data55[i9]; + const _errs131 = errors; + if (errors === _errs131) { + if ( + data56 && + typeof data56 == 'object' && + !Array.isArray(data56) + ) { + let missing10; + if (data56.url === undefined && (missing10 = 'url')) { + const err90 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + missing10 + "'", + schema: + schema114.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema114.anyOf[3].allOf[0].properties.viewer + .items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } else { + if (data56.url !== undefined) { + let data57 = data56.url; + const _errs133 = errors; + if (errors === _errs133) { + if (errors === _errs133) { + if (typeof data57 === 'string') { + if (!formats0(data57)) { + const err91 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema114.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + } else { + const err92 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema114.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + } + } + } + } + } else { + const err93 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema114.anyOf[3].allOf[0].properties.viewer.items + .type, + parentSchema: + schema114.anyOf[3].allOf[0].properties.viewer.items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + var valid30 = _errs131 === errors; + if (!valid30) { + break; + } + } + } else { + const err94 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema114.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: schema114.anyOf[3].allOf[0].properties.viewer, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid29 = _errs129 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.owner !== undefined) { + let data58 = data.owner; + const _errs135 = errors; + if (errors === _errs135) { + if (Array.isArray(data58)) { + var valid32 = true; + const len10 = data58.length; + for (let i10 = 0; i10 < len10; i10++) { + let data59 = data58[i10]; + const _errs137 = errors; + if (errors === _errs137) { + if ( + data59 && + typeof data59 == 'object' && + !Array.isArray(data59) + ) { + let missing11; + if (data59.url === undefined && (missing11 = 'url')) { + const err95 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema114.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema114.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } else { + if (data59.url !== undefined) { + let data60 = data59.url; + const _errs139 = errors; + if (errors === _errs139) { + if (errors === _errs139) { + if (typeof data60 === 'string') { + if (!formats0(data60)) { + const err96 = { + instancePath: + instancePath + + '/owner/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema114.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } else { + const err97 = { + instancePath: + instancePath + '/owner/' + i10 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema114.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + } + } + } + } + } else { + const err98 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema114.anyOf[3].allOf[0].properties.owner.items + .type, + parentSchema: + schema114.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } + var valid32 = _errs137 === errors; + if (!valid32) { + break; + } + } + } else { + const err99 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema114.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema114.anyOf[3].allOf[0].properties.owner, + data: data58, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + var valid29 = _errs135 === errors; + } else { + var valid29 = true; + } + } + } + } + } + } + } + } else { + const err100 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema114.anyOf[3].allOf[0].type, + parentSchema: schema114.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + } + var valid28 = _errs119 === errors; + if (valid28) { + const _errs141 = errors; + if (errors === _errs141) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data61 = data.type; + const _errs143 = errors; + if ('group' !== data61) { + const err101 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema114.anyOf[3].allOf[1].properties.type, + data: data61, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid34 = _errs143 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data.devices !== undefined) { + let data62 = data.devices; + const _errs144 = errors; + if (errors === _errs144) { + if (Array.isArray(data62)) { + var valid35 = true; + const len11 = data62.length; + for (let i11 = 0; i11 < len11; i11++) { + let data63 = data62[i11]; + const _errs146 = errors; + if (errors === _errs146) { + if ( + data63 && + typeof data63 == 'object' && + !Array.isArray(data63) + ) { + let missing12; + if (data63.url === undefined && (missing12 = 'url')) { + const err102 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: + "must have required property '" + missing12 + "'", + schema: + schema114.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema114.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } else { + if (data63.url !== undefined) { + let data64 = data63.url; + const _errs148 = errors; + if (errors === _errs148) { + if (errors === _errs148) { + if (typeof data64 === 'string') { + if (!formats0(data64)) { + const err103 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema114.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + } else { + const err104 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema114.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema114.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + } + } + } + } + } else { + const err105 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema114.anyOf[3].allOf[1].properties.devices.items.type, + parentSchema: + schema114.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } + } + var valid35 = _errs146 === errors; + if (!valid35) { + break; + } + } + } else { + const err106 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema114.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema114.anyOf[3].allOf[1].properties.devices, + data: data62, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } + var valid34 = _errs144 === errors; + } else { + var valid34 = true; + } + } + } else { + const err107 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema114.anyOf[3].allOf[1].type, + parentSchema: schema114.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + var valid28 = _errs141 === errors; + } + var _valid0 = _errs118 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err108 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema114.anyOf, + parentSchema: schema114, + data, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + validate129.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate129.errors = vErrors; + return errors === 0; +} +exports.validateDeviceUpdateResponse = validate130; +const schema115 = { + title: 'Device Update', + anyOf: [ + { + title: 'Instantiable Cloud Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Concrete Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Instantiable Browser Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Device Group Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + }, + ], + }, + ], + 'x-standalone': true, + 'x-name': 'DeviceUpdateResponse', + 'x-location': '#/components/schemas/device_update_response', + 'x-schema-type': 'response', +}; +function validate130( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema115.anyOf[0].allOf[0].required, + parentSchema: schema115.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs4 = errors; + if (typeof data0 !== 'string') { + const err1 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema115.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema115.anyOf[0].allOf[0].properties.name, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err2 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema115.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema115.anyOf[0].allOf[0].properties.description, + data: data1, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err3 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema115.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema115.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + const err4 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema115.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema115.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema115.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs10 = errors; + if (typeof data3 !== 'boolean') { + const err5 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema115.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema115.anyOf[0].allOf[0].properties.isPublic, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data4)) { + var valid3 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + const err6 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: + schema115.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema115.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + const err7 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema115.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema115.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } + } else { + const err9 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema115.anyOf[0].allOf[0].properties.viewer.items.type, + parentSchema: + schema115.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var valid3 = _errs14 === errors; + if (!valid3) { + break; + } + } + } else { + const err10 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema115.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema115.anyOf[0].allOf[0].properties.viewer, + data: data4, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid5 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + const err11 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema115.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema115.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + const err12 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema115.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } else { + const err13 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema115.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + } + } + } + } + } else { + const err14 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema115.anyOf[0].allOf[0].properties.owner.items.type, + parentSchema: + schema115.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } + var valid5 = _errs20 === errors; + if (!valid5) { + break; + } + } + } else { + const err15 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema115.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema115.anyOf[0].allOf[0].properties.owner, + data: data7, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + var valid2 = _errs18 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } else { + const err16 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema115.anyOf[0].allOf[0].type, + parentSchema: schema115.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs26 = errors; + if ('cloud instantiable' !== data10) { + const err17 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema115.anyOf[0].allOf[1].properties.type, + data: data10, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var valid7 = _errs26 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data11 = data.instantiateUrl; + const _errs27 = errors; + if (errors === _errs27) { + if (errors === _errs27) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + const err18 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema115.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } else { + const err19 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema115.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema115.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + } + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data12)) { + var valid8 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + const err20 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema115.anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema115.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid9 = _errs34 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs36 = errors; + if (typeof data15 !== 'string') { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema115.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err23 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema115.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + const err24 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema115.anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema115.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema115.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err25 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema115.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema115.anyOf[0].allOf[1].properties.services.items, + data: data13, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + var valid8 = _errs31 === errors; + if (!valid8) { + break; + } + } + } else { + const err26 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema115.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema115.anyOf[0].allOf[1].properties.services, + data: data12, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err27 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema115.anyOf[0].allOf[1].type, + parentSchema: schema115.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid1 = _errs24 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs40 = errors; + const _errs41 = errors; + if (errors === _errs41) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if (data.type === undefined && (missing3 = 'type')) { + const err28 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema115.anyOf[1].allOf[0].required, + parentSchema: schema115.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } else { + if (data.name !== undefined) { + let data17 = data.name; + const _errs43 = errors; + if (typeof data17 !== 'string') { + const err29 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema115.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema115.anyOf[1].allOf[0].properties.name, + data: data17, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + var valid11 = _errs43 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data18 = data.description; + const _errs45 = errors; + if (typeof data18 !== 'string') { + const err30 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema115.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema115.anyOf[1].allOf[0].properties.description, + data: data18, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data19 = data.type; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err31 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema115.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema115.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + if ( + !( + data19 === 'device' || + data19 === 'group' || + data19 === 'edge instantiable' || + data19 === 'cloud instantiable' + ) + ) { + const err32 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema115.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema115.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema115.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data20 = data.isPublic; + const _errs49 = errors; + if (typeof data20 !== 'boolean') { + const err33 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema115.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema115.anyOf[1].allOf[0].properties.isPublic, + data: data20, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data21 = data.viewer; + const _errs51 = errors; + if (errors === _errs51) { + if (Array.isArray(data21)) { + var valid12 = true; + const len3 = data21.length; + for (let i3 = 0; i3 < len3; i3++) { + let data22 = data21[i3]; + const _errs53 = errors; + if (errors === _errs53) { + if ( + data22 && + typeof data22 == 'object' && + !Array.isArray(data22) + ) { + let missing4; + if (data22.url === undefined && (missing4 = 'url')) { + const err34 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema115.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema115.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } else { + if (data22.url !== undefined) { + let data23 = data22.url; + const _errs55 = errors; + if (errors === _errs55) { + if (errors === _errs55) { + if (typeof data23 === 'string') { + if (!formats0(data23)) { + const err35 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema115.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } else { + const err36 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[1].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema115.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + } + } + } + } else { + const err37 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema115.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema115.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + var valid12 = _errs53 === errors; + if (!valid12) { + break; + } + } + } else { + const err38 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema115.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema115.anyOf[1].allOf[0].properties.viewer, + data: data21, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data24 = data.owner; + const _errs57 = errors; + if (errors === _errs57) { + if (Array.isArray(data24)) { + var valid14 = true; + const len4 = data24.length; + for (let i4 = 0; i4 < len4; i4++) { + let data25 = data24[i4]; + const _errs59 = errors; + if (errors === _errs59) { + if ( + data25 && + typeof data25 == 'object' && + !Array.isArray(data25) + ) { + let missing5; + if (data25.url === undefined && (missing5 = 'url')) { + const err39 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema115.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema115.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } else { + if (data25.url !== undefined) { + let data26 = data25.url; + const _errs61 = errors; + if (errors === _errs61) { + if (errors === _errs61) { + if (typeof data26 === 'string') { + if (!formats0(data26)) { + const err40 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema115.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } else { + const err41 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[1].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema115.anyOf[1].allOf[0].properties.owner + .items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + } + } + } + } else { + const err42 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema115.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema115.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid14 = _errs59 === errors; + if (!valid14) { + break; + } + } + } else { + const err43 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema115.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema115.anyOf[1].allOf[0].properties.owner, + data: data24, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + } + var valid11 = _errs57 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } else { + const err44 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema115.anyOf[1].allOf[0].type, + parentSchema: schema115.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var valid10 = _errs41 === errors; + if (valid10) { + const _errs63 = errors; + if (errors === _errs63) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data27 = data.type; + const _errs65 = errors; + if ('device' !== data27) { + const err45 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema115.anyOf[1].allOf[1].properties.type, + data: data27, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + var valid16 = _errs65 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data28 = data.experiment; + const _errs66 = errors; + if (errors === _errs66) { + if (errors === _errs66) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err46 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema115.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } else { + const err47 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema115.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema115.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + } + var valid16 = _errs66 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data29 = data.services; + const _errs68 = errors; + if (errors === _errs68) { + if (Array.isArray(data29)) { + var valid17 = true; + const len5 = data29.length; + for (let i5 = 0; i5 < len5; i5++) { + let data30 = data29[i5]; + const _errs70 = errors; + if (errors === _errs70) { + if ( + data30 && + typeof data30 == 'object' && + !Array.isArray(data30) + ) { + if (data30.serviceType !== undefined) { + let data31 = data30.serviceType; + const _errs73 = errors; + if (errors === _errs73) { + if (errors === _errs73) { + if (typeof data31 === 'string') { + if (!formats0(data31)) { + const err48 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema115.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } else { + const err49 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema115.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + } + } + var valid18 = _errs73 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceId !== undefined) { + let data32 = data30.serviceId; + const _errs75 = errors; + if (typeof data32 !== 'string') { + const err50 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[1].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema115.anyOf[1].allOf[1].properties.services.items + .properties.serviceId, + data: data32, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid18 = _errs75 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceDirection !== undefined) { + let data33 = data30.serviceDirection; + const _errs77 = errors; + if (typeof data33 !== 'string') { + const err51 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema115.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + if ( + !( + data33 === 'consumer' || + data33 === 'producer' || + data33 === 'prosumer' + ) + ) { + const err52 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema115.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema115.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema115.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + var valid18 = _errs77 === errors; + } else { + var valid18 = true; + } + } + } + } else { + const err53 = { + instancePath: instancePath + '/services/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema115.anyOf[1].allOf[1].properties.services.items.type, + parentSchema: + schema115.anyOf[1].allOf[1].properties.services.items, + data: data30, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + var valid17 = _errs70 === errors; + if (!valid17) { + break; + } + } + } else { + const err54 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema115.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema115.anyOf[1].allOf[1].properties.services, + data: data29, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + var valid16 = _errs68 === errors; + } else { + var valid16 = true; + } + } + } + } else { + const err55 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema115.anyOf[1].allOf[1].type, + parentSchema: schema115.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid10 = _errs63 === errors; + } + var _valid0 = _errs40 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs79 = errors; + const _errs80 = errors; + if (errors === _errs80) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if (data.type === undefined && (missing6 = 'type')) { + const err56 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema115.anyOf[2].allOf[0].required, + parentSchema: schema115.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } else { + if (data.name !== undefined) { + let data34 = data.name; + const _errs82 = errors; + if (typeof data34 !== 'string') { + const err57 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema115.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema115.anyOf[2].allOf[0].properties.name, + data: data34, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + var valid20 = _errs82 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.description !== undefined) { + let data35 = data.description; + const _errs84 = errors; + if (typeof data35 !== 'string') { + const err58 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema115.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema115.anyOf[2].allOf[0].properties.description, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + var valid20 = _errs84 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.type !== undefined) { + let data36 = data.type; + const _errs86 = errors; + if (typeof data36 !== 'string') { + const err59 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema115.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema115.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + if ( + !( + data36 === 'device' || + data36 === 'group' || + data36 === 'edge instantiable' || + data36 === 'cloud instantiable' + ) + ) { + const err60 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema115.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema115.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema115.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + var valid20 = _errs86 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.isPublic !== undefined) { + let data37 = data.isPublic; + const _errs88 = errors; + if (typeof data37 !== 'boolean') { + const err61 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema115.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema115.anyOf[2].allOf[0].properties.isPublic, + data: data37, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs88 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.viewer !== undefined) { + let data38 = data.viewer; + const _errs90 = errors; + if (errors === _errs90) { + if (Array.isArray(data38)) { + var valid21 = true; + const len6 = data38.length; + for (let i6 = 0; i6 < len6; i6++) { + let data39 = data38[i6]; + const _errs92 = errors; + if (errors === _errs92) { + if ( + data39 && + typeof data39 == 'object' && + !Array.isArray(data39) + ) { + let missing7; + if (data39.url === undefined && (missing7 = 'url')) { + const err62 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema115.anyOf[2].allOf[0].properties.viewer.items + .required, + parentSchema: + schema115.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } else { + if (data39.url !== undefined) { + let data40 = data39.url; + const _errs94 = errors; + if (errors === _errs94) { + if (errors === _errs94) { + if (typeof data40 === 'string') { + if (!formats0(data40)) { + const err63 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema115.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + } else { + const err64 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema115.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + } + } + } + } else { + const err65 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema115.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema115.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid21 = _errs92 === errors; + if (!valid21) { + break; + } + } + } else { + const err66 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema115.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema115.anyOf[2].allOf[0].properties.viewer, + data: data38, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid20 = _errs90 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.owner !== undefined) { + let data41 = data.owner; + const _errs96 = errors; + if (errors === _errs96) { + if (Array.isArray(data41)) { + var valid23 = true; + const len7 = data41.length; + for (let i7 = 0; i7 < len7; i7++) { + let data42 = data41[i7]; + const _errs98 = errors; + if (errors === _errs98) { + if ( + data42 && + typeof data42 == 'object' && + !Array.isArray(data42) + ) { + let missing8; + if (data42.url === undefined && (missing8 = 'url')) { + const err67 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + missing8 + "'", + schema: + schema115.anyOf[2].allOf[0].properties.owner.items + .required, + parentSchema: + schema115.anyOf[2].allOf[0].properties.owner + .items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data42.url !== undefined) { + let data43 = data42.url; + const _errs100 = errors; + if (errors === _errs100) { + if (errors === _errs100) { + if (typeof data43 === 'string') { + if (!formats0(data43)) { + const err68 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema115.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema115.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + } + } + } else { + const err70 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema115.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema115.anyOf[2].allOf[0].properties.owner.items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + } + var valid23 = _errs98 === errors; + if (!valid23) { + break; + } + } + } else { + const err71 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema115.anyOf[2].allOf[0].properties.owner.type, + parentSchema: schema115.anyOf[2].allOf[0].properties.owner, + data: data41, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + } + var valid20 = _errs96 === errors; + } else { + var valid20 = true; + } + } + } + } + } + } + } + } else { + const err72 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema115.anyOf[2].allOf[0].type, + parentSchema: schema115.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + var valid19 = _errs80 === errors; + if (valid19) { + const _errs102 = errors; + if (errors === _errs102) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs104 = errors; + if ('edge instantiable' !== data44) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema115.anyOf[2].allOf[1].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid25 = _errs104 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.codeUrl !== undefined) { + let data45 = data.codeUrl; + const _errs105 = errors; + if (errors === _errs105) { + if (errors === _errs105) { + if (typeof data45 === 'string') { + if (!formats0(data45)) { + const err74 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema115.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } else { + const err75 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema115.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema115.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + } + var valid25 = _errs105 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.services !== undefined) { + let data46 = data.services; + const _errs107 = errors; + if (errors === _errs107) { + if (Array.isArray(data46)) { + var valid26 = true; + const len8 = data46.length; + for (let i8 = 0; i8 < len8; i8++) { + let data47 = data46[i8]; + const _errs109 = errors; + if (errors === _errs109) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + if (data47.serviceType !== undefined) { + let data48 = data47.serviceType; + const _errs112 = errors; + if (errors === _errs112) { + if (errors === _errs112) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema115.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema115.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + var valid27 = _errs112 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceId !== undefined) { + let data49 = data47.serviceId; + const _errs114 = errors; + if (typeof data49 !== 'string') { + const err78 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[2].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema115.anyOf[2].allOf[1].properties.services + .items.properties.serviceId, + data: data49, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + var valid27 = _errs114 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceDirection !== undefined) { + let data50 = data47.serviceDirection; + const _errs116 = errors; + if (typeof data50 !== 'string') { + const err79 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema115.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + if ( + !( + data50 === 'consumer' || + data50 === 'producer' || + data50 === 'prosumer' + ) + ) { + const err80 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema115.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema115.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema115.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + var valid27 = _errs116 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err81 = { + instancePath: instancePath + '/services/' + i8, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema115.anyOf[2].allOf[1].properties.services.items + .type, + parentSchema: + schema115.anyOf[2].allOf[1].properties.services.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + var valid26 = _errs109 === errors; + if (!valid26) { + break; + } + } + } else { + const err82 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema115.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema115.anyOf[2].allOf[1].properties.services, + data: data46, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + var valid25 = _errs107 === errors; + } else { + var valid25 = true; + } + } + } + } else { + const err83 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema115.anyOf[2].allOf[1].type, + parentSchema: schema115.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid19 = _errs102 === errors; + } + var _valid0 = _errs79 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs118 = errors; + const _errs119 = errors; + if (errors === _errs119) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if (data.type === undefined && (missing9 = 'type')) { + const err84 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema115.anyOf[3].allOf[0].required, + parentSchema: schema115.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } else { + if (data.name !== undefined) { + let data51 = data.name; + const _errs121 = errors; + if (typeof data51 !== 'string') { + const err85 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema115.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema115.anyOf[3].allOf[0].properties.name, + data: data51, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + var valid29 = _errs121 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.description !== undefined) { + let data52 = data.description; + const _errs123 = errors; + if (typeof data52 !== 'string') { + const err86 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema115.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema115.anyOf[3].allOf[0].properties.description, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid29 = _errs123 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.type !== undefined) { + let data53 = data.type; + const _errs125 = errors; + if (typeof data53 !== 'string') { + const err87 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema115.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema115.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + if ( + !( + data53 === 'device' || + data53 === 'group' || + data53 === 'edge instantiable' || + data53 === 'cloud instantiable' + ) + ) { + const err88 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema115.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema115.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema115.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + var valid29 = _errs125 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.isPublic !== undefined) { + let data54 = data.isPublic; + const _errs127 = errors; + if (typeof data54 !== 'boolean') { + const err89 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema115.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema115.anyOf[3].allOf[0].properties.isPublic, + data: data54, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + var valid29 = _errs127 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.viewer !== undefined) { + let data55 = data.viewer; + const _errs129 = errors; + if (errors === _errs129) { + if (Array.isArray(data55)) { + var valid30 = true; + const len9 = data55.length; + for (let i9 = 0; i9 < len9; i9++) { + let data56 = data55[i9]; + const _errs131 = errors; + if (errors === _errs131) { + if ( + data56 && + typeof data56 == 'object' && + !Array.isArray(data56) + ) { + let missing10; + if (data56.url === undefined && (missing10 = 'url')) { + const err90 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + missing10 + "'", + schema: + schema115.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema115.anyOf[3].allOf[0].properties.viewer + .items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } else { + if (data56.url !== undefined) { + let data57 = data56.url; + const _errs133 = errors; + if (errors === _errs133) { + if (errors === _errs133) { + if (typeof data57 === 'string') { + if (!formats0(data57)) { + const err91 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema115.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + } else { + const err92 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema115.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + } + } + } + } + } else { + const err93 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema115.anyOf[3].allOf[0].properties.viewer.items + .type, + parentSchema: + schema115.anyOf[3].allOf[0].properties.viewer.items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + var valid30 = _errs131 === errors; + if (!valid30) { + break; + } + } + } else { + const err94 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema115.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: schema115.anyOf[3].allOf[0].properties.viewer, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid29 = _errs129 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.owner !== undefined) { + let data58 = data.owner; + const _errs135 = errors; + if (errors === _errs135) { + if (Array.isArray(data58)) { + var valid32 = true; + const len10 = data58.length; + for (let i10 = 0; i10 < len10; i10++) { + let data59 = data58[i10]; + const _errs137 = errors; + if (errors === _errs137) { + if ( + data59 && + typeof data59 == 'object' && + !Array.isArray(data59) + ) { + let missing11; + if (data59.url === undefined && (missing11 = 'url')) { + const err95 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema115.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema115.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } else { + if (data59.url !== undefined) { + let data60 = data59.url; + const _errs139 = errors; + if (errors === _errs139) { + if (errors === _errs139) { + if (typeof data60 === 'string') { + if (!formats0(data60)) { + const err96 = { + instancePath: + instancePath + + '/owner/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema115.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } else { + const err97 = { + instancePath: + instancePath + '/owner/' + i10 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema115.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + } + } + } + } + } else { + const err98 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema115.anyOf[3].allOf[0].properties.owner.items + .type, + parentSchema: + schema115.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } + var valid32 = _errs137 === errors; + if (!valid32) { + break; + } + } + } else { + const err99 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema115.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema115.anyOf[3].allOf[0].properties.owner, + data: data58, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + var valid29 = _errs135 === errors; + } else { + var valid29 = true; + } + } + } + } + } + } + } + } else { + const err100 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema115.anyOf[3].allOf[0].type, + parentSchema: schema115.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + } + var valid28 = _errs119 === errors; + if (valid28) { + const _errs141 = errors; + if (errors === _errs141) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data61 = data.type; + const _errs143 = errors; + if ('group' !== data61) { + const err101 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema115.anyOf[3].allOf[1].properties.type, + data: data61, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid34 = _errs143 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data.devices !== undefined) { + let data62 = data.devices; + const _errs144 = errors; + if (errors === _errs144) { + if (Array.isArray(data62)) { + var valid35 = true; + const len11 = data62.length; + for (let i11 = 0; i11 < len11; i11++) { + let data63 = data62[i11]; + const _errs146 = errors; + if (errors === _errs146) { + if ( + data63 && + typeof data63 == 'object' && + !Array.isArray(data63) + ) { + let missing12; + if (data63.url === undefined && (missing12 = 'url')) { + const err102 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: + "must have required property '" + missing12 + "'", + schema: + schema115.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema115.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } else { + if (data63.url !== undefined) { + let data64 = data63.url; + const _errs148 = errors; + if (errors === _errs148) { + if (errors === _errs148) { + if (typeof data64 === 'string') { + if (!formats0(data64)) { + const err103 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema115.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + } else { + const err104 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema115.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema115.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + } + } + } + } + } else { + const err105 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema115.anyOf[3].allOf[1].properties.devices.items.type, + parentSchema: + schema115.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } + } + var valid35 = _errs146 === errors; + if (!valid35) { + break; + } + } + } else { + const err106 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema115.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema115.anyOf[3].allOf[1].properties.devices, + data: data62, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } + var valid34 = _errs144 === errors; + } else { + var valid34 = true; + } + } + } else { + const err107 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema115.anyOf[3].allOf[1].type, + parentSchema: schema115.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + var valid28 = _errs141 === errors; + } + var _valid0 = _errs118 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err108 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema115.anyOf, + parentSchema: schema115, + data, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + validate130.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate130.errors = vErrors; + return errors === 0; +} +exports.validateAvailabilityRuleRequest = validate131; +const schema116 = { + title: 'Availability Rule', + type: 'object', + allOf: [ + { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + { + type: 'object', + properties: { + available: { type: 'boolean' }, + repeat: { + description: + 'If specified the time slot is repeated in a fixed offset specified by the frequency', + type: 'object', + properties: { + frequency: { type: 'string', enum: ['HOURLY', 'DAILY', 'WEEKLY'] }, + until: { + description: 'Up to this date-time the time slot will be repeated.', + type: 'string', + format: 'date-time', + }, + count: { + description: 'How often the time slot will be repeated', + type: 'integer', + }, + }, + required: ['frequency'], + }, + }, + }, + ], + 'x-standalone': true, + 'x-name': 'AvailabilityRuleRequest', + 'x-location': '#/components/schemas/availability_rule_request', + 'x-schema-type': 'request', +}; +function validate131( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (!(data && typeof data == 'object' && !Array.isArray(data))) { + validate131.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema116.type, + parentSchema: schema116, + data, + }, + ]; + return false; + } + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.start !== undefined) { + let data0 = data.start; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data0 === 'string') { + if (!formats22.validate(data0)) { + validate131.errors = [ + { + instancePath: instancePath + '/start', + schemaPath: '#/allOf/0/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema116.allOf[0].properties.start, + data: data0, + }, + ]; + return false; + } + } else { + validate131.errors = [ + { + instancePath: instancePath + '/start', + schemaPath: '#/allOf/0/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema116.allOf[0].properties.start.type, + parentSchema: schema116.allOf[0].properties.start, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.end !== undefined) { + let data1 = data.end; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate131.errors = [ + { + instancePath: instancePath + '/end', + schemaPath: '#/allOf/0/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema116.allOf[0].properties.end, + data: data1, + }, + ]; + return false; + } + } else { + validate131.errors = [ + { + instancePath: instancePath + '/end', + schemaPath: '#/allOf/0/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema116.allOf[0].properties.end.type, + parentSchema: schema116.allOf[0].properties.end, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + validate131.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema116.allOf[0].type, + parentSchema: schema116.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (valid0) { + const _errs7 = errors; + if (errors === _errs7) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.available !== undefined) { + let data2 = data.available; + const _errs9 = errors; + if (typeof data2 !== 'boolean') { + validate131.errors = [ + { + instancePath: instancePath + '/available', + schemaPath: '#/allOf/1/properties/available/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema116.allOf[1].properties.available.type, + parentSchema: schema116.allOf[1].properties.available, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs9 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.repeat !== undefined) { + let data3 = data.repeat; + const _errs11 = errors; + if (errors === _errs11) { + if (data3 && typeof data3 == 'object' && !Array.isArray(data3)) { + let missing0; + if (data3.frequency === undefined && (missing0 = 'frequency')) { + validate131.errors = [ + { + instancePath: instancePath + '/repeat', + schemaPath: '#/allOf/1/properties/repeat/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema116.allOf[1].properties.repeat.required, + parentSchema: schema116.allOf[1].properties.repeat, + data: data3, + }, + ]; + return false; + } else { + if (data3.frequency !== undefined) { + let data4 = data3.frequency; + const _errs13 = errors; + if (typeof data4 !== 'string') { + validate131.errors = [ + { + instancePath: instancePath + '/repeat/frequency', + schemaPath: + '#/allOf/1/properties/repeat/properties/frequency/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema116.allOf[1].properties.repeat.properties.frequency + .type, + parentSchema: + schema116.allOf[1].properties.repeat.properties.frequency, + data: data4, + }, + ]; + return false; + } + if ( + !(data4 === 'HOURLY' || data4 === 'DAILY' || data4 === 'WEEKLY') + ) { + validate131.errors = [ + { + instancePath: instancePath + '/repeat/frequency', + schemaPath: + '#/allOf/1/properties/repeat/properties/frequency/enum', + keyword: 'enum', + params: { + allowedValues: + schema116.allOf[1].properties.repeat.properties.frequency + .enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema116.allOf[1].properties.repeat.properties.frequency + .enum, + parentSchema: + schema116.allOf[1].properties.repeat.properties.frequency, + data: data4, + }, + ]; + return false; + } + var valid3 = _errs13 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.until !== undefined) { + let data5 = data3.until; + const _errs15 = errors; + if (errors === _errs15) { + if (errors === _errs15) { + if (typeof data5 === 'string') { + if (!formats22.validate(data5)) { + validate131.errors = [ + { + instancePath: instancePath + '/repeat/until', + schemaPath: + '#/allOf/1/properties/repeat/properties/until/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema116.allOf[1].properties.repeat.properties.until, + data: data5, + }, + ]; + return false; + } + } else { + validate131.errors = [ + { + instancePath: instancePath + '/repeat/until', + schemaPath: + '#/allOf/1/properties/repeat/properties/until/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema116.allOf[1].properties.repeat.properties.until + .type, + parentSchema: + schema116.allOf[1].properties.repeat.properties.until, + data: data5, + }, + ]; + return false; + } + } + } + var valid3 = _errs15 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.count !== undefined) { + let data6 = data3.count; + const _errs17 = errors; + if ( + !( + typeof data6 == 'number' && + !(data6 % 1) && + !isNaN(data6) && + isFinite(data6) + ) + ) { + validate131.errors = [ + { + instancePath: instancePath + '/repeat/count', + schemaPath: + '#/allOf/1/properties/repeat/properties/count/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + schema: + schema116.allOf[1].properties.repeat.properties.count + .type, + parentSchema: + schema116.allOf[1].properties.repeat.properties.count, + data: data6, + }, + ]; + return false; + } + var valid3 = _errs17 === errors; + } else { + var valid3 = true; + } + } + } + } + } else { + validate131.errors = [ + { + instancePath: instancePath + '/repeat', + schemaPath: '#/allOf/1/properties/repeat/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema116.allOf[1].properties.repeat.type, + parentSchema: schema116.allOf[1].properties.repeat, + data: data3, + }, + ]; + return false; + } + } + var valid2 = _errs11 === errors; + } else { + var valid2 = true; + } + } + } else { + validate131.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema116.allOf[1].type, + parentSchema: schema116.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs7 === errors; + } + validate131.errors = vErrors; + return errors === 0; +} +exports.validateAvailabilityRuleResponse = validate132; +const schema117 = { + title: 'Availability Rule', + type: 'object', + allOf: [ + { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + { + type: 'object', + properties: { + available: { type: 'boolean' }, + repeat: { + description: + 'If specified the time slot is repeated in a fixed offset specified by the frequency', + type: 'object', + properties: { + frequency: { type: 'string', enum: ['HOURLY', 'DAILY', 'WEEKLY'] }, + until: { + description: 'Up to this date-time the time slot will be repeated.', + type: 'string', + format: 'date-time', + }, + count: { + description: 'How often the time slot will be repeated', + type: 'integer', + }, + }, + required: ['frequency'], + }, + }, + }, + ], + 'x-standalone': true, + 'x-name': 'AvailabilityRuleResponse', + 'x-location': '#/components/schemas/availability_rule_response', + 'x-schema-type': 'response', +}; +function validate132( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (!(data && typeof data == 'object' && !Array.isArray(data))) { + validate132.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema117.type, + parentSchema: schema117, + data, + }, + ]; + return false; + } + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.start !== undefined) { + let data0 = data.start; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data0 === 'string') { + if (!formats22.validate(data0)) { + validate132.errors = [ + { + instancePath: instancePath + '/start', + schemaPath: '#/allOf/0/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema117.allOf[0].properties.start, + data: data0, + }, + ]; + return false; + } + } else { + validate132.errors = [ + { + instancePath: instancePath + '/start', + schemaPath: '#/allOf/0/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema117.allOf[0].properties.start.type, + parentSchema: schema117.allOf[0].properties.start, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.end !== undefined) { + let data1 = data.end; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate132.errors = [ + { + instancePath: instancePath + '/end', + schemaPath: '#/allOf/0/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema117.allOf[0].properties.end, + data: data1, + }, + ]; + return false; + } + } else { + validate132.errors = [ + { + instancePath: instancePath + '/end', + schemaPath: '#/allOf/0/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema117.allOf[0].properties.end.type, + parentSchema: schema117.allOf[0].properties.end, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + validate132.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema117.allOf[0].type, + parentSchema: schema117.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (valid0) { + const _errs7 = errors; + if (errors === _errs7) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.available !== undefined) { + let data2 = data.available; + const _errs9 = errors; + if (typeof data2 !== 'boolean') { + validate132.errors = [ + { + instancePath: instancePath + '/available', + schemaPath: '#/allOf/1/properties/available/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema117.allOf[1].properties.available.type, + parentSchema: schema117.allOf[1].properties.available, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs9 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.repeat !== undefined) { + let data3 = data.repeat; + const _errs11 = errors; + if (errors === _errs11) { + if (data3 && typeof data3 == 'object' && !Array.isArray(data3)) { + let missing0; + if (data3.frequency === undefined && (missing0 = 'frequency')) { + validate132.errors = [ + { + instancePath: instancePath + '/repeat', + schemaPath: '#/allOf/1/properties/repeat/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema117.allOf[1].properties.repeat.required, + parentSchema: schema117.allOf[1].properties.repeat, + data: data3, + }, + ]; + return false; + } else { + if (data3.frequency !== undefined) { + let data4 = data3.frequency; + const _errs13 = errors; + if (typeof data4 !== 'string') { + validate132.errors = [ + { + instancePath: instancePath + '/repeat/frequency', + schemaPath: + '#/allOf/1/properties/repeat/properties/frequency/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema117.allOf[1].properties.repeat.properties.frequency + .type, + parentSchema: + schema117.allOf[1].properties.repeat.properties.frequency, + data: data4, + }, + ]; + return false; + } + if ( + !(data4 === 'HOURLY' || data4 === 'DAILY' || data4 === 'WEEKLY') + ) { + validate132.errors = [ + { + instancePath: instancePath + '/repeat/frequency', + schemaPath: + '#/allOf/1/properties/repeat/properties/frequency/enum', + keyword: 'enum', + params: { + allowedValues: + schema117.allOf[1].properties.repeat.properties.frequency + .enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema117.allOf[1].properties.repeat.properties.frequency + .enum, + parentSchema: + schema117.allOf[1].properties.repeat.properties.frequency, + data: data4, + }, + ]; + return false; + } + var valid3 = _errs13 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.until !== undefined) { + let data5 = data3.until; + const _errs15 = errors; + if (errors === _errs15) { + if (errors === _errs15) { + if (typeof data5 === 'string') { + if (!formats22.validate(data5)) { + validate132.errors = [ + { + instancePath: instancePath + '/repeat/until', + schemaPath: + '#/allOf/1/properties/repeat/properties/until/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema117.allOf[1].properties.repeat.properties.until, + data: data5, + }, + ]; + return false; + } + } else { + validate132.errors = [ + { + instancePath: instancePath + '/repeat/until', + schemaPath: + '#/allOf/1/properties/repeat/properties/until/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema117.allOf[1].properties.repeat.properties.until + .type, + parentSchema: + schema117.allOf[1].properties.repeat.properties.until, + data: data5, + }, + ]; + return false; + } + } + } + var valid3 = _errs15 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.count !== undefined) { + let data6 = data3.count; + const _errs17 = errors; + if ( + !( + typeof data6 == 'number' && + !(data6 % 1) && + !isNaN(data6) && + isFinite(data6) + ) + ) { + validate132.errors = [ + { + instancePath: instancePath + '/repeat/count', + schemaPath: + '#/allOf/1/properties/repeat/properties/count/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + schema: + schema117.allOf[1].properties.repeat.properties.count + .type, + parentSchema: + schema117.allOf[1].properties.repeat.properties.count, + data: data6, + }, + ]; + return false; + } + var valid3 = _errs17 === errors; + } else { + var valid3 = true; + } + } + } + } + } else { + validate132.errors = [ + { + instancePath: instancePath + '/repeat', + schemaPath: '#/allOf/1/properties/repeat/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema117.allOf[1].properties.repeat.type, + parentSchema: schema117.allOf[1].properties.repeat, + data: data3, + }, + ]; + return false; + } + } + var valid2 = _errs11 === errors; + } else { + var valid2 = true; + } + } + } else { + validate132.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema117.allOf[1].type, + parentSchema: schema117.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs7 === errors; + } + validate132.errors = vErrors; + return errors === 0; +} +exports.validateMessageRequest = validate133; +const schema118 = { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'MessageRequest', + 'x-location': '#/components/schemas/message_request', + 'x-schema-type': 'request', +}; +function validate133( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate133.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema118.required, + parentSchema: schema118, + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate133.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema118.properties.messageType.type, + parentSchema: schema118.properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate133.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema118.type, + parentSchema: schema118, + data, + }, + ]; + return false; + } + } + validate133.errors = vErrors; + return errors === 0; +} +exports.validateMessageResponse = validate134; +const schema119 = { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'MessageResponse', + 'x-location': '#/components/schemas/message_response', + 'x-schema-type': 'response', +}; +function validate134( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate134.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema119.required, + parentSchema: schema119, + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate134.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema119.properties.messageType.type, + parentSchema: schema119.properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate134.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema119.type, + parentSchema: schema119, + data, + }, + ]; + return false; + } + } + validate134.errors = vErrors; + return errors === 0; +} +exports.validateCommandMessageRequest = validate135; +const schema120 = { + title: 'Command Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { messageType: { const: 'command' }, command: { type: 'string' } }, + required: ['messageType', 'command'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'CommandMessageRequest', + 'x-location': '#/components/schemas/command_message_request', + 'x-schema-type': 'request', +}; +function validate135( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate135.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema120.allOf[0].required, + parentSchema: schema120.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate135.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema120.allOf[0].properties.messageType.type, + parentSchema: schema120.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate135.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema120.allOf[0].type, + parentSchema: schema120.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.command === undefined && (missing1 = 'command')) + ) { + validate135.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema120.allOf[1].required, + parentSchema: schema120.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('command' !== data1) { + validate135.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'command' }, + message: 'must be equal to constant', + schema: 'command', + parentSchema: schema120.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.command !== undefined) { + let data2 = data.command; + const _errs8 = errors; + if (typeof data2 !== 'string') { + validate135.errors = [ + { + instancePath: instancePath + '/command', + schemaPath: '#/allOf/1/properties/command/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema120.allOf[1].properties.command.type, + parentSchema: schema120.allOf[1].properties.command, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate135.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema120.allOf[1].type, + parentSchema: schema120.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate135.errors = vErrors; + return errors === 0; +} +exports.validateCommandMessageResponse = validate136; +const schema121 = { + title: 'Command Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { messageType: { const: 'command' }, command: { type: 'string' } }, + required: ['messageType', 'command'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'CommandMessageResponse', + 'x-location': '#/components/schemas/command_message_response', + 'x-schema-type': 'response', +}; +function validate136( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate136.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema121.allOf[0].required, + parentSchema: schema121.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate136.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema121.allOf[0].properties.messageType.type, + parentSchema: schema121.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate136.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema121.allOf[0].type, + parentSchema: schema121.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.command === undefined && (missing1 = 'command')) + ) { + validate136.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema121.allOf[1].required, + parentSchema: schema121.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('command' !== data1) { + validate136.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'command' }, + message: 'must be equal to constant', + schema: 'command', + parentSchema: schema121.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.command !== undefined) { + let data2 = data.command; + const _errs8 = errors; + if (typeof data2 !== 'string') { + validate136.errors = [ + { + instancePath: instancePath + '/command', + schemaPath: '#/allOf/1/properties/command/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema121.allOf[1].properties.command.type, + parentSchema: schema121.allOf[1].properties.command, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate136.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema121.allOf[1].type, + parentSchema: schema121.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate136.errors = vErrors; + return errors === 0; +} +exports.validateServiceConfigRequest = validate137; +const schema122 = { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + 'x-standalone': true, + 'x-name': 'ServiceConfigRequest', + 'x-location': '#/components/schemas/service_config_request', + 'x-schema-type': 'request', +}; +function validate137( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.serviceType === undefined && (missing0 = 'serviceType')) || + (data.serviceId === undefined && (missing0 = 'serviceId')) || + (data.remoteServiceId === undefined && (missing0 = 'remoteServiceId')) + ) { + validate137.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema122.required, + parentSchema: schema122, + data, + }, + ]; + return false; + } else { + if (data.serviceType !== undefined) { + let data0 = data.serviceType; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate137.errors = [ + { + instancePath: instancePath + '/serviceType', + schemaPath: '#/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema122.properties.serviceType, + data: data0, + }, + ]; + return false; + } + } else { + validate137.errors = [ + { + instancePath: instancePath + '/serviceType', + schemaPath: '#/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema122.properties.serviceType.type, + parentSchema: schema122.properties.serviceType, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs2 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.serviceId !== undefined) { + let data1 = data.serviceId; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate137.errors = [ + { + instancePath: instancePath + '/serviceId', + schemaPath: '#/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema122.properties.serviceId.type, + parentSchema: schema122.properties.serviceId, + data: data1, + }, + ]; + return false; + } + var valid0 = _errs4 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.remoteServiceId !== undefined) { + let data2 = data.remoteServiceId; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate137.errors = [ + { + instancePath: instancePath + '/remoteServiceId', + schemaPath: '#/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema122.properties.remoteServiceId.type, + parentSchema: schema122.properties.remoteServiceId, + data: data2, + }, + ]; + return false; + } + var valid0 = _errs6 === errors; + } else { + var valid0 = true; + } + } + } + } + } else { + validate137.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema122.type, + parentSchema: schema122, + data, + }, + ]; + return false; + } + } + validate137.errors = vErrors; + return errors === 0; +} +exports.validateServiceConfigResponse = validate138; +const schema123 = { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + 'x-standalone': true, + 'x-name': 'ServiceConfigResponse', + 'x-location': '#/components/schemas/service_config_response', + 'x-schema-type': 'response', +}; +function validate138( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.serviceType === undefined && (missing0 = 'serviceType')) || + (data.serviceId === undefined && (missing0 = 'serviceId')) || + (data.remoteServiceId === undefined && (missing0 = 'remoteServiceId')) + ) { + validate138.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema123.required, + parentSchema: schema123, + data, + }, + ]; + return false; + } else { + if (data.serviceType !== undefined) { + let data0 = data.serviceType; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate138.errors = [ + { + instancePath: instancePath + '/serviceType', + schemaPath: '#/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema123.properties.serviceType, + data: data0, + }, + ]; + return false; + } + } else { + validate138.errors = [ + { + instancePath: instancePath + '/serviceType', + schemaPath: '#/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema123.properties.serviceType.type, + parentSchema: schema123.properties.serviceType, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs2 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.serviceId !== undefined) { + let data1 = data.serviceId; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate138.errors = [ + { + instancePath: instancePath + '/serviceId', + schemaPath: '#/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema123.properties.serviceId.type, + parentSchema: schema123.properties.serviceId, + data: data1, + }, + ]; + return false; + } + var valid0 = _errs4 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.remoteServiceId !== undefined) { + let data2 = data.remoteServiceId; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate138.errors = [ + { + instancePath: instancePath + '/remoteServiceId', + schemaPath: '#/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema123.properties.remoteServiceId.type, + parentSchema: schema123.properties.remoteServiceId, + data: data2, + }, + ]; + return false; + } + var valid0 = _errs6 === errors; + } else { + var valid0 = true; + } + } + } + } + } else { + validate138.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema123.type, + parentSchema: schema123, + data, + }, + ]; + return false; + } + } + validate138.errors = vErrors; + return errors === 0; +} +exports.validateCreatePeerconnectionMessageRequest = validate139; +const schema124 = { + title: 'Create Peerconnection Message', + allOf: [ + { + title: 'Command Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { messageType: { const: 'command' }, command: { type: 'string' } }, + required: ['messageType', 'command'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + command: { const: 'createPeerconnection' }, + connectionType: { type: 'string', enum: ['webrtc', 'websocket', 'local'] }, + connectionUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + type: 'object', + required: ['serviceType', 'serviceId', 'remoteServiceId'], + title: 'Service Config', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + additionalProperties: true, + }, + }, + tiebreaker: { type: 'boolean' }, + config: { type: 'object', additionalProperties: true }, + }, + required: ['command', 'connectionType', 'connectionUrl', 'services', 'tiebreaker'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'CreatePeerconnectionMessageRequest', + 'x-location': '#/components/schemas/create_peerconnection_message_request', + 'x-schema-type': 'request', +}; +function validate139( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate139.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema124.allOf[0].allOf[0].required, + parentSchema: schema124.allOf[0].allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate139.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema124.allOf[0].allOf[0].properties.messageType.type, + parentSchema: schema124.allOf[0].allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate139.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema124.allOf[0].allOf[0].type, + parentSchema: schema124.allOf[0].allOf[0], + data, + }, + ]; + return false; + } + } + var valid1 = _errs1 === errors; + if (valid1) { + const _errs6 = errors; + if (errors === _errs6) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.command === undefined && (missing1 = 'command')) + ) { + validate139.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema124.allOf[0].allOf[1].required, + parentSchema: schema124.allOf[0].allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs8 = errors; + if ('command' !== data1) { + validate139.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'command' }, + message: 'must be equal to constant', + schema: 'command', + parentSchema: schema124.allOf[0].allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid3 = _errs8 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data.command !== undefined) { + let data2 = data.command; + const _errs9 = errors; + if (typeof data2 !== 'string') { + validate139.errors = [ + { + instancePath: instancePath + '/command', + schemaPath: '#/allOf/0/allOf/1/properties/command/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema124.allOf[0].allOf[1].properties.command.type, + parentSchema: schema124.allOf[0].allOf[1].properties.command, + data: data2, + }, + ]; + return false; + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate139.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema124.allOf[0].allOf[1].type, + parentSchema: schema124.allOf[0].allOf[1], + data, + }, + ]; + return false; + } + } + var valid1 = _errs6 === errors; + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.command === undefined && (missing2 = 'command')) || + (data.connectionType === undefined && (missing2 = 'connectionType')) || + (data.connectionUrl === undefined && (missing2 = 'connectionUrl')) || + (data.services === undefined && (missing2 = 'services')) || + (data.tiebreaker === undefined && (missing2 = 'tiebreaker')) + ) { + validate139.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema124.allOf[1].required, + parentSchema: schema124.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.command !== undefined) { + let data3 = data.command; + const _errs13 = errors; + if ('createPeerconnection' !== data3) { + validate139.errors = [ + { + instancePath: instancePath + '/command', + schemaPath: '#/allOf/1/properties/command/const', + keyword: 'const', + params: { allowedValue: 'createPeerconnection' }, + message: 'must be equal to constant', + schema: 'createPeerconnection', + parentSchema: schema124.allOf[1].properties.command, + data: data3, + }, + ]; + return false; + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.connectionType !== undefined) { + let data4 = data.connectionType; + const _errs14 = errors; + if (typeof data4 !== 'string') { + validate139.errors = [ + { + instancePath: instancePath + '/connectionType', + schemaPath: '#/allOf/1/properties/connectionType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema124.allOf[1].properties.connectionType.type, + parentSchema: schema124.allOf[1].properties.connectionType, + data: data4, + }, + ]; + return false; + } + if (!(data4 === 'webrtc' || data4 === 'websocket' || data4 === 'local')) { + validate139.errors = [ + { + instancePath: instancePath + '/connectionType', + schemaPath: '#/allOf/1/properties/connectionType/enum', + keyword: 'enum', + params: { + allowedValues: schema124.allOf[1].properties.connectionType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema124.allOf[1].properties.connectionType.enum, + parentSchema: schema124.allOf[1].properties.connectionType, + data: data4, + }, + ]; + return false; + } + var valid4 = _errs14 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.connectionUrl !== undefined) { + let data5 = data.connectionUrl; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate139.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema124.allOf[1].properties.connectionUrl, + data: data5, + }, + ]; + return false; + } + } else { + validate139.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema124.allOf[1].properties.connectionUrl.type, + parentSchema: schema124.allOf[1].properties.connectionUrl, + data: data5, + }, + ]; + return false; + } + } + } + var valid4 = _errs16 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.services !== undefined) { + let data6 = data.services; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data6)) { + var valid5 = true; + const len0 = data6.length; + for (let i0 = 0; i0 < len0; i0++) { + let data7 = data6[i0]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing3; + if ( + (data7.serviceType === undefined && + (missing3 = 'serviceType')) || + (data7.serviceId === undefined && + (missing3 = 'serviceId')) || + (data7.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate139.errors = [ + { + instancePath: instancePath + '/services/' + i0, + schemaPath: + '#/allOf/1/properties/services/items/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: + "must have required property '" + missing3 + "'", + schema: + schema124.allOf[1].properties.services.items.required, + parentSchema: + schema124.allOf[1].properties.services.items, + data: data7, + }, + ]; + return false; + } else { + if (data7.serviceType !== undefined) { + let data8 = data7.serviceType; + const _errs23 = errors; + if (errors === _errs23) { + if (errors === _errs23) { + if (typeof data8 === 'string') { + if (!formats0(data8)) { + validate139.errors = [ + { + instancePath: + instancePath + + '/services/' + + i0 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema124.allOf[1].properties.services.items + .properties.serviceType, + data: data8, + }, + ]; + return false; + } + } else { + validate139.errors = [ + { + instancePath: + instancePath + + '/services/' + + i0 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema124.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema124.allOf[1].properties.services.items + .properties.serviceType, + data: data8, + }, + ]; + return false; + } + } + } + var valid6 = _errs23 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data7.serviceId !== undefined) { + let data9 = data7.serviceId; + const _errs25 = errors; + if (typeof data9 !== 'string') { + validate139.errors = [ + { + instancePath: + instancePath + '/services/' + i0 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema124.allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema124.allOf[1].properties.services.items + .properties.serviceId, + data: data9, + }, + ]; + return false; + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data7.remoteServiceId !== undefined) { + let data10 = data7.remoteServiceId; + const _errs27 = errors; + if (typeof data10 !== 'string') { + validate139.errors = [ + { + instancePath: + instancePath + + '/services/' + + i0 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema124.allOf[1].properties.services.items + .properties.remoteServiceId.type, + parentSchema: + schema124.allOf[1].properties.services.items + .properties.remoteServiceId, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + } + } + } + } else { + validate139.errors = [ + { + instancePath: instancePath + '/services/' + i0, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema124.allOf[1].properties.services.items.type, + parentSchema: + schema124.allOf[1].properties.services.items, + data: data7, + }, + ]; + return false; + } + } + var valid5 = _errs20 === errors; + if (!valid5) { + break; + } + } + } else { + validate139.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema124.allOf[1].properties.services.type, + parentSchema: schema124.allOf[1].properties.services, + data: data6, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.tiebreaker !== undefined) { + let data11 = data.tiebreaker; + const _errs29 = errors; + if (typeof data11 !== 'boolean') { + validate139.errors = [ + { + instancePath: instancePath + '/tiebreaker', + schemaPath: '#/allOf/1/properties/tiebreaker/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema124.allOf[1].properties.tiebreaker.type, + parentSchema: schema124.allOf[1].properties.tiebreaker, + data: data11, + }, + ]; + return false; + } + var valid4 = _errs29 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.config !== undefined) { + let data12 = data.config; + const _errs31 = errors; + if (errors === _errs31) { + if ( + data12 && + typeof data12 == 'object' && + !Array.isArray(data12) + ) { + } else { + validate139.errors = [ + { + instancePath: instancePath + '/config', + schemaPath: '#/allOf/1/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema124.allOf[1].properties.config.type, + parentSchema: schema124.allOf[1].properties.config, + data: data12, + }, + ]; + return false; + } + } + var valid4 = _errs31 === errors; + } else { + var valid4 = true; + } + } + } + } + } + } + } + } else { + validate139.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema124.allOf[1].type, + parentSchema: schema124.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } + validate139.errors = vErrors; + return errors === 0; +} +exports.validateCreatePeerconnectionMessageResponse = validate140; +const schema125 = { + title: 'Create Peerconnection Message', + allOf: [ + { + title: 'Command Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { messageType: { const: 'command' }, command: { type: 'string' } }, + required: ['messageType', 'command'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + command: { const: 'createPeerconnection' }, + connectionType: { type: 'string', enum: ['webrtc', 'websocket', 'local'] }, + connectionUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + type: 'object', + required: ['serviceType', 'serviceId', 'remoteServiceId'], + title: 'Service Config', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + additionalProperties: true, + }, + }, + tiebreaker: { type: 'boolean' }, + config: { type: 'object', additionalProperties: true }, + }, + required: ['command', 'connectionType', 'connectionUrl', 'services', 'tiebreaker'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'CreatePeerconnectionMessageResponse', + 'x-location': '#/components/schemas/create_peerconnection_message_response', + 'x-schema-type': 'response', +}; +function validate140( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate140.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema125.allOf[0].allOf[0].required, + parentSchema: schema125.allOf[0].allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate140.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema125.allOf[0].allOf[0].properties.messageType.type, + parentSchema: schema125.allOf[0].allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate140.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema125.allOf[0].allOf[0].type, + parentSchema: schema125.allOf[0].allOf[0], + data, + }, + ]; + return false; + } + } + var valid1 = _errs1 === errors; + if (valid1) { + const _errs6 = errors; + if (errors === _errs6) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.command === undefined && (missing1 = 'command')) + ) { + validate140.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema125.allOf[0].allOf[1].required, + parentSchema: schema125.allOf[0].allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs8 = errors; + if ('command' !== data1) { + validate140.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'command' }, + message: 'must be equal to constant', + schema: 'command', + parentSchema: schema125.allOf[0].allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid3 = _errs8 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data.command !== undefined) { + let data2 = data.command; + const _errs9 = errors; + if (typeof data2 !== 'string') { + validate140.errors = [ + { + instancePath: instancePath + '/command', + schemaPath: '#/allOf/0/allOf/1/properties/command/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema125.allOf[0].allOf[1].properties.command.type, + parentSchema: schema125.allOf[0].allOf[1].properties.command, + data: data2, + }, + ]; + return false; + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate140.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema125.allOf[0].allOf[1].type, + parentSchema: schema125.allOf[0].allOf[1], + data, + }, + ]; + return false; + } + } + var valid1 = _errs6 === errors; + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.command === undefined && (missing2 = 'command')) || + (data.connectionType === undefined && (missing2 = 'connectionType')) || + (data.connectionUrl === undefined && (missing2 = 'connectionUrl')) || + (data.services === undefined && (missing2 = 'services')) || + (data.tiebreaker === undefined && (missing2 = 'tiebreaker')) + ) { + validate140.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema125.allOf[1].required, + parentSchema: schema125.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.command !== undefined) { + let data3 = data.command; + const _errs13 = errors; + if ('createPeerconnection' !== data3) { + validate140.errors = [ + { + instancePath: instancePath + '/command', + schemaPath: '#/allOf/1/properties/command/const', + keyword: 'const', + params: { allowedValue: 'createPeerconnection' }, + message: 'must be equal to constant', + schema: 'createPeerconnection', + parentSchema: schema125.allOf[1].properties.command, + data: data3, + }, + ]; + return false; + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.connectionType !== undefined) { + let data4 = data.connectionType; + const _errs14 = errors; + if (typeof data4 !== 'string') { + validate140.errors = [ + { + instancePath: instancePath + '/connectionType', + schemaPath: '#/allOf/1/properties/connectionType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema125.allOf[1].properties.connectionType.type, + parentSchema: schema125.allOf[1].properties.connectionType, + data: data4, + }, + ]; + return false; + } + if (!(data4 === 'webrtc' || data4 === 'websocket' || data4 === 'local')) { + validate140.errors = [ + { + instancePath: instancePath + '/connectionType', + schemaPath: '#/allOf/1/properties/connectionType/enum', + keyword: 'enum', + params: { + allowedValues: schema125.allOf[1].properties.connectionType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema125.allOf[1].properties.connectionType.enum, + parentSchema: schema125.allOf[1].properties.connectionType, + data: data4, + }, + ]; + return false; + } + var valid4 = _errs14 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.connectionUrl !== undefined) { + let data5 = data.connectionUrl; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate140.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema125.allOf[1].properties.connectionUrl, + data: data5, + }, + ]; + return false; + } + } else { + validate140.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema125.allOf[1].properties.connectionUrl.type, + parentSchema: schema125.allOf[1].properties.connectionUrl, + data: data5, + }, + ]; + return false; + } + } + } + var valid4 = _errs16 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.services !== undefined) { + let data6 = data.services; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data6)) { + var valid5 = true; + const len0 = data6.length; + for (let i0 = 0; i0 < len0; i0++) { + let data7 = data6[i0]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing3; + if ( + (data7.serviceType === undefined && + (missing3 = 'serviceType')) || + (data7.serviceId === undefined && + (missing3 = 'serviceId')) || + (data7.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate140.errors = [ + { + instancePath: instancePath + '/services/' + i0, + schemaPath: + '#/allOf/1/properties/services/items/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: + "must have required property '" + missing3 + "'", + schema: + schema125.allOf[1].properties.services.items.required, + parentSchema: + schema125.allOf[1].properties.services.items, + data: data7, + }, + ]; + return false; + } else { + if (data7.serviceType !== undefined) { + let data8 = data7.serviceType; + const _errs23 = errors; + if (errors === _errs23) { + if (errors === _errs23) { + if (typeof data8 === 'string') { + if (!formats0(data8)) { + validate140.errors = [ + { + instancePath: + instancePath + + '/services/' + + i0 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema125.allOf[1].properties.services.items + .properties.serviceType, + data: data8, + }, + ]; + return false; + } + } else { + validate140.errors = [ + { + instancePath: + instancePath + + '/services/' + + i0 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema125.allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema125.allOf[1].properties.services.items + .properties.serviceType, + data: data8, + }, + ]; + return false; + } + } + } + var valid6 = _errs23 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data7.serviceId !== undefined) { + let data9 = data7.serviceId; + const _errs25 = errors; + if (typeof data9 !== 'string') { + validate140.errors = [ + { + instancePath: + instancePath + '/services/' + i0 + '/serviceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema125.allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema125.allOf[1].properties.services.items + .properties.serviceId, + data: data9, + }, + ]; + return false; + } + var valid6 = _errs25 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data7.remoteServiceId !== undefined) { + let data10 = data7.remoteServiceId; + const _errs27 = errors; + if (typeof data10 !== 'string') { + validate140.errors = [ + { + instancePath: + instancePath + + '/services/' + + i0 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema125.allOf[1].properties.services.items + .properties.remoteServiceId.type, + parentSchema: + schema125.allOf[1].properties.services.items + .properties.remoteServiceId, + data: data10, + }, + ]; + return false; + } + var valid6 = _errs27 === errors; + } else { + var valid6 = true; + } + } + } + } + } else { + validate140.errors = [ + { + instancePath: instancePath + '/services/' + i0, + schemaPath: '#/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema125.allOf[1].properties.services.items.type, + parentSchema: + schema125.allOf[1].properties.services.items, + data: data7, + }, + ]; + return false; + } + } + var valid5 = _errs20 === errors; + if (!valid5) { + break; + } + } + } else { + validate140.errors = [ + { + instancePath: instancePath + '/services', + schemaPath: '#/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema125.allOf[1].properties.services.type, + parentSchema: schema125.allOf[1].properties.services, + data: data6, + }, + ]; + return false; + } + } + var valid4 = _errs18 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.tiebreaker !== undefined) { + let data11 = data.tiebreaker; + const _errs29 = errors; + if (typeof data11 !== 'boolean') { + validate140.errors = [ + { + instancePath: instancePath + '/tiebreaker', + schemaPath: '#/allOf/1/properties/tiebreaker/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema125.allOf[1].properties.tiebreaker.type, + parentSchema: schema125.allOf[1].properties.tiebreaker, + data: data11, + }, + ]; + return false; + } + var valid4 = _errs29 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.config !== undefined) { + let data12 = data.config; + const _errs31 = errors; + if (errors === _errs31) { + if ( + data12 && + typeof data12 == 'object' && + !Array.isArray(data12) + ) { + } else { + validate140.errors = [ + { + instancePath: instancePath + '/config', + schemaPath: '#/allOf/1/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema125.allOf[1].properties.config.type, + parentSchema: schema125.allOf[1].properties.config, + data: data12, + }, + ]; + return false; + } + } + var valid4 = _errs31 === errors; + } else { + var valid4 = true; + } + } + } + } + } + } + } + } else { + validate140.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema125.allOf[1].type, + parentSchema: schema125.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } + validate140.errors = vErrors; + return errors === 0; +} +exports.validateClosePeerconnectionMessageRequest = validate141; +const schema126 = { + title: 'Close Peerconnection Message', + allOf: [ + { + title: 'Command Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { messageType: { const: 'command' }, command: { type: 'string' } }, + required: ['messageType', 'command'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + command: { const: 'closePeerconnection' }, + connectionUrl: { type: 'string', format: 'uri' }, + }, + required: ['command', 'connectionUrl'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'ClosePeerconnectionMessageRequest', + 'x-location': '#/components/schemas/close_peerconnection_message_request', + 'x-schema-type': 'request', +}; +function validate141( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate141.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema126.allOf[0].allOf[0].required, + parentSchema: schema126.allOf[0].allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate141.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema126.allOf[0].allOf[0].properties.messageType.type, + parentSchema: schema126.allOf[0].allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate141.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema126.allOf[0].allOf[0].type, + parentSchema: schema126.allOf[0].allOf[0], + data, + }, + ]; + return false; + } + } + var valid1 = _errs1 === errors; + if (valid1) { + const _errs6 = errors; + if (errors === _errs6) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.command === undefined && (missing1 = 'command')) + ) { + validate141.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema126.allOf[0].allOf[1].required, + parentSchema: schema126.allOf[0].allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs8 = errors; + if ('command' !== data1) { + validate141.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'command' }, + message: 'must be equal to constant', + schema: 'command', + parentSchema: schema126.allOf[0].allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid3 = _errs8 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data.command !== undefined) { + let data2 = data.command; + const _errs9 = errors; + if (typeof data2 !== 'string') { + validate141.errors = [ + { + instancePath: instancePath + '/command', + schemaPath: '#/allOf/0/allOf/1/properties/command/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema126.allOf[0].allOf[1].properties.command.type, + parentSchema: schema126.allOf[0].allOf[1].properties.command, + data: data2, + }, + ]; + return false; + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate141.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema126.allOf[0].allOf[1].type, + parentSchema: schema126.allOf[0].allOf[1], + data, + }, + ]; + return false; + } + } + var valid1 = _errs6 === errors; + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.command === undefined && (missing2 = 'command')) || + (data.connectionUrl === undefined && (missing2 = 'connectionUrl')) + ) { + validate141.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema126.allOf[1].required, + parentSchema: schema126.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.command !== undefined) { + let data3 = data.command; + const _errs13 = errors; + if ('closePeerconnection' !== data3) { + validate141.errors = [ + { + instancePath: instancePath + '/command', + schemaPath: '#/allOf/1/properties/command/const', + keyword: 'const', + params: { allowedValue: 'closePeerconnection' }, + message: 'must be equal to constant', + schema: 'closePeerconnection', + parentSchema: schema126.allOf[1].properties.command, + data: data3, + }, + ]; + return false; + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.connectionUrl !== undefined) { + let data4 = data.connectionUrl; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data4 === 'string') { + if (!formats0(data4)) { + validate141.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema126.allOf[1].properties.connectionUrl, + data: data4, + }, + ]; + return false; + } + } else { + validate141.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema126.allOf[1].properties.connectionUrl.type, + parentSchema: schema126.allOf[1].properties.connectionUrl, + data: data4, + }, + ]; + return false; + } + } + } + var valid4 = _errs14 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate141.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema126.allOf[1].type, + parentSchema: schema126.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } + validate141.errors = vErrors; + return errors === 0; +} +exports.validateClosePeerconnectionMessageResponse = validate142; +const schema127 = { + title: 'Close Peerconnection Message', + allOf: [ + { + title: 'Command Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { messageType: { const: 'command' }, command: { type: 'string' } }, + required: ['messageType', 'command'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + command: { const: 'closePeerconnection' }, + connectionUrl: { type: 'string', format: 'uri' }, + }, + required: ['command', 'connectionUrl'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'ClosePeerconnectionMessageResponse', + 'x-location': '#/components/schemas/close_peerconnection_message_response', + 'x-schema-type': 'response', +}; +function validate142( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate142.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema127.allOf[0].allOf[0].required, + parentSchema: schema127.allOf[0].allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate142.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema127.allOf[0].allOf[0].properties.messageType.type, + parentSchema: schema127.allOf[0].allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate142.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema127.allOf[0].allOf[0].type, + parentSchema: schema127.allOf[0].allOf[0], + data, + }, + ]; + return false; + } + } + var valid1 = _errs1 === errors; + if (valid1) { + const _errs6 = errors; + if (errors === _errs6) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.command === undefined && (missing1 = 'command')) + ) { + validate142.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema127.allOf[0].allOf[1].required, + parentSchema: schema127.allOf[0].allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs8 = errors; + if ('command' !== data1) { + validate142.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'command' }, + message: 'must be equal to constant', + schema: 'command', + parentSchema: schema127.allOf[0].allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid3 = _errs8 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data.command !== undefined) { + let data2 = data.command; + const _errs9 = errors; + if (typeof data2 !== 'string') { + validate142.errors = [ + { + instancePath: instancePath + '/command', + schemaPath: '#/allOf/0/allOf/1/properties/command/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema127.allOf[0].allOf[1].properties.command.type, + parentSchema: schema127.allOf[0].allOf[1].properties.command, + data: data2, + }, + ]; + return false; + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate142.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema127.allOf[0].allOf[1].type, + parentSchema: schema127.allOf[0].allOf[1], + data, + }, + ]; + return false; + } + } + var valid1 = _errs6 === errors; + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.command === undefined && (missing2 = 'command')) || + (data.connectionUrl === undefined && (missing2 = 'connectionUrl')) + ) { + validate142.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema127.allOf[1].required, + parentSchema: schema127.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.command !== undefined) { + let data3 = data.command; + const _errs13 = errors; + if ('closePeerconnection' !== data3) { + validate142.errors = [ + { + instancePath: instancePath + '/command', + schemaPath: '#/allOf/1/properties/command/const', + keyword: 'const', + params: { allowedValue: 'closePeerconnection' }, + message: 'must be equal to constant', + schema: 'closePeerconnection', + parentSchema: schema127.allOf[1].properties.command, + data: data3, + }, + ]; + return false; + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.connectionUrl !== undefined) { + let data4 = data.connectionUrl; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data4 === 'string') { + if (!formats0(data4)) { + validate142.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema127.allOf[1].properties.connectionUrl, + data: data4, + }, + ]; + return false; + } + } else { + validate142.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema127.allOf[1].properties.connectionUrl.type, + parentSchema: schema127.allOf[1].properties.connectionUrl, + data: data4, + }, + ]; + return false; + } + } + } + var valid4 = _errs14 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate142.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema127.allOf[1].type, + parentSchema: schema127.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } + validate142.errors = vErrors; + return errors === 0; +} +exports.validateSignalingMessageRequest = validate143; +const schema128 = { + title: 'Signaling Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'signaling' }, + signalingType: { type: 'string' }, + connectionUrl: { type: 'string', format: 'uri' }, + content: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'signalingType', 'connectionUrl', 'content'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'SignalingMessageRequest', + 'x-location': '#/components/schemas/signaling_message_request', + 'x-schema-type': 'request', +}; +function validate143( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate143.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema128.allOf[0].required, + parentSchema: schema128.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate143.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema128.allOf[0].properties.messageType.type, + parentSchema: schema128.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate143.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema128.allOf[0].type, + parentSchema: schema128.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.signalingType === undefined && (missing1 = 'signalingType')) || + (data.connectionUrl === undefined && (missing1 = 'connectionUrl')) || + (data.content === undefined && (missing1 = 'content')) + ) { + validate143.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema128.allOf[1].required, + parentSchema: schema128.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('signaling' !== data1) { + validate143.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'signaling' }, + message: 'must be equal to constant', + schema: 'signaling', + parentSchema: schema128.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.signalingType !== undefined) { + let data2 = data.signalingType; + const _errs8 = errors; + if (typeof data2 !== 'string') { + validate143.errors = [ + { + instancePath: instancePath + '/signalingType', + schemaPath: '#/allOf/1/properties/signalingType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema128.allOf[1].properties.signalingType.type, + parentSchema: schema128.allOf[1].properties.signalingType, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.connectionUrl !== undefined) { + let data3 = data.connectionUrl; + const _errs10 = errors; + if (errors === _errs10) { + if (errors === _errs10) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + validate143.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema128.allOf[1].properties.connectionUrl, + data: data3, + }, + ]; + return false; + } + } else { + validate143.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema128.allOf[1].properties.connectionUrl.type, + parentSchema: schema128.allOf[1].properties.connectionUrl, + data: data3, + }, + ]; + return false; + } + } + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.content !== undefined) { + let data4 = data.content; + const _errs12 = errors; + if (errors === _errs12) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + } else { + validate143.errors = [ + { + instancePath: instancePath + '/content', + schemaPath: '#/allOf/1/properties/content/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema128.allOf[1].properties.content.type, + parentSchema: schema128.allOf[1].properties.content, + data: data4, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } else { + validate143.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema128.allOf[1].type, + parentSchema: schema128.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate143.errors = vErrors; + return errors === 0; +} +exports.validateSignalingMessageResponse = validate144; +const schema129 = { + title: 'Signaling Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'signaling' }, + signalingType: { type: 'string' }, + connectionUrl: { type: 'string', format: 'uri' }, + content: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'signalingType', 'connectionUrl', 'content'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'SignalingMessageResponse', + 'x-location': '#/components/schemas/signaling_message_response', + 'x-schema-type': 'response', +}; +function validate144( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate144.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema129.allOf[0].required, + parentSchema: schema129.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate144.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema129.allOf[0].properties.messageType.type, + parentSchema: schema129.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate144.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema129.allOf[0].type, + parentSchema: schema129.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.signalingType === undefined && (missing1 = 'signalingType')) || + (data.connectionUrl === undefined && (missing1 = 'connectionUrl')) || + (data.content === undefined && (missing1 = 'content')) + ) { + validate144.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema129.allOf[1].required, + parentSchema: schema129.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('signaling' !== data1) { + validate144.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'signaling' }, + message: 'must be equal to constant', + schema: 'signaling', + parentSchema: schema129.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.signalingType !== undefined) { + let data2 = data.signalingType; + const _errs8 = errors; + if (typeof data2 !== 'string') { + validate144.errors = [ + { + instancePath: instancePath + '/signalingType', + schemaPath: '#/allOf/1/properties/signalingType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema129.allOf[1].properties.signalingType.type, + parentSchema: schema129.allOf[1].properties.signalingType, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.connectionUrl !== undefined) { + let data3 = data.connectionUrl; + const _errs10 = errors; + if (errors === _errs10) { + if (errors === _errs10) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + validate144.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema129.allOf[1].properties.connectionUrl, + data: data3, + }, + ]; + return false; + } + } else { + validate144.errors = [ + { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema129.allOf[1].properties.connectionUrl.type, + parentSchema: schema129.allOf[1].properties.connectionUrl, + data: data3, + }, + ]; + return false; + } + } + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.content !== undefined) { + let data4 = data.content; + const _errs12 = errors; + if (errors === _errs12) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + } else { + validate144.errors = [ + { + instancePath: instancePath + '/content', + schemaPath: '#/allOf/1/properties/content/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema129.allOf[1].properties.content.type, + parentSchema: schema129.allOf[1].properties.content, + data: data4, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } else { + validate144.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema129.allOf[1].type, + parentSchema: schema129.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate144.errors = vErrors; + return errors === 0; +} +exports.validateConfigurationMessageRequest = validate145; +const schema130 = { + title: 'Configuration Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'configuration' }, + configuration: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'configuration'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'ConfigurationMessageRequest', + 'x-location': '#/components/schemas/configuration_message_request', + 'x-schema-type': 'request', +}; +function validate145( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate145.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema130.allOf[0].required, + parentSchema: schema130.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate145.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema130.allOf[0].properties.messageType.type, + parentSchema: schema130.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate145.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema130.allOf[0].type, + parentSchema: schema130.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.configuration === undefined && (missing1 = 'configuration')) + ) { + validate145.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema130.allOf[1].required, + parentSchema: schema130.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('configuration' !== data1) { + validate145.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'configuration' }, + message: 'must be equal to constant', + schema: 'configuration', + parentSchema: schema130.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.configuration !== undefined) { + let data2 = data.configuration; + const _errs8 = errors; + if (errors === _errs8) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + } else { + validate145.errors = [ + { + instancePath: instancePath + '/configuration', + schemaPath: '#/allOf/1/properties/configuration/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema130.allOf[1].properties.configuration.type, + parentSchema: schema130.allOf[1].properties.configuration, + data: data2, + }, + ]; + return false; + } + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate145.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema130.allOf[1].type, + parentSchema: schema130.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate145.errors = vErrors; + return errors === 0; +} +exports.validateConfigurationMessageResponse = validate146; +const schema131 = { + title: 'Configuration Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'configuration' }, + configuration: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'configuration'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'ConfigurationMessageResponse', + 'x-location': '#/components/schemas/configuration_message_response', + 'x-schema-type': 'response', +}; +function validate146( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate146.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema131.allOf[0].required, + parentSchema: schema131.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate146.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema131.allOf[0].properties.messageType.type, + parentSchema: schema131.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate146.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema131.allOf[0].type, + parentSchema: schema131.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.configuration === undefined && (missing1 = 'configuration')) + ) { + validate146.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema131.allOf[1].required, + parentSchema: schema131.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('configuration' !== data1) { + validate146.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'configuration' }, + message: 'must be equal to constant', + schema: 'configuration', + parentSchema: schema131.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.configuration !== undefined) { + let data2 = data.configuration; + const _errs8 = errors; + if (errors === _errs8) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + } else { + validate146.errors = [ + { + instancePath: instancePath + '/configuration', + schemaPath: '#/allOf/1/properties/configuration/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema131.allOf[1].properties.configuration.type, + parentSchema: schema131.allOf[1].properties.configuration, + data: data2, + }, + ]; + return false; + } + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate146.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema131.allOf[1].type, + parentSchema: schema131.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate146.errors = vErrors; + return errors === 0; +} +exports.validateExperimentStatusChangedMessageRequest = validate147; +const schema132 = { + title: 'Experiment Status Changed Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'experiment-status-changed' }, + status: { type: 'string' }, + message: { type: 'string' }, + }, + required: ['messageType', 'status'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'ExperimentStatusChangedMessageRequest', + 'x-location': '#/components/schemas/experiment_status_changed_message_request', + 'x-schema-type': 'request', +}; +function validate147( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate147.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema132.allOf[0].required, + parentSchema: schema132.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate147.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema132.allOf[0].properties.messageType.type, + parentSchema: schema132.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate147.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema132.allOf[0].type, + parentSchema: schema132.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.status === undefined && (missing1 = 'status')) + ) { + validate147.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema132.allOf[1].required, + parentSchema: schema132.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('experiment-status-changed' !== data1) { + validate147.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'experiment-status-changed' }, + message: 'must be equal to constant', + schema: 'experiment-status-changed', + parentSchema: schema132.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.status !== undefined) { + let data2 = data.status; + const _errs8 = errors; + if (typeof data2 !== 'string') { + validate147.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/1/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema132.allOf[1].properties.status.type, + parentSchema: schema132.allOf[1].properties.status, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.message !== undefined) { + let data3 = data.message; + const _errs10 = errors; + if (typeof data3 !== 'string') { + validate147.errors = [ + { + instancePath: instancePath + '/message', + schemaPath: '#/allOf/1/properties/message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema132.allOf[1].properties.message.type, + parentSchema: schema132.allOf[1].properties.message, + data: data3, + }, + ]; + return false; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + } + } + } + } else { + validate147.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema132.allOf[1].type, + parentSchema: schema132.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate147.errors = vErrors; + return errors === 0; +} +exports.validateExperimentStatusChangedMessageResponse = validate148; +const schema133 = { + title: 'Experiment Status Changed Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'experiment-status-changed' }, + status: { type: 'string' }, + message: { type: 'string' }, + }, + required: ['messageType', 'status'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'ExperimentStatusChangedMessageResponse', + 'x-location': '#/components/schemas/experiment_status_changed_message_response', + 'x-schema-type': 'response', +}; +function validate148( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate148.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema133.allOf[0].required, + parentSchema: schema133.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate148.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema133.allOf[0].properties.messageType.type, + parentSchema: schema133.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate148.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema133.allOf[0].type, + parentSchema: schema133.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.status === undefined && (missing1 = 'status')) + ) { + validate148.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema133.allOf[1].required, + parentSchema: schema133.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('experiment-status-changed' !== data1) { + validate148.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'experiment-status-changed' }, + message: 'must be equal to constant', + schema: 'experiment-status-changed', + parentSchema: schema133.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.status !== undefined) { + let data2 = data.status; + const _errs8 = errors; + if (typeof data2 !== 'string') { + validate148.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/1/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema133.allOf[1].properties.status.type, + parentSchema: schema133.allOf[1].properties.status, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.message !== undefined) { + let data3 = data.message; + const _errs10 = errors; + if (typeof data3 !== 'string') { + validate148.errors = [ + { + instancePath: instancePath + '/message', + schemaPath: '#/allOf/1/properties/message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema133.allOf[1].properties.message.type, + parentSchema: schema133.allOf[1].properties.message, + data: data3, + }, + ]; + return false; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + } + } + } + } else { + validate148.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema133.allOf[1].type, + parentSchema: schema133.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate148.errors = vErrors; + return errors === 0; +} +exports.validateLoggingMessageRequest = validate149; +const schema134 = { + title: 'Logging Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'logging' }, + content: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'content'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'LoggingMessageRequest', + 'x-location': '#/components/schemas/logging_message_request', + 'x-schema-type': 'request', +}; +function validate149( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate149.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema134.allOf[0].required, + parentSchema: schema134.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate149.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema134.allOf[0].properties.messageType.type, + parentSchema: schema134.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate149.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema134.allOf[0].type, + parentSchema: schema134.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.content === undefined && (missing1 = 'content')) + ) { + validate149.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema134.allOf[1].required, + parentSchema: schema134.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('logging' !== data1) { + validate149.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'logging' }, + message: 'must be equal to constant', + schema: 'logging', + parentSchema: schema134.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.content !== undefined) { + let data2 = data.content; + const _errs8 = errors; + if (errors === _errs8) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + } else { + validate149.errors = [ + { + instancePath: instancePath + '/content', + schemaPath: '#/allOf/1/properties/content/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema134.allOf[1].properties.content.type, + parentSchema: schema134.allOf[1].properties.content, + data: data2, + }, + ]; + return false; + } + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate149.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema134.allOf[1].type, + parentSchema: schema134.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate149.errors = vErrors; + return errors === 0; +} +exports.validateLoggingMessageResponse = validate150; +const schema135 = { + title: 'Logging Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'logging' }, + content: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'content'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'LoggingMessageResponse', + 'x-location': '#/components/schemas/logging_message_response', + 'x-schema-type': 'response', +}; +function validate150( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + validate150.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema135.allOf[0].required, + parentSchema: schema135.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + validate150.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema135.allOf[0].properties.messageType.type, + parentSchema: schema135.allOf[0].properties.messageType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate150.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema135.allOf[0].type, + parentSchema: schema135.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.content === undefined && (missing1 = 'content')) + ) { + validate150.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema135.allOf[1].required, + parentSchema: schema135.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs7 = errors; + if ('logging' !== data1) { + validate150.errors = [ + { + instancePath: instancePath + '/messageType', + schemaPath: '#/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'logging' }, + message: 'must be equal to constant', + schema: 'logging', + parentSchema: schema135.allOf[1].properties.messageType, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.content !== undefined) { + let data2 = data.content; + const _errs8 = errors; + if (errors === _errs8) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + } else { + validate150.errors = [ + { + instancePath: instancePath + '/content', + schemaPath: '#/allOf/1/properties/content/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema135.allOf[1].properties.content.type, + parentSchema: schema135.allOf[1].properties.content, + data: data2, + }, + ]; + return false; + } + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate150.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema135.allOf[1].type, + parentSchema: schema135.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs5 === errors; + } + validate150.errors = vErrors; + return errors === 0; +} +exports.validateConnectionStatusRequest = validate151; +const schema136 = { + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + 'x-standalone': true, + 'x-name': 'ConnectionStatusRequest', + 'x-location': '#/components/schemas/peerconnection_status_request', + 'x-schema-type': 'request', +}; +function validate151( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate151.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema136.type, + parentSchema: schema136, + data, + }, + ]; + return false; + } + if ( + !( + data === 'new' || + data === 'connecting' || + data === 'connected' || + data === 'disconnected' || + data === 'failed' || + data === 'closed' + ) + ) { + validate151.errors = [ + { + instancePath, + schemaPath: '#/enum', + keyword: 'enum', + params: { allowedValues: schema136.enum }, + message: 'must be equal to one of the allowed values', + schema: schema136.enum, + parentSchema: schema136, + data, + }, + ]; + return false; + } + validate151.errors = vErrors; + return errors === 0; +} +exports.validateConnectionStatusResponse = validate152; +const schema137 = { + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + 'x-standalone': true, + 'x-name': 'ConnectionStatusResponse', + 'x-location': '#/components/schemas/peerconnection_status_response', + 'x-schema-type': 'response', +}; +function validate152( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate152.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema137.type, + parentSchema: schema137, + data, + }, + ]; + return false; + } + if ( + !( + data === 'new' || + data === 'connecting' || + data === 'connected' || + data === 'disconnected' || + data === 'failed' || + data === 'closed' + ) + ) { + validate152.errors = [ + { + instancePath, + schemaPath: '#/enum', + keyword: 'enum', + params: { allowedValues: schema137.enum }, + message: 'must be equal to one of the allowed values', + schema: schema137.enum, + parentSchema: schema137, + data, + }, + ]; + return false; + } + validate152.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnectionCommonRequest = validate153; +const schema138 = { + type: 'object', + title: 'Peerconnection Common', + properties: { + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + }, + required: ['type'], + 'x-standalone': true, + 'x-name': 'PeerconnectionCommonRequest', + 'x-location': '#/components/schemas/peerconnection_common_request', + 'x-schema-type': 'request', +}; +function validate153( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate153.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema138.required, + parentSchema: schema138, + data, + }, + ]; + return false; + } else { + if (data.type !== undefined) { + let data0 = data.type; + if (typeof data0 !== 'string') { + validate153.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema138.properties.type.type, + parentSchema: schema138.properties.type, + data: data0, + }, + ]; + return false; + } + if (!(data0 === 'local' || data0 === 'webrtc')) { + validate153.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema138.properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema138.properties.type.enum, + parentSchema: schema138.properties.type, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate153.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema138.type, + parentSchema: schema138, + data, + }, + ]; + return false; + } + } + validate153.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnectionCommonResponse = validate154; +const schema139 = { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['url', 'type', 'status'], + 'x-standalone': true, + 'x-name': 'PeerconnectionCommonResponse', + 'x-location': '#/components/schemas/peerconnection_common_response', + 'x-schema-type': 'response', +}; +function validate154( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.status === undefined && (missing0 = 'status')) + ) { + validate154.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema139.required, + parentSchema: schema139, + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate154.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema139.properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate154.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema139.properties.url.type, + parentSchema: schema139.properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.type !== undefined) { + let data1 = data.type; + const _errs3 = errors; + if (typeof data1 !== 'string') { + validate154.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema139.properties.type.type, + parentSchema: schema139.properties.type, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'local' || data1 === 'webrtc')) { + validate154.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema139.properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema139.properties.type.enum, + parentSchema: schema139.properties.type, + data: data1, + }, + ]; + return false; + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.status !== undefined) { + let data2 = data.status; + const _errs5 = errors; + if (typeof data2 !== 'string') { + validate154.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema139.properties.status.type, + parentSchema: schema139.properties.status, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'new' || + data2 === 'connecting' || + data2 === 'connected' || + data2 === 'disconnected' || + data2 === 'failed' || + data2 === 'closed' + ) + ) { + validate154.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema139.properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema139.properties.status.enum, + parentSchema: schema139.properties.status, + data: data2, + }, + ]; + return false; + } + var valid0 = _errs5 === errors; + } else { + var valid0 = true; + } + } + } + } + } else { + validate154.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema139.type, + parentSchema: schema139, + data, + }, + ]; + return false; + } + } + validate154.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnectionOverviewRequest = validate155; +const schema140 = { + title: 'Peerconnection Overview', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-standalone': true, + 'x-name': 'PeerconnectionOverviewRequest', + 'x-location': '#/components/schemas/peerconnection_overview_request', + 'x-schema-type': 'request', +}; +function validate155( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate155.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema140.allOf[0].required, + parentSchema: schema140.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.type !== undefined) { + let data0 = data.type; + if (typeof data0 !== 'string') { + validate155.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema140.allOf[0].properties.type.type, + parentSchema: schema140.allOf[0].properties.type, + data: data0, + }, + ]; + return false; + } + if (!(data0 === 'local' || data0 === 'webrtc')) { + validate155.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema140.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema140.allOf[0].properties.type.enum, + parentSchema: schema140.allOf[0].properties.type, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate155.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema140.allOf[0].type, + parentSchema: schema140.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs4 = errors; + if (errors === _errs4) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate155.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema140.allOf[1].required, + parentSchema: schema140.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data1 = data.devices; + const _errs6 = errors; + if (errors === _errs6) { + if (Array.isArray(data1)) { + if (data1.length > 2) { + validate155.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema140.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } else { + if (data1.length < 2) { + validate155.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema140.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs8 = errors; + if (errors === _errs8) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing2; + if (data2.url === undefined && (missing2 = 'url')) { + validate155.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema140.allOf[1].properties.devices.items.required, + parentSchema: schema140.allOf[1].properties.devices.items, + data: data2, + }, + ]; + return false; + } else { + if (data2.url !== undefined) { + let data3 = data2.url; + const _errs10 = errors; + if (errors === _errs10) { + if (errors === _errs10) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + validate155.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema140.allOf[1].properties.devices.items + .properties.url, + data: data3, + }, + ]; + return false; + } + } else { + validate155.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema140.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema140.allOf[1].properties.devices.items + .properties.url, + data: data3, + }, + ]; + return false; + } + } + } + } + } + } else { + validate155.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema140.allOf[1].properties.devices.items.type, + parentSchema: schema140.allOf[1].properties.devices.items, + data: data2, + }, + ]; + return false; + } + } + var valid3 = _errs8 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate155.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema140.allOf[1].properties.devices.type, + parentSchema: schema140.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } + } + } + } + } else { + validate155.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema140.allOf[1].type, + parentSchema: schema140.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs4 === errors; + } + validate155.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnectionOverviewResponse = validate156; +const schema141 = { + title: 'Peerconnection Overview', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-standalone': true, + 'x-name': 'PeerconnectionOverviewResponse', + 'x-location': '#/components/schemas/peerconnection_overview_response', + 'x-schema-type': 'response', +}; +function validate156( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.status === undefined && (missing0 = 'status')) + ) { + validate156.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema141.allOf[0].required, + parentSchema: schema141.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate156.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema141.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate156.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema141.allOf[0].properties.url.type, + parentSchema: schema141.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data1 = data.type; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate156.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema141.allOf[0].properties.type.type, + parentSchema: schema141.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'local' || data1 === 'webrtc')) { + validate156.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema141.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema141.allOf[0].properties.type.enum, + parentSchema: schema141.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.status !== undefined) { + let data2 = data.status; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate156.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema141.allOf[0].properties.status.type, + parentSchema: schema141.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'new' || + data2 === 'connecting' || + data2 === 'connected' || + data2 === 'disconnected' || + data2 === 'failed' || + data2 === 'closed' + ) + ) { + validate156.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema141.allOf[0].properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema141.allOf[0].properties.status.enum, + parentSchema: schema141.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate156.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema141.allOf[0].type, + parentSchema: schema141.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs8 = errors; + if (errors === _errs8) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate156.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema141.allOf[1].required, + parentSchema: schema141.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data3 = data.devices; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data3)) { + if (data3.length > 2) { + validate156.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema141.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + if (data3.length < 2) { + validate156.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema141.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data3.length; + for (let i0 = 0; i0 < len0; i0++) { + let data4 = data3[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing2; + if (data4.url === undefined && (missing2 = 'url')) { + validate156.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema141.allOf[1].properties.devices.items.required, + parentSchema: schema141.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate156.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema141.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } else { + validate156.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema141.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema141.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } + } + } + } + } else { + validate156.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema141.allOf[1].properties.devices.items.type, + parentSchema: schema141.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } + } + var valid3 = _errs12 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate156.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema141.allOf[1].properties.devices.type, + parentSchema: schema141.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } + } + } + } + } else { + validate156.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema141.allOf[1].type, + parentSchema: schema141.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs8 === errors; + } + validate156.errors = vErrors; + return errors === 0; +} +exports.validateConfiguredDeviceReferenceRequest = validate157; +const schema142 = { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + 'x-standalone': true, + 'x-name': 'ConfiguredDeviceReferenceRequest', + 'x-location': '#/components/schemas/configured_device_reference_request', + 'x-schema-type': 'request', +}; +function validate157( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.url === undefined && (missing0 = 'url')) { + validate157.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema142.required, + parentSchema: schema142, + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate157.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema142.properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate157.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema142.properties.url.type, + parentSchema: schema142.properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.config !== undefined) { + let data1 = data.config; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + if (data1.services !== undefined) { + let data2 = data1.services; + const _errs5 = errors; + if (errors === _errs5) { + if (Array.isArray(data2)) { + var valid2 = true; + const len0 = data2.length; + for (let i0 = 0; i0 < len0; i0++) { + let data3 = data2[i0]; + const _errs7 = errors; + if (errors === _errs7) { + if ( + data3 && + typeof data3 == 'object' && + !Array.isArray(data3) + ) { + let missing1; + if ( + (data3.serviceType === undefined && + (missing1 = 'serviceType')) || + (data3.serviceId === undefined && + (missing1 = 'serviceId')) || + (data3.remoteServiceId === undefined && + (missing1 = 'remoteServiceId')) + ) { + validate157.errors = [ + { + instancePath: instancePath + '/config/services/' + i0, + schemaPath: + '#/properties/config/properties/services/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema142.properties.config.properties.services.items + .required, + parentSchema: + schema142.properties.config.properties.services.items, + data: data3, + }, + ]; + return false; + } else { + if (data3.serviceType !== undefined) { + let data4 = data3.serviceType; + const _errs10 = errors; + if (errors === _errs10) { + if (errors === _errs10) { + if (typeof data4 === 'string') { + if (!formats0(data4)) { + validate157.errors = [ + { + instancePath: + instancePath + + '/config/services/' + + i0 + + '/serviceType', + schemaPath: + '#/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema142.properties.config.properties + .services.items.properties.serviceType, + data: data4, + }, + ]; + return false; + } + } else { + validate157.errors = [ + { + instancePath: + instancePath + + '/config/services/' + + i0 + + '/serviceType', + schemaPath: + '#/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema142.properties.config.properties + .services.items.properties.serviceType.type, + parentSchema: + schema142.properties.config.properties + .services.items.properties.serviceType, + data: data4, + }, + ]; + return false; + } + } + } + var valid3 = _errs10 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.serviceId !== undefined) { + let data5 = data3.serviceId; + const _errs12 = errors; + if (typeof data5 !== 'string') { + validate157.errors = [ + { + instancePath: + instancePath + + '/config/services/' + + i0 + + '/serviceId', + schemaPath: + '#/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema142.properties.config.properties.services + .items.properties.serviceId.type, + parentSchema: + schema142.properties.config.properties.services + .items.properties.serviceId, + data: data5, + }, + ]; + return false; + } + var valid3 = _errs12 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.remoteServiceId !== undefined) { + let data6 = data3.remoteServiceId; + const _errs14 = errors; + if (typeof data6 !== 'string') { + validate157.errors = [ + { + instancePath: + instancePath + + '/config/services/' + + i0 + + '/remoteServiceId', + schemaPath: + '#/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema142.properties.config.properties + .services.items.properties.remoteServiceId + .type, + parentSchema: + schema142.properties.config.properties + .services.items.properties.remoteServiceId, + data: data6, + }, + ]; + return false; + } + var valid3 = _errs14 === errors; + } else { + var valid3 = true; + } + } + } + } + } else { + validate157.errors = [ + { + instancePath: instancePath + '/config/services/' + i0, + schemaPath: + '#/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema142.properties.config.properties.services.items + .type, + parentSchema: + schema142.properties.config.properties.services.items, + data: data3, + }, + ]; + return false; + } + } + var valid2 = _errs7 === errors; + if (!valid2) { + break; + } + } + } else { + validate157.errors = [ + { + instancePath: instancePath + '/config/services', + schemaPath: '#/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema142.properties.config.properties.services.type, + parentSchema: schema142.properties.config.properties.services, + data: data2, + }, + ]; + return false; + } + } + } + } else { + validate157.errors = [ + { + instancePath: instancePath + '/config', + schemaPath: '#/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema142.properties.config.type, + parentSchema: schema142.properties.config, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate157.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema142.type, + parentSchema: schema142, + data, + }, + ]; + return false; + } + } + validate157.errors = vErrors; + return errors === 0; +} +exports.validateConfiguredDeviceReferenceResponse = validate158; +const schema143 = { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + 'x-standalone': true, + 'x-name': 'ConfiguredDeviceReferenceResponse', + 'x-location': '#/components/schemas/configured_device_reference_response', + 'x-schema-type': 'response', +}; +function validate158( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.url === undefined && (missing0 = 'url')) { + validate158.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema143.required, + parentSchema: schema143, + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate158.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema143.properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate158.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema143.properties.url.type, + parentSchema: schema143.properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.config !== undefined) { + let data1 = data.config; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + if (data1.services !== undefined) { + let data2 = data1.services; + const _errs5 = errors; + if (errors === _errs5) { + if (Array.isArray(data2)) { + var valid2 = true; + const len0 = data2.length; + for (let i0 = 0; i0 < len0; i0++) { + let data3 = data2[i0]; + const _errs7 = errors; + if (errors === _errs7) { + if ( + data3 && + typeof data3 == 'object' && + !Array.isArray(data3) + ) { + let missing1; + if ( + (data3.serviceType === undefined && + (missing1 = 'serviceType')) || + (data3.serviceId === undefined && + (missing1 = 'serviceId')) || + (data3.remoteServiceId === undefined && + (missing1 = 'remoteServiceId')) + ) { + validate158.errors = [ + { + instancePath: instancePath + '/config/services/' + i0, + schemaPath: + '#/properties/config/properties/services/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema143.properties.config.properties.services.items + .required, + parentSchema: + schema143.properties.config.properties.services.items, + data: data3, + }, + ]; + return false; + } else { + if (data3.serviceType !== undefined) { + let data4 = data3.serviceType; + const _errs10 = errors; + if (errors === _errs10) { + if (errors === _errs10) { + if (typeof data4 === 'string') { + if (!formats0(data4)) { + validate158.errors = [ + { + instancePath: + instancePath + + '/config/services/' + + i0 + + '/serviceType', + schemaPath: + '#/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema143.properties.config.properties + .services.items.properties.serviceType, + data: data4, + }, + ]; + return false; + } + } else { + validate158.errors = [ + { + instancePath: + instancePath + + '/config/services/' + + i0 + + '/serviceType', + schemaPath: + '#/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema143.properties.config.properties + .services.items.properties.serviceType.type, + parentSchema: + schema143.properties.config.properties + .services.items.properties.serviceType, + data: data4, + }, + ]; + return false; + } + } + } + var valid3 = _errs10 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.serviceId !== undefined) { + let data5 = data3.serviceId; + const _errs12 = errors; + if (typeof data5 !== 'string') { + validate158.errors = [ + { + instancePath: + instancePath + + '/config/services/' + + i0 + + '/serviceId', + schemaPath: + '#/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema143.properties.config.properties.services + .items.properties.serviceId.type, + parentSchema: + schema143.properties.config.properties.services + .items.properties.serviceId, + data: data5, + }, + ]; + return false; + } + var valid3 = _errs12 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.remoteServiceId !== undefined) { + let data6 = data3.remoteServiceId; + const _errs14 = errors; + if (typeof data6 !== 'string') { + validate158.errors = [ + { + instancePath: + instancePath + + '/config/services/' + + i0 + + '/remoteServiceId', + schemaPath: + '#/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema143.properties.config.properties + .services.items.properties.remoteServiceId + .type, + parentSchema: + schema143.properties.config.properties + .services.items.properties.remoteServiceId, + data: data6, + }, + ]; + return false; + } + var valid3 = _errs14 === errors; + } else { + var valid3 = true; + } + } + } + } + } else { + validate158.errors = [ + { + instancePath: instancePath + '/config/services/' + i0, + schemaPath: + '#/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema143.properties.config.properties.services.items + .type, + parentSchema: + schema143.properties.config.properties.services.items, + data: data3, + }, + ]; + return false; + } + } + var valid2 = _errs7 === errors; + if (!valid2) { + break; + } + } + } else { + validate158.errors = [ + { + instancePath: instancePath + '/config/services', + schemaPath: '#/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema143.properties.config.properties.services.type, + parentSchema: schema143.properties.config.properties.services, + data: data2, + }, + ]; + return false; + } + } + } + } else { + validate158.errors = [ + { + instancePath: instancePath + '/config', + schemaPath: '#/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema143.properties.config.type, + parentSchema: schema143.properties.config, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate158.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema143.type, + parentSchema: schema143, + data, + }, + ]; + return false; + } + } + validate158.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnectionRequest = validate159; +const schema144 = { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'PeerconnectionRequest', + 'x-location': '#/components/schemas/peerconnection_request', + 'x-schema-type': 'request', +}; +function validate159( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate159.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema144.allOf[0].required, + parentSchema: schema144.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.type !== undefined) { + let data0 = data.type; + if (typeof data0 !== 'string') { + validate159.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema144.allOf[0].properties.type.type, + parentSchema: schema144.allOf[0].properties.type, + data: data0, + }, + ]; + return false; + } + if (!(data0 === 'local' || data0 === 'webrtc')) { + validate159.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema144.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema144.allOf[0].properties.type.enum, + parentSchema: schema144.allOf[0].properties.type, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate159.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema144.allOf[0].type, + parentSchema: schema144.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs4 = errors; + if (errors === _errs4) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate159.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema144.allOf[1].required, + parentSchema: schema144.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data1 = data.devices; + const _errs6 = errors; + if (errors === _errs6) { + if (Array.isArray(data1)) { + if (data1.length > 2) { + validate159.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema144.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } else { + if (data1.length < 2) { + validate159.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema144.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs8 = errors; + if (errors === _errs8) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing2; + if (data2.url === undefined && (missing2 = 'url')) { + validate159.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema144.allOf[1].properties.devices.items.required, + parentSchema: schema144.allOf[1].properties.devices.items, + data: data2, + }, + ]; + return false; + } else { + if (data2.url !== undefined) { + let data3 = data2.url; + const _errs10 = errors; + if (errors === _errs10) { + if (errors === _errs10) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + validate159.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema144.allOf[1].properties.devices.items + .properties.url, + data: data3, + }, + ]; + return false; + } + } else { + validate159.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema144.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema144.allOf[1].properties.devices.items + .properties.url, + data: data3, + }, + ]; + return false; + } + } + } + var valid4 = _errs10 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data2.config !== undefined) { + let data4 = data2.config; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data4 && + typeof data4 == 'object' && + !Array.isArray(data4) + ) { + if (data4.services !== undefined) { + let data5 = data4.services; + const _errs14 = errors; + if (errors === _errs14) { + if (Array.isArray(data5)) { + var valid6 = true; + const len1 = data5.length; + for (let i1 = 0; i1 < len1; i1++) { + let data6 = data5[i1]; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing3; + if ( + (data6.serviceType === undefined && + (missing3 = 'serviceType')) || + (data6.serviceId === undefined && + (missing3 = 'serviceId')) || + (data6.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate159.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: missing3, + }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema144.allOf[1].properties + .devices.items.properties.config + .properties.services.items + .required, + parentSchema: + schema144.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data6, + }, + ]; + return false; + } else { + if (data6.serviceType !== undefined) { + let data7 = data6.serviceType; + const _errs19 = errors; + if (errors === _errs19) { + if (errors === _errs19) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + validate159.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema144.allOf[1] + .properties.devices + .items.properties + .config.properties + .services.items + .properties + .serviceType, + data: data7, + }, + ]; + return false; + } + } else { + validate159.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema144.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType.type, + parentSchema: + schema144.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType, + data: data7, + }, + ]; + return false; + } + } + } + var valid7 = _errs19 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data6.serviceId !== undefined) { + let data8 = data6.serviceId; + const _errs21 = errors; + if (typeof data8 !== 'string') { + validate159.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema144.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId + .type, + parentSchema: + schema144.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId, + data: data8, + }, + ]; + return false; + } + var valid7 = _errs21 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if ( + data6.remoteServiceId !== + undefined + ) { + let data9 = data6.remoteServiceId; + const _errs23 = errors; + if (typeof data9 !== 'string') { + validate159.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema144.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId.type, + parentSchema: + schema144.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId, + data: data9, + }, + ]; + return false; + } + var valid7 = _errs23 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + validate159.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema144.allOf[1].properties + .devices.items.properties.config + .properties.services.items.type, + parentSchema: + schema144.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data6, + }, + ]; + return false; + } + } + var valid6 = _errs16 === errors; + if (!valid6) { + break; + } + } + } else { + validate159.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema144.allOf[1].properties.devices + .items.properties.config.properties + .services.type, + parentSchema: + schema144.allOf[1].properties.devices + .items.properties.config.properties + .services, + data: data5, + }, + ]; + return false; + } + } + } + } else { + validate159.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/config', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema144.allOf[1].properties.devices.items + .properties.config.type, + parentSchema: + schema144.allOf[1].properties.devices.items + .properties.config, + data: data4, + }, + ]; + return false; + } + } + var valid4 = _errs12 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate159.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema144.allOf[1].properties.devices.items.type, + parentSchema: schema144.allOf[1].properties.devices.items, + data: data2, + }, + ]; + return false; + } + } + var valid3 = _errs8 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate159.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema144.allOf[1].properties.devices.type, + parentSchema: schema144.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } + } + } + } + } else { + validate159.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema144.allOf[1].type, + parentSchema: schema144.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs4 === errors; + } + validate159.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnectionResponse = validate160; +const schema145 = { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'PeerconnectionResponse', + 'x-location': '#/components/schemas/peerconnection_response', + 'x-schema-type': 'response', +}; +function validate160( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.status === undefined && (missing0 = 'status')) + ) { + validate160.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema145.allOf[0].required, + parentSchema: schema145.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate160.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema145.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate160.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema145.allOf[0].properties.url.type, + parentSchema: schema145.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data1 = data.type; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate160.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema145.allOf[0].properties.type.type, + parentSchema: schema145.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'local' || data1 === 'webrtc')) { + validate160.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema145.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema145.allOf[0].properties.type.enum, + parentSchema: schema145.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.status !== undefined) { + let data2 = data.status; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate160.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema145.allOf[0].properties.status.type, + parentSchema: schema145.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'new' || + data2 === 'connecting' || + data2 === 'connected' || + data2 === 'disconnected' || + data2 === 'failed' || + data2 === 'closed' + ) + ) { + validate160.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema145.allOf[0].properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema145.allOf[0].properties.status.enum, + parentSchema: schema145.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate160.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema145.allOf[0].type, + parentSchema: schema145.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs8 = errors; + if (errors === _errs8) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate160.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema145.allOf[1].required, + parentSchema: schema145.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data3 = data.devices; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data3)) { + if (data3.length > 2) { + validate160.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema145.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + if (data3.length < 2) { + validate160.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema145.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data3.length; + for (let i0 = 0; i0 < len0; i0++) { + let data4 = data3[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing2; + if (data4.url === undefined && (missing2 = 'url')) { + validate160.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema145.allOf[1].properties.devices.items.required, + parentSchema: schema145.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate160.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema145.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } else { + validate160.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema145.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema145.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } + } + var valid4 = _errs14 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data4.config !== undefined) { + let data6 = data4.config; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + if (data6.services !== undefined) { + let data7 = data6.services; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid6 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing3; + if ( + (data8.serviceType === undefined && + (missing3 = 'serviceType')) || + (data8.serviceId === undefined && + (missing3 = 'serviceId')) || + (data8.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate160.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: missing3, + }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema145.allOf[1].properties + .devices.items.properties.config + .properties.services.items + .required, + parentSchema: + schema145.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.serviceType !== undefined) { + let data9 = data8.serviceType; + const _errs23 = errors; + if (errors === _errs23) { + if (errors === _errs23) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate160.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema145.allOf[1] + .properties.devices + .items.properties + .config.properties + .services.items + .properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } else { + validate160.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema145.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType.type, + parentSchema: + schema145.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } + } + var valid7 = _errs23 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data8.serviceId !== undefined) { + let data10 = data8.serviceId; + const _errs25 = errors; + if (typeof data10 !== 'string') { + validate160.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema145.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId + .type, + parentSchema: + schema145.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId, + data: data10, + }, + ]; + return false; + } + var valid7 = _errs25 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if ( + data8.remoteServiceId !== + undefined + ) { + let data11 = + data8.remoteServiceId; + const _errs27 = errors; + if (typeof data11 !== 'string') { + validate160.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema145.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId.type, + parentSchema: + schema145.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId, + data: data11, + }, + ]; + return false; + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + validate160.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema145.allOf[1].properties + .devices.items.properties.config + .properties.services.items.type, + parentSchema: + schema145.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } + } + var valid6 = _errs20 === errors; + if (!valid6) { + break; + } + } + } else { + validate160.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema145.allOf[1].properties.devices + .items.properties.config.properties + .services.type, + parentSchema: + schema145.allOf[1].properties.devices + .items.properties.config.properties + .services, + data: data7, + }, + ]; + return false; + } + } + } + } else { + validate160.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/config', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema145.allOf[1].properties.devices.items + .properties.config.type, + parentSchema: + schema145.allOf[1].properties.devices.items + .properties.config, + data: data6, + }, + ]; + return false; + } + } + var valid4 = _errs16 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate160.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema145.allOf[1].properties.devices.items.type, + parentSchema: schema145.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } + } + var valid3 = _errs12 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate160.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema145.allOf[1].properties.devices.type, + parentSchema: schema145.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } + } + } + } + } else { + validate160.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema145.allOf[1].type, + parentSchema: schema145.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs8 === errors; + } + validate160.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnectionClosedEventCallbackRequest = validate161; +const schema146 = { + title: 'Peerconnection Closed Event Callback', + allOf: [ + { + title: 'Event Callback', + allOf: [ + { + title: 'Callback', + type: 'object', + properties: { callbackType: { type: 'string' } }, + required: ['callbackType'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + callbackType: { type: 'string', enum: ['event'] }, + eventType: { type: 'string' }, + }, + required: ['callbackType', 'eventType'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + eventType: { type: 'string', enum: ['peerconnection-closed'] }, + peerconnection: { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + }, + required: ['eventType', 'peerconnection'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'PeerconnectionClosedEventCallbackRequest', + 'x-location': '#/components/schemas/peerconnection_closed_request', + 'x-schema-type': 'request', +}; +function validate161( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.callbackType === undefined && (missing0 = 'callbackType')) { + validate161.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema146.allOf[0].allOf[0].required, + parentSchema: schema146.allOf[0].allOf[0], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data0 = data.callbackType; + if (typeof data0 !== 'string') { + validate161.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/0/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema146.allOf[0].allOf[0].properties.callbackType.type, + parentSchema: schema146.allOf[0].allOf[0].properties.callbackType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate161.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema146.allOf[0].allOf[0].type, + parentSchema: schema146.allOf[0].allOf[0], + data, + }, + ]; + return false; + } + } + var valid1 = _errs1 === errors; + if (valid1) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.callbackType === undefined && (missing1 = 'callbackType')) || + (data.eventType === undefined && (missing1 = 'eventType')) + ) { + validate161.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema146.allOf[0].allOf[1].required, + parentSchema: schema146.allOf[0].allOf[1], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data1 = data.callbackType; + const _errs7 = errors; + if (typeof data1 !== 'string') { + validate161.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema146.allOf[0].allOf[1].properties.callbackType.type, + parentSchema: schema146.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'event')) { + validate161.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/enum', + keyword: 'enum', + params: { + allowedValues: + schema146.allOf[0].allOf[1].properties.callbackType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema146.allOf[0].allOf[1].properties.callbackType.enum, + parentSchema: schema146.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + var valid3 = _errs7 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data.eventType !== undefined) { + let data2 = data.eventType; + const _errs9 = errors; + if (typeof data2 !== 'string') { + validate161.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/0/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema146.allOf[0].allOf[1].properties.eventType.type, + parentSchema: schema146.allOf[0].allOf[1].properties.eventType, + data: data2, + }, + ]; + return false; + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate161.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema146.allOf[0].allOf[1].type, + parentSchema: schema146.allOf[0].allOf[1], + data, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.eventType === undefined && (missing2 = 'eventType')) || + (data.peerconnection === undefined && (missing2 = 'peerconnection')) + ) { + validate161.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema146.allOf[1].required, + parentSchema: schema146.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.eventType !== undefined) { + let data3 = data.eventType; + const _errs13 = errors; + if (typeof data3 !== 'string') { + validate161.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema146.allOf[1].properties.eventType.type, + parentSchema: schema146.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + if (!(data3 === 'peerconnection-closed')) { + validate161.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/enum', + keyword: 'enum', + params: { allowedValues: schema146.allOf[1].properties.eventType.enum }, + message: 'must be equal to one of the allowed values', + schema: schema146.allOf[1].properties.eventType.enum, + parentSchema: schema146.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.peerconnection !== undefined) { + let data4 = data.peerconnection; + const _errs15 = errors; + const _errs16 = errors; + if (errors === _errs16) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing3; + if (data4.type === undefined && (missing3 = 'type')) { + validate161.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: + schema146.allOf[1].properties.peerconnection.allOf[0].required, + parentSchema: + schema146.allOf[1].properties.peerconnection.allOf[0], + data: data4, + }, + ]; + return false; + } else { + if (data4.type !== undefined) { + let data5 = data4.type; + if (typeof data5 !== 'string') { + validate161.errors = [ + { + instancePath: instancePath + '/peerconnection/type', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema146.allOf[1].properties.peerconnection.allOf[0] + .properties.type.type, + parentSchema: + schema146.allOf[1].properties.peerconnection.allOf[0] + .properties.type, + data: data5, + }, + ]; + return false; + } + if (!(data5 === 'local' || data5 === 'webrtc')) { + validate161.errors = [ + { + instancePath: instancePath + '/peerconnection/type', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema146.allOf[1].properties.peerconnection.allOf[0] + .properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema146.allOf[1].properties.peerconnection.allOf[0] + .properties.type.enum, + parentSchema: + schema146.allOf[1].properties.peerconnection.allOf[0] + .properties.type, + data: data5, + }, + ]; + return false; + } + } + } + } else { + validate161.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: '#/allOf/1/properties/peerconnection/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema146.allOf[1].properties.peerconnection.allOf[0].type, + parentSchema: schema146.allOf[1].properties.peerconnection.allOf[0], + data: data4, + }, + ]; + return false; + } + } + var valid5 = _errs16 === errors; + if (valid5) { + const _errs20 = errors; + if (errors === _errs20) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing4; + if (data4.devices === undefined && (missing4 = 'devices')) { + validate161.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: "must have required property '" + missing4 + "'", + schema: + schema146.allOf[1].properties.peerconnection.allOf[1] + .required, + parentSchema: + schema146.allOf[1].properties.peerconnection.allOf[1], + data: data4, + }, + ]; + return false; + } else { + if (data4.devices !== undefined) { + let data6 = data4.devices; + const _errs22 = errors; + if (errors === _errs22) { + if (Array.isArray(data6)) { + if (data6.length > 2) { + validate161.errors = [ + { + instancePath: instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: + schema146.allOf[1].properties.peerconnection.allOf[1] + .properties.devices, + data: data6, + }, + ]; + return false; + } else { + if (data6.length < 2) { + validate161.errors = [ + { + instancePath: + instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: + schema146.allOf[1].properties.peerconnection + .allOf[1].properties.devices, + data: data6, + }, + ]; + return false; + } else { + var valid8 = true; + const len0 = data6.length; + for (let i0 = 0; i0 < len0; i0++) { + let data7 = data6[i0]; + const _errs24 = errors; + if (errors === _errs24) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing5; + if (data7.url === undefined && (missing5 = 'url')) { + validate161.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + + missing5 + + "'", + schema: + schema146.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items + .required, + parentSchema: + schema146.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items, + data: data7, + }, + ]; + return false; + } else { + if (data7.url !== undefined) { + let data8 = data7.url; + const _errs26 = errors; + if (errors === _errs26) { + if (errors === _errs26) { + if (typeof data8 === 'string') { + if (!formats0(data8)) { + validate161.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema146.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url, + data: data8, + }, + ]; + return false; + } + } else { + validate161.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema146.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url.type, + parentSchema: + schema146.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url, + data: data8, + }, + ]; + return false; + } + } + } + var valid9 = _errs26 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data7.config !== undefined) { + let data9 = data7.config; + const _errs28 = errors; + if (errors === _errs28) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + if (data9.services !== undefined) { + let data10 = data9.services; + const _errs30 = errors; + if (errors === _errs30) { + if (Array.isArray(data10)) { + var valid11 = true; + const len1 = data10.length; + for (let i1 = 0; i1 < len1; i1++) { + let data11 = data10[i1]; + const _errs32 = errors; + if (errors === _errs32) { + if ( + data11 && + typeof data11 == 'object' && + !Array.isArray(data11) + ) { + let missing6; + if ( + (data11.serviceType === + undefined && + (missing6 = + 'serviceType')) || + (data11.serviceId === + undefined && + (missing6 = + 'serviceId')) || + (data11.remoteServiceId === + undefined && + (missing6 = + 'remoteServiceId')) + ) { + validate161.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: + missing6, + }, + message: + "must have required property '" + + missing6 + + "'", + schema: + schema146.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items.required, + parentSchema: + schema146.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items, + data: data11, + }, + ]; + return false; + } else { + if ( + data11.serviceType !== + undefined + ) { + let data12 = + data11.serviceType; + const _errs35 = errors; + if (errors === _errs35) { + if ( + errors === _errs35 + ) { + if ( + typeof data12 === + 'string' + ) { + if ( + !formats0(data12) + ) { + validate161.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: + 'format', + params: { + format: + 'uri', + }, + message: + 'must match format "' + + 'uri' + + '"', + schema: + 'uri', + parentSchema: + schema146 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType, + data: data12, + }, + ]; + return false; + } + } else { + validate161.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: + 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema146 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType + .type, + parentSchema: + schema146 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType, + data: data12, + }, + ]; + return false; + } + } + } + var valid12 = + _errs35 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if ( + data11.serviceId !== + undefined + ) { + let data13 = + data11.serviceId; + const _errs37 = errors; + if ( + typeof data13 !== + 'string' + ) { + validate161.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema146 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices.items + .properties + .config + .properties + .services + .items + .properties + .serviceId + .type, + parentSchema: + schema146 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices.items + .properties + .config + .properties + .services + .items + .properties + .serviceId, + data: data13, + }, + ]; + return false; + } + var valid12 = + _errs37 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if ( + data11.remoteServiceId !== + undefined + ) { + let data14 = + data11.remoteServiceId; + const _errs39 = + errors; + if ( + typeof data14 !== + 'string' + ) { + validate161.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: + 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema146 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .remoteServiceId + .type, + parentSchema: + schema146 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .remoteServiceId, + data: data14, + }, + ]; + return false; + } + var valid12 = + _errs39 === errors; + } else { + var valid12 = true; + } + } + } + } + } else { + validate161.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { + type: 'object', + }, + message: 'must be object', + schema: + schema146.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items.type, + parentSchema: + schema146.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items, + data: data11, + }, + ]; + return false; + } + } + var valid11 = _errs32 === errors; + if (!valid11) { + break; + } + } + } else { + validate161.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema146.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config + .properties.services.type, + parentSchema: + schema146.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config + .properties.services, + data: data10, + }, + ]; + return false; + } + } + } + } else { + validate161.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema146.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config.type, + parentSchema: + schema146.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config, + data: data9, + }, + ]; + return false; + } + } + var valid9 = _errs28 === errors; + } else { + var valid9 = true; + } + } + } + } else { + validate161.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema146.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items.type, + parentSchema: + schema146.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items, + data: data7, + }, + ]; + return false; + } + } + var valid8 = _errs24 === errors; + if (!valid8) { + break; + } + } + } + } + } else { + validate161.errors = [ + { + instancePath: instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema146.allOf[1].properties.peerconnection.allOf[1] + .properties.devices.type, + parentSchema: + schema146.allOf[1].properties.peerconnection.allOf[1] + .properties.devices, + data: data6, + }, + ]; + return false; + } + } + } + } + } else { + validate161.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: '#/allOf/1/properties/peerconnection/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema146.allOf[1].properties.peerconnection.allOf[1].type, + parentSchema: + schema146.allOf[1].properties.peerconnection.allOf[1], + data: data4, + }, + ]; + return false; + } + } + var valid5 = _errs20 === errors; + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate161.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema146.allOf[1].type, + parentSchema: schema146.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } + validate161.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnectionClosedEventCallbackResponse = validate162; +const schema147 = { + title: 'Peerconnection Closed Event Callback', + allOf: [ + { + title: 'Event Callback', + allOf: [ + { + title: 'Callback', + type: 'object', + properties: { callbackType: { type: 'string' } }, + required: ['callbackType'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + callbackType: { type: 'string', enum: ['event'] }, + eventType: { type: 'string' }, + }, + required: ['callbackType', 'eventType'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + eventType: { type: 'string', enum: ['peerconnection-closed'] }, + peerconnection: { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: [ + 'new', + 'connecting', + 'connected', + 'disconnected', + 'failed', + 'closed', + ], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + }, + required: ['eventType', 'peerconnection'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'PeerconnectionClosedEventCallbackResponse', + 'x-location': '#/components/schemas/peerconnection_closed_response', + 'x-schema-type': 'response', +}; +function validate162( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.callbackType === undefined && (missing0 = 'callbackType')) { + validate162.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema147.allOf[0].allOf[0].required, + parentSchema: schema147.allOf[0].allOf[0], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data0 = data.callbackType; + if (typeof data0 !== 'string') { + validate162.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/0/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema147.allOf[0].allOf[0].properties.callbackType.type, + parentSchema: schema147.allOf[0].allOf[0].properties.callbackType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate162.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema147.allOf[0].allOf[0].type, + parentSchema: schema147.allOf[0].allOf[0], + data, + }, + ]; + return false; + } + } + var valid1 = _errs1 === errors; + if (valid1) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.callbackType === undefined && (missing1 = 'callbackType')) || + (data.eventType === undefined && (missing1 = 'eventType')) + ) { + validate162.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema147.allOf[0].allOf[1].required, + parentSchema: schema147.allOf[0].allOf[1], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data1 = data.callbackType; + const _errs7 = errors; + if (typeof data1 !== 'string') { + validate162.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema147.allOf[0].allOf[1].properties.callbackType.type, + parentSchema: schema147.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'event')) { + validate162.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/enum', + keyword: 'enum', + params: { + allowedValues: + schema147.allOf[0].allOf[1].properties.callbackType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema147.allOf[0].allOf[1].properties.callbackType.enum, + parentSchema: schema147.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + var valid3 = _errs7 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data.eventType !== undefined) { + let data2 = data.eventType; + const _errs9 = errors; + if (typeof data2 !== 'string') { + validate162.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/0/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema147.allOf[0].allOf[1].properties.eventType.type, + parentSchema: schema147.allOf[0].allOf[1].properties.eventType, + data: data2, + }, + ]; + return false; + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate162.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema147.allOf[0].allOf[1].type, + parentSchema: schema147.allOf[0].allOf[1], + data, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.eventType === undefined && (missing2 = 'eventType')) || + (data.peerconnection === undefined && (missing2 = 'peerconnection')) + ) { + validate162.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema147.allOf[1].required, + parentSchema: schema147.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.eventType !== undefined) { + let data3 = data.eventType; + const _errs13 = errors; + if (typeof data3 !== 'string') { + validate162.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema147.allOf[1].properties.eventType.type, + parentSchema: schema147.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + if (!(data3 === 'peerconnection-closed')) { + validate162.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/enum', + keyword: 'enum', + params: { allowedValues: schema147.allOf[1].properties.eventType.enum }, + message: 'must be equal to one of the allowed values', + schema: schema147.allOf[1].properties.eventType.enum, + parentSchema: schema147.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.peerconnection !== undefined) { + let data4 = data.peerconnection; + const _errs15 = errors; + const _errs16 = errors; + if (errors === _errs16) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing3; + if ( + (data4.url === undefined && (missing3 = 'url')) || + (data4.type === undefined && (missing3 = 'type')) || + (data4.status === undefined && (missing3 = 'status')) + ) { + validate162.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: + schema147.allOf[1].properties.peerconnection.allOf[0].required, + parentSchema: + schema147.allOf[1].properties.peerconnection.allOf[0], + data: data4, + }, + ]; + return false; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate162.errors = [ + { + instancePath: instancePath + '/peerconnection/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema147.allOf[1].properties.peerconnection.allOf[0] + .properties.url, + data: data5, + }, + ]; + return false; + } + } else { + validate162.errors = [ + { + instancePath: instancePath + '/peerconnection/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema147.allOf[1].properties.peerconnection.allOf[0] + .properties.url.type, + parentSchema: + schema147.allOf[1].properties.peerconnection.allOf[0] + .properties.url, + data: data5, + }, + ]; + return false; + } + } + } + var valid6 = _errs18 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data4.type !== undefined) { + let data6 = data4.type; + const _errs20 = errors; + if (typeof data6 !== 'string') { + validate162.errors = [ + { + instancePath: instancePath + '/peerconnection/type', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema147.allOf[1].properties.peerconnection.allOf[0] + .properties.type.type, + parentSchema: + schema147.allOf[1].properties.peerconnection.allOf[0] + .properties.type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'local' || data6 === 'webrtc')) { + validate162.errors = [ + { + instancePath: instancePath + '/peerconnection/type', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema147.allOf[1].properties.peerconnection.allOf[0] + .properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema147.allOf[1].properties.peerconnection.allOf[0] + .properties.type.enum, + parentSchema: + schema147.allOf[1].properties.peerconnection.allOf[0] + .properties.type, + data: data6, + }, + ]; + return false; + } + var valid6 = _errs20 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data4.status !== undefined) { + let data7 = data4.status; + const _errs22 = errors; + if (typeof data7 !== 'string') { + validate162.errors = [ + { + instancePath: instancePath + '/peerconnection/status', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema147.allOf[1].properties.peerconnection.allOf[0] + .properties.status.type, + parentSchema: + schema147.allOf[1].properties.peerconnection.allOf[0] + .properties.status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'new' || + data7 === 'connecting' || + data7 === 'connected' || + data7 === 'disconnected' || + data7 === 'failed' || + data7 === 'closed' + ) + ) { + validate162.errors = [ + { + instancePath: instancePath + '/peerconnection/status', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/status/enum', + keyword: 'enum', + params: { + allowedValues: + schema147.allOf[1].properties.peerconnection.allOf[0] + .properties.status.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema147.allOf[1].properties.peerconnection.allOf[0] + .properties.status.enum, + parentSchema: + schema147.allOf[1].properties.peerconnection.allOf[0] + .properties.status, + data: data7, + }, + ]; + return false; + } + var valid6 = _errs22 === errors; + } else { + var valid6 = true; + } + } + } + } + } else { + validate162.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: '#/allOf/1/properties/peerconnection/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema147.allOf[1].properties.peerconnection.allOf[0].type, + parentSchema: schema147.allOf[1].properties.peerconnection.allOf[0], + data: data4, + }, + ]; + return false; + } + } + var valid5 = _errs16 === errors; + if (valid5) { + const _errs24 = errors; + if (errors === _errs24) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing4; + if (data4.devices === undefined && (missing4 = 'devices')) { + validate162.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: "must have required property '" + missing4 + "'", + schema: + schema147.allOf[1].properties.peerconnection.allOf[1] + .required, + parentSchema: + schema147.allOf[1].properties.peerconnection.allOf[1], + data: data4, + }, + ]; + return false; + } else { + if (data4.devices !== undefined) { + let data8 = data4.devices; + const _errs26 = errors; + if (errors === _errs26) { + if (Array.isArray(data8)) { + if (data8.length > 2) { + validate162.errors = [ + { + instancePath: instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: + schema147.allOf[1].properties.peerconnection.allOf[1] + .properties.devices, + data: data8, + }, + ]; + return false; + } else { + if (data8.length < 2) { + validate162.errors = [ + { + instancePath: + instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: + schema147.allOf[1].properties.peerconnection + .allOf[1].properties.devices, + data: data8, + }, + ]; + return false; + } else { + var valid8 = true; + const len0 = data8.length; + for (let i0 = 0; i0 < len0; i0++) { + let data9 = data8[i0]; + const _errs28 = errors; + if (errors === _errs28) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing5; + if (data9.url === undefined && (missing5 = 'url')) { + validate162.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + + missing5 + + "'", + schema: + schema147.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items + .required, + parentSchema: + schema147.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items, + data: data9, + }, + ]; + return false; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs30 = errors; + if (errors === _errs30) { + if (errors === _errs30) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + validate162.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema147.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } else { + validate162.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema147.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url.type, + parentSchema: + schema147.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } + } + var valid9 = _errs30 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data9.config !== undefined) { + let data11 = data9.config; + const _errs32 = errors; + if (errors === _errs32) { + if ( + data11 && + typeof data11 == 'object' && + !Array.isArray(data11) + ) { + if (data11.services !== undefined) { + let data12 = data11.services; + const _errs34 = errors; + if (errors === _errs34) { + if (Array.isArray(data12)) { + var valid11 = true; + const len1 = data12.length; + for (let i1 = 0; i1 < len1; i1++) { + let data13 = data12[i1]; + const _errs36 = errors; + if (errors === _errs36) { + if ( + data13 && + typeof data13 == 'object' && + !Array.isArray(data13) + ) { + let missing6; + if ( + (data13.serviceType === + undefined && + (missing6 = + 'serviceType')) || + (data13.serviceId === + undefined && + (missing6 = + 'serviceId')) || + (data13.remoteServiceId === + undefined && + (missing6 = + 'remoteServiceId')) + ) { + validate162.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: + missing6, + }, + message: + "must have required property '" + + missing6 + + "'", + schema: + schema147.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items.required, + parentSchema: + schema147.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items, + data: data13, + }, + ]; + return false; + } else { + if ( + data13.serviceType !== + undefined + ) { + let data14 = + data13.serviceType; + const _errs39 = errors; + if (errors === _errs39) { + if ( + errors === _errs39 + ) { + if ( + typeof data14 === + 'string' + ) { + if ( + !formats0(data14) + ) { + validate162.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: + 'format', + params: { + format: + 'uri', + }, + message: + 'must match format "' + + 'uri' + + '"', + schema: + 'uri', + parentSchema: + schema147 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType, + data: data14, + }, + ]; + return false; + } + } else { + validate162.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: + 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema147 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType + .type, + parentSchema: + schema147 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType, + data: data14, + }, + ]; + return false; + } + } + } + var valid12 = + _errs39 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if ( + data13.serviceId !== + undefined + ) { + let data15 = + data13.serviceId; + const _errs41 = errors; + if ( + typeof data15 !== + 'string' + ) { + validate162.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema147 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices.items + .properties + .config + .properties + .services + .items + .properties + .serviceId + .type, + parentSchema: + schema147 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices.items + .properties + .config + .properties + .services + .items + .properties + .serviceId, + data: data15, + }, + ]; + return false; + } + var valid12 = + _errs41 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if ( + data13.remoteServiceId !== + undefined + ) { + let data16 = + data13.remoteServiceId; + const _errs43 = + errors; + if ( + typeof data16 !== + 'string' + ) { + validate162.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: + 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema147 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .remoteServiceId + .type, + parentSchema: + schema147 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .remoteServiceId, + data: data16, + }, + ]; + return false; + } + var valid12 = + _errs43 === errors; + } else { + var valid12 = true; + } + } + } + } + } else { + validate162.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { + type: 'object', + }, + message: 'must be object', + schema: + schema147.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items.type, + parentSchema: + schema147.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items, + data: data13, + }, + ]; + return false; + } + } + var valid11 = _errs36 === errors; + if (!valid11) { + break; + } + } + } else { + validate162.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema147.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config + .properties.services.type, + parentSchema: + schema147.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config + .properties.services, + data: data12, + }, + ]; + return false; + } + } + } + } else { + validate162.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema147.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config.type, + parentSchema: + schema147.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config, + data: data11, + }, + ]; + return false; + } + } + var valid9 = _errs32 === errors; + } else { + var valid9 = true; + } + } + } + } else { + validate162.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema147.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items.type, + parentSchema: + schema147.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items, + data: data9, + }, + ]; + return false; + } + } + var valid8 = _errs28 === errors; + if (!valid8) { + break; + } + } + } + } + } else { + validate162.errors = [ + { + instancePath: instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema147.allOf[1].properties.peerconnection.allOf[1] + .properties.devices.type, + parentSchema: + schema147.allOf[1].properties.peerconnection.allOf[1] + .properties.devices, + data: data8, + }, + ]; + return false; + } + } + } + } + } else { + validate162.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: '#/allOf/1/properties/peerconnection/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema147.allOf[1].properties.peerconnection.allOf[1].type, + parentSchema: + schema147.allOf[1].properties.peerconnection.allOf[1], + data: data4, + }, + ]; + return false; + } + } + var valid5 = _errs24 === errors; + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate162.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema147.allOf[1].type, + parentSchema: schema147.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } + validate162.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnectionStatusChangedEventCallbackRequest = validate163; +const schema148 = { + title: 'Peerconnection Status Changed Event Callback', + allOf: [ + { + title: 'Event Callback', + allOf: [ + { + title: 'Callback', + type: 'object', + properties: { callbackType: { type: 'string' } }, + required: ['callbackType'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + callbackType: { type: 'string', enum: ['event'] }, + eventType: { type: 'string' }, + }, + required: ['callbackType', 'eventType'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + eventType: { type: 'string', enum: ['peerconnection-status-changed'] }, + peerconnection: { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + }, + required: ['eventType', 'peerconnection'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'PeerconnectionStatusChangedEventCallbackRequest', + 'x-location': '#/components/schemas/peerconnection_status_changed_request', + 'x-schema-type': 'request', +}; +function validate163( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.callbackType === undefined && (missing0 = 'callbackType')) { + validate163.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema148.allOf[0].allOf[0].required, + parentSchema: schema148.allOf[0].allOf[0], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data0 = data.callbackType; + if (typeof data0 !== 'string') { + validate163.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/0/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema148.allOf[0].allOf[0].properties.callbackType.type, + parentSchema: schema148.allOf[0].allOf[0].properties.callbackType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate163.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema148.allOf[0].allOf[0].type, + parentSchema: schema148.allOf[0].allOf[0], + data, + }, + ]; + return false; + } + } + var valid1 = _errs1 === errors; + if (valid1) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.callbackType === undefined && (missing1 = 'callbackType')) || + (data.eventType === undefined && (missing1 = 'eventType')) + ) { + validate163.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema148.allOf[0].allOf[1].required, + parentSchema: schema148.allOf[0].allOf[1], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data1 = data.callbackType; + const _errs7 = errors; + if (typeof data1 !== 'string') { + validate163.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema148.allOf[0].allOf[1].properties.callbackType.type, + parentSchema: schema148.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'event')) { + validate163.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/enum', + keyword: 'enum', + params: { + allowedValues: + schema148.allOf[0].allOf[1].properties.callbackType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema148.allOf[0].allOf[1].properties.callbackType.enum, + parentSchema: schema148.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + var valid3 = _errs7 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data.eventType !== undefined) { + let data2 = data.eventType; + const _errs9 = errors; + if (typeof data2 !== 'string') { + validate163.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/0/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema148.allOf[0].allOf[1].properties.eventType.type, + parentSchema: schema148.allOf[0].allOf[1].properties.eventType, + data: data2, + }, + ]; + return false; + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate163.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema148.allOf[0].allOf[1].type, + parentSchema: schema148.allOf[0].allOf[1], + data, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.eventType === undefined && (missing2 = 'eventType')) || + (data.peerconnection === undefined && (missing2 = 'peerconnection')) + ) { + validate163.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema148.allOf[1].required, + parentSchema: schema148.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.eventType !== undefined) { + let data3 = data.eventType; + const _errs13 = errors; + if (typeof data3 !== 'string') { + validate163.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema148.allOf[1].properties.eventType.type, + parentSchema: schema148.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + if (!(data3 === 'peerconnection-status-changed')) { + validate163.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/enum', + keyword: 'enum', + params: { allowedValues: schema148.allOf[1].properties.eventType.enum }, + message: 'must be equal to one of the allowed values', + schema: schema148.allOf[1].properties.eventType.enum, + parentSchema: schema148.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.peerconnection !== undefined) { + let data4 = data.peerconnection; + const _errs15 = errors; + const _errs16 = errors; + if (errors === _errs16) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing3; + if (data4.type === undefined && (missing3 = 'type')) { + validate163.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: + schema148.allOf[1].properties.peerconnection.allOf[0].required, + parentSchema: + schema148.allOf[1].properties.peerconnection.allOf[0], + data: data4, + }, + ]; + return false; + } else { + if (data4.type !== undefined) { + let data5 = data4.type; + if (typeof data5 !== 'string') { + validate163.errors = [ + { + instancePath: instancePath + '/peerconnection/type', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema148.allOf[1].properties.peerconnection.allOf[0] + .properties.type.type, + parentSchema: + schema148.allOf[1].properties.peerconnection.allOf[0] + .properties.type, + data: data5, + }, + ]; + return false; + } + if (!(data5 === 'local' || data5 === 'webrtc')) { + validate163.errors = [ + { + instancePath: instancePath + '/peerconnection/type', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema148.allOf[1].properties.peerconnection.allOf[0] + .properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema148.allOf[1].properties.peerconnection.allOf[0] + .properties.type.enum, + parentSchema: + schema148.allOf[1].properties.peerconnection.allOf[0] + .properties.type, + data: data5, + }, + ]; + return false; + } + } + } + } else { + validate163.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: '#/allOf/1/properties/peerconnection/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema148.allOf[1].properties.peerconnection.allOf[0].type, + parentSchema: schema148.allOf[1].properties.peerconnection.allOf[0], + data: data4, + }, + ]; + return false; + } + } + var valid5 = _errs16 === errors; + if (valid5) { + const _errs20 = errors; + if (errors === _errs20) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing4; + if (data4.devices === undefined && (missing4 = 'devices')) { + validate163.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: "must have required property '" + missing4 + "'", + schema: + schema148.allOf[1].properties.peerconnection.allOf[1] + .required, + parentSchema: + schema148.allOf[1].properties.peerconnection.allOf[1], + data: data4, + }, + ]; + return false; + } else { + if (data4.devices !== undefined) { + let data6 = data4.devices; + const _errs22 = errors; + if (errors === _errs22) { + if (Array.isArray(data6)) { + if (data6.length > 2) { + validate163.errors = [ + { + instancePath: instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: + schema148.allOf[1].properties.peerconnection.allOf[1] + .properties.devices, + data: data6, + }, + ]; + return false; + } else { + if (data6.length < 2) { + validate163.errors = [ + { + instancePath: + instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: + schema148.allOf[1].properties.peerconnection + .allOf[1].properties.devices, + data: data6, + }, + ]; + return false; + } else { + var valid8 = true; + const len0 = data6.length; + for (let i0 = 0; i0 < len0; i0++) { + let data7 = data6[i0]; + const _errs24 = errors; + if (errors === _errs24) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing5; + if (data7.url === undefined && (missing5 = 'url')) { + validate163.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + + missing5 + + "'", + schema: + schema148.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items + .required, + parentSchema: + schema148.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items, + data: data7, + }, + ]; + return false; + } else { + if (data7.url !== undefined) { + let data8 = data7.url; + const _errs26 = errors; + if (errors === _errs26) { + if (errors === _errs26) { + if (typeof data8 === 'string') { + if (!formats0(data8)) { + validate163.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema148.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url, + data: data8, + }, + ]; + return false; + } + } else { + validate163.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema148.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url.type, + parentSchema: + schema148.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url, + data: data8, + }, + ]; + return false; + } + } + } + var valid9 = _errs26 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data7.config !== undefined) { + let data9 = data7.config; + const _errs28 = errors; + if (errors === _errs28) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + if (data9.services !== undefined) { + let data10 = data9.services; + const _errs30 = errors; + if (errors === _errs30) { + if (Array.isArray(data10)) { + var valid11 = true; + const len1 = data10.length; + for (let i1 = 0; i1 < len1; i1++) { + let data11 = data10[i1]; + const _errs32 = errors; + if (errors === _errs32) { + if ( + data11 && + typeof data11 == 'object' && + !Array.isArray(data11) + ) { + let missing6; + if ( + (data11.serviceType === + undefined && + (missing6 = + 'serviceType')) || + (data11.serviceId === + undefined && + (missing6 = + 'serviceId')) || + (data11.remoteServiceId === + undefined && + (missing6 = + 'remoteServiceId')) + ) { + validate163.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: + missing6, + }, + message: + "must have required property '" + + missing6 + + "'", + schema: + schema148.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items.required, + parentSchema: + schema148.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items, + data: data11, + }, + ]; + return false; + } else { + if ( + data11.serviceType !== + undefined + ) { + let data12 = + data11.serviceType; + const _errs35 = errors; + if (errors === _errs35) { + if ( + errors === _errs35 + ) { + if ( + typeof data12 === + 'string' + ) { + if ( + !formats0(data12) + ) { + validate163.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: + 'format', + params: { + format: + 'uri', + }, + message: + 'must match format "' + + 'uri' + + '"', + schema: + 'uri', + parentSchema: + schema148 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType, + data: data12, + }, + ]; + return false; + } + } else { + validate163.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: + 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema148 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType + .type, + parentSchema: + schema148 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType, + data: data12, + }, + ]; + return false; + } + } + } + var valid12 = + _errs35 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if ( + data11.serviceId !== + undefined + ) { + let data13 = + data11.serviceId; + const _errs37 = errors; + if ( + typeof data13 !== + 'string' + ) { + validate163.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema148 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices.items + .properties + .config + .properties + .services + .items + .properties + .serviceId + .type, + parentSchema: + schema148 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices.items + .properties + .config + .properties + .services + .items + .properties + .serviceId, + data: data13, + }, + ]; + return false; + } + var valid12 = + _errs37 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if ( + data11.remoteServiceId !== + undefined + ) { + let data14 = + data11.remoteServiceId; + const _errs39 = + errors; + if ( + typeof data14 !== + 'string' + ) { + validate163.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: + 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema148 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .remoteServiceId + .type, + parentSchema: + schema148 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .remoteServiceId, + data: data14, + }, + ]; + return false; + } + var valid12 = + _errs39 === errors; + } else { + var valid12 = true; + } + } + } + } + } else { + validate163.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { + type: 'object', + }, + message: 'must be object', + schema: + schema148.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items.type, + parentSchema: + schema148.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items, + data: data11, + }, + ]; + return false; + } + } + var valid11 = _errs32 === errors; + if (!valid11) { + break; + } + } + } else { + validate163.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema148.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config + .properties.services.type, + parentSchema: + schema148.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config + .properties.services, + data: data10, + }, + ]; + return false; + } + } + } + } else { + validate163.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema148.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config.type, + parentSchema: + schema148.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config, + data: data9, + }, + ]; + return false; + } + } + var valid9 = _errs28 === errors; + } else { + var valid9 = true; + } + } + } + } else { + validate163.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema148.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items.type, + parentSchema: + schema148.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items, + data: data7, + }, + ]; + return false; + } + } + var valid8 = _errs24 === errors; + if (!valid8) { + break; + } + } + } + } + } else { + validate163.errors = [ + { + instancePath: instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema148.allOf[1].properties.peerconnection.allOf[1] + .properties.devices.type, + parentSchema: + schema148.allOf[1].properties.peerconnection.allOf[1] + .properties.devices, + data: data6, + }, + ]; + return false; + } + } + } + } + } else { + validate163.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: '#/allOf/1/properties/peerconnection/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema148.allOf[1].properties.peerconnection.allOf[1].type, + parentSchema: + schema148.allOf[1].properties.peerconnection.allOf[1], + data: data4, + }, + ]; + return false; + } + } + var valid5 = _errs20 === errors; + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate163.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema148.allOf[1].type, + parentSchema: schema148.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } + validate163.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnectionStatusChangedEventCallbackResponse = validate164; +const schema149 = { + title: 'Peerconnection Status Changed Event Callback', + allOf: [ + { + title: 'Event Callback', + allOf: [ + { + title: 'Callback', + type: 'object', + properties: { callbackType: { type: 'string' } }, + required: ['callbackType'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + callbackType: { type: 'string', enum: ['event'] }, + eventType: { type: 'string' }, + }, + required: ['callbackType', 'eventType'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + eventType: { type: 'string', enum: ['peerconnection-status-changed'] }, + peerconnection: { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: [ + 'new', + 'connecting', + 'connected', + 'disconnected', + 'failed', + 'closed', + ], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + }, + required: ['eventType', 'peerconnection'], + }, + ], + 'x-typeguard': true, + 'x-standalone': true, + 'x-name': 'PeerconnectionStatusChangedEventCallbackResponse', + 'x-location': '#/components/schemas/peerconnection_status_changed_response', + 'x-schema-type': 'response', +}; +function validate164( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.callbackType === undefined && (missing0 = 'callbackType')) { + validate164.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema149.allOf[0].allOf[0].required, + parentSchema: schema149.allOf[0].allOf[0], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data0 = data.callbackType; + if (typeof data0 !== 'string') { + validate164.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/0/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema149.allOf[0].allOf[0].properties.callbackType.type, + parentSchema: schema149.allOf[0].allOf[0].properties.callbackType, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate164.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema149.allOf[0].allOf[0].type, + parentSchema: schema149.allOf[0].allOf[0], + data, + }, + ]; + return false; + } + } + var valid1 = _errs1 === errors; + if (valid1) { + const _errs5 = errors; + if (errors === _errs5) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.callbackType === undefined && (missing1 = 'callbackType')) || + (data.eventType === undefined && (missing1 = 'eventType')) + ) { + validate164.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema149.allOf[0].allOf[1].required, + parentSchema: schema149.allOf[0].allOf[1], + data, + }, + ]; + return false; + } else { + if (data.callbackType !== undefined) { + let data1 = data.callbackType; + const _errs7 = errors; + if (typeof data1 !== 'string') { + validate164.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema149.allOf[0].allOf[1].properties.callbackType.type, + parentSchema: schema149.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'event')) { + validate164.errors = [ + { + instancePath: instancePath + '/callbackType', + schemaPath: '#/allOf/0/allOf/1/properties/callbackType/enum', + keyword: 'enum', + params: { + allowedValues: + schema149.allOf[0].allOf[1].properties.callbackType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema149.allOf[0].allOf[1].properties.callbackType.enum, + parentSchema: schema149.allOf[0].allOf[1].properties.callbackType, + data: data1, + }, + ]; + return false; + } + var valid3 = _errs7 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data.eventType !== undefined) { + let data2 = data.eventType; + const _errs9 = errors; + if (typeof data2 !== 'string') { + validate164.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/0/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema149.allOf[0].allOf[1].properties.eventType.type, + parentSchema: schema149.allOf[0].allOf[1].properties.eventType, + data: data2, + }, + ]; + return false; + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate164.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema149.allOf[0].allOf[1].type, + parentSchema: schema149.allOf[0].allOf[1], + data, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.eventType === undefined && (missing2 = 'eventType')) || + (data.peerconnection === undefined && (missing2 = 'peerconnection')) + ) { + validate164.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema149.allOf[1].required, + parentSchema: schema149.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.eventType !== undefined) { + let data3 = data.eventType; + const _errs13 = errors; + if (typeof data3 !== 'string') { + validate164.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema149.allOf[1].properties.eventType.type, + parentSchema: schema149.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + if (!(data3 === 'peerconnection-status-changed')) { + validate164.errors = [ + { + instancePath: instancePath + '/eventType', + schemaPath: '#/allOf/1/properties/eventType/enum', + keyword: 'enum', + params: { allowedValues: schema149.allOf[1].properties.eventType.enum }, + message: 'must be equal to one of the allowed values', + schema: schema149.allOf[1].properties.eventType.enum, + parentSchema: schema149.allOf[1].properties.eventType, + data: data3, + }, + ]; + return false; + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.peerconnection !== undefined) { + let data4 = data.peerconnection; + const _errs15 = errors; + const _errs16 = errors; + if (errors === _errs16) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing3; + if ( + (data4.url === undefined && (missing3 = 'url')) || + (data4.type === undefined && (missing3 = 'type')) || + (data4.status === undefined && (missing3 = 'status')) + ) { + validate164.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: + schema149.allOf[1].properties.peerconnection.allOf[0].required, + parentSchema: + schema149.allOf[1].properties.peerconnection.allOf[0], + data: data4, + }, + ]; + return false; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate164.errors = [ + { + instancePath: instancePath + '/peerconnection/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema149.allOf[1].properties.peerconnection.allOf[0] + .properties.url, + data: data5, + }, + ]; + return false; + } + } else { + validate164.errors = [ + { + instancePath: instancePath + '/peerconnection/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema149.allOf[1].properties.peerconnection.allOf[0] + .properties.url.type, + parentSchema: + schema149.allOf[1].properties.peerconnection.allOf[0] + .properties.url, + data: data5, + }, + ]; + return false; + } + } + } + var valid6 = _errs18 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data4.type !== undefined) { + let data6 = data4.type; + const _errs20 = errors; + if (typeof data6 !== 'string') { + validate164.errors = [ + { + instancePath: instancePath + '/peerconnection/type', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema149.allOf[1].properties.peerconnection.allOf[0] + .properties.type.type, + parentSchema: + schema149.allOf[1].properties.peerconnection.allOf[0] + .properties.type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'local' || data6 === 'webrtc')) { + validate164.errors = [ + { + instancePath: instancePath + '/peerconnection/type', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema149.allOf[1].properties.peerconnection.allOf[0] + .properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema149.allOf[1].properties.peerconnection.allOf[0] + .properties.type.enum, + parentSchema: + schema149.allOf[1].properties.peerconnection.allOf[0] + .properties.type, + data: data6, + }, + ]; + return false; + } + var valid6 = _errs20 === errors; + } else { + var valid6 = true; + } + if (valid6) { + if (data4.status !== undefined) { + let data7 = data4.status; + const _errs22 = errors; + if (typeof data7 !== 'string') { + validate164.errors = [ + { + instancePath: instancePath + '/peerconnection/status', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema149.allOf[1].properties.peerconnection.allOf[0] + .properties.status.type, + parentSchema: + schema149.allOf[1].properties.peerconnection.allOf[0] + .properties.status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'new' || + data7 === 'connecting' || + data7 === 'connected' || + data7 === 'disconnected' || + data7 === 'failed' || + data7 === 'closed' + ) + ) { + validate164.errors = [ + { + instancePath: instancePath + '/peerconnection/status', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/0/properties/status/enum', + keyword: 'enum', + params: { + allowedValues: + schema149.allOf[1].properties.peerconnection.allOf[0] + .properties.status.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema149.allOf[1].properties.peerconnection.allOf[0] + .properties.status.enum, + parentSchema: + schema149.allOf[1].properties.peerconnection.allOf[0] + .properties.status, + data: data7, + }, + ]; + return false; + } + var valid6 = _errs22 === errors; + } else { + var valid6 = true; + } + } + } + } + } else { + validate164.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: '#/allOf/1/properties/peerconnection/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema149.allOf[1].properties.peerconnection.allOf[0].type, + parentSchema: schema149.allOf[1].properties.peerconnection.allOf[0], + data: data4, + }, + ]; + return false; + } + } + var valid5 = _errs16 === errors; + if (valid5) { + const _errs24 = errors; + if (errors === _errs24) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing4; + if (data4.devices === undefined && (missing4 = 'devices')) { + validate164.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: "must have required property '" + missing4 + "'", + schema: + schema149.allOf[1].properties.peerconnection.allOf[1] + .required, + parentSchema: + schema149.allOf[1].properties.peerconnection.allOf[1], + data: data4, + }, + ]; + return false; + } else { + if (data4.devices !== undefined) { + let data8 = data4.devices; + const _errs26 = errors; + if (errors === _errs26) { + if (Array.isArray(data8)) { + if (data8.length > 2) { + validate164.errors = [ + { + instancePath: instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: + schema149.allOf[1].properties.peerconnection.allOf[1] + .properties.devices, + data: data8, + }, + ]; + return false; + } else { + if (data8.length < 2) { + validate164.errors = [ + { + instancePath: + instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: + schema149.allOf[1].properties.peerconnection + .allOf[1].properties.devices, + data: data8, + }, + ]; + return false; + } else { + var valid8 = true; + const len0 = data8.length; + for (let i0 = 0; i0 < len0; i0++) { + let data9 = data8[i0]; + const _errs28 = errors; + if (errors === _errs28) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing5; + if (data9.url === undefined && (missing5 = 'url')) { + validate164.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + + missing5 + + "'", + schema: + schema149.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items + .required, + parentSchema: + schema149.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items, + data: data9, + }, + ]; + return false; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs30 = errors; + if (errors === _errs30) { + if (errors === _errs30) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + validate164.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema149.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } else { + validate164.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/url', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema149.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url.type, + parentSchema: + schema149.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } + } + var valid9 = _errs30 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data9.config !== undefined) { + let data11 = data9.config; + const _errs32 = errors; + if (errors === _errs32) { + if ( + data11 && + typeof data11 == 'object' && + !Array.isArray(data11) + ) { + if (data11.services !== undefined) { + let data12 = data11.services; + const _errs34 = errors; + if (errors === _errs34) { + if (Array.isArray(data12)) { + var valid11 = true; + const len1 = data12.length; + for (let i1 = 0; i1 < len1; i1++) { + let data13 = data12[i1]; + const _errs36 = errors; + if (errors === _errs36) { + if ( + data13 && + typeof data13 == 'object' && + !Array.isArray(data13) + ) { + let missing6; + if ( + (data13.serviceType === + undefined && + (missing6 = + 'serviceType')) || + (data13.serviceId === + undefined && + (missing6 = + 'serviceId')) || + (data13.remoteServiceId === + undefined && + (missing6 = + 'remoteServiceId')) + ) { + validate164.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: + missing6, + }, + message: + "must have required property '" + + missing6 + + "'", + schema: + schema149.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items.required, + parentSchema: + schema149.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items, + data: data13, + }, + ]; + return false; + } else { + if ( + data13.serviceType !== + undefined + ) { + let data14 = + data13.serviceType; + const _errs39 = errors; + if (errors === _errs39) { + if ( + errors === _errs39 + ) { + if ( + typeof data14 === + 'string' + ) { + if ( + !formats0(data14) + ) { + validate164.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: + 'format', + params: { + format: + 'uri', + }, + message: + 'must match format "' + + 'uri' + + '"', + schema: + 'uri', + parentSchema: + schema149 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType, + data: data14, + }, + ]; + return false; + } + } else { + validate164.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: + 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema149 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType + .type, + parentSchema: + schema149 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .serviceType, + data: data14, + }, + ]; + return false; + } + } + } + var valid12 = + _errs39 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if ( + data13.serviceId !== + undefined + ) { + let data15 = + data13.serviceId; + const _errs41 = errors; + if ( + typeof data15 !== + 'string' + ) { + validate164.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema149 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices.items + .properties + .config + .properties + .services + .items + .properties + .serviceId + .type, + parentSchema: + schema149 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices.items + .properties + .config + .properties + .services + .items + .properties + .serviceId, + data: data15, + }, + ]; + return false; + } + var valid12 = + _errs41 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if ( + data13.remoteServiceId !== + undefined + ) { + let data16 = + data13.remoteServiceId; + const _errs43 = + errors; + if ( + typeof data16 !== + 'string' + ) { + validate164.errors = + [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: + 'type', + params: { + type: 'string', + }, + message: + 'must be string', + schema: + schema149 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .remoteServiceId + .type, + parentSchema: + schema149 + .allOf[1] + .properties + .peerconnection + .allOf[1] + .properties + .devices + .items + .properties + .config + .properties + .services + .items + .properties + .remoteServiceId, + data: data16, + }, + ]; + return false; + } + var valid12 = + _errs43 === errors; + } else { + var valid12 = true; + } + } + } + } + } else { + validate164.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { + type: 'object', + }, + message: 'must be object', + schema: + schema149.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items.type, + parentSchema: + schema149.allOf[1] + .properties + .peerconnection + .allOf[1].properties + .devices.items + .properties.config + .properties.services + .items, + data: data13, + }, + ]; + return false; + } + } + var valid11 = _errs36 === errors; + if (!valid11) { + break; + } + } + } else { + validate164.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema149.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config + .properties.services.type, + parentSchema: + schema149.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config + .properties.services, + data: data12, + }, + ]; + return false; + } + } + } + } else { + validate164.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0 + + '/config', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema149.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config.type, + parentSchema: + schema149.allOf[1].properties + .peerconnection.allOf[1] + .properties.devices.items + .properties.config, + data: data11, + }, + ]; + return false; + } + } + var valid9 = _errs32 === errors; + } else { + var valid9 = true; + } + } + } + } else { + validate164.errors = [ + { + instancePath: + instancePath + + '/peerconnection/devices/' + + i0, + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema149.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items.type, + parentSchema: + schema149.allOf[1].properties.peerconnection + .allOf[1].properties.devices.items, + data: data9, + }, + ]; + return false; + } + } + var valid8 = _errs28 === errors; + if (!valid8) { + break; + } + } + } + } + } else { + validate164.errors = [ + { + instancePath: instancePath + '/peerconnection/devices', + schemaPath: + '#/allOf/1/properties/peerconnection/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema149.allOf[1].properties.peerconnection.allOf[1] + .properties.devices.type, + parentSchema: + schema149.allOf[1].properties.peerconnection.allOf[1] + .properties.devices, + data: data8, + }, + ]; + return false; + } + } + } + } + } else { + validate164.errors = [ + { + instancePath: instancePath + '/peerconnection', + schemaPath: '#/allOf/1/properties/peerconnection/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema149.allOf[1].properties.peerconnection.allOf[1].type, + parentSchema: + schema149.allOf[1].properties.peerconnection.allOf[1], + data: data4, + }, + ]; + return false; + } + } + var valid5 = _errs24 === errors; + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate164.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema149.allOf[1].type, + parentSchema: schema149.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } + validate164.errors = vErrors; + return errors === 0; +} +exports.validateChangedUrlRequest = validate165; +const schema150 = { + type: 'string', + format: 'uri', + 'x-standalone': false, + 'x-name': 'ChangedUrlRequest', + 'x-location': '#/components/parameters/device_changed_url/schema_request', + 'x-schema-type': 'request', +}; +function validate165( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats0(data)) { + validate165.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema150, + data, + }, + ]; + return false; + } + } else { + validate165.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema150.type, + parentSchema: schema150, + data, + }, + ]; + return false; + } + } + } + validate165.errors = vErrors; + return errors === 0; +} +exports.validateChangedUrlResponse = validate166; +const schema151 = { + type: 'string', + format: 'uri', + 'x-standalone': false, + 'x-name': 'ChangedUrlResponse', + 'x-location': '#/components/parameters/device_changed_url/schema_response', + 'x-schema-type': 'response', +}; +function validate166( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats0(data)) { + validate166.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema151, + data, + }, + ]; + return false; + } + } else { + validate166.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema151.type, + parentSchema: schema151, + data, + }, + ]; + return false; + } + } + } + validate166.errors = vErrors; + return errors === 0; +} +exports.validateDeviceIdRequest = validate167; +const schema152 = { + type: 'string', + format: 'uuid', + 'x-standalone': false, + 'x-name': 'DeviceIdRequest', + 'x-location': '#/components/parameters/device_id/schema_request', + 'x-schema-type': 'request', +}; +function validate167( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats258.test(data)) { + validate167.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uuid' }, + message: 'must match format "' + 'uuid' + '"', + schema: 'uuid', + parentSchema: schema152, + data, + }, + ]; + return false; + } + } else { + validate167.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema152.type, + parentSchema: schema152, + data, + }, + ]; + return false; + } + } + } + validate167.errors = vErrors; + return errors === 0; +} +exports.validateDeviceIdResponse = validate168; +const schema153 = { + type: 'string', + format: 'uuid', + 'x-standalone': false, + 'x-name': 'DeviceIdResponse', + 'x-location': '#/components/parameters/device_id/schema_response', + 'x-schema-type': 'response', +}; +function validate168( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats258.test(data)) { + validate168.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uuid' }, + message: 'must match format "' + 'uuid' + '"', + schema: 'uuid', + parentSchema: schema153, + data, + }, + ]; + return false; + } + } else { + validate168.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema153.type, + parentSchema: schema153, + data, + }, + ]; + return false; + } + } + } + validate168.errors = vErrors; + return errors === 0; +} +exports.validateFlatGroupRequest = validate169; +const schema154 = { + type: 'boolean', + default: false, + 'x-standalone': false, + 'x-name': 'FlatGroupRequest', + 'x-location': '#/components/parameters/flat_group/schema_request', + 'x-schema-type': 'request', +}; +function validate169( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'boolean') { + validate169.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema154.type, + parentSchema: schema154, + data, + }, + ]; + return false; + } + validate169.errors = vErrors; + return errors === 0; +} +exports.validateFlatGroupResponse = validate170; +const schema155 = { + type: 'boolean', + default: false, + 'x-standalone': false, + 'x-name': 'FlatGroupResponse', + 'x-location': '#/components/parameters/flat_group/schema_response', + 'x-schema-type': 'response', +}; +function validate170( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'boolean') { + validate170.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema155.type, + parentSchema: schema155, + data, + }, + ]; + return false; + } + validate170.errors = vErrors; + return errors === 0; +} +exports.validateStartTimeRequest = validate171; +const schema156 = { + type: 'string', + format: 'date-time', + 'x-standalone': false, + 'x-name': 'StartTimeRequest', + 'x-location': '#/components/parameters/start_time/schema_request', + 'x-schema-type': 'request', +}; +function validate171( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats22.validate(data)) { + validate171.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema156, + data, + }, + ]; + return false; + } + } else { + validate171.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema156.type, + parentSchema: schema156, + data, + }, + ]; + return false; + } + } + } + validate171.errors = vErrors; + return errors === 0; +} +exports.validateStartTimeResponse = validate172; +const schema157 = { + type: 'string', + format: 'date-time', + 'x-standalone': false, + 'x-name': 'StartTimeResponse', + 'x-location': '#/components/parameters/start_time/schema_response', + 'x-schema-type': 'response', +}; +function validate172( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats22.validate(data)) { + validate172.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema157, + data, + }, + ]; + return false; + } + } else { + validate172.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema157.type, + parentSchema: schema157, + data, + }, + ]; + return false; + } + } + } + validate172.errors = vErrors; + return errors === 0; +} +exports.validateEndTimeRequest = validate173; +const schema158 = { + type: 'string', + format: 'date-time', + 'x-standalone': false, + 'x-name': 'EndTimeRequest', + 'x-location': '#/components/parameters/end_time/schema_request', + 'x-schema-type': 'request', +}; +function validate173( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats22.validate(data)) { + validate173.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema158, + data, + }, + ]; + return false; + } + } else { + validate173.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema158.type, + parentSchema: schema158, + data, + }, + ]; + return false; + } + } + } + validate173.errors = vErrors; + return errors === 0; +} +exports.validateEndTimeResponse = validate174; +const schema159 = { + type: 'string', + format: 'date-time', + 'x-standalone': false, + 'x-name': 'EndTimeResponse', + 'x-location': '#/components/parameters/end_time/schema_response', + 'x-schema-type': 'response', +}; +function validate174( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats22.validate(data)) { + validate174.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema159, + data, + }, + ]; + return false; + } + } else { + validate174.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema159.type, + parentSchema: schema159, + data, + }, + ]; + return false; + } + } + } + validate174.errors = vErrors; + return errors === 0; +} +exports.validateClosedUrlRequest = validate175; +const schema160 = { + type: 'string', + format: 'uri', + 'x-standalone': false, + 'x-name': 'ClosedUrlRequest', + 'x-location': '#/components/parameters/closed_url/schema_request', + 'x-schema-type': 'request', +}; +function validate175( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats0(data)) { + validate175.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema160, + data, + }, + ]; + return false; + } + } else { + validate175.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema160.type, + parentSchema: schema160, + data, + }, + ]; + return false; + } + } + } + validate175.errors = vErrors; + return errors === 0; +} +exports.validateClosedUrlResponse = validate176; +const schema161 = { + type: 'string', + format: 'uri', + 'x-standalone': false, + 'x-name': 'ClosedUrlResponse', + 'x-location': '#/components/parameters/closed_url/schema_response', + 'x-schema-type': 'response', +}; +function validate176( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats0(data)) { + validate176.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema161, + data, + }, + ]; + return false; + } + } else { + validate176.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema161.type, + parentSchema: schema161, + data, + }, + ]; + return false; + } + } + } + validate176.errors = vErrors; + return errors === 0; +} +exports.validateStatusChangedUrlRequest = validate177; +const schema162 = { + type: 'string', + format: 'uri', + 'x-standalone': false, + 'x-name': 'StatusChangedUrlRequest', + 'x-location': '#/components/parameters/status_changed_url/schema_request', + 'x-schema-type': 'request', +}; +function validate177( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats0(data)) { + validate177.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema162, + data, + }, + ]; + return false; + } + } else { + validate177.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema162.type, + parentSchema: schema162, + data, + }, + ]; + return false; + } + } + } + validate177.errors = vErrors; + return errors === 0; +} +exports.validateStatusChangedUrlResponse = validate178; +const schema163 = { + type: 'string', + format: 'uri', + 'x-standalone': false, + 'x-name': 'StatusChangedUrlResponse', + 'x-location': '#/components/parameters/status_changed_url/schema_response', + 'x-schema-type': 'response', +}; +function validate178( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats0(data)) { + validate178.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema163, + data, + }, + ]; + return false; + } + } else { + validate178.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema163.type, + parentSchema: schema163, + data, + }, + ]; + return false; + } + } + } + validate178.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnectionIdRequest = validate179; +const schema164 = { + type: 'string', + format: 'uuid', + 'x-standalone': false, + 'x-name': 'PeerconnectionIdRequest', + 'x-location': '#/components/parameters/peerconnection_id/schema_request', + 'x-schema-type': 'request', +}; +function validate179( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats258.test(data)) { + validate179.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uuid' }, + message: 'must match format "' + 'uuid' + '"', + schema: 'uuid', + parentSchema: schema164, + data, + }, + ]; + return false; + } + } else { + validate179.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema164.type, + parentSchema: schema164, + data, + }, + ]; + return false; + } + } + } + validate179.errors = vErrors; + return errors === 0; +} +exports.validatePeerconnectionIdResponse = validate180; +const schema165 = { + type: 'string', + format: 'uuid', + 'x-standalone': false, + 'x-name': 'PeerconnectionIdResponse', + 'x-location': '#/components/parameters/peerconnection_id/schema_response', + 'x-schema-type': 'response', +}; +function validate180( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats258.test(data)) { + validate180.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uuid' }, + message: 'must match format "' + 'uuid' + '"', + schema: 'uuid', + parentSchema: schema165, + data, + }, + ]; + return false; + } + } else { + validate180.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema165.type, + parentSchema: schema165, + data, + }, + ]; + return false; + } + } + } + validate180.errors = vErrors; + return errors === 0; +} +exports.validateDeviceUrlRequest = validate181; +const schema166 = { + type: 'string', + format: 'uri', + 'x-standalone': false, + 'x-name': 'DeviceUrlRequest', + 'x-location': '#/components/parameters/device_url/schema_request', + 'x-schema-type': 'request', +}; +function validate181( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats0(data)) { + validate181.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema166, + data, + }, + ]; + return false; + } + } else { + validate181.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema166.type, + parentSchema: schema166, + data, + }, + ]; + return false; + } + } + } + validate181.errors = vErrors; + return errors === 0; +} +exports.validateDeviceUrlResponse = validate182; +const schema167 = { + type: 'string', + format: 'uri', + 'x-standalone': false, + 'x-name': 'DeviceUrlResponse', + 'x-location': '#/components/parameters/device_url/schema_response', + 'x-schema-type': 'response', +}; +function validate182( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (errors === 0) { + if (typeof data === 'string') { + if (!formats0(data)) { + validate182.errors = [ + { + instancePath, + schemaPath: '#/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema167, + data, + }, + ]; + return false; + } + } else { + validate182.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema167.type, + parentSchema: schema167, + data, + }, + ]; + return false; + } + } + } + validate182.errors = vErrors; + return errors === 0; +} +exports.validateListDevicesResponse200Request = validate183; +const schema168 = { + type: 'array', + items: { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + 'x-standalone': false, + 'x-name': 'listDevicesResponse200Request', + 'x-location': + '#/paths//devices/get/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate183( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if ( + (data0.type === undefined && (missing0 = 'type')) || + (data0.name === undefined && (missing0 = 'name')) || + (data0.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate183.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema168.items.required, + parentSchema: schema168.items, + data: data0, + }, + ]; + return false; + } else { + if (data0.name !== undefined) { + let data1 = data0.name; + const _errs3 = errors; + if (typeof data1 !== 'string') { + validate183.errors = [ + { + instancePath: instancePath + '/' + i0 + '/name', + schemaPath: '#/items/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema168.items.properties.name.type, + parentSchema: schema168.items.properties.name, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.description !== undefined) { + let data2 = data0.description; + const _errs5 = errors; + if (typeof data2 !== 'string') { + validate183.errors = [ + { + instancePath: instancePath + '/' + i0 + '/description', + schemaPath: '#/items/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema168.items.properties.description.type, + parentSchema: schema168.items.properties.description, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.type !== undefined) { + let data3 = data0.type; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate183.errors = [ + { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema168.items.properties.type.type, + parentSchema: schema168.items.properties.type, + data: data3, + }, + ]; + return false; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + validate183.errors = [ + { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema168.items.properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema168.items.properties.type.enum, + parentSchema: schema168.items.properties.type, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.isPublic !== undefined) { + let data4 = data0.isPublic; + const _errs9 = errors; + if (typeof data4 !== 'boolean') { + validate183.errors = [ + { + instancePath: instancePath + '/' + i0 + '/isPublic', + schemaPath: '#/items/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema168.items.properties.isPublic.type, + parentSchema: schema168.items.properties.isPublic, + data: data4, + }, + ]; + return false; + } + var valid1 = _errs9 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.viewer !== undefined) { + let data5 = data0.viewer; + const _errs11 = errors; + if (errors === _errs11) { + if (Array.isArray(data5)) { + var valid2 = true; + const len1 = data5.length; + for (let i1 = 0; i1 < len1; i1++) { + let data6 = data5[i1]; + const _errs13 = errors; + if (errors === _errs13) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + validate183.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/viewer/' + i1, + schemaPath: + '#/items/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + + missing1 + + "'", + schema: + schema168.items.properties.viewer.items + .required, + parentSchema: + schema168.items.properties.viewer.items, + data: data6, + }, + ]; + return false; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs15 = errors; + if (errors === _errs15) { + if (errors === _errs15) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + validate183.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/viewer/' + + i1 + + '/url', + schemaPath: + '#/items/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema168.items.properties.viewer + .items.properties.url, + data: data7, + }, + ]; + return false; + } + } else { + validate183.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/viewer/' + + i1 + + '/url', + schemaPath: + '#/items/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema168.items.properties.viewer.items + .properties.url.type, + parentSchema: + schema168.items.properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } + } + } + } + } else { + validate183.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/viewer/' + i1, + schemaPath: '#/items/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema168.items.properties.viewer.items.type, + parentSchema: + schema168.items.properties.viewer.items, + data: data6, + }, + ]; + return false; + } + } + var valid2 = _errs13 === errors; + if (!valid2) { + break; + } + } + } else { + validate183.errors = [ + { + instancePath: instancePath + '/' + i0 + '/viewer', + schemaPath: '#/items/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema168.items.properties.viewer.type, + parentSchema: schema168.items.properties.viewer, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs11 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.owner !== undefined) { + let data8 = data0.owner; + const _errs17 = errors; + if (errors === _errs17) { + if (Array.isArray(data8)) { + var valid4 = true; + const len2 = data8.length; + for (let i2 = 0; i2 < len2; i2++) { + let data9 = data8[i2]; + const _errs19 = errors; + if (errors === _errs19) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + validate183.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/owner/' + i2, + schemaPath: + '#/items/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + + missing2 + + "'", + schema: + schema168.items.properties.owner.items + .required, + parentSchema: + schema168.items.properties.owner.items, + data: data9, + }, + ]; + return false; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs21 = errors; + if (errors === _errs21) { + if (errors === _errs21) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + validate183.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/owner/' + + i2 + + '/url', + schemaPath: + '#/items/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema168.items.properties.owner + .items.properties.url, + data: data10, + }, + ]; + return false; + } + } else { + validate183.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/owner/' + + i2 + + '/url', + schemaPath: + '#/items/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema168.items.properties.owner.items + .properties.url.type, + parentSchema: + schema168.items.properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } + } + } + } + } else { + validate183.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/owner/' + i2, + schemaPath: '#/items/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema168.items.properties.owner.items.type, + parentSchema: + schema168.items.properties.owner.items, + data: data9, + }, + ]; + return false; + } + } + var valid4 = _errs19 === errors; + if (!valid4) { + break; + } + } + } else { + validate183.errors = [ + { + instancePath: instancePath + '/' + i0 + '/owner', + schemaPath: '#/items/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema168.items.properties.owner.type, + parentSchema: schema168.items.properties.owner, + data: data8, + }, + ]; + return false; + } + } + var valid1 = _errs17 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } else { + validate183.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema168.items.type, + parentSchema: schema168.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate183.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema168.type, + parentSchema: schema168, + data, + }, + ]; + return false; + } + } + validate183.errors = vErrors; + return errors === 0; +} +exports.validateListDevicesResponse200Response = validate184; +const schema169 = { + type: 'array', + items: { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + 'x-standalone': false, + 'x-name': 'listDevicesResponse200Response', + 'x-location': + '#/paths//devices/get/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate184( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if ( + (data0.url === undefined && (missing0 = 'url')) || + (data0.type === undefined && (missing0 = 'type')) || + (data0.name === undefined && (missing0 = 'name')) || + (data0.isPublic === undefined && (missing0 = 'isPublic')) + ) { + validate184.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema169.items.required, + parentSchema: schema169.items, + data: data0, + }, + ]; + return false; + } else { + if (data0.url !== undefined) { + let data1 = data0.url; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate184.errors = [ + { + instancePath: instancePath + '/' + i0 + '/url', + schemaPath: '#/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema169.items.properties.url, + data: data1, + }, + ]; + return false; + } + } else { + validate184.errors = [ + { + instancePath: instancePath + '/' + i0 + '/url', + schemaPath: '#/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema169.items.properties.url.type, + parentSchema: schema169.items.properties.url, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.name !== undefined) { + let data2 = data0.name; + const _errs5 = errors; + if (typeof data2 !== 'string') { + validate184.errors = [ + { + instancePath: instancePath + '/' + i0 + '/name', + schemaPath: '#/items/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema169.items.properties.name.type, + parentSchema: schema169.items.properties.name, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.description !== undefined) { + let data3 = data0.description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate184.errors = [ + { + instancePath: instancePath + '/' + i0 + '/description', + schemaPath: '#/items/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema169.items.properties.description.type, + parentSchema: schema169.items.properties.description, + data: data3, + }, + ]; + return false; + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.type !== undefined) { + let data4 = data0.type; + const _errs9 = errors; + if (typeof data4 !== 'string') { + validate184.errors = [ + { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema169.items.properties.type.type, + parentSchema: schema169.items.properties.type, + data: data4, + }, + ]; + return false; + } + if ( + !( + data4 === 'device' || + data4 === 'group' || + data4 === 'edge instantiable' || + data4 === 'cloud instantiable' + ) + ) { + validate184.errors = [ + { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema169.items.properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema169.items.properties.type.enum, + parentSchema: schema169.items.properties.type, + data: data4, + }, + ]; + return false; + } + var valid1 = _errs9 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.isPublic !== undefined) { + let data5 = data0.isPublic; + const _errs11 = errors; + if (typeof data5 !== 'boolean') { + validate184.errors = [ + { + instancePath: instancePath + '/' + i0 + '/isPublic', + schemaPath: '#/items/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema169.items.properties.isPublic.type, + parentSchema: schema169.items.properties.isPublic, + data: data5, + }, + ]; + return false; + } + var valid1 = _errs11 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.viewer !== undefined) { + let data6 = data0.viewer; + const _errs13 = errors; + if (errors === _errs13) { + if (Array.isArray(data6)) { + var valid2 = true; + const len1 = data6.length; + for (let i1 = 0; i1 < len1; i1++) { + let data7 = data6[i1]; + const _errs15 = errors; + if (errors === _errs15) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing1; + if (data7.url === undefined && (missing1 = 'url')) { + validate184.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/viewer/' + i1, + schemaPath: + '#/items/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + + missing1 + + "'", + schema: + schema169.items.properties.viewer.items + .required, + parentSchema: + schema169.items.properties.viewer.items, + data: data7, + }, + ]; + return false; + } else { + if (data7.url !== undefined) { + let data8 = data7.url; + const _errs17 = errors; + if (errors === _errs17) { + if (errors === _errs17) { + if (typeof data8 === 'string') { + if (!formats0(data8)) { + validate184.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/viewer/' + + i1 + + '/url', + schemaPath: + '#/items/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema169.items.properties.viewer + .items.properties.url, + data: data8, + }, + ]; + return false; + } + } else { + validate184.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/viewer/' + + i1 + + '/url', + schemaPath: + '#/items/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema169.items.properties.viewer + .items.properties.url.type, + parentSchema: + schema169.items.properties.viewer + .items.properties.url, + data: data8, + }, + ]; + return false; + } + } + } + } + } + } else { + validate184.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/viewer/' + i1, + schemaPath: + '#/items/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema169.items.properties.viewer.items.type, + parentSchema: + schema169.items.properties.viewer.items, + data: data7, + }, + ]; + return false; + } + } + var valid2 = _errs15 === errors; + if (!valid2) { + break; + } + } + } else { + validate184.errors = [ + { + instancePath: instancePath + '/' + i0 + '/viewer', + schemaPath: '#/items/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema169.items.properties.viewer.type, + parentSchema: schema169.items.properties.viewer, + data: data6, + }, + ]; + return false; + } + } + var valid1 = _errs13 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.owner !== undefined) { + let data9 = data0.owner; + const _errs19 = errors; + if (errors === _errs19) { + if (Array.isArray(data9)) { + var valid4 = true; + const len2 = data9.length; + for (let i2 = 0; i2 < len2; i2++) { + let data10 = data9[i2]; + const _errs21 = errors; + if (errors === _errs21) { + if ( + data10 && + typeof data10 == 'object' && + !Array.isArray(data10) + ) { + let missing2; + if ( + data10.url === undefined && + (missing2 = 'url') + ) { + validate184.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/owner/' + i2, + schemaPath: + '#/items/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + + missing2 + + "'", + schema: + schema169.items.properties.owner.items + .required, + parentSchema: + schema169.items.properties.owner.items, + data: data10, + }, + ]; + return false; + } else { + if (data10.url !== undefined) { + let data11 = data10.url; + const _errs23 = errors; + if (errors === _errs23) { + if (errors === _errs23) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + validate184.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/owner/' + + i2 + + '/url', + schemaPath: + '#/items/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema169.items.properties.owner + .items.properties.url, + data: data11, + }, + ]; + return false; + } + } else { + validate184.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/owner/' + + i2 + + '/url', + schemaPath: + '#/items/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema169.items.properties.owner + .items.properties.url.type, + parentSchema: + schema169.items.properties.owner + .items.properties.url, + data: data11, + }, + ]; + return false; + } + } + } + } + } + } else { + validate184.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/owner/' + i2, + schemaPath: + '#/items/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema169.items.properties.owner.items.type, + parentSchema: + schema169.items.properties.owner.items, + data: data10, + }, + ]; + return false; + } + } + var valid4 = _errs21 === errors; + if (!valid4) { + break; + } + } + } else { + validate184.errors = [ + { + instancePath: instancePath + '/' + i0 + '/owner', + schemaPath: '#/items/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema169.items.properties.owner.type, + parentSchema: schema169.items.properties.owner, + data: data9, + }, + ]; + return false; + } + } + var valid1 = _errs19 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } + } else { + validate184.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema169.items.type, + parentSchema: schema169.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate184.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema169.type, + parentSchema: schema169, + data, + }, + ]; + return false; + } + } + validate184.errors = vErrors; + return errors === 0; +} +exports.validateCreateDeviceBodyRequest = validate185; +const schema170 = { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'createDeviceBodyRequest', + 'x-location': + '#/paths//devices/post/requestBody/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate185( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema170.anyOf[0].allOf[0].required, + parentSchema: schema170.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs4 = errors; + if (typeof data0 !== 'string') { + const err1 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema170.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema170.anyOf[0].allOf[0].properties.name, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err2 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema170.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema170.anyOf[0].allOf[0].properties.description, + data: data1, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err3 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema170.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema170.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + const err4 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema170.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema170.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema170.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs10 = errors; + if (typeof data3 !== 'boolean') { + const err5 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema170.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema170.anyOf[0].allOf[0].properties.isPublic, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data4)) { + var valid3 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + const err6 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: + schema170.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema170.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + const err7 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema170.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema170.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } + } else { + const err9 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema170.anyOf[0].allOf[0].properties.viewer.items.type, + parentSchema: + schema170.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var valid3 = _errs14 === errors; + if (!valid3) { + break; + } + } + } else { + const err10 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema170.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema170.anyOf[0].allOf[0].properties.viewer, + data: data4, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid5 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + const err11 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema170.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema170.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + const err12 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema170.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } else { + const err13 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema170.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + } + } + } + } + } else { + const err14 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema170.anyOf[0].allOf[0].properties.owner.items.type, + parentSchema: + schema170.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } + var valid5 = _errs20 === errors; + if (!valid5) { + break; + } + } + } else { + const err15 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema170.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema170.anyOf[0].allOf[0].properties.owner, + data: data7, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + var valid2 = _errs18 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } else { + const err16 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema170.anyOf[0].allOf[0].type, + parentSchema: schema170.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs26 = errors; + if ('cloud instantiable' !== data10) { + const err17 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema170.anyOf[0].allOf[1].properties.type, + data: data10, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var valid7 = _errs26 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data11 = data.instantiateUrl; + const _errs27 = errors; + if (errors === _errs27) { + if (errors === _errs27) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + const err18 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema170.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } else { + const err19 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema170.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema170.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + } + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data12)) { + var valid8 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + const err20 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema170.anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema170.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid9 = _errs34 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs36 = errors; + if (typeof data15 !== 'string') { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema170.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err23 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema170.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + const err24 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema170.anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema170.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema170.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err25 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema170.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema170.anyOf[0].allOf[1].properties.services.items, + data: data13, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + var valid8 = _errs31 === errors; + if (!valid8) { + break; + } + } + } else { + const err26 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema170.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema170.anyOf[0].allOf[1].properties.services, + data: data12, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err27 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema170.anyOf[0].allOf[1].type, + parentSchema: schema170.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid1 = _errs24 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs40 = errors; + const _errs41 = errors; + if (errors === _errs41) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if ( + (data.type === undefined && (missing3 = 'type')) || + (data.name === undefined && (missing3 = 'name')) || + (data.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err28 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema170.anyOf[1].allOf[0].required, + parentSchema: schema170.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } else { + if (data.name !== undefined) { + let data17 = data.name; + const _errs43 = errors; + if (typeof data17 !== 'string') { + const err29 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema170.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema170.anyOf[1].allOf[0].properties.name, + data: data17, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + var valid11 = _errs43 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data18 = data.description; + const _errs45 = errors; + if (typeof data18 !== 'string') { + const err30 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema170.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema170.anyOf[1].allOf[0].properties.description, + data: data18, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data19 = data.type; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err31 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema170.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema170.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + if ( + !( + data19 === 'device' || + data19 === 'group' || + data19 === 'edge instantiable' || + data19 === 'cloud instantiable' + ) + ) { + const err32 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema170.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema170.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema170.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data20 = data.isPublic; + const _errs49 = errors; + if (typeof data20 !== 'boolean') { + const err33 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema170.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema170.anyOf[1].allOf[0].properties.isPublic, + data: data20, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data21 = data.viewer; + const _errs51 = errors; + if (errors === _errs51) { + if (Array.isArray(data21)) { + var valid12 = true; + const len3 = data21.length; + for (let i3 = 0; i3 < len3; i3++) { + let data22 = data21[i3]; + const _errs53 = errors; + if (errors === _errs53) { + if ( + data22 && + typeof data22 == 'object' && + !Array.isArray(data22) + ) { + let missing4; + if (data22.url === undefined && (missing4 = 'url')) { + const err34 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema170.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema170.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } else { + if (data22.url !== undefined) { + let data23 = data22.url; + const _errs55 = errors; + if (errors === _errs55) { + if (errors === _errs55) { + if (typeof data23 === 'string') { + if (!formats0(data23)) { + const err35 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema170.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } else { + const err36 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[1].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema170.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + } + } + } + } else { + const err37 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema170.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema170.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + var valid12 = _errs53 === errors; + if (!valid12) { + break; + } + } + } else { + const err38 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema170.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema170.anyOf[1].allOf[0].properties.viewer, + data: data21, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data24 = data.owner; + const _errs57 = errors; + if (errors === _errs57) { + if (Array.isArray(data24)) { + var valid14 = true; + const len4 = data24.length; + for (let i4 = 0; i4 < len4; i4++) { + let data25 = data24[i4]; + const _errs59 = errors; + if (errors === _errs59) { + if ( + data25 && + typeof data25 == 'object' && + !Array.isArray(data25) + ) { + let missing5; + if (data25.url === undefined && (missing5 = 'url')) { + const err39 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema170.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema170.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } else { + if (data25.url !== undefined) { + let data26 = data25.url; + const _errs61 = errors; + if (errors === _errs61) { + if (errors === _errs61) { + if (typeof data26 === 'string') { + if (!formats0(data26)) { + const err40 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema170.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } else { + const err41 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[1].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema170.anyOf[1].allOf[0].properties.owner + .items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + } + } + } + } else { + const err42 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema170.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema170.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid14 = _errs59 === errors; + if (!valid14) { + break; + } + } + } else { + const err43 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema170.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema170.anyOf[1].allOf[0].properties.owner, + data: data24, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + } + var valid11 = _errs57 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } else { + const err44 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema170.anyOf[1].allOf[0].type, + parentSchema: schema170.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var valid10 = _errs41 === errors; + if (valid10) { + const _errs63 = errors; + if (errors === _errs63) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data27 = data.type; + const _errs65 = errors; + if ('device' !== data27) { + const err45 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema170.anyOf[1].allOf[1].properties.type, + data: data27, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + var valid16 = _errs65 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data28 = data.experiment; + const _errs66 = errors; + if (errors === _errs66) { + if (errors === _errs66) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err46 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema170.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } else { + const err47 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema170.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema170.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + } + var valid16 = _errs66 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data29 = data.services; + const _errs68 = errors; + if (errors === _errs68) { + if (Array.isArray(data29)) { + var valid17 = true; + const len5 = data29.length; + for (let i5 = 0; i5 < len5; i5++) { + let data30 = data29[i5]; + const _errs70 = errors; + if (errors === _errs70) { + if ( + data30 && + typeof data30 == 'object' && + !Array.isArray(data30) + ) { + if (data30.serviceType !== undefined) { + let data31 = data30.serviceType; + const _errs73 = errors; + if (errors === _errs73) { + if (errors === _errs73) { + if (typeof data31 === 'string') { + if (!formats0(data31)) { + const err48 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema170.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } else { + const err49 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema170.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + } + } + var valid18 = _errs73 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceId !== undefined) { + let data32 = data30.serviceId; + const _errs75 = errors; + if (typeof data32 !== 'string') { + const err50 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[1].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema170.anyOf[1].allOf[1].properties.services.items + .properties.serviceId, + data: data32, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid18 = _errs75 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceDirection !== undefined) { + let data33 = data30.serviceDirection; + const _errs77 = errors; + if (typeof data33 !== 'string') { + const err51 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema170.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + if ( + !( + data33 === 'consumer' || + data33 === 'producer' || + data33 === 'prosumer' + ) + ) { + const err52 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema170.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema170.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema170.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + var valid18 = _errs77 === errors; + } else { + var valid18 = true; + } + } + } + } else { + const err53 = { + instancePath: instancePath + '/services/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema170.anyOf[1].allOf[1].properties.services.items.type, + parentSchema: + schema170.anyOf[1].allOf[1].properties.services.items, + data: data30, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + var valid17 = _errs70 === errors; + if (!valid17) { + break; + } + } + } else { + const err54 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema170.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema170.anyOf[1].allOf[1].properties.services, + data: data29, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + var valid16 = _errs68 === errors; + } else { + var valid16 = true; + } + } + } + } else { + const err55 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema170.anyOf[1].allOf[1].type, + parentSchema: schema170.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid10 = _errs63 === errors; + } + var _valid0 = _errs40 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs79 = errors; + const _errs80 = errors; + if (errors === _errs80) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.type === undefined && (missing6 = 'type')) || + (data.name === undefined && (missing6 = 'name')) || + (data.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err56 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema170.anyOf[2].allOf[0].required, + parentSchema: schema170.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } else { + if (data.name !== undefined) { + let data34 = data.name; + const _errs82 = errors; + if (typeof data34 !== 'string') { + const err57 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema170.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema170.anyOf[2].allOf[0].properties.name, + data: data34, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + var valid20 = _errs82 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.description !== undefined) { + let data35 = data.description; + const _errs84 = errors; + if (typeof data35 !== 'string') { + const err58 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema170.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema170.anyOf[2].allOf[0].properties.description, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + var valid20 = _errs84 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.type !== undefined) { + let data36 = data.type; + const _errs86 = errors; + if (typeof data36 !== 'string') { + const err59 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema170.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema170.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + if ( + !( + data36 === 'device' || + data36 === 'group' || + data36 === 'edge instantiable' || + data36 === 'cloud instantiable' + ) + ) { + const err60 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema170.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema170.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema170.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + var valid20 = _errs86 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.isPublic !== undefined) { + let data37 = data.isPublic; + const _errs88 = errors; + if (typeof data37 !== 'boolean') { + const err61 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema170.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema170.anyOf[2].allOf[0].properties.isPublic, + data: data37, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs88 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.viewer !== undefined) { + let data38 = data.viewer; + const _errs90 = errors; + if (errors === _errs90) { + if (Array.isArray(data38)) { + var valid21 = true; + const len6 = data38.length; + for (let i6 = 0; i6 < len6; i6++) { + let data39 = data38[i6]; + const _errs92 = errors; + if (errors === _errs92) { + if ( + data39 && + typeof data39 == 'object' && + !Array.isArray(data39) + ) { + let missing7; + if (data39.url === undefined && (missing7 = 'url')) { + const err62 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema170.anyOf[2].allOf[0].properties.viewer.items + .required, + parentSchema: + schema170.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } else { + if (data39.url !== undefined) { + let data40 = data39.url; + const _errs94 = errors; + if (errors === _errs94) { + if (errors === _errs94) { + if (typeof data40 === 'string') { + if (!formats0(data40)) { + const err63 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema170.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + } else { + const err64 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema170.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + } + } + } + } else { + const err65 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema170.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema170.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid21 = _errs92 === errors; + if (!valid21) { + break; + } + } + } else { + const err66 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema170.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema170.anyOf[2].allOf[0].properties.viewer, + data: data38, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid20 = _errs90 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.owner !== undefined) { + let data41 = data.owner; + const _errs96 = errors; + if (errors === _errs96) { + if (Array.isArray(data41)) { + var valid23 = true; + const len7 = data41.length; + for (let i7 = 0; i7 < len7; i7++) { + let data42 = data41[i7]; + const _errs98 = errors; + if (errors === _errs98) { + if ( + data42 && + typeof data42 == 'object' && + !Array.isArray(data42) + ) { + let missing8; + if (data42.url === undefined && (missing8 = 'url')) { + const err67 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + missing8 + "'", + schema: + schema170.anyOf[2].allOf[0].properties.owner.items + .required, + parentSchema: + schema170.anyOf[2].allOf[0].properties.owner + .items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data42.url !== undefined) { + let data43 = data42.url; + const _errs100 = errors; + if (errors === _errs100) { + if (errors === _errs100) { + if (typeof data43 === 'string') { + if (!formats0(data43)) { + const err68 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema170.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema170.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + } + } + } else { + const err70 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema170.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema170.anyOf[2].allOf[0].properties.owner.items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + } + var valid23 = _errs98 === errors; + if (!valid23) { + break; + } + } + } else { + const err71 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema170.anyOf[2].allOf[0].properties.owner.type, + parentSchema: schema170.anyOf[2].allOf[0].properties.owner, + data: data41, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + } + var valid20 = _errs96 === errors; + } else { + var valid20 = true; + } + } + } + } + } + } + } + } else { + const err72 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema170.anyOf[2].allOf[0].type, + parentSchema: schema170.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + var valid19 = _errs80 === errors; + if (valid19) { + const _errs102 = errors; + if (errors === _errs102) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs104 = errors; + if ('edge instantiable' !== data44) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema170.anyOf[2].allOf[1].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid25 = _errs104 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.codeUrl !== undefined) { + let data45 = data.codeUrl; + const _errs105 = errors; + if (errors === _errs105) { + if (errors === _errs105) { + if (typeof data45 === 'string') { + if (!formats0(data45)) { + const err74 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema170.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } else { + const err75 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema170.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema170.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + } + var valid25 = _errs105 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.services !== undefined) { + let data46 = data.services; + const _errs107 = errors; + if (errors === _errs107) { + if (Array.isArray(data46)) { + var valid26 = true; + const len8 = data46.length; + for (let i8 = 0; i8 < len8; i8++) { + let data47 = data46[i8]; + const _errs109 = errors; + if (errors === _errs109) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + if (data47.serviceType !== undefined) { + let data48 = data47.serviceType; + const _errs112 = errors; + if (errors === _errs112) { + if (errors === _errs112) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema170.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema170.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + var valid27 = _errs112 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceId !== undefined) { + let data49 = data47.serviceId; + const _errs114 = errors; + if (typeof data49 !== 'string') { + const err78 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[2].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema170.anyOf[2].allOf[1].properties.services + .items.properties.serviceId, + data: data49, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + var valid27 = _errs114 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceDirection !== undefined) { + let data50 = data47.serviceDirection; + const _errs116 = errors; + if (typeof data50 !== 'string') { + const err79 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema170.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + if ( + !( + data50 === 'consumer' || + data50 === 'producer' || + data50 === 'prosumer' + ) + ) { + const err80 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema170.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema170.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema170.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + var valid27 = _errs116 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err81 = { + instancePath: instancePath + '/services/' + i8, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema170.anyOf[2].allOf[1].properties.services.items + .type, + parentSchema: + schema170.anyOf[2].allOf[1].properties.services.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + var valid26 = _errs109 === errors; + if (!valid26) { + break; + } + } + } else { + const err82 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema170.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema170.anyOf[2].allOf[1].properties.services, + data: data46, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + var valid25 = _errs107 === errors; + } else { + var valid25 = true; + } + } + } + } else { + const err83 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema170.anyOf[2].allOf[1].type, + parentSchema: schema170.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid19 = _errs102 === errors; + } + var _valid0 = _errs79 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs118 = errors; + const _errs119 = errors; + if (errors === _errs119) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if ( + (data.type === undefined && (missing9 = 'type')) || + (data.name === undefined && (missing9 = 'name')) || + (data.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err84 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema170.anyOf[3].allOf[0].required, + parentSchema: schema170.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } else { + if (data.name !== undefined) { + let data51 = data.name; + const _errs121 = errors; + if (typeof data51 !== 'string') { + const err85 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema170.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema170.anyOf[3].allOf[0].properties.name, + data: data51, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + var valid29 = _errs121 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.description !== undefined) { + let data52 = data.description; + const _errs123 = errors; + if (typeof data52 !== 'string') { + const err86 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema170.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema170.anyOf[3].allOf[0].properties.description, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid29 = _errs123 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.type !== undefined) { + let data53 = data.type; + const _errs125 = errors; + if (typeof data53 !== 'string') { + const err87 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema170.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema170.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + if ( + !( + data53 === 'device' || + data53 === 'group' || + data53 === 'edge instantiable' || + data53 === 'cloud instantiable' + ) + ) { + const err88 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema170.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema170.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema170.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + var valid29 = _errs125 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.isPublic !== undefined) { + let data54 = data.isPublic; + const _errs127 = errors; + if (typeof data54 !== 'boolean') { + const err89 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema170.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema170.anyOf[3].allOf[0].properties.isPublic, + data: data54, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + var valid29 = _errs127 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.viewer !== undefined) { + let data55 = data.viewer; + const _errs129 = errors; + if (errors === _errs129) { + if (Array.isArray(data55)) { + var valid30 = true; + const len9 = data55.length; + for (let i9 = 0; i9 < len9; i9++) { + let data56 = data55[i9]; + const _errs131 = errors; + if (errors === _errs131) { + if ( + data56 && + typeof data56 == 'object' && + !Array.isArray(data56) + ) { + let missing10; + if (data56.url === undefined && (missing10 = 'url')) { + const err90 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + missing10 + "'", + schema: + schema170.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema170.anyOf[3].allOf[0].properties.viewer + .items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } else { + if (data56.url !== undefined) { + let data57 = data56.url; + const _errs133 = errors; + if (errors === _errs133) { + if (errors === _errs133) { + if (typeof data57 === 'string') { + if (!formats0(data57)) { + const err91 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema170.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + } else { + const err92 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema170.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + } + } + } + } + } else { + const err93 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema170.anyOf[3].allOf[0].properties.viewer.items + .type, + parentSchema: + schema170.anyOf[3].allOf[0].properties.viewer.items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + var valid30 = _errs131 === errors; + if (!valid30) { + break; + } + } + } else { + const err94 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema170.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: schema170.anyOf[3].allOf[0].properties.viewer, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid29 = _errs129 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.owner !== undefined) { + let data58 = data.owner; + const _errs135 = errors; + if (errors === _errs135) { + if (Array.isArray(data58)) { + var valid32 = true; + const len10 = data58.length; + for (let i10 = 0; i10 < len10; i10++) { + let data59 = data58[i10]; + const _errs137 = errors; + if (errors === _errs137) { + if ( + data59 && + typeof data59 == 'object' && + !Array.isArray(data59) + ) { + let missing11; + if (data59.url === undefined && (missing11 = 'url')) { + const err95 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema170.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema170.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } else { + if (data59.url !== undefined) { + let data60 = data59.url; + const _errs139 = errors; + if (errors === _errs139) { + if (errors === _errs139) { + if (typeof data60 === 'string') { + if (!formats0(data60)) { + const err96 = { + instancePath: + instancePath + + '/owner/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema170.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } else { + const err97 = { + instancePath: + instancePath + '/owner/' + i10 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema170.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + } + } + } + } + } else { + const err98 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema170.anyOf[3].allOf[0].properties.owner.items + .type, + parentSchema: + schema170.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } + var valid32 = _errs137 === errors; + if (!valid32) { + break; + } + } + } else { + const err99 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema170.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema170.anyOf[3].allOf[0].properties.owner, + data: data58, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + var valid29 = _errs135 === errors; + } else { + var valid29 = true; + } + } + } + } + } + } + } + } else { + const err100 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema170.anyOf[3].allOf[0].type, + parentSchema: schema170.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + } + var valid28 = _errs119 === errors; + if (valid28) { + const _errs141 = errors; + if (errors === _errs141) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if (data.devices === undefined && (missing12 = 'devices')) { + const err101 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema170.anyOf[3].allOf[1].required, + parentSchema: schema170.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } else { + if (data.type !== undefined) { + let data61 = data.type; + const _errs143 = errors; + if ('group' !== data61) { + const err102 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema170.anyOf[3].allOf[1].properties.type, + data: data61, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + var valid34 = _errs143 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data.devices !== undefined) { + let data62 = data.devices; + const _errs144 = errors; + if (errors === _errs144) { + if (Array.isArray(data62)) { + var valid35 = true; + const len11 = data62.length; + for (let i11 = 0; i11 < len11; i11++) { + let data63 = data62[i11]; + const _errs146 = errors; + if (errors === _errs146) { + if ( + data63 && + typeof data63 == 'object' && + !Array.isArray(data63) + ) { + let missing13; + if (data63.url === undefined && (missing13 = 'url')) { + const err103 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: + "must have required property '" + missing13 + "'", + schema: + schema170.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema170.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } else { + if (data63.url !== undefined) { + let data64 = data63.url; + const _errs148 = errors; + if (errors === _errs148) { + if (errors === _errs148) { + if (typeof data64 === 'string') { + if (!formats0(data64)) { + const err104 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema170.anyOf[3].allOf[1].properties + .devices.items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + } else { + const err105 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema170.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema170.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } + } + } + } + } + } else { + const err106 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema170.anyOf[3].allOf[1].properties.devices.items + .type, + parentSchema: + schema170.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } + var valid35 = _errs146 === errors; + if (!valid35) { + break; + } + } + } else { + const err107 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema170.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema170.anyOf[3].allOf[1].properties.devices, + data: data62, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + var valid34 = _errs144 === errors; + } else { + var valid34 = true; + } + } + } + } else { + const err108 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema170.anyOf[3].allOf[1].type, + parentSchema: schema170.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid28 = _errs141 === errors; + } + var _valid0 = _errs118 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err109 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema170.anyOf, + parentSchema: schema170, + data, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + validate185.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate185.errors = vErrors; + return errors === 0; +} +exports.validateCreateDeviceBodyResponse = validate186; +const schema171 = { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + connected: { + description: + 'If true, the device is connected to the service and can be used.\n', + type: 'boolean', + readOnly: true, + }, + announcedAvailability: { + readOnly: true, + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'createDeviceBodyResponse', + 'x-location': + '#/paths//devices/post/requestBody/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate186( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema171.anyOf[0].allOf[0].required, + parentSchema: schema171.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs4 = errors; + if (errors === _errs4) { + if (errors === _errs4) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + const err1 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema171.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } else { + const err2 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[0].allOf[0].properties.url.type, + parentSchema: schema171.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err3 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema171.anyOf[0].allOf[0].properties.name, + data: data1, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err4 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema171.anyOf[0].allOf[0].properties.description, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs10 = errors; + if (typeof data3 !== 'string') { + const err5 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema171.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + const err6 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema171.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema171.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema171.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs12 = errors; + if (typeof data4 !== 'boolean') { + const err7 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema171.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema171.anyOf[0].allOf[0].properties.isPublic, + data: data4, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs14 = errors; + if (errors === _errs14) { + if (Array.isArray(data5)) { + var valid3 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + const err8 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema171.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema171.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + const err9 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema171.anyOf[0].allOf[0].properties + .viewer.items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } else { + const err10 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema171.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + } + } + } + } else { + const err11 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema171.anyOf[0].allOf[0].properties.viewer.items + .type, + parentSchema: + schema171.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } + var valid3 = _errs16 === errors; + if (!valid3) { + break; + } + } + } else { + const err12 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema171.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema171.anyOf[0].allOf[0].properties.viewer, + data: data5, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } + var valid2 = _errs14 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs20 = errors; + if (errors === _errs20) { + if (Array.isArray(data8)) { + var valid5 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs22 = errors; + if (errors === _errs22) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + const err13 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema171.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema171.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs24 = errors; + if (errors === _errs24) { + if (errors === _errs24) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + const err14 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema171.anyOf[0].allOf[0].properties + .owner.items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } else { + const err15 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema171.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + } + } + } + } else { + const err16 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema171.anyOf[0].allOf[0].properties.owner.items + .type, + parentSchema: + schema171.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid5 = _errs22 === errors; + if (!valid5) { + break; + } + } + } else { + const err17 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema171.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema171.anyOf[0].allOf[0].properties.owner, + data: data8, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + } + var valid2 = _errs20 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } + } else { + const err18 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema171.anyOf[0].allOf[0].type, + parentSchema: schema171.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs26 = errors; + if (errors === _errs26) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data11 = data.type; + const _errs28 = errors; + if ('cloud instantiable' !== data11) { + const err19 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema171.anyOf[0].allOf[1].properties.type, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + var valid7 = _errs28 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data12 = data.instantiateUrl; + const _errs29 = errors; + if (errors === _errs29) { + if (errors === _errs29) { + if (typeof data12 === 'string') { + if (!formats0(data12)) { + const err20 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema171.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema171.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data13 = data.services; + const _errs31 = errors; + if (errors === _errs31) { + if (Array.isArray(data13)) { + var valid8 = true; + const len2 = data13.length; + for (let i2 = 0; i2 < len2; i2++) { + let data14 = data13[i2]; + const _errs33 = errors; + if (errors === _errs33) { + if (data14 && typeof data14 == 'object' && !Array.isArray(data14)) { + if (data14.serviceType !== undefined) { + let data15 = data14.serviceType; + const _errs36 = errors; + if (errors === _errs36) { + if (errors === _errs36) { + if (typeof data15 === 'string') { + if (!formats0(data15)) { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema171.anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } else { + const err23 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema171.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + } + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceId !== undefined) { + let data16 = data14.serviceId; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err24 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema171.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceDirection !== undefined) { + let data17 = data14.serviceDirection; + const _errs40 = errors; + if (typeof data17 !== 'string') { + const err25 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema171.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + if ( + !( + data17 === 'consumer' || + data17 === 'producer' || + data17 === 'prosumer' + ) + ) { + const err26 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema171.anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema171.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema171.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + var valid9 = _errs40 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err27 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema171.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema171.anyOf[0].allOf[1].properties.services.items, + data: data14, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid8 = _errs33 === errors; + if (!valid8) { + break; + } + } + } else { + const err28 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema171.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema171.anyOf[0].allOf[1].properties.services, + data: data13, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + } + var valid7 = _errs31 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err29 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema171.anyOf[0].allOf[1].type, + parentSchema: schema171.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + } + var valid1 = _errs26 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs42 = errors; + const _errs43 = errors; + if (errors === _errs43) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if ( + (data.url === undefined && (missing3 = 'url')) || + (data.type === undefined && (missing3 = 'type')) || + (data.name === undefined && (missing3 = 'name')) || + (data.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err30 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema171.anyOf[1].allOf[0].required, + parentSchema: schema171.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } else { + if (data.url !== undefined) { + let data18 = data.url; + const _errs45 = errors; + if (errors === _errs45) { + if (errors === _errs45) { + if (typeof data18 === 'string') { + if (!formats0(data18)) { + const err31 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema171.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } else { + const err32 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[1].allOf[0].properties.url.type, + parentSchema: schema171.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.name !== undefined) { + let data19 = data.name; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err33 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema171.anyOf[1].allOf[0].properties.name, + data: data19, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data20 = data.description; + const _errs49 = errors; + if (typeof data20 !== 'string') { + const err34 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema171.anyOf[1].allOf[0].properties.description, + data: data20, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data21 = data.type; + const _errs51 = errors; + if (typeof data21 !== 'string') { + const err35 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema171.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + if ( + !( + data21 === 'device' || + data21 === 'group' || + data21 === 'edge instantiable' || + data21 === 'cloud instantiable' + ) + ) { + const err36 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema171.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema171.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema171.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data22 = data.isPublic; + const _errs53 = errors; + if (typeof data22 !== 'boolean') { + const err37 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema171.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema171.anyOf[1].allOf[0].properties.isPublic, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + var valid11 = _errs53 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data23 = data.viewer; + const _errs55 = errors; + if (errors === _errs55) { + if (Array.isArray(data23)) { + var valid12 = true; + const len3 = data23.length; + for (let i3 = 0; i3 < len3; i3++) { + let data24 = data23[i3]; + const _errs57 = errors; + if (errors === _errs57) { + if ( + data24 && + typeof data24 == 'object' && + !Array.isArray(data24) + ) { + let missing4; + if (data24.url === undefined && (missing4 = 'url')) { + const err38 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema171.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema171.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } else { + if (data24.url !== undefined) { + let data25 = data24.url; + const _errs59 = errors; + if (errors === _errs59) { + if (errors === _errs59) { + if (typeof data25 === 'string') { + if (!formats0(data25)) { + const err39 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema171.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } else { + const err40 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[1].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema171.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + } + } + } + } else { + const err41 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema171.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema171.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + var valid12 = _errs57 === errors; + if (!valid12) { + break; + } + } + } else { + const err42 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema171.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema171.anyOf[1].allOf[0].properties.viewer, + data: data23, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid11 = _errs55 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data26 = data.owner; + const _errs61 = errors; + if (errors === _errs61) { + if (Array.isArray(data26)) { + var valid14 = true; + const len4 = data26.length; + for (let i4 = 0; i4 < len4; i4++) { + let data27 = data26[i4]; + const _errs63 = errors; + if (errors === _errs63) { + if ( + data27 && + typeof data27 == 'object' && + !Array.isArray(data27) + ) { + let missing5; + if (data27.url === undefined && (missing5 = 'url')) { + const err43 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema171.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema171.anyOf[1].allOf[0].properties.owner + .items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } else { + if (data27.url !== undefined) { + let data28 = data27.url; + const _errs65 = errors; + if (errors === _errs65) { + if (errors === _errs65) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err44 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema171.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } else { + const err45 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[1].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema171.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + } + } + } + } + } else { + const err46 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema171.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema171.anyOf[1].allOf[0].properties.owner.items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } + var valid14 = _errs63 === errors; + if (!valid14) { + break; + } + } + } else { + const err47 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema171.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema171.anyOf[1].allOf[0].properties.owner, + data: data26, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var valid11 = _errs61 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } + } else { + const err48 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema171.anyOf[1].allOf[0].type, + parentSchema: schema171.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } + var valid10 = _errs43 === errors; + if (valid10) { + const _errs67 = errors; + if (errors === _errs67) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data29 = data.type; + const _errs69 = errors; + if ('device' !== data29) { + const err49 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema171.anyOf[1].allOf[1].properties.type, + data: data29, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + var valid16 = _errs69 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.connected !== undefined) { + let data30 = data.connected; + const _errs70 = errors; + if (typeof data30 !== 'boolean') { + const err50 = { + instancePath: instancePath + '/connected', + schemaPath: '#/anyOf/1/allOf/1/properties/connected/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema171.anyOf[1].allOf[1].properties.connected.type, + parentSchema: schema171.anyOf[1].allOf[1].properties.connected, + data: data30, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid16 = _errs70 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.announcedAvailability !== undefined) { + let data31 = data.announcedAvailability; + const _errs72 = errors; + if (errors === _errs72) { + if (Array.isArray(data31)) { + var valid17 = true; + const len5 = data31.length; + for (let i5 = 0; i5 < len5; i5++) { + let data32 = data31[i5]; + const _errs74 = errors; + if (errors === _errs74) { + if ( + data32 && + typeof data32 == 'object' && + !Array.isArray(data32) + ) { + if (data32.start !== undefined) { + let data33 = data32.start; + const _errs76 = errors; + if (errors === _errs76) { + if (errors === _errs76) { + if (typeof data33 === 'string') { + if (!formats22.validate(data33)) { + const err51 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema171.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } else { + const err52 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start + .type, + parentSchema: + schema171.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + } + } + var valid18 = _errs76 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data32.end !== undefined) { + let data34 = data32.end; + const _errs78 = errors; + if (errors === _errs78) { + if (errors === _errs78) { + if (typeof data34 === 'string') { + if (!formats22.validate(data34)) { + const err53 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema171.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } else { + const err54 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end + .type, + parentSchema: + schema171.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + } + var valid18 = _errs78 === errors; + } else { + var valid18 = true; + } + } + } else { + const err55 = { + instancePath: instancePath + '/announcedAvailability/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema171.anyOf[1].allOf[1].properties.announcedAvailability + .items.type, + parentSchema: + schema171.anyOf[1].allOf[1].properties.announcedAvailability + .items, + data: data32, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid17 = _errs74 === errors; + if (!valid17) { + break; + } + } + } else { + const err56 = { + instancePath: instancePath + '/announcedAvailability', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema171.anyOf[1].allOf[1].properties.announcedAvailability.type, + parentSchema: + schema171.anyOf[1].allOf[1].properties.announcedAvailability, + data: data31, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + var valid16 = _errs72 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data35 = data.experiment; + const _errs80 = errors; + if (errors === _errs80) { + if (errors === _errs80) { + if (typeof data35 === 'string') { + if (!formats0(data35)) { + const err57 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema171.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } else { + const err58 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema171.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + } + } + var valid16 = _errs80 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data36 = data.services; + const _errs82 = errors; + if (errors === _errs82) { + if (Array.isArray(data36)) { + var valid19 = true; + const len6 = data36.length; + for (let i6 = 0; i6 < len6; i6++) { + let data37 = data36[i6]; + const _errs84 = errors; + if (errors === _errs84) { + if ( + data37 && + typeof data37 == 'object' && + !Array.isArray(data37) + ) { + if (data37.serviceType !== undefined) { + let data38 = data37.serviceType; + const _errs87 = errors; + if (errors === _errs87) { + if (errors === _errs87) { + if (typeof data38 === 'string') { + if (!formats0(data38)) { + const err59 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema171.anyOf[1].allOf[1].properties + .services.items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } else { + const err60 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema171.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + } + var valid20 = _errs87 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceId !== undefined) { + let data39 = data37.serviceId; + const _errs89 = errors; + if (typeof data39 !== 'string') { + const err61 = { + instancePath: + instancePath + '/services/' + i6 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[1].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema171.anyOf[1].allOf[1].properties.services + .items.properties.serviceId, + data: data39, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs89 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceDirection !== undefined) { + let data40 = data37.serviceDirection; + const _errs91 = errors; + if (typeof data40 !== 'string') { + const err62 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema171.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + if ( + !( + data40 === 'consumer' || + data40 === 'producer' || + data40 === 'prosumer' + ) + ) { + const err63 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema171.anyOf[1].allOf[1].properties + .services.items.properties.serviceDirection + .enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema171.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema171.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + var valid20 = _errs91 === errors; + } else { + var valid20 = true; + } + } + } + } else { + const err64 = { + instancePath: instancePath + '/services/' + i6, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema171.anyOf[1].allOf[1].properties.services.items + .type, + parentSchema: + schema171.anyOf[1].allOf[1].properties.services.items, + data: data37, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + var valid19 = _errs84 === errors; + if (!valid19) { + break; + } + } + } else { + const err65 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema171.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema171.anyOf[1].allOf[1].properties.services, + data: data36, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid16 = _errs82 === errors; + } else { + var valid16 = true; + } + } + } + } + } + } else { + const err66 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema171.anyOf[1].allOf[1].type, + parentSchema: schema171.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid10 = _errs67 === errors; + } + var _valid0 = _errs42 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs93 = errors; + const _errs94 = errors; + if (errors === _errs94) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.url === undefined && (missing6 = 'url')) || + (data.type === undefined && (missing6 = 'type')) || + (data.name === undefined && (missing6 = 'name')) || + (data.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err67 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema171.anyOf[2].allOf[0].required, + parentSchema: schema171.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data.url !== undefined) { + let data41 = data.url; + const _errs96 = errors; + if (errors === _errs96) { + if (errors === _errs96) { + if (typeof data41 === 'string') { + if (!formats0(data41)) { + const err68 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema171.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[2].allOf[0].properties.url.type, + parentSchema: schema171.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + var valid22 = _errs96 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.name !== undefined) { + let data42 = data.name; + const _errs98 = errors; + if (typeof data42 !== 'string') { + const err70 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema171.anyOf[2].allOf[0].properties.name, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var valid22 = _errs98 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.description !== undefined) { + let data43 = data.description; + const _errs100 = errors; + if (typeof data43 !== 'string') { + const err71 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema171.anyOf[2].allOf[0].properties.description, + data: data43, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + var valid22 = _errs100 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs102 = errors; + if (typeof data44 !== 'string') { + const err72 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema171.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + if ( + !( + data44 === 'device' || + data44 === 'group' || + data44 === 'edge instantiable' || + data44 === 'cloud instantiable' + ) + ) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema171.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema171.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema171.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid22 = _errs102 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.isPublic !== undefined) { + let data45 = data.isPublic; + const _errs104 = errors; + if (typeof data45 !== 'boolean') { + const err74 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema171.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema171.anyOf[2].allOf[0].properties.isPublic, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + var valid22 = _errs104 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.viewer !== undefined) { + let data46 = data.viewer; + const _errs106 = errors; + if (errors === _errs106) { + if (Array.isArray(data46)) { + var valid23 = true; + const len7 = data46.length; + for (let i7 = 0; i7 < len7; i7++) { + let data47 = data46[i7]; + const _errs108 = errors; + if (errors === _errs108) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + let missing7; + if (data47.url === undefined && (missing7 = 'url')) { + const err75 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema171.anyOf[2].allOf[0].properties.viewer + .items.required, + parentSchema: + schema171.anyOf[2].allOf[0].properties.viewer + .items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } else { + if (data47.url !== undefined) { + let data48 = data47.url; + const _errs110 = errors; + if (errors === _errs110) { + if (errors === _errs110) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema171.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema171.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + } + } + } else { + const err78 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema171.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema171.anyOf[2].allOf[0].properties.viewer.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + var valid23 = _errs108 === errors; + if (!valid23) { + break; + } + } + } else { + const err79 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema171.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema171.anyOf[2].allOf[0].properties.viewer, + data: data46, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + var valid22 = _errs106 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.owner !== undefined) { + let data49 = data.owner; + const _errs112 = errors; + if (errors === _errs112) { + if (Array.isArray(data49)) { + var valid25 = true; + const len8 = data49.length; + for (let i8 = 0; i8 < len8; i8++) { + let data50 = data49[i8]; + const _errs114 = errors; + if (errors === _errs114) { + if ( + data50 && + typeof data50 == 'object' && + !Array.isArray(data50) + ) { + let missing8; + if (data50.url === undefined && (missing8 = 'url')) { + const err80 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + + missing8 + + "'", + schema: + schema171.anyOf[2].allOf[0].properties.owner + .items.required, + parentSchema: + schema171.anyOf[2].allOf[0].properties.owner + .items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } else { + if (data50.url !== undefined) { + let data51 = data50.url; + const _errs116 = errors; + if (errors === _errs116) { + if (errors === _errs116) { + if (typeof data51 === 'string') { + if (!formats0(data51)) { + const err81 = { + instancePath: + instancePath + + '/owner/' + + i8 + + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema171.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } else { + const err82 = { + instancePath: + instancePath + '/owner/' + i8 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema171.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + } + } + } + } else { + const err83 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema171.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema171.anyOf[2].allOf[0].properties.owner + .items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid25 = _errs114 === errors; + if (!valid25) { + break; + } + } + } else { + const err84 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema171.anyOf[2].allOf[0].properties.owner.type, + parentSchema: + schema171.anyOf[2].allOf[0].properties.owner, + data: data49, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + var valid22 = _errs112 === errors; + } else { + var valid22 = true; + } + } + } + } + } + } + } + } + } else { + const err85 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema171.anyOf[2].allOf[0].type, + parentSchema: schema171.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + } + var valid21 = _errs94 === errors; + if (valid21) { + const _errs118 = errors; + if (errors === _errs118) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data52 = data.type; + const _errs120 = errors; + if ('edge instantiable' !== data52) { + const err86 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema171.anyOf[2].allOf[1].properties.type, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid27 = _errs120 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.codeUrl !== undefined) { + let data53 = data.codeUrl; + const _errs121 = errors; + if (errors === _errs121) { + if (errors === _errs121) { + if (typeof data53 === 'string') { + if (!formats0(data53)) { + const err87 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema171.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + } else { + const err88 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema171.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + } + } + var valid27 = _errs121 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.services !== undefined) { + let data54 = data.services; + const _errs123 = errors; + if (errors === _errs123) { + if (Array.isArray(data54)) { + var valid28 = true; + const len9 = data54.length; + for (let i9 = 0; i9 < len9; i9++) { + let data55 = data54[i9]; + const _errs125 = errors; + if (errors === _errs125) { + if ( + data55 && + typeof data55 == 'object' && + !Array.isArray(data55) + ) { + if (data55.serviceType !== undefined) { + let data56 = data55.serviceType; + const _errs128 = errors; + if (errors === _errs128) { + if (errors === _errs128) { + if (typeof data56 === 'string') { + if (!formats0(data56)) { + const err89 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema171.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } else { + const err90 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema171.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + } + var valid29 = _errs128 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceId !== undefined) { + let data57 = data55.serviceId; + const _errs130 = errors; + if (typeof data57 !== 'string') { + const err91 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[2].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema171.anyOf[2].allOf[1].properties.services + .items.properties.serviceId, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + var valid29 = _errs130 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceDirection !== undefined) { + let data58 = data55.serviceDirection; + const _errs132 = errors; + if (typeof data58 !== 'string') { + const err92 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema171.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + if ( + !( + data58 === 'consumer' || + data58 === 'producer' || + data58 === 'prosumer' + ) + ) { + const err93 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema171.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema171.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema171.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + var valid29 = _errs132 === errors; + } else { + var valid29 = true; + } + } + } + } else { + const err94 = { + instancePath: instancePath + '/services/' + i9, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema171.anyOf[2].allOf[1].properties.services.items + .type, + parentSchema: + schema171.anyOf[2].allOf[1].properties.services.items, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid28 = _errs125 === errors; + if (!valid28) { + break; + } + } + } else { + const err95 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema171.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema171.anyOf[2].allOf[1].properties.services, + data: data54, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + var valid27 = _errs123 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err96 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema171.anyOf[2].allOf[1].type, + parentSchema: schema171.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + var valid21 = _errs118 === errors; + } + var _valid0 = _errs93 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs134 = errors; + const _errs135 = errors; + if (errors === _errs135) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if ( + (data.url === undefined && (missing9 = 'url')) || + (data.type === undefined && (missing9 = 'type')) || + (data.name === undefined && (missing9 = 'name')) || + (data.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err97 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema171.anyOf[3].allOf[0].required, + parentSchema: schema171.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } else { + if (data.url !== undefined) { + let data59 = data.url; + const _errs137 = errors; + if (errors === _errs137) { + if (errors === _errs137) { + if (typeof data59 === 'string') { + if (!formats0(data59)) { + const err98 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema171.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } else { + const err99 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[3].allOf[0].properties.url.type, + parentSchema: schema171.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + } + var valid31 = _errs137 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.name !== undefined) { + let data60 = data.name; + const _errs139 = errors; + if (typeof data60 !== 'string') { + const err100 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema171.anyOf[3].allOf[0].properties.name, + data: data60, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + var valid31 = _errs139 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.description !== undefined) { + let data61 = data.description; + const _errs141 = errors; + if (typeof data61 !== 'string') { + const err101 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema171.anyOf[3].allOf[0].properties.description, + data: data61, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid31 = _errs141 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.type !== undefined) { + let data62 = data.type; + const _errs143 = errors; + if (typeof data62 !== 'string') { + const err102 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema171.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema171.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + if ( + !( + data62 === 'device' || + data62 === 'group' || + data62 === 'edge instantiable' || + data62 === 'cloud instantiable' + ) + ) { + const err103 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema171.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema171.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema171.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + var valid31 = _errs143 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.isPublic !== undefined) { + let data63 = data.isPublic; + const _errs145 = errors; + if (typeof data63 !== 'boolean') { + const err104 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema171.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema171.anyOf[3].allOf[0].properties.isPublic, + data: data63, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + var valid31 = _errs145 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.viewer !== undefined) { + let data64 = data.viewer; + const _errs147 = errors; + if (errors === _errs147) { + if (Array.isArray(data64)) { + var valid32 = true; + const len10 = data64.length; + for (let i10 = 0; i10 < len10; i10++) { + let data65 = data64[i10]; + const _errs149 = errors; + if (errors === _errs149) { + if ( + data65 && + typeof data65 == 'object' && + !Array.isArray(data65) + ) { + let missing10; + if (data65.url === undefined && (missing10 = 'url')) { + const err105 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + + missing10 + + "'", + schema: + schema171.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema171.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } else { + if (data65.url !== undefined) { + let data66 = data65.url; + const _errs151 = errors; + if (errors === _errs151) { + if (errors === _errs151) { + if (typeof data66 === 'string') { + if (!formats0(data66)) { + const err106 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema171.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } else { + const err107 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema171.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + } + } + } + } else { + const err108 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema171.anyOf[3].allOf[0].properties.viewer + .items.type, + parentSchema: + schema171.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid32 = _errs149 === errors; + if (!valid32) { + break; + } + } + } else { + const err109 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema171.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: + schema171.anyOf[3].allOf[0].properties.viewer, + data: data64, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + } + } + var valid31 = _errs147 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.owner !== undefined) { + let data67 = data.owner; + const _errs153 = errors; + if (errors === _errs153) { + if (Array.isArray(data67)) { + var valid34 = true; + const len11 = data67.length; + for (let i11 = 0; i11 < len11; i11++) { + let data68 = data67[i11]; + const _errs155 = errors; + if (errors === _errs155) { + if ( + data68 && + typeof data68 == 'object' && + !Array.isArray(data68) + ) { + let missing11; + if ( + data68.url === undefined && + (missing11 = 'url') + ) { + const err110 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema171.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema171.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err110]; + } else { + vErrors.push(err110); + } + errors++; + } else { + if (data68.url !== undefined) { + let data69 = data68.url; + const _errs157 = errors; + if (errors === _errs157) { + if (errors === _errs157) { + if (typeof data69 === 'string') { + if (!formats0(data69)) { + const err111 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema171.anyOf[3].allOf[0] + .properties.owner.items.properties + .url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err111]; + } else { + vErrors.push(err111); + } + errors++; + } + } else { + const err112 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema171.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err112]; + } else { + vErrors.push(err112); + } + errors++; + } + } + } + } + } + } else { + const err113 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema171.anyOf[3].allOf[0].properties.owner + .items.type, + parentSchema: + schema171.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err113]; + } else { + vErrors.push(err113); + } + errors++; + } + } + var valid34 = _errs155 === errors; + if (!valid34) { + break; + } + } + } else { + const err114 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema171.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema171.anyOf[3].allOf[0].properties.owner, + data: data67, + }; + if (vErrors === null) { + vErrors = [err114]; + } else { + vErrors.push(err114); + } + errors++; + } + } + var valid31 = _errs153 === errors; + } else { + var valid31 = true; + } + } + } + } + } + } + } + } + } else { + const err115 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema171.anyOf[3].allOf[0].type, + parentSchema: schema171.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err115]; + } else { + vErrors.push(err115); + } + errors++; + } + } + var valid30 = _errs135 === errors; + if (valid30) { + const _errs159 = errors; + if (errors === _errs159) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if (data.devices === undefined && (missing12 = 'devices')) { + const err116 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema171.anyOf[3].allOf[1].required, + parentSchema: schema171.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err116]; + } else { + vErrors.push(err116); + } + errors++; + } else { + if (data.type !== undefined) { + let data70 = data.type; + const _errs161 = errors; + if ('group' !== data70) { + const err117 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema171.anyOf[3].allOf[1].properties.type, + data: data70, + }; + if (vErrors === null) { + vErrors = [err117]; + } else { + vErrors.push(err117); + } + errors++; + } + var valid36 = _errs161 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data.devices !== undefined) { + let data71 = data.devices; + const _errs162 = errors; + if (errors === _errs162) { + if (Array.isArray(data71)) { + var valid37 = true; + const len12 = data71.length; + for (let i12 = 0; i12 < len12; i12++) { + let data72 = data71[i12]; + const _errs164 = errors; + if (errors === _errs164) { + if ( + data72 && + typeof data72 == 'object' && + !Array.isArray(data72) + ) { + let missing13; + if (data72.url === undefined && (missing13 = 'url')) { + const err118 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: + "must have required property '" + missing13 + "'", + schema: + schema171.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema171.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err118]; + } else { + vErrors.push(err118); + } + errors++; + } else { + if (data72.url !== undefined) { + let data73 = data72.url; + const _errs166 = errors; + if (errors === _errs166) { + if (errors === _errs166) { + if (typeof data73 === 'string') { + if (!formats0(data73)) { + const err119 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema171.anyOf[3].allOf[1].properties + .devices.items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err119]; + } else { + vErrors.push(err119); + } + errors++; + } + } else { + const err120 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema171.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema171.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err120]; + } else { + vErrors.push(err120); + } + errors++; + } + } + } + } + } + } else { + const err121 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema171.anyOf[3].allOf[1].properties.devices.items + .type, + parentSchema: + schema171.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err121]; + } else { + vErrors.push(err121); + } + errors++; + } + } + var valid37 = _errs164 === errors; + if (!valid37) { + break; + } + } + } else { + const err122 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema171.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema171.anyOf[3].allOf[1].properties.devices, + data: data71, + }; + if (vErrors === null) { + vErrors = [err122]; + } else { + vErrors.push(err122); + } + errors++; + } + } + var valid36 = _errs162 === errors; + } else { + var valid36 = true; + } + } + } + } else { + const err123 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema171.anyOf[3].allOf[1].type, + parentSchema: schema171.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err123]; + } else { + vErrors.push(err123); + } + errors++; + } + } + var valid30 = _errs159 === errors; + } + var _valid0 = _errs134 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err124 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema171.anyOf, + parentSchema: schema171, + data, + }; + if (vErrors === null) { + vErrors = [err124]; + } else { + vErrors.push(err124); + } + errors++; + validate186.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate186.errors = vErrors; + return errors === 0; +} +exports.validateCreateDeviceResponse201Request = validate187; +const schema172 = { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'createDeviceResponse201Request', + 'x-location': + '#/paths//devices/post/responses/201/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate187( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema172.anyOf[0].allOf[0].required, + parentSchema: schema172.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs4 = errors; + if (typeof data0 !== 'string') { + const err1 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema172.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema172.anyOf[0].allOf[0].properties.name, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err2 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema172.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema172.anyOf[0].allOf[0].properties.description, + data: data1, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err3 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema172.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema172.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + const err4 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema172.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema172.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema172.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs10 = errors; + if (typeof data3 !== 'boolean') { + const err5 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema172.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema172.anyOf[0].allOf[0].properties.isPublic, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data4)) { + var valid3 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + const err6 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: + schema172.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema172.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + const err7 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema172.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema172.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } + } else { + const err9 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema172.anyOf[0].allOf[0].properties.viewer.items.type, + parentSchema: + schema172.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var valid3 = _errs14 === errors; + if (!valid3) { + break; + } + } + } else { + const err10 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema172.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema172.anyOf[0].allOf[0].properties.viewer, + data: data4, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid5 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + const err11 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema172.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema172.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + const err12 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema172.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } else { + const err13 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema172.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + } + } + } + } + } else { + const err14 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema172.anyOf[0].allOf[0].properties.owner.items.type, + parentSchema: + schema172.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } + var valid5 = _errs20 === errors; + if (!valid5) { + break; + } + } + } else { + const err15 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema172.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema172.anyOf[0].allOf[0].properties.owner, + data: data7, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + var valid2 = _errs18 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } else { + const err16 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema172.anyOf[0].allOf[0].type, + parentSchema: schema172.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs26 = errors; + if ('cloud instantiable' !== data10) { + const err17 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema172.anyOf[0].allOf[1].properties.type, + data: data10, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var valid7 = _errs26 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data11 = data.instantiateUrl; + const _errs27 = errors; + if (errors === _errs27) { + if (errors === _errs27) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + const err18 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema172.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } else { + const err19 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema172.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema172.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + } + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data12)) { + var valid8 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + const err20 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema172.anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema172.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid9 = _errs34 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs36 = errors; + if (typeof data15 !== 'string') { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema172.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err23 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema172.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + const err24 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema172.anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema172.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema172.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err25 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema172.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema172.anyOf[0].allOf[1].properties.services.items, + data: data13, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + var valid8 = _errs31 === errors; + if (!valid8) { + break; + } + } + } else { + const err26 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema172.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema172.anyOf[0].allOf[1].properties.services, + data: data12, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err27 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema172.anyOf[0].allOf[1].type, + parentSchema: schema172.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid1 = _errs24 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs40 = errors; + const _errs41 = errors; + if (errors === _errs41) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if ( + (data.type === undefined && (missing3 = 'type')) || + (data.name === undefined && (missing3 = 'name')) || + (data.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err28 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema172.anyOf[1].allOf[0].required, + parentSchema: schema172.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } else { + if (data.name !== undefined) { + let data17 = data.name; + const _errs43 = errors; + if (typeof data17 !== 'string') { + const err29 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema172.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema172.anyOf[1].allOf[0].properties.name, + data: data17, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + var valid11 = _errs43 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data18 = data.description; + const _errs45 = errors; + if (typeof data18 !== 'string') { + const err30 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema172.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema172.anyOf[1].allOf[0].properties.description, + data: data18, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data19 = data.type; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err31 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema172.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema172.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + if ( + !( + data19 === 'device' || + data19 === 'group' || + data19 === 'edge instantiable' || + data19 === 'cloud instantiable' + ) + ) { + const err32 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema172.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema172.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema172.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data20 = data.isPublic; + const _errs49 = errors; + if (typeof data20 !== 'boolean') { + const err33 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema172.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema172.anyOf[1].allOf[0].properties.isPublic, + data: data20, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data21 = data.viewer; + const _errs51 = errors; + if (errors === _errs51) { + if (Array.isArray(data21)) { + var valid12 = true; + const len3 = data21.length; + for (let i3 = 0; i3 < len3; i3++) { + let data22 = data21[i3]; + const _errs53 = errors; + if (errors === _errs53) { + if ( + data22 && + typeof data22 == 'object' && + !Array.isArray(data22) + ) { + let missing4; + if (data22.url === undefined && (missing4 = 'url')) { + const err34 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema172.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema172.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } else { + if (data22.url !== undefined) { + let data23 = data22.url; + const _errs55 = errors; + if (errors === _errs55) { + if (errors === _errs55) { + if (typeof data23 === 'string') { + if (!formats0(data23)) { + const err35 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema172.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } else { + const err36 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[1].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema172.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + } + } + } + } else { + const err37 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema172.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema172.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + var valid12 = _errs53 === errors; + if (!valid12) { + break; + } + } + } else { + const err38 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema172.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema172.anyOf[1].allOf[0].properties.viewer, + data: data21, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data24 = data.owner; + const _errs57 = errors; + if (errors === _errs57) { + if (Array.isArray(data24)) { + var valid14 = true; + const len4 = data24.length; + for (let i4 = 0; i4 < len4; i4++) { + let data25 = data24[i4]; + const _errs59 = errors; + if (errors === _errs59) { + if ( + data25 && + typeof data25 == 'object' && + !Array.isArray(data25) + ) { + let missing5; + if (data25.url === undefined && (missing5 = 'url')) { + const err39 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema172.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema172.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } else { + if (data25.url !== undefined) { + let data26 = data25.url; + const _errs61 = errors; + if (errors === _errs61) { + if (errors === _errs61) { + if (typeof data26 === 'string') { + if (!formats0(data26)) { + const err40 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema172.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } else { + const err41 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[1].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema172.anyOf[1].allOf[0].properties.owner + .items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + } + } + } + } else { + const err42 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema172.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema172.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid14 = _errs59 === errors; + if (!valid14) { + break; + } + } + } else { + const err43 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema172.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema172.anyOf[1].allOf[0].properties.owner, + data: data24, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + } + var valid11 = _errs57 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } else { + const err44 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema172.anyOf[1].allOf[0].type, + parentSchema: schema172.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var valid10 = _errs41 === errors; + if (valid10) { + const _errs63 = errors; + if (errors === _errs63) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data27 = data.type; + const _errs65 = errors; + if ('device' !== data27) { + const err45 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema172.anyOf[1].allOf[1].properties.type, + data: data27, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + var valid16 = _errs65 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data28 = data.experiment; + const _errs66 = errors; + if (errors === _errs66) { + if (errors === _errs66) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err46 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema172.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } else { + const err47 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema172.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema172.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + } + var valid16 = _errs66 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data29 = data.services; + const _errs68 = errors; + if (errors === _errs68) { + if (Array.isArray(data29)) { + var valid17 = true; + const len5 = data29.length; + for (let i5 = 0; i5 < len5; i5++) { + let data30 = data29[i5]; + const _errs70 = errors; + if (errors === _errs70) { + if ( + data30 && + typeof data30 == 'object' && + !Array.isArray(data30) + ) { + if (data30.serviceType !== undefined) { + let data31 = data30.serviceType; + const _errs73 = errors; + if (errors === _errs73) { + if (errors === _errs73) { + if (typeof data31 === 'string') { + if (!formats0(data31)) { + const err48 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema172.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } else { + const err49 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema172.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + } + } + var valid18 = _errs73 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceId !== undefined) { + let data32 = data30.serviceId; + const _errs75 = errors; + if (typeof data32 !== 'string') { + const err50 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[1].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema172.anyOf[1].allOf[1].properties.services.items + .properties.serviceId, + data: data32, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid18 = _errs75 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceDirection !== undefined) { + let data33 = data30.serviceDirection; + const _errs77 = errors; + if (typeof data33 !== 'string') { + const err51 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema172.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + if ( + !( + data33 === 'consumer' || + data33 === 'producer' || + data33 === 'prosumer' + ) + ) { + const err52 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema172.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema172.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema172.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + var valid18 = _errs77 === errors; + } else { + var valid18 = true; + } + } + } + } else { + const err53 = { + instancePath: instancePath + '/services/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema172.anyOf[1].allOf[1].properties.services.items.type, + parentSchema: + schema172.anyOf[1].allOf[1].properties.services.items, + data: data30, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + var valid17 = _errs70 === errors; + if (!valid17) { + break; + } + } + } else { + const err54 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema172.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema172.anyOf[1].allOf[1].properties.services, + data: data29, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + var valid16 = _errs68 === errors; + } else { + var valid16 = true; + } + } + } + } else { + const err55 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema172.anyOf[1].allOf[1].type, + parentSchema: schema172.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid10 = _errs63 === errors; + } + var _valid0 = _errs40 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs79 = errors; + const _errs80 = errors; + if (errors === _errs80) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.type === undefined && (missing6 = 'type')) || + (data.name === undefined && (missing6 = 'name')) || + (data.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err56 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema172.anyOf[2].allOf[0].required, + parentSchema: schema172.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } else { + if (data.name !== undefined) { + let data34 = data.name; + const _errs82 = errors; + if (typeof data34 !== 'string') { + const err57 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema172.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema172.anyOf[2].allOf[0].properties.name, + data: data34, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + var valid20 = _errs82 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.description !== undefined) { + let data35 = data.description; + const _errs84 = errors; + if (typeof data35 !== 'string') { + const err58 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema172.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema172.anyOf[2].allOf[0].properties.description, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + var valid20 = _errs84 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.type !== undefined) { + let data36 = data.type; + const _errs86 = errors; + if (typeof data36 !== 'string') { + const err59 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema172.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema172.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + if ( + !( + data36 === 'device' || + data36 === 'group' || + data36 === 'edge instantiable' || + data36 === 'cloud instantiable' + ) + ) { + const err60 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema172.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema172.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema172.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + var valid20 = _errs86 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.isPublic !== undefined) { + let data37 = data.isPublic; + const _errs88 = errors; + if (typeof data37 !== 'boolean') { + const err61 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema172.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema172.anyOf[2].allOf[0].properties.isPublic, + data: data37, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs88 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.viewer !== undefined) { + let data38 = data.viewer; + const _errs90 = errors; + if (errors === _errs90) { + if (Array.isArray(data38)) { + var valid21 = true; + const len6 = data38.length; + for (let i6 = 0; i6 < len6; i6++) { + let data39 = data38[i6]; + const _errs92 = errors; + if (errors === _errs92) { + if ( + data39 && + typeof data39 == 'object' && + !Array.isArray(data39) + ) { + let missing7; + if (data39.url === undefined && (missing7 = 'url')) { + const err62 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema172.anyOf[2].allOf[0].properties.viewer.items + .required, + parentSchema: + schema172.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } else { + if (data39.url !== undefined) { + let data40 = data39.url; + const _errs94 = errors; + if (errors === _errs94) { + if (errors === _errs94) { + if (typeof data40 === 'string') { + if (!formats0(data40)) { + const err63 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema172.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + } else { + const err64 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema172.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + } + } + } + } else { + const err65 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema172.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema172.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid21 = _errs92 === errors; + if (!valid21) { + break; + } + } + } else { + const err66 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema172.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema172.anyOf[2].allOf[0].properties.viewer, + data: data38, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid20 = _errs90 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.owner !== undefined) { + let data41 = data.owner; + const _errs96 = errors; + if (errors === _errs96) { + if (Array.isArray(data41)) { + var valid23 = true; + const len7 = data41.length; + for (let i7 = 0; i7 < len7; i7++) { + let data42 = data41[i7]; + const _errs98 = errors; + if (errors === _errs98) { + if ( + data42 && + typeof data42 == 'object' && + !Array.isArray(data42) + ) { + let missing8; + if (data42.url === undefined && (missing8 = 'url')) { + const err67 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + missing8 + "'", + schema: + schema172.anyOf[2].allOf[0].properties.owner.items + .required, + parentSchema: + schema172.anyOf[2].allOf[0].properties.owner + .items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data42.url !== undefined) { + let data43 = data42.url; + const _errs100 = errors; + if (errors === _errs100) { + if (errors === _errs100) { + if (typeof data43 === 'string') { + if (!formats0(data43)) { + const err68 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema172.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema172.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + } + } + } else { + const err70 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema172.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema172.anyOf[2].allOf[0].properties.owner.items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + } + var valid23 = _errs98 === errors; + if (!valid23) { + break; + } + } + } else { + const err71 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema172.anyOf[2].allOf[0].properties.owner.type, + parentSchema: schema172.anyOf[2].allOf[0].properties.owner, + data: data41, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + } + var valid20 = _errs96 === errors; + } else { + var valid20 = true; + } + } + } + } + } + } + } + } else { + const err72 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema172.anyOf[2].allOf[0].type, + parentSchema: schema172.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + var valid19 = _errs80 === errors; + if (valid19) { + const _errs102 = errors; + if (errors === _errs102) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs104 = errors; + if ('edge instantiable' !== data44) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema172.anyOf[2].allOf[1].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid25 = _errs104 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.codeUrl !== undefined) { + let data45 = data.codeUrl; + const _errs105 = errors; + if (errors === _errs105) { + if (errors === _errs105) { + if (typeof data45 === 'string') { + if (!formats0(data45)) { + const err74 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema172.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } else { + const err75 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema172.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema172.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + } + var valid25 = _errs105 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.services !== undefined) { + let data46 = data.services; + const _errs107 = errors; + if (errors === _errs107) { + if (Array.isArray(data46)) { + var valid26 = true; + const len8 = data46.length; + for (let i8 = 0; i8 < len8; i8++) { + let data47 = data46[i8]; + const _errs109 = errors; + if (errors === _errs109) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + if (data47.serviceType !== undefined) { + let data48 = data47.serviceType; + const _errs112 = errors; + if (errors === _errs112) { + if (errors === _errs112) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema172.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema172.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + var valid27 = _errs112 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceId !== undefined) { + let data49 = data47.serviceId; + const _errs114 = errors; + if (typeof data49 !== 'string') { + const err78 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[2].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema172.anyOf[2].allOf[1].properties.services + .items.properties.serviceId, + data: data49, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + var valid27 = _errs114 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceDirection !== undefined) { + let data50 = data47.serviceDirection; + const _errs116 = errors; + if (typeof data50 !== 'string') { + const err79 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema172.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + if ( + !( + data50 === 'consumer' || + data50 === 'producer' || + data50 === 'prosumer' + ) + ) { + const err80 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema172.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema172.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema172.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + var valid27 = _errs116 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err81 = { + instancePath: instancePath + '/services/' + i8, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema172.anyOf[2].allOf[1].properties.services.items + .type, + parentSchema: + schema172.anyOf[2].allOf[1].properties.services.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + var valid26 = _errs109 === errors; + if (!valid26) { + break; + } + } + } else { + const err82 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema172.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema172.anyOf[2].allOf[1].properties.services, + data: data46, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + var valid25 = _errs107 === errors; + } else { + var valid25 = true; + } + } + } + } else { + const err83 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema172.anyOf[2].allOf[1].type, + parentSchema: schema172.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid19 = _errs102 === errors; + } + var _valid0 = _errs79 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs118 = errors; + const _errs119 = errors; + if (errors === _errs119) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if ( + (data.type === undefined && (missing9 = 'type')) || + (data.name === undefined && (missing9 = 'name')) || + (data.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err84 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema172.anyOf[3].allOf[0].required, + parentSchema: schema172.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } else { + if (data.name !== undefined) { + let data51 = data.name; + const _errs121 = errors; + if (typeof data51 !== 'string') { + const err85 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema172.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema172.anyOf[3].allOf[0].properties.name, + data: data51, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + var valid29 = _errs121 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.description !== undefined) { + let data52 = data.description; + const _errs123 = errors; + if (typeof data52 !== 'string') { + const err86 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema172.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema172.anyOf[3].allOf[0].properties.description, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid29 = _errs123 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.type !== undefined) { + let data53 = data.type; + const _errs125 = errors; + if (typeof data53 !== 'string') { + const err87 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema172.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema172.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + if ( + !( + data53 === 'device' || + data53 === 'group' || + data53 === 'edge instantiable' || + data53 === 'cloud instantiable' + ) + ) { + const err88 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema172.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema172.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema172.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + var valid29 = _errs125 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.isPublic !== undefined) { + let data54 = data.isPublic; + const _errs127 = errors; + if (typeof data54 !== 'boolean') { + const err89 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema172.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema172.anyOf[3].allOf[0].properties.isPublic, + data: data54, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + var valid29 = _errs127 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.viewer !== undefined) { + let data55 = data.viewer; + const _errs129 = errors; + if (errors === _errs129) { + if (Array.isArray(data55)) { + var valid30 = true; + const len9 = data55.length; + for (let i9 = 0; i9 < len9; i9++) { + let data56 = data55[i9]; + const _errs131 = errors; + if (errors === _errs131) { + if ( + data56 && + typeof data56 == 'object' && + !Array.isArray(data56) + ) { + let missing10; + if (data56.url === undefined && (missing10 = 'url')) { + const err90 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + missing10 + "'", + schema: + schema172.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema172.anyOf[3].allOf[0].properties.viewer + .items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } else { + if (data56.url !== undefined) { + let data57 = data56.url; + const _errs133 = errors; + if (errors === _errs133) { + if (errors === _errs133) { + if (typeof data57 === 'string') { + if (!formats0(data57)) { + const err91 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema172.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + } else { + const err92 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema172.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + } + } + } + } + } else { + const err93 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema172.anyOf[3].allOf[0].properties.viewer.items + .type, + parentSchema: + schema172.anyOf[3].allOf[0].properties.viewer.items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + var valid30 = _errs131 === errors; + if (!valid30) { + break; + } + } + } else { + const err94 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema172.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: schema172.anyOf[3].allOf[0].properties.viewer, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid29 = _errs129 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.owner !== undefined) { + let data58 = data.owner; + const _errs135 = errors; + if (errors === _errs135) { + if (Array.isArray(data58)) { + var valid32 = true; + const len10 = data58.length; + for (let i10 = 0; i10 < len10; i10++) { + let data59 = data58[i10]; + const _errs137 = errors; + if (errors === _errs137) { + if ( + data59 && + typeof data59 == 'object' && + !Array.isArray(data59) + ) { + let missing11; + if (data59.url === undefined && (missing11 = 'url')) { + const err95 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema172.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema172.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } else { + if (data59.url !== undefined) { + let data60 = data59.url; + const _errs139 = errors; + if (errors === _errs139) { + if (errors === _errs139) { + if (typeof data60 === 'string') { + if (!formats0(data60)) { + const err96 = { + instancePath: + instancePath + + '/owner/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema172.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } else { + const err97 = { + instancePath: + instancePath + '/owner/' + i10 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema172.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + } + } + } + } + } else { + const err98 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema172.anyOf[3].allOf[0].properties.owner.items + .type, + parentSchema: + schema172.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } + var valid32 = _errs137 === errors; + if (!valid32) { + break; + } + } + } else { + const err99 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema172.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema172.anyOf[3].allOf[0].properties.owner, + data: data58, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + var valid29 = _errs135 === errors; + } else { + var valid29 = true; + } + } + } + } + } + } + } + } else { + const err100 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema172.anyOf[3].allOf[0].type, + parentSchema: schema172.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + } + var valid28 = _errs119 === errors; + if (valid28) { + const _errs141 = errors; + if (errors === _errs141) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if (data.devices === undefined && (missing12 = 'devices')) { + const err101 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema172.anyOf[3].allOf[1].required, + parentSchema: schema172.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } else { + if (data.type !== undefined) { + let data61 = data.type; + const _errs143 = errors; + if ('group' !== data61) { + const err102 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema172.anyOf[3].allOf[1].properties.type, + data: data61, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + var valid34 = _errs143 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data.devices !== undefined) { + let data62 = data.devices; + const _errs144 = errors; + if (errors === _errs144) { + if (Array.isArray(data62)) { + var valid35 = true; + const len11 = data62.length; + for (let i11 = 0; i11 < len11; i11++) { + let data63 = data62[i11]; + const _errs146 = errors; + if (errors === _errs146) { + if ( + data63 && + typeof data63 == 'object' && + !Array.isArray(data63) + ) { + let missing13; + if (data63.url === undefined && (missing13 = 'url')) { + const err103 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: + "must have required property '" + missing13 + "'", + schema: + schema172.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema172.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } else { + if (data63.url !== undefined) { + let data64 = data63.url; + const _errs148 = errors; + if (errors === _errs148) { + if (errors === _errs148) { + if (typeof data64 === 'string') { + if (!formats0(data64)) { + const err104 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema172.anyOf[3].allOf[1].properties + .devices.items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + } else { + const err105 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema172.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema172.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } + } + } + } + } + } else { + const err106 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema172.anyOf[3].allOf[1].properties.devices.items + .type, + parentSchema: + schema172.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } + var valid35 = _errs146 === errors; + if (!valid35) { + break; + } + } + } else { + const err107 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema172.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema172.anyOf[3].allOf[1].properties.devices, + data: data62, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + var valid34 = _errs144 === errors; + } else { + var valid34 = true; + } + } + } + } else { + const err108 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema172.anyOf[3].allOf[1].type, + parentSchema: schema172.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid28 = _errs141 === errors; + } + var _valid0 = _errs118 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err109 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema172.anyOf, + parentSchema: schema172, + data, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + validate187.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate187.errors = vErrors; + return errors === 0; +} +exports.validateCreateDeviceResponse201Response = validate188; +const schema173 = { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + connected: { + description: + 'If true, the device is connected to the service and can be used.\n', + type: 'boolean', + readOnly: true, + }, + announcedAvailability: { + readOnly: true, + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'createDeviceResponse201Response', + 'x-location': + '#/paths//devices/post/responses/201/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate188( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema173.anyOf[0].allOf[0].required, + parentSchema: schema173.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs4 = errors; + if (errors === _errs4) { + if (errors === _errs4) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + const err1 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema173.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } else { + const err2 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[0].allOf[0].properties.url.type, + parentSchema: schema173.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err3 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema173.anyOf[0].allOf[0].properties.name, + data: data1, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err4 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema173.anyOf[0].allOf[0].properties.description, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs10 = errors; + if (typeof data3 !== 'string') { + const err5 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema173.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + const err6 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema173.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema173.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema173.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs12 = errors; + if (typeof data4 !== 'boolean') { + const err7 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema173.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema173.anyOf[0].allOf[0].properties.isPublic, + data: data4, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs14 = errors; + if (errors === _errs14) { + if (Array.isArray(data5)) { + var valid3 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + const err8 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema173.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema173.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + const err9 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema173.anyOf[0].allOf[0].properties + .viewer.items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } else { + const err10 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema173.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + } + } + } + } else { + const err11 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema173.anyOf[0].allOf[0].properties.viewer.items + .type, + parentSchema: + schema173.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } + var valid3 = _errs16 === errors; + if (!valid3) { + break; + } + } + } else { + const err12 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema173.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema173.anyOf[0].allOf[0].properties.viewer, + data: data5, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } + var valid2 = _errs14 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs20 = errors; + if (errors === _errs20) { + if (Array.isArray(data8)) { + var valid5 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs22 = errors; + if (errors === _errs22) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + const err13 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema173.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema173.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs24 = errors; + if (errors === _errs24) { + if (errors === _errs24) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + const err14 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema173.anyOf[0].allOf[0].properties + .owner.items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } else { + const err15 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema173.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + } + } + } + } else { + const err16 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema173.anyOf[0].allOf[0].properties.owner.items + .type, + parentSchema: + schema173.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid5 = _errs22 === errors; + if (!valid5) { + break; + } + } + } else { + const err17 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema173.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema173.anyOf[0].allOf[0].properties.owner, + data: data8, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + } + var valid2 = _errs20 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } + } else { + const err18 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema173.anyOf[0].allOf[0].type, + parentSchema: schema173.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs26 = errors; + if (errors === _errs26) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data11 = data.type; + const _errs28 = errors; + if ('cloud instantiable' !== data11) { + const err19 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema173.anyOf[0].allOf[1].properties.type, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + var valid7 = _errs28 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data12 = data.instantiateUrl; + const _errs29 = errors; + if (errors === _errs29) { + if (errors === _errs29) { + if (typeof data12 === 'string') { + if (!formats0(data12)) { + const err20 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema173.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema173.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data13 = data.services; + const _errs31 = errors; + if (errors === _errs31) { + if (Array.isArray(data13)) { + var valid8 = true; + const len2 = data13.length; + for (let i2 = 0; i2 < len2; i2++) { + let data14 = data13[i2]; + const _errs33 = errors; + if (errors === _errs33) { + if (data14 && typeof data14 == 'object' && !Array.isArray(data14)) { + if (data14.serviceType !== undefined) { + let data15 = data14.serviceType; + const _errs36 = errors; + if (errors === _errs36) { + if (errors === _errs36) { + if (typeof data15 === 'string') { + if (!formats0(data15)) { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema173.anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } else { + const err23 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema173.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + } + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceId !== undefined) { + let data16 = data14.serviceId; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err24 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema173.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceDirection !== undefined) { + let data17 = data14.serviceDirection; + const _errs40 = errors; + if (typeof data17 !== 'string') { + const err25 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema173.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + if ( + !( + data17 === 'consumer' || + data17 === 'producer' || + data17 === 'prosumer' + ) + ) { + const err26 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema173.anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema173.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema173.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + var valid9 = _errs40 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err27 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema173.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema173.anyOf[0].allOf[1].properties.services.items, + data: data14, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid8 = _errs33 === errors; + if (!valid8) { + break; + } + } + } else { + const err28 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema173.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema173.anyOf[0].allOf[1].properties.services, + data: data13, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + } + var valid7 = _errs31 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err29 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema173.anyOf[0].allOf[1].type, + parentSchema: schema173.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + } + var valid1 = _errs26 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs42 = errors; + const _errs43 = errors; + if (errors === _errs43) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if ( + (data.url === undefined && (missing3 = 'url')) || + (data.type === undefined && (missing3 = 'type')) || + (data.name === undefined && (missing3 = 'name')) || + (data.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err30 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema173.anyOf[1].allOf[0].required, + parentSchema: schema173.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } else { + if (data.url !== undefined) { + let data18 = data.url; + const _errs45 = errors; + if (errors === _errs45) { + if (errors === _errs45) { + if (typeof data18 === 'string') { + if (!formats0(data18)) { + const err31 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema173.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } else { + const err32 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[1].allOf[0].properties.url.type, + parentSchema: schema173.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.name !== undefined) { + let data19 = data.name; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err33 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema173.anyOf[1].allOf[0].properties.name, + data: data19, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data20 = data.description; + const _errs49 = errors; + if (typeof data20 !== 'string') { + const err34 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema173.anyOf[1].allOf[0].properties.description, + data: data20, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data21 = data.type; + const _errs51 = errors; + if (typeof data21 !== 'string') { + const err35 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema173.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + if ( + !( + data21 === 'device' || + data21 === 'group' || + data21 === 'edge instantiable' || + data21 === 'cloud instantiable' + ) + ) { + const err36 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema173.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema173.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema173.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data22 = data.isPublic; + const _errs53 = errors; + if (typeof data22 !== 'boolean') { + const err37 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema173.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema173.anyOf[1].allOf[0].properties.isPublic, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + var valid11 = _errs53 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data23 = data.viewer; + const _errs55 = errors; + if (errors === _errs55) { + if (Array.isArray(data23)) { + var valid12 = true; + const len3 = data23.length; + for (let i3 = 0; i3 < len3; i3++) { + let data24 = data23[i3]; + const _errs57 = errors; + if (errors === _errs57) { + if ( + data24 && + typeof data24 == 'object' && + !Array.isArray(data24) + ) { + let missing4; + if (data24.url === undefined && (missing4 = 'url')) { + const err38 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema173.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema173.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } else { + if (data24.url !== undefined) { + let data25 = data24.url; + const _errs59 = errors; + if (errors === _errs59) { + if (errors === _errs59) { + if (typeof data25 === 'string') { + if (!formats0(data25)) { + const err39 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema173.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } else { + const err40 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[1].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema173.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + } + } + } + } else { + const err41 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema173.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema173.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + var valid12 = _errs57 === errors; + if (!valid12) { + break; + } + } + } else { + const err42 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema173.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema173.anyOf[1].allOf[0].properties.viewer, + data: data23, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid11 = _errs55 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data26 = data.owner; + const _errs61 = errors; + if (errors === _errs61) { + if (Array.isArray(data26)) { + var valid14 = true; + const len4 = data26.length; + for (let i4 = 0; i4 < len4; i4++) { + let data27 = data26[i4]; + const _errs63 = errors; + if (errors === _errs63) { + if ( + data27 && + typeof data27 == 'object' && + !Array.isArray(data27) + ) { + let missing5; + if (data27.url === undefined && (missing5 = 'url')) { + const err43 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema173.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema173.anyOf[1].allOf[0].properties.owner + .items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } else { + if (data27.url !== undefined) { + let data28 = data27.url; + const _errs65 = errors; + if (errors === _errs65) { + if (errors === _errs65) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err44 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema173.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } else { + const err45 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[1].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema173.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + } + } + } + } + } else { + const err46 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema173.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema173.anyOf[1].allOf[0].properties.owner.items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } + var valid14 = _errs63 === errors; + if (!valid14) { + break; + } + } + } else { + const err47 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema173.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema173.anyOf[1].allOf[0].properties.owner, + data: data26, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var valid11 = _errs61 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } + } else { + const err48 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema173.anyOf[1].allOf[0].type, + parentSchema: schema173.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } + var valid10 = _errs43 === errors; + if (valid10) { + const _errs67 = errors; + if (errors === _errs67) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data29 = data.type; + const _errs69 = errors; + if ('device' !== data29) { + const err49 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema173.anyOf[1].allOf[1].properties.type, + data: data29, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + var valid16 = _errs69 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.connected !== undefined) { + let data30 = data.connected; + const _errs70 = errors; + if (typeof data30 !== 'boolean') { + const err50 = { + instancePath: instancePath + '/connected', + schemaPath: '#/anyOf/1/allOf/1/properties/connected/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema173.anyOf[1].allOf[1].properties.connected.type, + parentSchema: schema173.anyOf[1].allOf[1].properties.connected, + data: data30, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid16 = _errs70 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.announcedAvailability !== undefined) { + let data31 = data.announcedAvailability; + const _errs72 = errors; + if (errors === _errs72) { + if (Array.isArray(data31)) { + var valid17 = true; + const len5 = data31.length; + for (let i5 = 0; i5 < len5; i5++) { + let data32 = data31[i5]; + const _errs74 = errors; + if (errors === _errs74) { + if ( + data32 && + typeof data32 == 'object' && + !Array.isArray(data32) + ) { + if (data32.start !== undefined) { + let data33 = data32.start; + const _errs76 = errors; + if (errors === _errs76) { + if (errors === _errs76) { + if (typeof data33 === 'string') { + if (!formats22.validate(data33)) { + const err51 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema173.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } else { + const err52 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start + .type, + parentSchema: + schema173.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + } + } + var valid18 = _errs76 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data32.end !== undefined) { + let data34 = data32.end; + const _errs78 = errors; + if (errors === _errs78) { + if (errors === _errs78) { + if (typeof data34 === 'string') { + if (!formats22.validate(data34)) { + const err53 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema173.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } else { + const err54 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end + .type, + parentSchema: + schema173.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + } + var valid18 = _errs78 === errors; + } else { + var valid18 = true; + } + } + } else { + const err55 = { + instancePath: instancePath + '/announcedAvailability/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema173.anyOf[1].allOf[1].properties.announcedAvailability + .items.type, + parentSchema: + schema173.anyOf[1].allOf[1].properties.announcedAvailability + .items, + data: data32, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid17 = _errs74 === errors; + if (!valid17) { + break; + } + } + } else { + const err56 = { + instancePath: instancePath + '/announcedAvailability', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema173.anyOf[1].allOf[1].properties.announcedAvailability.type, + parentSchema: + schema173.anyOf[1].allOf[1].properties.announcedAvailability, + data: data31, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + var valid16 = _errs72 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data35 = data.experiment; + const _errs80 = errors; + if (errors === _errs80) { + if (errors === _errs80) { + if (typeof data35 === 'string') { + if (!formats0(data35)) { + const err57 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema173.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } else { + const err58 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema173.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + } + } + var valid16 = _errs80 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data36 = data.services; + const _errs82 = errors; + if (errors === _errs82) { + if (Array.isArray(data36)) { + var valid19 = true; + const len6 = data36.length; + for (let i6 = 0; i6 < len6; i6++) { + let data37 = data36[i6]; + const _errs84 = errors; + if (errors === _errs84) { + if ( + data37 && + typeof data37 == 'object' && + !Array.isArray(data37) + ) { + if (data37.serviceType !== undefined) { + let data38 = data37.serviceType; + const _errs87 = errors; + if (errors === _errs87) { + if (errors === _errs87) { + if (typeof data38 === 'string') { + if (!formats0(data38)) { + const err59 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema173.anyOf[1].allOf[1].properties + .services.items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } else { + const err60 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema173.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + } + var valid20 = _errs87 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceId !== undefined) { + let data39 = data37.serviceId; + const _errs89 = errors; + if (typeof data39 !== 'string') { + const err61 = { + instancePath: + instancePath + '/services/' + i6 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[1].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema173.anyOf[1].allOf[1].properties.services + .items.properties.serviceId, + data: data39, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs89 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceDirection !== undefined) { + let data40 = data37.serviceDirection; + const _errs91 = errors; + if (typeof data40 !== 'string') { + const err62 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema173.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + if ( + !( + data40 === 'consumer' || + data40 === 'producer' || + data40 === 'prosumer' + ) + ) { + const err63 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema173.anyOf[1].allOf[1].properties + .services.items.properties.serviceDirection + .enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema173.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema173.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + var valid20 = _errs91 === errors; + } else { + var valid20 = true; + } + } + } + } else { + const err64 = { + instancePath: instancePath + '/services/' + i6, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema173.anyOf[1].allOf[1].properties.services.items + .type, + parentSchema: + schema173.anyOf[1].allOf[1].properties.services.items, + data: data37, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + var valid19 = _errs84 === errors; + if (!valid19) { + break; + } + } + } else { + const err65 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema173.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema173.anyOf[1].allOf[1].properties.services, + data: data36, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid16 = _errs82 === errors; + } else { + var valid16 = true; + } + } + } + } + } + } else { + const err66 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema173.anyOf[1].allOf[1].type, + parentSchema: schema173.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid10 = _errs67 === errors; + } + var _valid0 = _errs42 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs93 = errors; + const _errs94 = errors; + if (errors === _errs94) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.url === undefined && (missing6 = 'url')) || + (data.type === undefined && (missing6 = 'type')) || + (data.name === undefined && (missing6 = 'name')) || + (data.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err67 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema173.anyOf[2].allOf[0].required, + parentSchema: schema173.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data.url !== undefined) { + let data41 = data.url; + const _errs96 = errors; + if (errors === _errs96) { + if (errors === _errs96) { + if (typeof data41 === 'string') { + if (!formats0(data41)) { + const err68 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema173.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[2].allOf[0].properties.url.type, + parentSchema: schema173.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + var valid22 = _errs96 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.name !== undefined) { + let data42 = data.name; + const _errs98 = errors; + if (typeof data42 !== 'string') { + const err70 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema173.anyOf[2].allOf[0].properties.name, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var valid22 = _errs98 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.description !== undefined) { + let data43 = data.description; + const _errs100 = errors; + if (typeof data43 !== 'string') { + const err71 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema173.anyOf[2].allOf[0].properties.description, + data: data43, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + var valid22 = _errs100 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs102 = errors; + if (typeof data44 !== 'string') { + const err72 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema173.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + if ( + !( + data44 === 'device' || + data44 === 'group' || + data44 === 'edge instantiable' || + data44 === 'cloud instantiable' + ) + ) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema173.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema173.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema173.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid22 = _errs102 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.isPublic !== undefined) { + let data45 = data.isPublic; + const _errs104 = errors; + if (typeof data45 !== 'boolean') { + const err74 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema173.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema173.anyOf[2].allOf[0].properties.isPublic, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + var valid22 = _errs104 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.viewer !== undefined) { + let data46 = data.viewer; + const _errs106 = errors; + if (errors === _errs106) { + if (Array.isArray(data46)) { + var valid23 = true; + const len7 = data46.length; + for (let i7 = 0; i7 < len7; i7++) { + let data47 = data46[i7]; + const _errs108 = errors; + if (errors === _errs108) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + let missing7; + if (data47.url === undefined && (missing7 = 'url')) { + const err75 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema173.anyOf[2].allOf[0].properties.viewer + .items.required, + parentSchema: + schema173.anyOf[2].allOf[0].properties.viewer + .items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } else { + if (data47.url !== undefined) { + let data48 = data47.url; + const _errs110 = errors; + if (errors === _errs110) { + if (errors === _errs110) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema173.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema173.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + } + } + } else { + const err78 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema173.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema173.anyOf[2].allOf[0].properties.viewer.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + var valid23 = _errs108 === errors; + if (!valid23) { + break; + } + } + } else { + const err79 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema173.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema173.anyOf[2].allOf[0].properties.viewer, + data: data46, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + var valid22 = _errs106 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.owner !== undefined) { + let data49 = data.owner; + const _errs112 = errors; + if (errors === _errs112) { + if (Array.isArray(data49)) { + var valid25 = true; + const len8 = data49.length; + for (let i8 = 0; i8 < len8; i8++) { + let data50 = data49[i8]; + const _errs114 = errors; + if (errors === _errs114) { + if ( + data50 && + typeof data50 == 'object' && + !Array.isArray(data50) + ) { + let missing8; + if (data50.url === undefined && (missing8 = 'url')) { + const err80 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + + missing8 + + "'", + schema: + schema173.anyOf[2].allOf[0].properties.owner + .items.required, + parentSchema: + schema173.anyOf[2].allOf[0].properties.owner + .items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } else { + if (data50.url !== undefined) { + let data51 = data50.url; + const _errs116 = errors; + if (errors === _errs116) { + if (errors === _errs116) { + if (typeof data51 === 'string') { + if (!formats0(data51)) { + const err81 = { + instancePath: + instancePath + + '/owner/' + + i8 + + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema173.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } else { + const err82 = { + instancePath: + instancePath + '/owner/' + i8 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema173.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + } + } + } + } else { + const err83 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema173.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema173.anyOf[2].allOf[0].properties.owner + .items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid25 = _errs114 === errors; + if (!valid25) { + break; + } + } + } else { + const err84 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema173.anyOf[2].allOf[0].properties.owner.type, + parentSchema: + schema173.anyOf[2].allOf[0].properties.owner, + data: data49, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + var valid22 = _errs112 === errors; + } else { + var valid22 = true; + } + } + } + } + } + } + } + } + } else { + const err85 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema173.anyOf[2].allOf[0].type, + parentSchema: schema173.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + } + var valid21 = _errs94 === errors; + if (valid21) { + const _errs118 = errors; + if (errors === _errs118) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data52 = data.type; + const _errs120 = errors; + if ('edge instantiable' !== data52) { + const err86 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema173.anyOf[2].allOf[1].properties.type, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid27 = _errs120 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.codeUrl !== undefined) { + let data53 = data.codeUrl; + const _errs121 = errors; + if (errors === _errs121) { + if (errors === _errs121) { + if (typeof data53 === 'string') { + if (!formats0(data53)) { + const err87 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema173.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + } else { + const err88 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema173.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + } + } + var valid27 = _errs121 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.services !== undefined) { + let data54 = data.services; + const _errs123 = errors; + if (errors === _errs123) { + if (Array.isArray(data54)) { + var valid28 = true; + const len9 = data54.length; + for (let i9 = 0; i9 < len9; i9++) { + let data55 = data54[i9]; + const _errs125 = errors; + if (errors === _errs125) { + if ( + data55 && + typeof data55 == 'object' && + !Array.isArray(data55) + ) { + if (data55.serviceType !== undefined) { + let data56 = data55.serviceType; + const _errs128 = errors; + if (errors === _errs128) { + if (errors === _errs128) { + if (typeof data56 === 'string') { + if (!formats0(data56)) { + const err89 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema173.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } else { + const err90 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema173.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + } + var valid29 = _errs128 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceId !== undefined) { + let data57 = data55.serviceId; + const _errs130 = errors; + if (typeof data57 !== 'string') { + const err91 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[2].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema173.anyOf[2].allOf[1].properties.services + .items.properties.serviceId, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + var valid29 = _errs130 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceDirection !== undefined) { + let data58 = data55.serviceDirection; + const _errs132 = errors; + if (typeof data58 !== 'string') { + const err92 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema173.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + if ( + !( + data58 === 'consumer' || + data58 === 'producer' || + data58 === 'prosumer' + ) + ) { + const err93 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema173.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema173.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema173.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + var valid29 = _errs132 === errors; + } else { + var valid29 = true; + } + } + } + } else { + const err94 = { + instancePath: instancePath + '/services/' + i9, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema173.anyOf[2].allOf[1].properties.services.items + .type, + parentSchema: + schema173.anyOf[2].allOf[1].properties.services.items, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid28 = _errs125 === errors; + if (!valid28) { + break; + } + } + } else { + const err95 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema173.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema173.anyOf[2].allOf[1].properties.services, + data: data54, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + var valid27 = _errs123 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err96 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema173.anyOf[2].allOf[1].type, + parentSchema: schema173.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + var valid21 = _errs118 === errors; + } + var _valid0 = _errs93 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs134 = errors; + const _errs135 = errors; + if (errors === _errs135) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if ( + (data.url === undefined && (missing9 = 'url')) || + (data.type === undefined && (missing9 = 'type')) || + (data.name === undefined && (missing9 = 'name')) || + (data.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err97 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema173.anyOf[3].allOf[0].required, + parentSchema: schema173.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } else { + if (data.url !== undefined) { + let data59 = data.url; + const _errs137 = errors; + if (errors === _errs137) { + if (errors === _errs137) { + if (typeof data59 === 'string') { + if (!formats0(data59)) { + const err98 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema173.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } else { + const err99 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[3].allOf[0].properties.url.type, + parentSchema: schema173.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + } + var valid31 = _errs137 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.name !== undefined) { + let data60 = data.name; + const _errs139 = errors; + if (typeof data60 !== 'string') { + const err100 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema173.anyOf[3].allOf[0].properties.name, + data: data60, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + var valid31 = _errs139 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.description !== undefined) { + let data61 = data.description; + const _errs141 = errors; + if (typeof data61 !== 'string') { + const err101 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema173.anyOf[3].allOf[0].properties.description, + data: data61, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid31 = _errs141 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.type !== undefined) { + let data62 = data.type; + const _errs143 = errors; + if (typeof data62 !== 'string') { + const err102 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema173.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema173.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + if ( + !( + data62 === 'device' || + data62 === 'group' || + data62 === 'edge instantiable' || + data62 === 'cloud instantiable' + ) + ) { + const err103 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema173.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema173.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema173.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + var valid31 = _errs143 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.isPublic !== undefined) { + let data63 = data.isPublic; + const _errs145 = errors; + if (typeof data63 !== 'boolean') { + const err104 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema173.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema173.anyOf[3].allOf[0].properties.isPublic, + data: data63, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + var valid31 = _errs145 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.viewer !== undefined) { + let data64 = data.viewer; + const _errs147 = errors; + if (errors === _errs147) { + if (Array.isArray(data64)) { + var valid32 = true; + const len10 = data64.length; + for (let i10 = 0; i10 < len10; i10++) { + let data65 = data64[i10]; + const _errs149 = errors; + if (errors === _errs149) { + if ( + data65 && + typeof data65 == 'object' && + !Array.isArray(data65) + ) { + let missing10; + if (data65.url === undefined && (missing10 = 'url')) { + const err105 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + + missing10 + + "'", + schema: + schema173.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema173.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } else { + if (data65.url !== undefined) { + let data66 = data65.url; + const _errs151 = errors; + if (errors === _errs151) { + if (errors === _errs151) { + if (typeof data66 === 'string') { + if (!formats0(data66)) { + const err106 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema173.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } else { + const err107 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema173.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + } + } + } + } else { + const err108 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema173.anyOf[3].allOf[0].properties.viewer + .items.type, + parentSchema: + schema173.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid32 = _errs149 === errors; + if (!valid32) { + break; + } + } + } else { + const err109 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema173.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: + schema173.anyOf[3].allOf[0].properties.viewer, + data: data64, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + } + } + var valid31 = _errs147 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.owner !== undefined) { + let data67 = data.owner; + const _errs153 = errors; + if (errors === _errs153) { + if (Array.isArray(data67)) { + var valid34 = true; + const len11 = data67.length; + for (let i11 = 0; i11 < len11; i11++) { + let data68 = data67[i11]; + const _errs155 = errors; + if (errors === _errs155) { + if ( + data68 && + typeof data68 == 'object' && + !Array.isArray(data68) + ) { + let missing11; + if ( + data68.url === undefined && + (missing11 = 'url') + ) { + const err110 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema173.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema173.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err110]; + } else { + vErrors.push(err110); + } + errors++; + } else { + if (data68.url !== undefined) { + let data69 = data68.url; + const _errs157 = errors; + if (errors === _errs157) { + if (errors === _errs157) { + if (typeof data69 === 'string') { + if (!formats0(data69)) { + const err111 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema173.anyOf[3].allOf[0] + .properties.owner.items.properties + .url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err111]; + } else { + vErrors.push(err111); + } + errors++; + } + } else { + const err112 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema173.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err112]; + } else { + vErrors.push(err112); + } + errors++; + } + } + } + } + } + } else { + const err113 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema173.anyOf[3].allOf[0].properties.owner + .items.type, + parentSchema: + schema173.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err113]; + } else { + vErrors.push(err113); + } + errors++; + } + } + var valid34 = _errs155 === errors; + if (!valid34) { + break; + } + } + } else { + const err114 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema173.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema173.anyOf[3].allOf[0].properties.owner, + data: data67, + }; + if (vErrors === null) { + vErrors = [err114]; + } else { + vErrors.push(err114); + } + errors++; + } + } + var valid31 = _errs153 === errors; + } else { + var valid31 = true; + } + } + } + } + } + } + } + } + } else { + const err115 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema173.anyOf[3].allOf[0].type, + parentSchema: schema173.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err115]; + } else { + vErrors.push(err115); + } + errors++; + } + } + var valid30 = _errs135 === errors; + if (valid30) { + const _errs159 = errors; + if (errors === _errs159) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if (data.devices === undefined && (missing12 = 'devices')) { + const err116 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema173.anyOf[3].allOf[1].required, + parentSchema: schema173.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err116]; + } else { + vErrors.push(err116); + } + errors++; + } else { + if (data.type !== undefined) { + let data70 = data.type; + const _errs161 = errors; + if ('group' !== data70) { + const err117 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema173.anyOf[3].allOf[1].properties.type, + data: data70, + }; + if (vErrors === null) { + vErrors = [err117]; + } else { + vErrors.push(err117); + } + errors++; + } + var valid36 = _errs161 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data.devices !== undefined) { + let data71 = data.devices; + const _errs162 = errors; + if (errors === _errs162) { + if (Array.isArray(data71)) { + var valid37 = true; + const len12 = data71.length; + for (let i12 = 0; i12 < len12; i12++) { + let data72 = data71[i12]; + const _errs164 = errors; + if (errors === _errs164) { + if ( + data72 && + typeof data72 == 'object' && + !Array.isArray(data72) + ) { + let missing13; + if (data72.url === undefined && (missing13 = 'url')) { + const err118 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: + "must have required property '" + missing13 + "'", + schema: + schema173.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema173.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err118]; + } else { + vErrors.push(err118); + } + errors++; + } else { + if (data72.url !== undefined) { + let data73 = data72.url; + const _errs166 = errors; + if (errors === _errs166) { + if (errors === _errs166) { + if (typeof data73 === 'string') { + if (!formats0(data73)) { + const err119 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema173.anyOf[3].allOf[1].properties + .devices.items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err119]; + } else { + vErrors.push(err119); + } + errors++; + } + } else { + const err120 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema173.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema173.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err120]; + } else { + vErrors.push(err120); + } + errors++; + } + } + } + } + } + } else { + const err121 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema173.anyOf[3].allOf[1].properties.devices.items + .type, + parentSchema: + schema173.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err121]; + } else { + vErrors.push(err121); + } + errors++; + } + } + var valid37 = _errs164 === errors; + if (!valid37) { + break; + } + } + } else { + const err122 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema173.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema173.anyOf[3].allOf[1].properties.devices, + data: data71, + }; + if (vErrors === null) { + vErrors = [err122]; + } else { + vErrors.push(err122); + } + errors++; + } + } + var valid36 = _errs162 === errors; + } else { + var valid36 = true; + } + } + } + } else { + const err123 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema173.anyOf[3].allOf[1].type, + parentSchema: schema173.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err123]; + } else { + vErrors.push(err123); + } + errors++; + } + } + var valid30 = _errs159 === errors; + } + var _valid0 = _errs134 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err124 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema173.anyOf, + parentSchema: schema173, + data, + }; + if (vErrors === null) { + vErrors = [err124]; + } else { + vErrors.push(err124); + } + errors++; + validate188.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate188.errors = vErrors; + return errors === 0; +} +exports.validateGetDeviceResponse200Request = validate189; +const schema174 = { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'getDeviceResponse200Request', + 'x-location': + '#/paths//devices/{device_id}/get/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate189( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema174.anyOf[0].allOf[0].required, + parentSchema: schema174.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs4 = errors; + if (typeof data0 !== 'string') { + const err1 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema174.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema174.anyOf[0].allOf[0].properties.name, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err2 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema174.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema174.anyOf[0].allOf[0].properties.description, + data: data1, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err3 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema174.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema174.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + const err4 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema174.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema174.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema174.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs10 = errors; + if (typeof data3 !== 'boolean') { + const err5 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema174.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema174.anyOf[0].allOf[0].properties.isPublic, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data4)) { + var valid3 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + const err6 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: + schema174.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema174.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + const err7 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema174.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema174.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } + } else { + const err9 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema174.anyOf[0].allOf[0].properties.viewer.items.type, + parentSchema: + schema174.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var valid3 = _errs14 === errors; + if (!valid3) { + break; + } + } + } else { + const err10 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema174.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema174.anyOf[0].allOf[0].properties.viewer, + data: data4, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid5 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + const err11 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema174.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema174.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + const err12 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema174.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } else { + const err13 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema174.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + } + } + } + } + } else { + const err14 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema174.anyOf[0].allOf[0].properties.owner.items.type, + parentSchema: + schema174.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } + var valid5 = _errs20 === errors; + if (!valid5) { + break; + } + } + } else { + const err15 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema174.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema174.anyOf[0].allOf[0].properties.owner, + data: data7, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + var valid2 = _errs18 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } else { + const err16 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema174.anyOf[0].allOf[0].type, + parentSchema: schema174.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs26 = errors; + if ('cloud instantiable' !== data10) { + const err17 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema174.anyOf[0].allOf[1].properties.type, + data: data10, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var valid7 = _errs26 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data11 = data.instantiateUrl; + const _errs27 = errors; + if (errors === _errs27) { + if (errors === _errs27) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + const err18 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema174.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } else { + const err19 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema174.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema174.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + } + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data12)) { + var valid8 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + const err20 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema174.anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema174.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid9 = _errs34 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs36 = errors; + if (typeof data15 !== 'string') { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema174.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err23 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema174.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + const err24 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema174.anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema174.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema174.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err25 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema174.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema174.anyOf[0].allOf[1].properties.services.items, + data: data13, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + var valid8 = _errs31 === errors; + if (!valid8) { + break; + } + } + } else { + const err26 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema174.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema174.anyOf[0].allOf[1].properties.services, + data: data12, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err27 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema174.anyOf[0].allOf[1].type, + parentSchema: schema174.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid1 = _errs24 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs40 = errors; + const _errs41 = errors; + if (errors === _errs41) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if ( + (data.type === undefined && (missing3 = 'type')) || + (data.name === undefined && (missing3 = 'name')) || + (data.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err28 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema174.anyOf[1].allOf[0].required, + parentSchema: schema174.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } else { + if (data.name !== undefined) { + let data17 = data.name; + const _errs43 = errors; + if (typeof data17 !== 'string') { + const err29 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema174.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema174.anyOf[1].allOf[0].properties.name, + data: data17, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + var valid11 = _errs43 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data18 = data.description; + const _errs45 = errors; + if (typeof data18 !== 'string') { + const err30 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema174.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema174.anyOf[1].allOf[0].properties.description, + data: data18, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data19 = data.type; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err31 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema174.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema174.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + if ( + !( + data19 === 'device' || + data19 === 'group' || + data19 === 'edge instantiable' || + data19 === 'cloud instantiable' + ) + ) { + const err32 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema174.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema174.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema174.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data20 = data.isPublic; + const _errs49 = errors; + if (typeof data20 !== 'boolean') { + const err33 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema174.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema174.anyOf[1].allOf[0].properties.isPublic, + data: data20, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data21 = data.viewer; + const _errs51 = errors; + if (errors === _errs51) { + if (Array.isArray(data21)) { + var valid12 = true; + const len3 = data21.length; + for (let i3 = 0; i3 < len3; i3++) { + let data22 = data21[i3]; + const _errs53 = errors; + if (errors === _errs53) { + if ( + data22 && + typeof data22 == 'object' && + !Array.isArray(data22) + ) { + let missing4; + if (data22.url === undefined && (missing4 = 'url')) { + const err34 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema174.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema174.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } else { + if (data22.url !== undefined) { + let data23 = data22.url; + const _errs55 = errors; + if (errors === _errs55) { + if (errors === _errs55) { + if (typeof data23 === 'string') { + if (!formats0(data23)) { + const err35 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema174.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } else { + const err36 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[1].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema174.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + } + } + } + } else { + const err37 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema174.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema174.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + var valid12 = _errs53 === errors; + if (!valid12) { + break; + } + } + } else { + const err38 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema174.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema174.anyOf[1].allOf[0].properties.viewer, + data: data21, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data24 = data.owner; + const _errs57 = errors; + if (errors === _errs57) { + if (Array.isArray(data24)) { + var valid14 = true; + const len4 = data24.length; + for (let i4 = 0; i4 < len4; i4++) { + let data25 = data24[i4]; + const _errs59 = errors; + if (errors === _errs59) { + if ( + data25 && + typeof data25 == 'object' && + !Array.isArray(data25) + ) { + let missing5; + if (data25.url === undefined && (missing5 = 'url')) { + const err39 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema174.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema174.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } else { + if (data25.url !== undefined) { + let data26 = data25.url; + const _errs61 = errors; + if (errors === _errs61) { + if (errors === _errs61) { + if (typeof data26 === 'string') { + if (!formats0(data26)) { + const err40 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema174.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } else { + const err41 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[1].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema174.anyOf[1].allOf[0].properties.owner + .items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + } + } + } + } else { + const err42 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema174.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema174.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid14 = _errs59 === errors; + if (!valid14) { + break; + } + } + } else { + const err43 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema174.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema174.anyOf[1].allOf[0].properties.owner, + data: data24, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + } + var valid11 = _errs57 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } else { + const err44 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema174.anyOf[1].allOf[0].type, + parentSchema: schema174.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var valid10 = _errs41 === errors; + if (valid10) { + const _errs63 = errors; + if (errors === _errs63) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data27 = data.type; + const _errs65 = errors; + if ('device' !== data27) { + const err45 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema174.anyOf[1].allOf[1].properties.type, + data: data27, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + var valid16 = _errs65 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data28 = data.experiment; + const _errs66 = errors; + if (errors === _errs66) { + if (errors === _errs66) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err46 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema174.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } else { + const err47 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema174.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema174.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + } + var valid16 = _errs66 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data29 = data.services; + const _errs68 = errors; + if (errors === _errs68) { + if (Array.isArray(data29)) { + var valid17 = true; + const len5 = data29.length; + for (let i5 = 0; i5 < len5; i5++) { + let data30 = data29[i5]; + const _errs70 = errors; + if (errors === _errs70) { + if ( + data30 && + typeof data30 == 'object' && + !Array.isArray(data30) + ) { + if (data30.serviceType !== undefined) { + let data31 = data30.serviceType; + const _errs73 = errors; + if (errors === _errs73) { + if (errors === _errs73) { + if (typeof data31 === 'string') { + if (!formats0(data31)) { + const err48 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema174.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } else { + const err49 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema174.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + } + } + var valid18 = _errs73 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceId !== undefined) { + let data32 = data30.serviceId; + const _errs75 = errors; + if (typeof data32 !== 'string') { + const err50 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[1].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema174.anyOf[1].allOf[1].properties.services.items + .properties.serviceId, + data: data32, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid18 = _errs75 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceDirection !== undefined) { + let data33 = data30.serviceDirection; + const _errs77 = errors; + if (typeof data33 !== 'string') { + const err51 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema174.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + if ( + !( + data33 === 'consumer' || + data33 === 'producer' || + data33 === 'prosumer' + ) + ) { + const err52 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema174.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema174.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema174.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + var valid18 = _errs77 === errors; + } else { + var valid18 = true; + } + } + } + } else { + const err53 = { + instancePath: instancePath + '/services/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema174.anyOf[1].allOf[1].properties.services.items.type, + parentSchema: + schema174.anyOf[1].allOf[1].properties.services.items, + data: data30, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + var valid17 = _errs70 === errors; + if (!valid17) { + break; + } + } + } else { + const err54 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema174.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema174.anyOf[1].allOf[1].properties.services, + data: data29, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + var valid16 = _errs68 === errors; + } else { + var valid16 = true; + } + } + } + } else { + const err55 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema174.anyOf[1].allOf[1].type, + parentSchema: schema174.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid10 = _errs63 === errors; + } + var _valid0 = _errs40 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs79 = errors; + const _errs80 = errors; + if (errors === _errs80) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.type === undefined && (missing6 = 'type')) || + (data.name === undefined && (missing6 = 'name')) || + (data.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err56 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema174.anyOf[2].allOf[0].required, + parentSchema: schema174.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } else { + if (data.name !== undefined) { + let data34 = data.name; + const _errs82 = errors; + if (typeof data34 !== 'string') { + const err57 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema174.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema174.anyOf[2].allOf[0].properties.name, + data: data34, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + var valid20 = _errs82 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.description !== undefined) { + let data35 = data.description; + const _errs84 = errors; + if (typeof data35 !== 'string') { + const err58 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema174.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema174.anyOf[2].allOf[0].properties.description, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + var valid20 = _errs84 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.type !== undefined) { + let data36 = data.type; + const _errs86 = errors; + if (typeof data36 !== 'string') { + const err59 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema174.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema174.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + if ( + !( + data36 === 'device' || + data36 === 'group' || + data36 === 'edge instantiable' || + data36 === 'cloud instantiable' + ) + ) { + const err60 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema174.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema174.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema174.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + var valid20 = _errs86 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.isPublic !== undefined) { + let data37 = data.isPublic; + const _errs88 = errors; + if (typeof data37 !== 'boolean') { + const err61 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema174.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema174.anyOf[2].allOf[0].properties.isPublic, + data: data37, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs88 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.viewer !== undefined) { + let data38 = data.viewer; + const _errs90 = errors; + if (errors === _errs90) { + if (Array.isArray(data38)) { + var valid21 = true; + const len6 = data38.length; + for (let i6 = 0; i6 < len6; i6++) { + let data39 = data38[i6]; + const _errs92 = errors; + if (errors === _errs92) { + if ( + data39 && + typeof data39 == 'object' && + !Array.isArray(data39) + ) { + let missing7; + if (data39.url === undefined && (missing7 = 'url')) { + const err62 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema174.anyOf[2].allOf[0].properties.viewer.items + .required, + parentSchema: + schema174.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } else { + if (data39.url !== undefined) { + let data40 = data39.url; + const _errs94 = errors; + if (errors === _errs94) { + if (errors === _errs94) { + if (typeof data40 === 'string') { + if (!formats0(data40)) { + const err63 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema174.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + } else { + const err64 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema174.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + } + } + } + } else { + const err65 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema174.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema174.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid21 = _errs92 === errors; + if (!valid21) { + break; + } + } + } else { + const err66 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema174.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema174.anyOf[2].allOf[0].properties.viewer, + data: data38, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid20 = _errs90 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.owner !== undefined) { + let data41 = data.owner; + const _errs96 = errors; + if (errors === _errs96) { + if (Array.isArray(data41)) { + var valid23 = true; + const len7 = data41.length; + for (let i7 = 0; i7 < len7; i7++) { + let data42 = data41[i7]; + const _errs98 = errors; + if (errors === _errs98) { + if ( + data42 && + typeof data42 == 'object' && + !Array.isArray(data42) + ) { + let missing8; + if (data42.url === undefined && (missing8 = 'url')) { + const err67 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + missing8 + "'", + schema: + schema174.anyOf[2].allOf[0].properties.owner.items + .required, + parentSchema: + schema174.anyOf[2].allOf[0].properties.owner + .items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data42.url !== undefined) { + let data43 = data42.url; + const _errs100 = errors; + if (errors === _errs100) { + if (errors === _errs100) { + if (typeof data43 === 'string') { + if (!formats0(data43)) { + const err68 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema174.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema174.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + } + } + } else { + const err70 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema174.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema174.anyOf[2].allOf[0].properties.owner.items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + } + var valid23 = _errs98 === errors; + if (!valid23) { + break; + } + } + } else { + const err71 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema174.anyOf[2].allOf[0].properties.owner.type, + parentSchema: schema174.anyOf[2].allOf[0].properties.owner, + data: data41, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + } + var valid20 = _errs96 === errors; + } else { + var valid20 = true; + } + } + } + } + } + } + } + } else { + const err72 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema174.anyOf[2].allOf[0].type, + parentSchema: schema174.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + var valid19 = _errs80 === errors; + if (valid19) { + const _errs102 = errors; + if (errors === _errs102) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs104 = errors; + if ('edge instantiable' !== data44) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema174.anyOf[2].allOf[1].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid25 = _errs104 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.codeUrl !== undefined) { + let data45 = data.codeUrl; + const _errs105 = errors; + if (errors === _errs105) { + if (errors === _errs105) { + if (typeof data45 === 'string') { + if (!formats0(data45)) { + const err74 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema174.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } else { + const err75 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema174.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema174.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + } + var valid25 = _errs105 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.services !== undefined) { + let data46 = data.services; + const _errs107 = errors; + if (errors === _errs107) { + if (Array.isArray(data46)) { + var valid26 = true; + const len8 = data46.length; + for (let i8 = 0; i8 < len8; i8++) { + let data47 = data46[i8]; + const _errs109 = errors; + if (errors === _errs109) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + if (data47.serviceType !== undefined) { + let data48 = data47.serviceType; + const _errs112 = errors; + if (errors === _errs112) { + if (errors === _errs112) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema174.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema174.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + var valid27 = _errs112 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceId !== undefined) { + let data49 = data47.serviceId; + const _errs114 = errors; + if (typeof data49 !== 'string') { + const err78 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[2].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema174.anyOf[2].allOf[1].properties.services + .items.properties.serviceId, + data: data49, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + var valid27 = _errs114 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceDirection !== undefined) { + let data50 = data47.serviceDirection; + const _errs116 = errors; + if (typeof data50 !== 'string') { + const err79 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema174.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + if ( + !( + data50 === 'consumer' || + data50 === 'producer' || + data50 === 'prosumer' + ) + ) { + const err80 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema174.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema174.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema174.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + var valid27 = _errs116 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err81 = { + instancePath: instancePath + '/services/' + i8, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema174.anyOf[2].allOf[1].properties.services.items + .type, + parentSchema: + schema174.anyOf[2].allOf[1].properties.services.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + var valid26 = _errs109 === errors; + if (!valid26) { + break; + } + } + } else { + const err82 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema174.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema174.anyOf[2].allOf[1].properties.services, + data: data46, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + var valid25 = _errs107 === errors; + } else { + var valid25 = true; + } + } + } + } else { + const err83 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema174.anyOf[2].allOf[1].type, + parentSchema: schema174.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid19 = _errs102 === errors; + } + var _valid0 = _errs79 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs118 = errors; + const _errs119 = errors; + if (errors === _errs119) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if ( + (data.type === undefined && (missing9 = 'type')) || + (data.name === undefined && (missing9 = 'name')) || + (data.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err84 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema174.anyOf[3].allOf[0].required, + parentSchema: schema174.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } else { + if (data.name !== undefined) { + let data51 = data.name; + const _errs121 = errors; + if (typeof data51 !== 'string') { + const err85 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema174.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema174.anyOf[3].allOf[0].properties.name, + data: data51, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + var valid29 = _errs121 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.description !== undefined) { + let data52 = data.description; + const _errs123 = errors; + if (typeof data52 !== 'string') { + const err86 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema174.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema174.anyOf[3].allOf[0].properties.description, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid29 = _errs123 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.type !== undefined) { + let data53 = data.type; + const _errs125 = errors; + if (typeof data53 !== 'string') { + const err87 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema174.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema174.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + if ( + !( + data53 === 'device' || + data53 === 'group' || + data53 === 'edge instantiable' || + data53 === 'cloud instantiable' + ) + ) { + const err88 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema174.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema174.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema174.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + var valid29 = _errs125 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.isPublic !== undefined) { + let data54 = data.isPublic; + const _errs127 = errors; + if (typeof data54 !== 'boolean') { + const err89 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema174.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema174.anyOf[3].allOf[0].properties.isPublic, + data: data54, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + var valid29 = _errs127 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.viewer !== undefined) { + let data55 = data.viewer; + const _errs129 = errors; + if (errors === _errs129) { + if (Array.isArray(data55)) { + var valid30 = true; + const len9 = data55.length; + for (let i9 = 0; i9 < len9; i9++) { + let data56 = data55[i9]; + const _errs131 = errors; + if (errors === _errs131) { + if ( + data56 && + typeof data56 == 'object' && + !Array.isArray(data56) + ) { + let missing10; + if (data56.url === undefined && (missing10 = 'url')) { + const err90 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + missing10 + "'", + schema: + schema174.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema174.anyOf[3].allOf[0].properties.viewer + .items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } else { + if (data56.url !== undefined) { + let data57 = data56.url; + const _errs133 = errors; + if (errors === _errs133) { + if (errors === _errs133) { + if (typeof data57 === 'string') { + if (!formats0(data57)) { + const err91 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema174.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + } else { + const err92 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema174.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + } + } + } + } + } else { + const err93 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema174.anyOf[3].allOf[0].properties.viewer.items + .type, + parentSchema: + schema174.anyOf[3].allOf[0].properties.viewer.items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + var valid30 = _errs131 === errors; + if (!valid30) { + break; + } + } + } else { + const err94 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema174.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: schema174.anyOf[3].allOf[0].properties.viewer, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid29 = _errs129 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.owner !== undefined) { + let data58 = data.owner; + const _errs135 = errors; + if (errors === _errs135) { + if (Array.isArray(data58)) { + var valid32 = true; + const len10 = data58.length; + for (let i10 = 0; i10 < len10; i10++) { + let data59 = data58[i10]; + const _errs137 = errors; + if (errors === _errs137) { + if ( + data59 && + typeof data59 == 'object' && + !Array.isArray(data59) + ) { + let missing11; + if (data59.url === undefined && (missing11 = 'url')) { + const err95 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema174.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema174.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } else { + if (data59.url !== undefined) { + let data60 = data59.url; + const _errs139 = errors; + if (errors === _errs139) { + if (errors === _errs139) { + if (typeof data60 === 'string') { + if (!formats0(data60)) { + const err96 = { + instancePath: + instancePath + + '/owner/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema174.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } else { + const err97 = { + instancePath: + instancePath + '/owner/' + i10 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema174.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + } + } + } + } + } else { + const err98 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema174.anyOf[3].allOf[0].properties.owner.items + .type, + parentSchema: + schema174.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } + var valid32 = _errs137 === errors; + if (!valid32) { + break; + } + } + } else { + const err99 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema174.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema174.anyOf[3].allOf[0].properties.owner, + data: data58, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + var valid29 = _errs135 === errors; + } else { + var valid29 = true; + } + } + } + } + } + } + } + } else { + const err100 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema174.anyOf[3].allOf[0].type, + parentSchema: schema174.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + } + var valid28 = _errs119 === errors; + if (valid28) { + const _errs141 = errors; + if (errors === _errs141) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if (data.devices === undefined && (missing12 = 'devices')) { + const err101 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema174.anyOf[3].allOf[1].required, + parentSchema: schema174.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } else { + if (data.type !== undefined) { + let data61 = data.type; + const _errs143 = errors; + if ('group' !== data61) { + const err102 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema174.anyOf[3].allOf[1].properties.type, + data: data61, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + var valid34 = _errs143 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data.devices !== undefined) { + let data62 = data.devices; + const _errs144 = errors; + if (errors === _errs144) { + if (Array.isArray(data62)) { + var valid35 = true; + const len11 = data62.length; + for (let i11 = 0; i11 < len11; i11++) { + let data63 = data62[i11]; + const _errs146 = errors; + if (errors === _errs146) { + if ( + data63 && + typeof data63 == 'object' && + !Array.isArray(data63) + ) { + let missing13; + if (data63.url === undefined && (missing13 = 'url')) { + const err103 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: + "must have required property '" + missing13 + "'", + schema: + schema174.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema174.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } else { + if (data63.url !== undefined) { + let data64 = data63.url; + const _errs148 = errors; + if (errors === _errs148) { + if (errors === _errs148) { + if (typeof data64 === 'string') { + if (!formats0(data64)) { + const err104 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema174.anyOf[3].allOf[1].properties + .devices.items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + } else { + const err105 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema174.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema174.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } + } + } + } + } + } else { + const err106 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema174.anyOf[3].allOf[1].properties.devices.items + .type, + parentSchema: + schema174.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } + var valid35 = _errs146 === errors; + if (!valid35) { + break; + } + } + } else { + const err107 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema174.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema174.anyOf[3].allOf[1].properties.devices, + data: data62, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + var valid34 = _errs144 === errors; + } else { + var valid34 = true; + } + } + } + } else { + const err108 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema174.anyOf[3].allOf[1].type, + parentSchema: schema174.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid28 = _errs141 === errors; + } + var _valid0 = _errs118 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err109 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema174.anyOf, + parentSchema: schema174, + data, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + validate189.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate189.errors = vErrors; + return errors === 0; +} +exports.validateGetDeviceResponse200Response = validate190; +const schema175 = { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + connected: { + description: + 'If true, the device is connected to the service and can be used.\n', + type: 'boolean', + readOnly: true, + }, + announcedAvailability: { + readOnly: true, + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'getDeviceResponse200Response', + 'x-location': + '#/paths//devices/{device_id}/get/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate190( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema175.anyOf[0].allOf[0].required, + parentSchema: schema175.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs4 = errors; + if (errors === _errs4) { + if (errors === _errs4) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + const err1 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema175.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } else { + const err2 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[0].allOf[0].properties.url.type, + parentSchema: schema175.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err3 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema175.anyOf[0].allOf[0].properties.name, + data: data1, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err4 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema175.anyOf[0].allOf[0].properties.description, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs10 = errors; + if (typeof data3 !== 'string') { + const err5 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema175.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + const err6 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema175.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema175.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema175.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs12 = errors; + if (typeof data4 !== 'boolean') { + const err7 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema175.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema175.anyOf[0].allOf[0].properties.isPublic, + data: data4, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs14 = errors; + if (errors === _errs14) { + if (Array.isArray(data5)) { + var valid3 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + const err8 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema175.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema175.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + const err9 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema175.anyOf[0].allOf[0].properties + .viewer.items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } else { + const err10 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema175.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + } + } + } + } else { + const err11 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema175.anyOf[0].allOf[0].properties.viewer.items + .type, + parentSchema: + schema175.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } + var valid3 = _errs16 === errors; + if (!valid3) { + break; + } + } + } else { + const err12 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema175.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema175.anyOf[0].allOf[0].properties.viewer, + data: data5, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } + var valid2 = _errs14 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs20 = errors; + if (errors === _errs20) { + if (Array.isArray(data8)) { + var valid5 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs22 = errors; + if (errors === _errs22) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + const err13 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema175.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema175.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs24 = errors; + if (errors === _errs24) { + if (errors === _errs24) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + const err14 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema175.anyOf[0].allOf[0].properties + .owner.items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } else { + const err15 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema175.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + } + } + } + } else { + const err16 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema175.anyOf[0].allOf[0].properties.owner.items + .type, + parentSchema: + schema175.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid5 = _errs22 === errors; + if (!valid5) { + break; + } + } + } else { + const err17 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema175.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema175.anyOf[0].allOf[0].properties.owner, + data: data8, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + } + var valid2 = _errs20 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } + } else { + const err18 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema175.anyOf[0].allOf[0].type, + parentSchema: schema175.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs26 = errors; + if (errors === _errs26) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data11 = data.type; + const _errs28 = errors; + if ('cloud instantiable' !== data11) { + const err19 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema175.anyOf[0].allOf[1].properties.type, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + var valid7 = _errs28 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data12 = data.instantiateUrl; + const _errs29 = errors; + if (errors === _errs29) { + if (errors === _errs29) { + if (typeof data12 === 'string') { + if (!formats0(data12)) { + const err20 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema175.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema175.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data13 = data.services; + const _errs31 = errors; + if (errors === _errs31) { + if (Array.isArray(data13)) { + var valid8 = true; + const len2 = data13.length; + for (let i2 = 0; i2 < len2; i2++) { + let data14 = data13[i2]; + const _errs33 = errors; + if (errors === _errs33) { + if (data14 && typeof data14 == 'object' && !Array.isArray(data14)) { + if (data14.serviceType !== undefined) { + let data15 = data14.serviceType; + const _errs36 = errors; + if (errors === _errs36) { + if (errors === _errs36) { + if (typeof data15 === 'string') { + if (!formats0(data15)) { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema175.anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } else { + const err23 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema175.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + } + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceId !== undefined) { + let data16 = data14.serviceId; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err24 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema175.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceDirection !== undefined) { + let data17 = data14.serviceDirection; + const _errs40 = errors; + if (typeof data17 !== 'string') { + const err25 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema175.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + if ( + !( + data17 === 'consumer' || + data17 === 'producer' || + data17 === 'prosumer' + ) + ) { + const err26 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema175.anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema175.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema175.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + var valid9 = _errs40 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err27 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema175.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema175.anyOf[0].allOf[1].properties.services.items, + data: data14, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid8 = _errs33 === errors; + if (!valid8) { + break; + } + } + } else { + const err28 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema175.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema175.anyOf[0].allOf[1].properties.services, + data: data13, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + } + var valid7 = _errs31 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err29 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema175.anyOf[0].allOf[1].type, + parentSchema: schema175.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + } + var valid1 = _errs26 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs42 = errors; + const _errs43 = errors; + if (errors === _errs43) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if ( + (data.url === undefined && (missing3 = 'url')) || + (data.type === undefined && (missing3 = 'type')) || + (data.name === undefined && (missing3 = 'name')) || + (data.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err30 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema175.anyOf[1].allOf[0].required, + parentSchema: schema175.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } else { + if (data.url !== undefined) { + let data18 = data.url; + const _errs45 = errors; + if (errors === _errs45) { + if (errors === _errs45) { + if (typeof data18 === 'string') { + if (!formats0(data18)) { + const err31 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema175.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } else { + const err32 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[1].allOf[0].properties.url.type, + parentSchema: schema175.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.name !== undefined) { + let data19 = data.name; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err33 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema175.anyOf[1].allOf[0].properties.name, + data: data19, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data20 = data.description; + const _errs49 = errors; + if (typeof data20 !== 'string') { + const err34 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema175.anyOf[1].allOf[0].properties.description, + data: data20, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data21 = data.type; + const _errs51 = errors; + if (typeof data21 !== 'string') { + const err35 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema175.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + if ( + !( + data21 === 'device' || + data21 === 'group' || + data21 === 'edge instantiable' || + data21 === 'cloud instantiable' + ) + ) { + const err36 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema175.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema175.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema175.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data22 = data.isPublic; + const _errs53 = errors; + if (typeof data22 !== 'boolean') { + const err37 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema175.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema175.anyOf[1].allOf[0].properties.isPublic, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + var valid11 = _errs53 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data23 = data.viewer; + const _errs55 = errors; + if (errors === _errs55) { + if (Array.isArray(data23)) { + var valid12 = true; + const len3 = data23.length; + for (let i3 = 0; i3 < len3; i3++) { + let data24 = data23[i3]; + const _errs57 = errors; + if (errors === _errs57) { + if ( + data24 && + typeof data24 == 'object' && + !Array.isArray(data24) + ) { + let missing4; + if (data24.url === undefined && (missing4 = 'url')) { + const err38 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema175.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema175.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } else { + if (data24.url !== undefined) { + let data25 = data24.url; + const _errs59 = errors; + if (errors === _errs59) { + if (errors === _errs59) { + if (typeof data25 === 'string') { + if (!formats0(data25)) { + const err39 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema175.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } else { + const err40 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[1].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema175.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + } + } + } + } else { + const err41 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema175.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema175.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + var valid12 = _errs57 === errors; + if (!valid12) { + break; + } + } + } else { + const err42 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema175.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema175.anyOf[1].allOf[0].properties.viewer, + data: data23, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid11 = _errs55 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data26 = data.owner; + const _errs61 = errors; + if (errors === _errs61) { + if (Array.isArray(data26)) { + var valid14 = true; + const len4 = data26.length; + for (let i4 = 0; i4 < len4; i4++) { + let data27 = data26[i4]; + const _errs63 = errors; + if (errors === _errs63) { + if ( + data27 && + typeof data27 == 'object' && + !Array.isArray(data27) + ) { + let missing5; + if (data27.url === undefined && (missing5 = 'url')) { + const err43 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema175.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema175.anyOf[1].allOf[0].properties.owner + .items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } else { + if (data27.url !== undefined) { + let data28 = data27.url; + const _errs65 = errors; + if (errors === _errs65) { + if (errors === _errs65) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err44 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema175.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } else { + const err45 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[1].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema175.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + } + } + } + } + } else { + const err46 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema175.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema175.anyOf[1].allOf[0].properties.owner.items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } + var valid14 = _errs63 === errors; + if (!valid14) { + break; + } + } + } else { + const err47 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema175.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema175.anyOf[1].allOf[0].properties.owner, + data: data26, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var valid11 = _errs61 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } + } else { + const err48 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema175.anyOf[1].allOf[0].type, + parentSchema: schema175.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } + var valid10 = _errs43 === errors; + if (valid10) { + const _errs67 = errors; + if (errors === _errs67) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data29 = data.type; + const _errs69 = errors; + if ('device' !== data29) { + const err49 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema175.anyOf[1].allOf[1].properties.type, + data: data29, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + var valid16 = _errs69 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.connected !== undefined) { + let data30 = data.connected; + const _errs70 = errors; + if (typeof data30 !== 'boolean') { + const err50 = { + instancePath: instancePath + '/connected', + schemaPath: '#/anyOf/1/allOf/1/properties/connected/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema175.anyOf[1].allOf[1].properties.connected.type, + parentSchema: schema175.anyOf[1].allOf[1].properties.connected, + data: data30, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid16 = _errs70 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.announcedAvailability !== undefined) { + let data31 = data.announcedAvailability; + const _errs72 = errors; + if (errors === _errs72) { + if (Array.isArray(data31)) { + var valid17 = true; + const len5 = data31.length; + for (let i5 = 0; i5 < len5; i5++) { + let data32 = data31[i5]; + const _errs74 = errors; + if (errors === _errs74) { + if ( + data32 && + typeof data32 == 'object' && + !Array.isArray(data32) + ) { + if (data32.start !== undefined) { + let data33 = data32.start; + const _errs76 = errors; + if (errors === _errs76) { + if (errors === _errs76) { + if (typeof data33 === 'string') { + if (!formats22.validate(data33)) { + const err51 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema175.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } else { + const err52 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start + .type, + parentSchema: + schema175.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + } + } + var valid18 = _errs76 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data32.end !== undefined) { + let data34 = data32.end; + const _errs78 = errors; + if (errors === _errs78) { + if (errors === _errs78) { + if (typeof data34 === 'string') { + if (!formats22.validate(data34)) { + const err53 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema175.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } else { + const err54 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end + .type, + parentSchema: + schema175.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + } + var valid18 = _errs78 === errors; + } else { + var valid18 = true; + } + } + } else { + const err55 = { + instancePath: instancePath + '/announcedAvailability/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema175.anyOf[1].allOf[1].properties.announcedAvailability + .items.type, + parentSchema: + schema175.anyOf[1].allOf[1].properties.announcedAvailability + .items, + data: data32, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid17 = _errs74 === errors; + if (!valid17) { + break; + } + } + } else { + const err56 = { + instancePath: instancePath + '/announcedAvailability', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema175.anyOf[1].allOf[1].properties.announcedAvailability.type, + parentSchema: + schema175.anyOf[1].allOf[1].properties.announcedAvailability, + data: data31, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + var valid16 = _errs72 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data35 = data.experiment; + const _errs80 = errors; + if (errors === _errs80) { + if (errors === _errs80) { + if (typeof data35 === 'string') { + if (!formats0(data35)) { + const err57 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema175.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } else { + const err58 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema175.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + } + } + var valid16 = _errs80 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data36 = data.services; + const _errs82 = errors; + if (errors === _errs82) { + if (Array.isArray(data36)) { + var valid19 = true; + const len6 = data36.length; + for (let i6 = 0; i6 < len6; i6++) { + let data37 = data36[i6]; + const _errs84 = errors; + if (errors === _errs84) { + if ( + data37 && + typeof data37 == 'object' && + !Array.isArray(data37) + ) { + if (data37.serviceType !== undefined) { + let data38 = data37.serviceType; + const _errs87 = errors; + if (errors === _errs87) { + if (errors === _errs87) { + if (typeof data38 === 'string') { + if (!formats0(data38)) { + const err59 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema175.anyOf[1].allOf[1].properties + .services.items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } else { + const err60 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema175.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + } + var valid20 = _errs87 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceId !== undefined) { + let data39 = data37.serviceId; + const _errs89 = errors; + if (typeof data39 !== 'string') { + const err61 = { + instancePath: + instancePath + '/services/' + i6 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[1].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema175.anyOf[1].allOf[1].properties.services + .items.properties.serviceId, + data: data39, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs89 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceDirection !== undefined) { + let data40 = data37.serviceDirection; + const _errs91 = errors; + if (typeof data40 !== 'string') { + const err62 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema175.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + if ( + !( + data40 === 'consumer' || + data40 === 'producer' || + data40 === 'prosumer' + ) + ) { + const err63 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema175.anyOf[1].allOf[1].properties + .services.items.properties.serviceDirection + .enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema175.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema175.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + var valid20 = _errs91 === errors; + } else { + var valid20 = true; + } + } + } + } else { + const err64 = { + instancePath: instancePath + '/services/' + i6, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema175.anyOf[1].allOf[1].properties.services.items + .type, + parentSchema: + schema175.anyOf[1].allOf[1].properties.services.items, + data: data37, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + var valid19 = _errs84 === errors; + if (!valid19) { + break; + } + } + } else { + const err65 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema175.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema175.anyOf[1].allOf[1].properties.services, + data: data36, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid16 = _errs82 === errors; + } else { + var valid16 = true; + } + } + } + } + } + } else { + const err66 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema175.anyOf[1].allOf[1].type, + parentSchema: schema175.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid10 = _errs67 === errors; + } + var _valid0 = _errs42 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs93 = errors; + const _errs94 = errors; + if (errors === _errs94) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.url === undefined && (missing6 = 'url')) || + (data.type === undefined && (missing6 = 'type')) || + (data.name === undefined && (missing6 = 'name')) || + (data.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err67 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema175.anyOf[2].allOf[0].required, + parentSchema: schema175.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data.url !== undefined) { + let data41 = data.url; + const _errs96 = errors; + if (errors === _errs96) { + if (errors === _errs96) { + if (typeof data41 === 'string') { + if (!formats0(data41)) { + const err68 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema175.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[2].allOf[0].properties.url.type, + parentSchema: schema175.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + var valid22 = _errs96 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.name !== undefined) { + let data42 = data.name; + const _errs98 = errors; + if (typeof data42 !== 'string') { + const err70 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema175.anyOf[2].allOf[0].properties.name, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var valid22 = _errs98 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.description !== undefined) { + let data43 = data.description; + const _errs100 = errors; + if (typeof data43 !== 'string') { + const err71 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema175.anyOf[2].allOf[0].properties.description, + data: data43, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + var valid22 = _errs100 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs102 = errors; + if (typeof data44 !== 'string') { + const err72 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema175.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + if ( + !( + data44 === 'device' || + data44 === 'group' || + data44 === 'edge instantiable' || + data44 === 'cloud instantiable' + ) + ) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema175.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema175.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema175.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid22 = _errs102 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.isPublic !== undefined) { + let data45 = data.isPublic; + const _errs104 = errors; + if (typeof data45 !== 'boolean') { + const err74 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema175.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema175.anyOf[2].allOf[0].properties.isPublic, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + var valid22 = _errs104 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.viewer !== undefined) { + let data46 = data.viewer; + const _errs106 = errors; + if (errors === _errs106) { + if (Array.isArray(data46)) { + var valid23 = true; + const len7 = data46.length; + for (let i7 = 0; i7 < len7; i7++) { + let data47 = data46[i7]; + const _errs108 = errors; + if (errors === _errs108) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + let missing7; + if (data47.url === undefined && (missing7 = 'url')) { + const err75 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema175.anyOf[2].allOf[0].properties.viewer + .items.required, + parentSchema: + schema175.anyOf[2].allOf[0].properties.viewer + .items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } else { + if (data47.url !== undefined) { + let data48 = data47.url; + const _errs110 = errors; + if (errors === _errs110) { + if (errors === _errs110) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema175.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema175.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + } + } + } else { + const err78 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema175.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema175.anyOf[2].allOf[0].properties.viewer.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + var valid23 = _errs108 === errors; + if (!valid23) { + break; + } + } + } else { + const err79 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema175.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema175.anyOf[2].allOf[0].properties.viewer, + data: data46, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + var valid22 = _errs106 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.owner !== undefined) { + let data49 = data.owner; + const _errs112 = errors; + if (errors === _errs112) { + if (Array.isArray(data49)) { + var valid25 = true; + const len8 = data49.length; + for (let i8 = 0; i8 < len8; i8++) { + let data50 = data49[i8]; + const _errs114 = errors; + if (errors === _errs114) { + if ( + data50 && + typeof data50 == 'object' && + !Array.isArray(data50) + ) { + let missing8; + if (data50.url === undefined && (missing8 = 'url')) { + const err80 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + + missing8 + + "'", + schema: + schema175.anyOf[2].allOf[0].properties.owner + .items.required, + parentSchema: + schema175.anyOf[2].allOf[0].properties.owner + .items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } else { + if (data50.url !== undefined) { + let data51 = data50.url; + const _errs116 = errors; + if (errors === _errs116) { + if (errors === _errs116) { + if (typeof data51 === 'string') { + if (!formats0(data51)) { + const err81 = { + instancePath: + instancePath + + '/owner/' + + i8 + + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema175.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } else { + const err82 = { + instancePath: + instancePath + '/owner/' + i8 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema175.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + } + } + } + } else { + const err83 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema175.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema175.anyOf[2].allOf[0].properties.owner + .items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid25 = _errs114 === errors; + if (!valid25) { + break; + } + } + } else { + const err84 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema175.anyOf[2].allOf[0].properties.owner.type, + parentSchema: + schema175.anyOf[2].allOf[0].properties.owner, + data: data49, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + var valid22 = _errs112 === errors; + } else { + var valid22 = true; + } + } + } + } + } + } + } + } + } else { + const err85 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema175.anyOf[2].allOf[0].type, + parentSchema: schema175.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + } + var valid21 = _errs94 === errors; + if (valid21) { + const _errs118 = errors; + if (errors === _errs118) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data52 = data.type; + const _errs120 = errors; + if ('edge instantiable' !== data52) { + const err86 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema175.anyOf[2].allOf[1].properties.type, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid27 = _errs120 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.codeUrl !== undefined) { + let data53 = data.codeUrl; + const _errs121 = errors; + if (errors === _errs121) { + if (errors === _errs121) { + if (typeof data53 === 'string') { + if (!formats0(data53)) { + const err87 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema175.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + } else { + const err88 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema175.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + } + } + var valid27 = _errs121 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.services !== undefined) { + let data54 = data.services; + const _errs123 = errors; + if (errors === _errs123) { + if (Array.isArray(data54)) { + var valid28 = true; + const len9 = data54.length; + for (let i9 = 0; i9 < len9; i9++) { + let data55 = data54[i9]; + const _errs125 = errors; + if (errors === _errs125) { + if ( + data55 && + typeof data55 == 'object' && + !Array.isArray(data55) + ) { + if (data55.serviceType !== undefined) { + let data56 = data55.serviceType; + const _errs128 = errors; + if (errors === _errs128) { + if (errors === _errs128) { + if (typeof data56 === 'string') { + if (!formats0(data56)) { + const err89 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema175.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } else { + const err90 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema175.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + } + var valid29 = _errs128 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceId !== undefined) { + let data57 = data55.serviceId; + const _errs130 = errors; + if (typeof data57 !== 'string') { + const err91 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[2].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema175.anyOf[2].allOf[1].properties.services + .items.properties.serviceId, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + var valid29 = _errs130 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceDirection !== undefined) { + let data58 = data55.serviceDirection; + const _errs132 = errors; + if (typeof data58 !== 'string') { + const err92 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema175.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + if ( + !( + data58 === 'consumer' || + data58 === 'producer' || + data58 === 'prosumer' + ) + ) { + const err93 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema175.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema175.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema175.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + var valid29 = _errs132 === errors; + } else { + var valid29 = true; + } + } + } + } else { + const err94 = { + instancePath: instancePath + '/services/' + i9, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema175.anyOf[2].allOf[1].properties.services.items + .type, + parentSchema: + schema175.anyOf[2].allOf[1].properties.services.items, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid28 = _errs125 === errors; + if (!valid28) { + break; + } + } + } else { + const err95 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema175.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema175.anyOf[2].allOf[1].properties.services, + data: data54, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + var valid27 = _errs123 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err96 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema175.anyOf[2].allOf[1].type, + parentSchema: schema175.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + var valid21 = _errs118 === errors; + } + var _valid0 = _errs93 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs134 = errors; + const _errs135 = errors; + if (errors === _errs135) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if ( + (data.url === undefined && (missing9 = 'url')) || + (data.type === undefined && (missing9 = 'type')) || + (data.name === undefined && (missing9 = 'name')) || + (data.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err97 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema175.anyOf[3].allOf[0].required, + parentSchema: schema175.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } else { + if (data.url !== undefined) { + let data59 = data.url; + const _errs137 = errors; + if (errors === _errs137) { + if (errors === _errs137) { + if (typeof data59 === 'string') { + if (!formats0(data59)) { + const err98 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema175.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } else { + const err99 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[3].allOf[0].properties.url.type, + parentSchema: schema175.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + } + var valid31 = _errs137 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.name !== undefined) { + let data60 = data.name; + const _errs139 = errors; + if (typeof data60 !== 'string') { + const err100 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema175.anyOf[3].allOf[0].properties.name, + data: data60, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + var valid31 = _errs139 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.description !== undefined) { + let data61 = data.description; + const _errs141 = errors; + if (typeof data61 !== 'string') { + const err101 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema175.anyOf[3].allOf[0].properties.description, + data: data61, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid31 = _errs141 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.type !== undefined) { + let data62 = data.type; + const _errs143 = errors; + if (typeof data62 !== 'string') { + const err102 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema175.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema175.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + if ( + !( + data62 === 'device' || + data62 === 'group' || + data62 === 'edge instantiable' || + data62 === 'cloud instantiable' + ) + ) { + const err103 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema175.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema175.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema175.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + var valid31 = _errs143 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.isPublic !== undefined) { + let data63 = data.isPublic; + const _errs145 = errors; + if (typeof data63 !== 'boolean') { + const err104 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema175.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema175.anyOf[3].allOf[0].properties.isPublic, + data: data63, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + var valid31 = _errs145 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.viewer !== undefined) { + let data64 = data.viewer; + const _errs147 = errors; + if (errors === _errs147) { + if (Array.isArray(data64)) { + var valid32 = true; + const len10 = data64.length; + for (let i10 = 0; i10 < len10; i10++) { + let data65 = data64[i10]; + const _errs149 = errors; + if (errors === _errs149) { + if ( + data65 && + typeof data65 == 'object' && + !Array.isArray(data65) + ) { + let missing10; + if (data65.url === undefined && (missing10 = 'url')) { + const err105 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + + missing10 + + "'", + schema: + schema175.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema175.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } else { + if (data65.url !== undefined) { + let data66 = data65.url; + const _errs151 = errors; + if (errors === _errs151) { + if (errors === _errs151) { + if (typeof data66 === 'string') { + if (!formats0(data66)) { + const err106 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema175.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } else { + const err107 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema175.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + } + } + } + } else { + const err108 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema175.anyOf[3].allOf[0].properties.viewer + .items.type, + parentSchema: + schema175.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid32 = _errs149 === errors; + if (!valid32) { + break; + } + } + } else { + const err109 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema175.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: + schema175.anyOf[3].allOf[0].properties.viewer, + data: data64, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + } + } + var valid31 = _errs147 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.owner !== undefined) { + let data67 = data.owner; + const _errs153 = errors; + if (errors === _errs153) { + if (Array.isArray(data67)) { + var valid34 = true; + const len11 = data67.length; + for (let i11 = 0; i11 < len11; i11++) { + let data68 = data67[i11]; + const _errs155 = errors; + if (errors === _errs155) { + if ( + data68 && + typeof data68 == 'object' && + !Array.isArray(data68) + ) { + let missing11; + if ( + data68.url === undefined && + (missing11 = 'url') + ) { + const err110 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema175.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema175.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err110]; + } else { + vErrors.push(err110); + } + errors++; + } else { + if (data68.url !== undefined) { + let data69 = data68.url; + const _errs157 = errors; + if (errors === _errs157) { + if (errors === _errs157) { + if (typeof data69 === 'string') { + if (!formats0(data69)) { + const err111 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema175.anyOf[3].allOf[0] + .properties.owner.items.properties + .url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err111]; + } else { + vErrors.push(err111); + } + errors++; + } + } else { + const err112 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema175.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err112]; + } else { + vErrors.push(err112); + } + errors++; + } + } + } + } + } + } else { + const err113 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema175.anyOf[3].allOf[0].properties.owner + .items.type, + parentSchema: + schema175.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err113]; + } else { + vErrors.push(err113); + } + errors++; + } + } + var valid34 = _errs155 === errors; + if (!valid34) { + break; + } + } + } else { + const err114 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema175.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema175.anyOf[3].allOf[0].properties.owner, + data: data67, + }; + if (vErrors === null) { + vErrors = [err114]; + } else { + vErrors.push(err114); + } + errors++; + } + } + var valid31 = _errs153 === errors; + } else { + var valid31 = true; + } + } + } + } + } + } + } + } + } else { + const err115 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema175.anyOf[3].allOf[0].type, + parentSchema: schema175.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err115]; + } else { + vErrors.push(err115); + } + errors++; + } + } + var valid30 = _errs135 === errors; + if (valid30) { + const _errs159 = errors; + if (errors === _errs159) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if (data.devices === undefined && (missing12 = 'devices')) { + const err116 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema175.anyOf[3].allOf[1].required, + parentSchema: schema175.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err116]; + } else { + vErrors.push(err116); + } + errors++; + } else { + if (data.type !== undefined) { + let data70 = data.type; + const _errs161 = errors; + if ('group' !== data70) { + const err117 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema175.anyOf[3].allOf[1].properties.type, + data: data70, + }; + if (vErrors === null) { + vErrors = [err117]; + } else { + vErrors.push(err117); + } + errors++; + } + var valid36 = _errs161 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data.devices !== undefined) { + let data71 = data.devices; + const _errs162 = errors; + if (errors === _errs162) { + if (Array.isArray(data71)) { + var valid37 = true; + const len12 = data71.length; + for (let i12 = 0; i12 < len12; i12++) { + let data72 = data71[i12]; + const _errs164 = errors; + if (errors === _errs164) { + if ( + data72 && + typeof data72 == 'object' && + !Array.isArray(data72) + ) { + let missing13; + if (data72.url === undefined && (missing13 = 'url')) { + const err118 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: + "must have required property '" + missing13 + "'", + schema: + schema175.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema175.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err118]; + } else { + vErrors.push(err118); + } + errors++; + } else { + if (data72.url !== undefined) { + let data73 = data72.url; + const _errs166 = errors; + if (errors === _errs166) { + if (errors === _errs166) { + if (typeof data73 === 'string') { + if (!formats0(data73)) { + const err119 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema175.anyOf[3].allOf[1].properties + .devices.items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err119]; + } else { + vErrors.push(err119); + } + errors++; + } + } else { + const err120 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema175.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema175.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err120]; + } else { + vErrors.push(err120); + } + errors++; + } + } + } + } + } + } else { + const err121 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema175.anyOf[3].allOf[1].properties.devices.items + .type, + parentSchema: + schema175.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err121]; + } else { + vErrors.push(err121); + } + errors++; + } + } + var valid37 = _errs164 === errors; + if (!valid37) { + break; + } + } + } else { + const err122 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema175.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema175.anyOf[3].allOf[1].properties.devices, + data: data71, + }; + if (vErrors === null) { + vErrors = [err122]; + } else { + vErrors.push(err122); + } + errors++; + } + } + var valid36 = _errs162 === errors; + } else { + var valid36 = true; + } + } + } + } else { + const err123 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema175.anyOf[3].allOf[1].type, + parentSchema: schema175.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err123]; + } else { + vErrors.push(err123); + } + errors++; + } + } + var valid30 = _errs159 === errors; + } + var _valid0 = _errs134 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err124 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema175.anyOf, + parentSchema: schema175, + data, + }; + if (vErrors === null) { + vErrors = [err124]; + } else { + vErrors.push(err124); + } + errors++; + validate190.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate190.errors = vErrors; + return errors === 0; +} +exports.validateUpdateDeviceBodyRequest = validate191; +const schema176 = { + title: 'Device Update', + anyOf: [ + { + title: 'Instantiable Cloud Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Concrete Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Instantiable Browser Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Device Group Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + }, + ], + }, + ], + 'x-standalone': false, + 'x-name': 'updateDeviceBodyRequest', + 'x-location': + '#/paths//devices/{device_id}/patch/requestBody/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate191( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema176.anyOf[0].allOf[0].required, + parentSchema: schema176.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs4 = errors; + if (typeof data0 !== 'string') { + const err1 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema176.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema176.anyOf[0].allOf[0].properties.name, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err2 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema176.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema176.anyOf[0].allOf[0].properties.description, + data: data1, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err3 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema176.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema176.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + const err4 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema176.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema176.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema176.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs10 = errors; + if (typeof data3 !== 'boolean') { + const err5 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema176.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema176.anyOf[0].allOf[0].properties.isPublic, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data4)) { + var valid3 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + const err6 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: + schema176.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema176.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + const err7 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema176.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema176.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } + } else { + const err9 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema176.anyOf[0].allOf[0].properties.viewer.items.type, + parentSchema: + schema176.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var valid3 = _errs14 === errors; + if (!valid3) { + break; + } + } + } else { + const err10 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema176.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema176.anyOf[0].allOf[0].properties.viewer, + data: data4, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid5 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + const err11 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema176.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema176.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + const err12 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema176.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } else { + const err13 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema176.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + } + } + } + } + } else { + const err14 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema176.anyOf[0].allOf[0].properties.owner.items.type, + parentSchema: + schema176.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } + var valid5 = _errs20 === errors; + if (!valid5) { + break; + } + } + } else { + const err15 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema176.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema176.anyOf[0].allOf[0].properties.owner, + data: data7, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + var valid2 = _errs18 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } else { + const err16 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema176.anyOf[0].allOf[0].type, + parentSchema: schema176.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs26 = errors; + if ('cloud instantiable' !== data10) { + const err17 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema176.anyOf[0].allOf[1].properties.type, + data: data10, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var valid7 = _errs26 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data11 = data.instantiateUrl; + const _errs27 = errors; + if (errors === _errs27) { + if (errors === _errs27) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + const err18 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema176.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } else { + const err19 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema176.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema176.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + } + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data12)) { + var valid8 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + const err20 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema176.anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema176.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid9 = _errs34 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs36 = errors; + if (typeof data15 !== 'string') { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema176.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err23 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema176.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + const err24 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema176.anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema176.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema176.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err25 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema176.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema176.anyOf[0].allOf[1].properties.services.items, + data: data13, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + var valid8 = _errs31 === errors; + if (!valid8) { + break; + } + } + } else { + const err26 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema176.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema176.anyOf[0].allOf[1].properties.services, + data: data12, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err27 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema176.anyOf[0].allOf[1].type, + parentSchema: schema176.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid1 = _errs24 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs40 = errors; + const _errs41 = errors; + if (errors === _errs41) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if (data.type === undefined && (missing3 = 'type')) { + const err28 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema176.anyOf[1].allOf[0].required, + parentSchema: schema176.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } else { + if (data.name !== undefined) { + let data17 = data.name; + const _errs43 = errors; + if (typeof data17 !== 'string') { + const err29 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema176.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema176.anyOf[1].allOf[0].properties.name, + data: data17, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + var valid11 = _errs43 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data18 = data.description; + const _errs45 = errors; + if (typeof data18 !== 'string') { + const err30 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema176.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema176.anyOf[1].allOf[0].properties.description, + data: data18, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data19 = data.type; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err31 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema176.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema176.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + if ( + !( + data19 === 'device' || + data19 === 'group' || + data19 === 'edge instantiable' || + data19 === 'cloud instantiable' + ) + ) { + const err32 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema176.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema176.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema176.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data20 = data.isPublic; + const _errs49 = errors; + if (typeof data20 !== 'boolean') { + const err33 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema176.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema176.anyOf[1].allOf[0].properties.isPublic, + data: data20, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data21 = data.viewer; + const _errs51 = errors; + if (errors === _errs51) { + if (Array.isArray(data21)) { + var valid12 = true; + const len3 = data21.length; + for (let i3 = 0; i3 < len3; i3++) { + let data22 = data21[i3]; + const _errs53 = errors; + if (errors === _errs53) { + if ( + data22 && + typeof data22 == 'object' && + !Array.isArray(data22) + ) { + let missing4; + if (data22.url === undefined && (missing4 = 'url')) { + const err34 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema176.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema176.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } else { + if (data22.url !== undefined) { + let data23 = data22.url; + const _errs55 = errors; + if (errors === _errs55) { + if (errors === _errs55) { + if (typeof data23 === 'string') { + if (!formats0(data23)) { + const err35 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema176.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } else { + const err36 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[1].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema176.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + } + } + } + } else { + const err37 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema176.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema176.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + var valid12 = _errs53 === errors; + if (!valid12) { + break; + } + } + } else { + const err38 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema176.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema176.anyOf[1].allOf[0].properties.viewer, + data: data21, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data24 = data.owner; + const _errs57 = errors; + if (errors === _errs57) { + if (Array.isArray(data24)) { + var valid14 = true; + const len4 = data24.length; + for (let i4 = 0; i4 < len4; i4++) { + let data25 = data24[i4]; + const _errs59 = errors; + if (errors === _errs59) { + if ( + data25 && + typeof data25 == 'object' && + !Array.isArray(data25) + ) { + let missing5; + if (data25.url === undefined && (missing5 = 'url')) { + const err39 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema176.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema176.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } else { + if (data25.url !== undefined) { + let data26 = data25.url; + const _errs61 = errors; + if (errors === _errs61) { + if (errors === _errs61) { + if (typeof data26 === 'string') { + if (!formats0(data26)) { + const err40 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema176.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } else { + const err41 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[1].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema176.anyOf[1].allOf[0].properties.owner + .items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + } + } + } + } else { + const err42 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema176.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema176.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid14 = _errs59 === errors; + if (!valid14) { + break; + } + } + } else { + const err43 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema176.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema176.anyOf[1].allOf[0].properties.owner, + data: data24, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + } + var valid11 = _errs57 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } else { + const err44 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema176.anyOf[1].allOf[0].type, + parentSchema: schema176.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var valid10 = _errs41 === errors; + if (valid10) { + const _errs63 = errors; + if (errors === _errs63) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data27 = data.type; + const _errs65 = errors; + if ('device' !== data27) { + const err45 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema176.anyOf[1].allOf[1].properties.type, + data: data27, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + var valid16 = _errs65 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data28 = data.experiment; + const _errs66 = errors; + if (errors === _errs66) { + if (errors === _errs66) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err46 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema176.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } else { + const err47 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema176.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema176.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + } + var valid16 = _errs66 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data29 = data.services; + const _errs68 = errors; + if (errors === _errs68) { + if (Array.isArray(data29)) { + var valid17 = true; + const len5 = data29.length; + for (let i5 = 0; i5 < len5; i5++) { + let data30 = data29[i5]; + const _errs70 = errors; + if (errors === _errs70) { + if ( + data30 && + typeof data30 == 'object' && + !Array.isArray(data30) + ) { + if (data30.serviceType !== undefined) { + let data31 = data30.serviceType; + const _errs73 = errors; + if (errors === _errs73) { + if (errors === _errs73) { + if (typeof data31 === 'string') { + if (!formats0(data31)) { + const err48 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema176.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } else { + const err49 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema176.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + } + } + var valid18 = _errs73 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceId !== undefined) { + let data32 = data30.serviceId; + const _errs75 = errors; + if (typeof data32 !== 'string') { + const err50 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[1].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema176.anyOf[1].allOf[1].properties.services.items + .properties.serviceId, + data: data32, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid18 = _errs75 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceDirection !== undefined) { + let data33 = data30.serviceDirection; + const _errs77 = errors; + if (typeof data33 !== 'string') { + const err51 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema176.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + if ( + !( + data33 === 'consumer' || + data33 === 'producer' || + data33 === 'prosumer' + ) + ) { + const err52 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema176.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema176.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema176.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + var valid18 = _errs77 === errors; + } else { + var valid18 = true; + } + } + } + } else { + const err53 = { + instancePath: instancePath + '/services/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema176.anyOf[1].allOf[1].properties.services.items.type, + parentSchema: + schema176.anyOf[1].allOf[1].properties.services.items, + data: data30, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + var valid17 = _errs70 === errors; + if (!valid17) { + break; + } + } + } else { + const err54 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema176.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema176.anyOf[1].allOf[1].properties.services, + data: data29, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + var valid16 = _errs68 === errors; + } else { + var valid16 = true; + } + } + } + } else { + const err55 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema176.anyOf[1].allOf[1].type, + parentSchema: schema176.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid10 = _errs63 === errors; + } + var _valid0 = _errs40 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs79 = errors; + const _errs80 = errors; + if (errors === _errs80) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if (data.type === undefined && (missing6 = 'type')) { + const err56 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema176.anyOf[2].allOf[0].required, + parentSchema: schema176.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } else { + if (data.name !== undefined) { + let data34 = data.name; + const _errs82 = errors; + if (typeof data34 !== 'string') { + const err57 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema176.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema176.anyOf[2].allOf[0].properties.name, + data: data34, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + var valid20 = _errs82 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.description !== undefined) { + let data35 = data.description; + const _errs84 = errors; + if (typeof data35 !== 'string') { + const err58 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema176.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema176.anyOf[2].allOf[0].properties.description, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + var valid20 = _errs84 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.type !== undefined) { + let data36 = data.type; + const _errs86 = errors; + if (typeof data36 !== 'string') { + const err59 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema176.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema176.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + if ( + !( + data36 === 'device' || + data36 === 'group' || + data36 === 'edge instantiable' || + data36 === 'cloud instantiable' + ) + ) { + const err60 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema176.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema176.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema176.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + var valid20 = _errs86 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.isPublic !== undefined) { + let data37 = data.isPublic; + const _errs88 = errors; + if (typeof data37 !== 'boolean') { + const err61 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema176.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema176.anyOf[2].allOf[0].properties.isPublic, + data: data37, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs88 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.viewer !== undefined) { + let data38 = data.viewer; + const _errs90 = errors; + if (errors === _errs90) { + if (Array.isArray(data38)) { + var valid21 = true; + const len6 = data38.length; + for (let i6 = 0; i6 < len6; i6++) { + let data39 = data38[i6]; + const _errs92 = errors; + if (errors === _errs92) { + if ( + data39 && + typeof data39 == 'object' && + !Array.isArray(data39) + ) { + let missing7; + if (data39.url === undefined && (missing7 = 'url')) { + const err62 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema176.anyOf[2].allOf[0].properties.viewer.items + .required, + parentSchema: + schema176.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } else { + if (data39.url !== undefined) { + let data40 = data39.url; + const _errs94 = errors; + if (errors === _errs94) { + if (errors === _errs94) { + if (typeof data40 === 'string') { + if (!formats0(data40)) { + const err63 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema176.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + } else { + const err64 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema176.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + } + } + } + } else { + const err65 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema176.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema176.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid21 = _errs92 === errors; + if (!valid21) { + break; + } + } + } else { + const err66 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema176.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema176.anyOf[2].allOf[0].properties.viewer, + data: data38, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid20 = _errs90 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.owner !== undefined) { + let data41 = data.owner; + const _errs96 = errors; + if (errors === _errs96) { + if (Array.isArray(data41)) { + var valid23 = true; + const len7 = data41.length; + for (let i7 = 0; i7 < len7; i7++) { + let data42 = data41[i7]; + const _errs98 = errors; + if (errors === _errs98) { + if ( + data42 && + typeof data42 == 'object' && + !Array.isArray(data42) + ) { + let missing8; + if (data42.url === undefined && (missing8 = 'url')) { + const err67 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + missing8 + "'", + schema: + schema176.anyOf[2].allOf[0].properties.owner.items + .required, + parentSchema: + schema176.anyOf[2].allOf[0].properties.owner + .items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data42.url !== undefined) { + let data43 = data42.url; + const _errs100 = errors; + if (errors === _errs100) { + if (errors === _errs100) { + if (typeof data43 === 'string') { + if (!formats0(data43)) { + const err68 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema176.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema176.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + } + } + } else { + const err70 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema176.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema176.anyOf[2].allOf[0].properties.owner.items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + } + var valid23 = _errs98 === errors; + if (!valid23) { + break; + } + } + } else { + const err71 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema176.anyOf[2].allOf[0].properties.owner.type, + parentSchema: schema176.anyOf[2].allOf[0].properties.owner, + data: data41, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + } + var valid20 = _errs96 === errors; + } else { + var valid20 = true; + } + } + } + } + } + } + } + } else { + const err72 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema176.anyOf[2].allOf[0].type, + parentSchema: schema176.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + var valid19 = _errs80 === errors; + if (valid19) { + const _errs102 = errors; + if (errors === _errs102) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs104 = errors; + if ('edge instantiable' !== data44) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema176.anyOf[2].allOf[1].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid25 = _errs104 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.codeUrl !== undefined) { + let data45 = data.codeUrl; + const _errs105 = errors; + if (errors === _errs105) { + if (errors === _errs105) { + if (typeof data45 === 'string') { + if (!formats0(data45)) { + const err74 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema176.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } else { + const err75 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema176.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema176.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + } + var valid25 = _errs105 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.services !== undefined) { + let data46 = data.services; + const _errs107 = errors; + if (errors === _errs107) { + if (Array.isArray(data46)) { + var valid26 = true; + const len8 = data46.length; + for (let i8 = 0; i8 < len8; i8++) { + let data47 = data46[i8]; + const _errs109 = errors; + if (errors === _errs109) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + if (data47.serviceType !== undefined) { + let data48 = data47.serviceType; + const _errs112 = errors; + if (errors === _errs112) { + if (errors === _errs112) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema176.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema176.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + var valid27 = _errs112 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceId !== undefined) { + let data49 = data47.serviceId; + const _errs114 = errors; + if (typeof data49 !== 'string') { + const err78 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[2].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema176.anyOf[2].allOf[1].properties.services + .items.properties.serviceId, + data: data49, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + var valid27 = _errs114 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceDirection !== undefined) { + let data50 = data47.serviceDirection; + const _errs116 = errors; + if (typeof data50 !== 'string') { + const err79 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema176.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + if ( + !( + data50 === 'consumer' || + data50 === 'producer' || + data50 === 'prosumer' + ) + ) { + const err80 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema176.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema176.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema176.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + var valid27 = _errs116 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err81 = { + instancePath: instancePath + '/services/' + i8, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema176.anyOf[2].allOf[1].properties.services.items + .type, + parentSchema: + schema176.anyOf[2].allOf[1].properties.services.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + var valid26 = _errs109 === errors; + if (!valid26) { + break; + } + } + } else { + const err82 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema176.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema176.anyOf[2].allOf[1].properties.services, + data: data46, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + var valid25 = _errs107 === errors; + } else { + var valid25 = true; + } + } + } + } else { + const err83 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema176.anyOf[2].allOf[1].type, + parentSchema: schema176.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid19 = _errs102 === errors; + } + var _valid0 = _errs79 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs118 = errors; + const _errs119 = errors; + if (errors === _errs119) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if (data.type === undefined && (missing9 = 'type')) { + const err84 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema176.anyOf[3].allOf[0].required, + parentSchema: schema176.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } else { + if (data.name !== undefined) { + let data51 = data.name; + const _errs121 = errors; + if (typeof data51 !== 'string') { + const err85 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema176.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema176.anyOf[3].allOf[0].properties.name, + data: data51, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + var valid29 = _errs121 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.description !== undefined) { + let data52 = data.description; + const _errs123 = errors; + if (typeof data52 !== 'string') { + const err86 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema176.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema176.anyOf[3].allOf[0].properties.description, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid29 = _errs123 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.type !== undefined) { + let data53 = data.type; + const _errs125 = errors; + if (typeof data53 !== 'string') { + const err87 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema176.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema176.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + if ( + !( + data53 === 'device' || + data53 === 'group' || + data53 === 'edge instantiable' || + data53 === 'cloud instantiable' + ) + ) { + const err88 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema176.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema176.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema176.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + var valid29 = _errs125 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.isPublic !== undefined) { + let data54 = data.isPublic; + const _errs127 = errors; + if (typeof data54 !== 'boolean') { + const err89 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema176.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema176.anyOf[3].allOf[0].properties.isPublic, + data: data54, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + var valid29 = _errs127 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.viewer !== undefined) { + let data55 = data.viewer; + const _errs129 = errors; + if (errors === _errs129) { + if (Array.isArray(data55)) { + var valid30 = true; + const len9 = data55.length; + for (let i9 = 0; i9 < len9; i9++) { + let data56 = data55[i9]; + const _errs131 = errors; + if (errors === _errs131) { + if ( + data56 && + typeof data56 == 'object' && + !Array.isArray(data56) + ) { + let missing10; + if (data56.url === undefined && (missing10 = 'url')) { + const err90 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + missing10 + "'", + schema: + schema176.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema176.anyOf[3].allOf[0].properties.viewer + .items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } else { + if (data56.url !== undefined) { + let data57 = data56.url; + const _errs133 = errors; + if (errors === _errs133) { + if (errors === _errs133) { + if (typeof data57 === 'string') { + if (!formats0(data57)) { + const err91 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema176.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + } else { + const err92 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema176.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + } + } + } + } + } else { + const err93 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema176.anyOf[3].allOf[0].properties.viewer.items + .type, + parentSchema: + schema176.anyOf[3].allOf[0].properties.viewer.items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + var valid30 = _errs131 === errors; + if (!valid30) { + break; + } + } + } else { + const err94 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema176.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: schema176.anyOf[3].allOf[0].properties.viewer, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid29 = _errs129 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.owner !== undefined) { + let data58 = data.owner; + const _errs135 = errors; + if (errors === _errs135) { + if (Array.isArray(data58)) { + var valid32 = true; + const len10 = data58.length; + for (let i10 = 0; i10 < len10; i10++) { + let data59 = data58[i10]; + const _errs137 = errors; + if (errors === _errs137) { + if ( + data59 && + typeof data59 == 'object' && + !Array.isArray(data59) + ) { + let missing11; + if (data59.url === undefined && (missing11 = 'url')) { + const err95 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema176.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema176.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } else { + if (data59.url !== undefined) { + let data60 = data59.url; + const _errs139 = errors; + if (errors === _errs139) { + if (errors === _errs139) { + if (typeof data60 === 'string') { + if (!formats0(data60)) { + const err96 = { + instancePath: + instancePath + + '/owner/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema176.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } else { + const err97 = { + instancePath: + instancePath + '/owner/' + i10 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema176.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + } + } + } + } + } else { + const err98 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema176.anyOf[3].allOf[0].properties.owner.items + .type, + parentSchema: + schema176.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } + var valid32 = _errs137 === errors; + if (!valid32) { + break; + } + } + } else { + const err99 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema176.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema176.anyOf[3].allOf[0].properties.owner, + data: data58, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + var valid29 = _errs135 === errors; + } else { + var valid29 = true; + } + } + } + } + } + } + } + } else { + const err100 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema176.anyOf[3].allOf[0].type, + parentSchema: schema176.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + } + var valid28 = _errs119 === errors; + if (valid28) { + const _errs141 = errors; + if (errors === _errs141) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data61 = data.type; + const _errs143 = errors; + if ('group' !== data61) { + const err101 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema176.anyOf[3].allOf[1].properties.type, + data: data61, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid34 = _errs143 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data.devices !== undefined) { + let data62 = data.devices; + const _errs144 = errors; + if (errors === _errs144) { + if (Array.isArray(data62)) { + var valid35 = true; + const len11 = data62.length; + for (let i11 = 0; i11 < len11; i11++) { + let data63 = data62[i11]; + const _errs146 = errors; + if (errors === _errs146) { + if ( + data63 && + typeof data63 == 'object' && + !Array.isArray(data63) + ) { + let missing12; + if (data63.url === undefined && (missing12 = 'url')) { + const err102 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: + "must have required property '" + missing12 + "'", + schema: + schema176.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema176.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } else { + if (data63.url !== undefined) { + let data64 = data63.url; + const _errs148 = errors; + if (errors === _errs148) { + if (errors === _errs148) { + if (typeof data64 === 'string') { + if (!formats0(data64)) { + const err103 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema176.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + } else { + const err104 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema176.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema176.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + } + } + } + } + } else { + const err105 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema176.anyOf[3].allOf[1].properties.devices.items.type, + parentSchema: + schema176.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } + } + var valid35 = _errs146 === errors; + if (!valid35) { + break; + } + } + } else { + const err106 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema176.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema176.anyOf[3].allOf[1].properties.devices, + data: data62, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } + var valid34 = _errs144 === errors; + } else { + var valid34 = true; + } + } + } else { + const err107 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema176.anyOf[3].allOf[1].type, + parentSchema: schema176.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + var valid28 = _errs141 === errors; + } + var _valid0 = _errs118 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err108 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema176.anyOf, + parentSchema: schema176, + data, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + validate191.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate191.errors = vErrors; + return errors === 0; +} +exports.validateUpdateDeviceBodyResponse = validate192; +const schema177 = { + title: 'Device Update', + anyOf: [ + { + title: 'Instantiable Cloud Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Concrete Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Instantiable Browser Device Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + }, + { + title: 'Device Group Update', + allOf: [ + { + title: 'Device Overview Update', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + }, + ], + }, + ], + 'x-standalone': false, + 'x-name': 'updateDeviceBodyResponse', + 'x-location': + '#/paths//devices/{device_id}/patch/requestBody/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate192( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema177.anyOf[0].allOf[0].required, + parentSchema: schema177.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs4 = errors; + if (typeof data0 !== 'string') { + const err1 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema177.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema177.anyOf[0].allOf[0].properties.name, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err2 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema177.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema177.anyOf[0].allOf[0].properties.description, + data: data1, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err3 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema177.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema177.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + const err4 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema177.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema177.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema177.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs10 = errors; + if (typeof data3 !== 'boolean') { + const err5 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema177.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema177.anyOf[0].allOf[0].properties.isPublic, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data4)) { + var valid3 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + const err6 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: + schema177.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema177.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + const err7 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema177.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema177.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } + } else { + const err9 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema177.anyOf[0].allOf[0].properties.viewer.items.type, + parentSchema: + schema177.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var valid3 = _errs14 === errors; + if (!valid3) { + break; + } + } + } else { + const err10 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema177.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema177.anyOf[0].allOf[0].properties.viewer, + data: data4, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid5 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + const err11 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema177.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema177.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + const err12 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema177.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } else { + const err13 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema177.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + } + } + } + } + } else { + const err14 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema177.anyOf[0].allOf[0].properties.owner.items.type, + parentSchema: + schema177.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } + var valid5 = _errs20 === errors; + if (!valid5) { + break; + } + } + } else { + const err15 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema177.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema177.anyOf[0].allOf[0].properties.owner, + data: data7, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + var valid2 = _errs18 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } else { + const err16 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema177.anyOf[0].allOf[0].type, + parentSchema: schema177.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs26 = errors; + if ('cloud instantiable' !== data10) { + const err17 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema177.anyOf[0].allOf[1].properties.type, + data: data10, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var valid7 = _errs26 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data11 = data.instantiateUrl; + const _errs27 = errors; + if (errors === _errs27) { + if (errors === _errs27) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + const err18 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema177.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } else { + const err19 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema177.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema177.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + } + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data12)) { + var valid8 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + const err20 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema177.anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema177.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid9 = _errs34 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs36 = errors; + if (typeof data15 !== 'string') { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema177.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err23 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema177.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + const err24 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema177.anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema177.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema177.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err25 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema177.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema177.anyOf[0].allOf[1].properties.services.items, + data: data13, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + var valid8 = _errs31 === errors; + if (!valid8) { + break; + } + } + } else { + const err26 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema177.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema177.anyOf[0].allOf[1].properties.services, + data: data12, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err27 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema177.anyOf[0].allOf[1].type, + parentSchema: schema177.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid1 = _errs24 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs40 = errors; + const _errs41 = errors; + if (errors === _errs41) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if (data.type === undefined && (missing3 = 'type')) { + const err28 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema177.anyOf[1].allOf[0].required, + parentSchema: schema177.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } else { + if (data.name !== undefined) { + let data17 = data.name; + const _errs43 = errors; + if (typeof data17 !== 'string') { + const err29 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema177.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema177.anyOf[1].allOf[0].properties.name, + data: data17, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + var valid11 = _errs43 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data18 = data.description; + const _errs45 = errors; + if (typeof data18 !== 'string') { + const err30 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema177.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema177.anyOf[1].allOf[0].properties.description, + data: data18, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data19 = data.type; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err31 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema177.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema177.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + if ( + !( + data19 === 'device' || + data19 === 'group' || + data19 === 'edge instantiable' || + data19 === 'cloud instantiable' + ) + ) { + const err32 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema177.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema177.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema177.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data20 = data.isPublic; + const _errs49 = errors; + if (typeof data20 !== 'boolean') { + const err33 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema177.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema177.anyOf[1].allOf[0].properties.isPublic, + data: data20, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data21 = data.viewer; + const _errs51 = errors; + if (errors === _errs51) { + if (Array.isArray(data21)) { + var valid12 = true; + const len3 = data21.length; + for (let i3 = 0; i3 < len3; i3++) { + let data22 = data21[i3]; + const _errs53 = errors; + if (errors === _errs53) { + if ( + data22 && + typeof data22 == 'object' && + !Array.isArray(data22) + ) { + let missing4; + if (data22.url === undefined && (missing4 = 'url')) { + const err34 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema177.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema177.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } else { + if (data22.url !== undefined) { + let data23 = data22.url; + const _errs55 = errors; + if (errors === _errs55) { + if (errors === _errs55) { + if (typeof data23 === 'string') { + if (!formats0(data23)) { + const err35 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema177.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } else { + const err36 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[1].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema177.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + } + } + } + } else { + const err37 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema177.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema177.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + var valid12 = _errs53 === errors; + if (!valid12) { + break; + } + } + } else { + const err38 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema177.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema177.anyOf[1].allOf[0].properties.viewer, + data: data21, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data24 = data.owner; + const _errs57 = errors; + if (errors === _errs57) { + if (Array.isArray(data24)) { + var valid14 = true; + const len4 = data24.length; + for (let i4 = 0; i4 < len4; i4++) { + let data25 = data24[i4]; + const _errs59 = errors; + if (errors === _errs59) { + if ( + data25 && + typeof data25 == 'object' && + !Array.isArray(data25) + ) { + let missing5; + if (data25.url === undefined && (missing5 = 'url')) { + const err39 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema177.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema177.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } else { + if (data25.url !== undefined) { + let data26 = data25.url; + const _errs61 = errors; + if (errors === _errs61) { + if (errors === _errs61) { + if (typeof data26 === 'string') { + if (!formats0(data26)) { + const err40 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema177.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } else { + const err41 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[1].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema177.anyOf[1].allOf[0].properties.owner + .items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + } + } + } + } else { + const err42 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema177.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema177.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid14 = _errs59 === errors; + if (!valid14) { + break; + } + } + } else { + const err43 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema177.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema177.anyOf[1].allOf[0].properties.owner, + data: data24, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + } + var valid11 = _errs57 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } else { + const err44 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema177.anyOf[1].allOf[0].type, + parentSchema: schema177.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var valid10 = _errs41 === errors; + if (valid10) { + const _errs63 = errors; + if (errors === _errs63) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data27 = data.type; + const _errs65 = errors; + if ('device' !== data27) { + const err45 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema177.anyOf[1].allOf[1].properties.type, + data: data27, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + var valid16 = _errs65 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data28 = data.experiment; + const _errs66 = errors; + if (errors === _errs66) { + if (errors === _errs66) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err46 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema177.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } else { + const err47 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema177.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema177.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + } + var valid16 = _errs66 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data29 = data.services; + const _errs68 = errors; + if (errors === _errs68) { + if (Array.isArray(data29)) { + var valid17 = true; + const len5 = data29.length; + for (let i5 = 0; i5 < len5; i5++) { + let data30 = data29[i5]; + const _errs70 = errors; + if (errors === _errs70) { + if ( + data30 && + typeof data30 == 'object' && + !Array.isArray(data30) + ) { + if (data30.serviceType !== undefined) { + let data31 = data30.serviceType; + const _errs73 = errors; + if (errors === _errs73) { + if (errors === _errs73) { + if (typeof data31 === 'string') { + if (!formats0(data31)) { + const err48 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema177.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } else { + const err49 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema177.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + } + } + var valid18 = _errs73 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceId !== undefined) { + let data32 = data30.serviceId; + const _errs75 = errors; + if (typeof data32 !== 'string') { + const err50 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[1].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema177.anyOf[1].allOf[1].properties.services.items + .properties.serviceId, + data: data32, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid18 = _errs75 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceDirection !== undefined) { + let data33 = data30.serviceDirection; + const _errs77 = errors; + if (typeof data33 !== 'string') { + const err51 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema177.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + if ( + !( + data33 === 'consumer' || + data33 === 'producer' || + data33 === 'prosumer' + ) + ) { + const err52 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema177.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema177.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema177.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + var valid18 = _errs77 === errors; + } else { + var valid18 = true; + } + } + } + } else { + const err53 = { + instancePath: instancePath + '/services/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema177.anyOf[1].allOf[1].properties.services.items.type, + parentSchema: + schema177.anyOf[1].allOf[1].properties.services.items, + data: data30, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + var valid17 = _errs70 === errors; + if (!valid17) { + break; + } + } + } else { + const err54 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema177.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema177.anyOf[1].allOf[1].properties.services, + data: data29, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + var valid16 = _errs68 === errors; + } else { + var valid16 = true; + } + } + } + } else { + const err55 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema177.anyOf[1].allOf[1].type, + parentSchema: schema177.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid10 = _errs63 === errors; + } + var _valid0 = _errs40 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs79 = errors; + const _errs80 = errors; + if (errors === _errs80) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if (data.type === undefined && (missing6 = 'type')) { + const err56 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema177.anyOf[2].allOf[0].required, + parentSchema: schema177.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } else { + if (data.name !== undefined) { + let data34 = data.name; + const _errs82 = errors; + if (typeof data34 !== 'string') { + const err57 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema177.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema177.anyOf[2].allOf[0].properties.name, + data: data34, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + var valid20 = _errs82 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.description !== undefined) { + let data35 = data.description; + const _errs84 = errors; + if (typeof data35 !== 'string') { + const err58 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema177.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema177.anyOf[2].allOf[0].properties.description, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + var valid20 = _errs84 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.type !== undefined) { + let data36 = data.type; + const _errs86 = errors; + if (typeof data36 !== 'string') { + const err59 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema177.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema177.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + if ( + !( + data36 === 'device' || + data36 === 'group' || + data36 === 'edge instantiable' || + data36 === 'cloud instantiable' + ) + ) { + const err60 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema177.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema177.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema177.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + var valid20 = _errs86 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.isPublic !== undefined) { + let data37 = data.isPublic; + const _errs88 = errors; + if (typeof data37 !== 'boolean') { + const err61 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema177.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema177.anyOf[2].allOf[0].properties.isPublic, + data: data37, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs88 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.viewer !== undefined) { + let data38 = data.viewer; + const _errs90 = errors; + if (errors === _errs90) { + if (Array.isArray(data38)) { + var valid21 = true; + const len6 = data38.length; + for (let i6 = 0; i6 < len6; i6++) { + let data39 = data38[i6]; + const _errs92 = errors; + if (errors === _errs92) { + if ( + data39 && + typeof data39 == 'object' && + !Array.isArray(data39) + ) { + let missing7; + if (data39.url === undefined && (missing7 = 'url')) { + const err62 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema177.anyOf[2].allOf[0].properties.viewer.items + .required, + parentSchema: + schema177.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } else { + if (data39.url !== undefined) { + let data40 = data39.url; + const _errs94 = errors; + if (errors === _errs94) { + if (errors === _errs94) { + if (typeof data40 === 'string') { + if (!formats0(data40)) { + const err63 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema177.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + } else { + const err64 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema177.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + } + } + } + } else { + const err65 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema177.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema177.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid21 = _errs92 === errors; + if (!valid21) { + break; + } + } + } else { + const err66 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema177.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema177.anyOf[2].allOf[0].properties.viewer, + data: data38, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid20 = _errs90 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.owner !== undefined) { + let data41 = data.owner; + const _errs96 = errors; + if (errors === _errs96) { + if (Array.isArray(data41)) { + var valid23 = true; + const len7 = data41.length; + for (let i7 = 0; i7 < len7; i7++) { + let data42 = data41[i7]; + const _errs98 = errors; + if (errors === _errs98) { + if ( + data42 && + typeof data42 == 'object' && + !Array.isArray(data42) + ) { + let missing8; + if (data42.url === undefined && (missing8 = 'url')) { + const err67 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + missing8 + "'", + schema: + schema177.anyOf[2].allOf[0].properties.owner.items + .required, + parentSchema: + schema177.anyOf[2].allOf[0].properties.owner + .items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data42.url !== undefined) { + let data43 = data42.url; + const _errs100 = errors; + if (errors === _errs100) { + if (errors === _errs100) { + if (typeof data43 === 'string') { + if (!formats0(data43)) { + const err68 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema177.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema177.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + } + } + } else { + const err70 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema177.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema177.anyOf[2].allOf[0].properties.owner.items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + } + var valid23 = _errs98 === errors; + if (!valid23) { + break; + } + } + } else { + const err71 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema177.anyOf[2].allOf[0].properties.owner.type, + parentSchema: schema177.anyOf[2].allOf[0].properties.owner, + data: data41, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + } + var valid20 = _errs96 === errors; + } else { + var valid20 = true; + } + } + } + } + } + } + } + } else { + const err72 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema177.anyOf[2].allOf[0].type, + parentSchema: schema177.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + var valid19 = _errs80 === errors; + if (valid19) { + const _errs102 = errors; + if (errors === _errs102) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs104 = errors; + if ('edge instantiable' !== data44) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema177.anyOf[2].allOf[1].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid25 = _errs104 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.codeUrl !== undefined) { + let data45 = data.codeUrl; + const _errs105 = errors; + if (errors === _errs105) { + if (errors === _errs105) { + if (typeof data45 === 'string') { + if (!formats0(data45)) { + const err74 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema177.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } else { + const err75 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema177.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema177.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + } + var valid25 = _errs105 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.services !== undefined) { + let data46 = data.services; + const _errs107 = errors; + if (errors === _errs107) { + if (Array.isArray(data46)) { + var valid26 = true; + const len8 = data46.length; + for (let i8 = 0; i8 < len8; i8++) { + let data47 = data46[i8]; + const _errs109 = errors; + if (errors === _errs109) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + if (data47.serviceType !== undefined) { + let data48 = data47.serviceType; + const _errs112 = errors; + if (errors === _errs112) { + if (errors === _errs112) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema177.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema177.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + var valid27 = _errs112 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceId !== undefined) { + let data49 = data47.serviceId; + const _errs114 = errors; + if (typeof data49 !== 'string') { + const err78 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[2].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema177.anyOf[2].allOf[1].properties.services + .items.properties.serviceId, + data: data49, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + var valid27 = _errs114 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceDirection !== undefined) { + let data50 = data47.serviceDirection; + const _errs116 = errors; + if (typeof data50 !== 'string') { + const err79 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema177.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + if ( + !( + data50 === 'consumer' || + data50 === 'producer' || + data50 === 'prosumer' + ) + ) { + const err80 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema177.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema177.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema177.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + var valid27 = _errs116 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err81 = { + instancePath: instancePath + '/services/' + i8, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema177.anyOf[2].allOf[1].properties.services.items + .type, + parentSchema: + schema177.anyOf[2].allOf[1].properties.services.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + var valid26 = _errs109 === errors; + if (!valid26) { + break; + } + } + } else { + const err82 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema177.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema177.anyOf[2].allOf[1].properties.services, + data: data46, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + var valid25 = _errs107 === errors; + } else { + var valid25 = true; + } + } + } + } else { + const err83 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema177.anyOf[2].allOf[1].type, + parentSchema: schema177.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid19 = _errs102 === errors; + } + var _valid0 = _errs79 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs118 = errors; + const _errs119 = errors; + if (errors === _errs119) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if (data.type === undefined && (missing9 = 'type')) { + const err84 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema177.anyOf[3].allOf[0].required, + parentSchema: schema177.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } else { + if (data.name !== undefined) { + let data51 = data.name; + const _errs121 = errors; + if (typeof data51 !== 'string') { + const err85 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema177.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema177.anyOf[3].allOf[0].properties.name, + data: data51, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + var valid29 = _errs121 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.description !== undefined) { + let data52 = data.description; + const _errs123 = errors; + if (typeof data52 !== 'string') { + const err86 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema177.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema177.anyOf[3].allOf[0].properties.description, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid29 = _errs123 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.type !== undefined) { + let data53 = data.type; + const _errs125 = errors; + if (typeof data53 !== 'string') { + const err87 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema177.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema177.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + if ( + !( + data53 === 'device' || + data53 === 'group' || + data53 === 'edge instantiable' || + data53 === 'cloud instantiable' + ) + ) { + const err88 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema177.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema177.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema177.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + var valid29 = _errs125 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.isPublic !== undefined) { + let data54 = data.isPublic; + const _errs127 = errors; + if (typeof data54 !== 'boolean') { + const err89 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema177.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema177.anyOf[3].allOf[0].properties.isPublic, + data: data54, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + var valid29 = _errs127 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.viewer !== undefined) { + let data55 = data.viewer; + const _errs129 = errors; + if (errors === _errs129) { + if (Array.isArray(data55)) { + var valid30 = true; + const len9 = data55.length; + for (let i9 = 0; i9 < len9; i9++) { + let data56 = data55[i9]; + const _errs131 = errors; + if (errors === _errs131) { + if ( + data56 && + typeof data56 == 'object' && + !Array.isArray(data56) + ) { + let missing10; + if (data56.url === undefined && (missing10 = 'url')) { + const err90 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + missing10 + "'", + schema: + schema177.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema177.anyOf[3].allOf[0].properties.viewer + .items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } else { + if (data56.url !== undefined) { + let data57 = data56.url; + const _errs133 = errors; + if (errors === _errs133) { + if (errors === _errs133) { + if (typeof data57 === 'string') { + if (!formats0(data57)) { + const err91 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema177.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + } else { + const err92 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema177.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + } + } + } + } + } else { + const err93 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema177.anyOf[3].allOf[0].properties.viewer.items + .type, + parentSchema: + schema177.anyOf[3].allOf[0].properties.viewer.items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + var valid30 = _errs131 === errors; + if (!valid30) { + break; + } + } + } else { + const err94 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema177.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: schema177.anyOf[3].allOf[0].properties.viewer, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid29 = _errs129 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.owner !== undefined) { + let data58 = data.owner; + const _errs135 = errors; + if (errors === _errs135) { + if (Array.isArray(data58)) { + var valid32 = true; + const len10 = data58.length; + for (let i10 = 0; i10 < len10; i10++) { + let data59 = data58[i10]; + const _errs137 = errors; + if (errors === _errs137) { + if ( + data59 && + typeof data59 == 'object' && + !Array.isArray(data59) + ) { + let missing11; + if (data59.url === undefined && (missing11 = 'url')) { + const err95 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema177.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema177.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } else { + if (data59.url !== undefined) { + let data60 = data59.url; + const _errs139 = errors; + if (errors === _errs139) { + if (errors === _errs139) { + if (typeof data60 === 'string') { + if (!formats0(data60)) { + const err96 = { + instancePath: + instancePath + + '/owner/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema177.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } else { + const err97 = { + instancePath: + instancePath + '/owner/' + i10 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema177.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + } + } + } + } + } else { + const err98 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema177.anyOf[3].allOf[0].properties.owner.items + .type, + parentSchema: + schema177.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } + var valid32 = _errs137 === errors; + if (!valid32) { + break; + } + } + } else { + const err99 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema177.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema177.anyOf[3].allOf[0].properties.owner, + data: data58, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + var valid29 = _errs135 === errors; + } else { + var valid29 = true; + } + } + } + } + } + } + } + } else { + const err100 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema177.anyOf[3].allOf[0].type, + parentSchema: schema177.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + } + var valid28 = _errs119 === errors; + if (valid28) { + const _errs141 = errors; + if (errors === _errs141) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data61 = data.type; + const _errs143 = errors; + if ('group' !== data61) { + const err101 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema177.anyOf[3].allOf[1].properties.type, + data: data61, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid34 = _errs143 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data.devices !== undefined) { + let data62 = data.devices; + const _errs144 = errors; + if (errors === _errs144) { + if (Array.isArray(data62)) { + var valid35 = true; + const len11 = data62.length; + for (let i11 = 0; i11 < len11; i11++) { + let data63 = data62[i11]; + const _errs146 = errors; + if (errors === _errs146) { + if ( + data63 && + typeof data63 == 'object' && + !Array.isArray(data63) + ) { + let missing12; + if (data63.url === undefined && (missing12 = 'url')) { + const err102 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: + "must have required property '" + missing12 + "'", + schema: + schema177.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema177.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } else { + if (data63.url !== undefined) { + let data64 = data63.url; + const _errs148 = errors; + if (errors === _errs148) { + if (errors === _errs148) { + if (typeof data64 === 'string') { + if (!formats0(data64)) { + const err103 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema177.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + } else { + const err104 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema177.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema177.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + } + } + } + } + } else { + const err105 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema177.anyOf[3].allOf[1].properties.devices.items.type, + parentSchema: + schema177.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } + } + var valid35 = _errs146 === errors; + if (!valid35) { + break; + } + } + } else { + const err106 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema177.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema177.anyOf[3].allOf[1].properties.devices, + data: data62, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } + var valid34 = _errs144 === errors; + } else { + var valid34 = true; + } + } + } else { + const err107 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema177.anyOf[3].allOf[1].type, + parentSchema: schema177.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + var valid28 = _errs141 === errors; + } + var _valid0 = _errs118 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err108 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema177.anyOf, + parentSchema: schema177, + data, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + validate192.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate192.errors = vErrors; + return errors === 0; +} +exports.validateUpdateDeviceResponse200Request = validate193; +const schema178 = { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'updateDeviceResponse200Request', + 'x-location': + '#/paths//devices/{device_id}/patch/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate193( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema178.anyOf[0].allOf[0].required, + parentSchema: schema178.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.name !== undefined) { + let data0 = data.name; + const _errs4 = errors; + if (typeof data0 !== 'string') { + const err1 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema178.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema178.anyOf[0].allOf[0].properties.name, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data1 = data.description; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err2 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema178.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema178.anyOf[0].allOf[0].properties.description, + data: data1, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data2 = data.type; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err3 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema178.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema178.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + if ( + !( + data2 === 'device' || + data2 === 'group' || + data2 === 'edge instantiable' || + data2 === 'cloud instantiable' + ) + ) { + const err4 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema178.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema178.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema178.anyOf[0].allOf[0].properties.type, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data3 = data.isPublic; + const _errs10 = errors; + if (typeof data3 !== 'boolean') { + const err5 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema178.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema178.anyOf[0].allOf[0].properties.isPublic, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data4 = data.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data4)) { + var valid3 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing1; + if (data5.url === undefined && (missing1 = 'url')) { + const err6 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: + schema178.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema178.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + const err7 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema178.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema178.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } + } else { + const err9 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema178.anyOf[0].allOf[0].properties.viewer.items.type, + parentSchema: + schema178.anyOf[0].allOf[0].properties.viewer.items, + data: data5, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var valid3 = _errs14 === errors; + if (!valid3) { + break; + } + } + } else { + const err10 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema178.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema178.anyOf[0].allOf[0].properties.viewer, + data: data4, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data7 = data.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid5 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing2; + if (data8.url === undefined && (missing2 = 'url')) { + const err11 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema178.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema178.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } else { + if (data8.url !== undefined) { + let data9 = data8.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + const err12 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema178.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } else { + const err13 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema178.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + } + } + } + } + } else { + const err14 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema178.anyOf[0].allOf[0].properties.owner.items.type, + parentSchema: + schema178.anyOf[0].allOf[0].properties.owner.items, + data: data8, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } + var valid5 = _errs20 === errors; + if (!valid5) { + break; + } + } + } else { + const err15 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema178.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema178.anyOf[0].allOf[0].properties.owner, + data: data7, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + var valid2 = _errs18 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } else { + const err16 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema178.anyOf[0].allOf[0].type, + parentSchema: schema178.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs24 = errors; + if (errors === _errs24) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data10 = data.type; + const _errs26 = errors; + if ('cloud instantiable' !== data10) { + const err17 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema178.anyOf[0].allOf[1].properties.type, + data: data10, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var valid7 = _errs26 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data11 = data.instantiateUrl; + const _errs27 = errors; + if (errors === _errs27) { + if (errors === _errs27) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + const err18 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema178.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } else { + const err19 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema178.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema178.anyOf[0].allOf[1].properties.instantiateUrl, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + } + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data12 = data.services; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data12)) { + var valid8 = true; + const len2 = data12.length; + for (let i2 = 0; i2 < len2; i2++) { + let data13 = data12[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if (data13 && typeof data13 == 'object' && !Array.isArray(data13)) { + if (data13.serviceType !== undefined) { + let data14 = data13.serviceType; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data14 === 'string') { + if (!formats0(data14)) { + const err20 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema178.anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema178.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid9 = _errs34 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceId !== undefined) { + let data15 = data13.serviceId; + const _errs36 = errors; + if (typeof data15 !== 'string') { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema178.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data13.serviceDirection !== undefined) { + let data16 = data13.serviceDirection; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err23 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema178.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data16 === 'consumer' || + data16 === 'producer' || + data16 === 'prosumer' + ) + ) { + const err24 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema178.anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema178.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema178.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err25 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema178.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema178.anyOf[0].allOf[1].properties.services.items, + data: data13, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + var valid8 = _errs31 === errors; + if (!valid8) { + break; + } + } + } else { + const err26 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema178.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema178.anyOf[0].allOf[1].properties.services, + data: data12, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err27 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema178.anyOf[0].allOf[1].type, + parentSchema: schema178.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid1 = _errs24 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs40 = errors; + const _errs41 = errors; + if (errors === _errs41) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if ( + (data.type === undefined && (missing3 = 'type')) || + (data.name === undefined && (missing3 = 'name')) || + (data.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err28 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema178.anyOf[1].allOf[0].required, + parentSchema: schema178.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } else { + if (data.name !== undefined) { + let data17 = data.name; + const _errs43 = errors; + if (typeof data17 !== 'string') { + const err29 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema178.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema178.anyOf[1].allOf[0].properties.name, + data: data17, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + var valid11 = _errs43 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data18 = data.description; + const _errs45 = errors; + if (typeof data18 !== 'string') { + const err30 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema178.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema178.anyOf[1].allOf[0].properties.description, + data: data18, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data19 = data.type; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err31 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema178.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema178.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + if ( + !( + data19 === 'device' || + data19 === 'group' || + data19 === 'edge instantiable' || + data19 === 'cloud instantiable' + ) + ) { + const err32 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema178.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema178.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema178.anyOf[1].allOf[0].properties.type, + data: data19, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data20 = data.isPublic; + const _errs49 = errors; + if (typeof data20 !== 'boolean') { + const err33 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema178.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema178.anyOf[1].allOf[0].properties.isPublic, + data: data20, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data21 = data.viewer; + const _errs51 = errors; + if (errors === _errs51) { + if (Array.isArray(data21)) { + var valid12 = true; + const len3 = data21.length; + for (let i3 = 0; i3 < len3; i3++) { + let data22 = data21[i3]; + const _errs53 = errors; + if (errors === _errs53) { + if ( + data22 && + typeof data22 == 'object' && + !Array.isArray(data22) + ) { + let missing4; + if (data22.url === undefined && (missing4 = 'url')) { + const err34 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema178.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema178.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } else { + if (data22.url !== undefined) { + let data23 = data22.url; + const _errs55 = errors; + if (errors === _errs55) { + if (errors === _errs55) { + if (typeof data23 === 'string') { + if (!formats0(data23)) { + const err35 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema178.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } else { + const err36 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[1].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema178.anyOf[1].allOf[0].properties.viewer + .items.properties.url, + data: data23, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + } + } + } + } else { + const err37 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema178.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema178.anyOf[1].allOf[0].properties.viewer.items, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + var valid12 = _errs53 === errors; + if (!valid12) { + break; + } + } + } else { + const err38 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema178.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema178.anyOf[1].allOf[0].properties.viewer, + data: data21, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data24 = data.owner; + const _errs57 = errors; + if (errors === _errs57) { + if (Array.isArray(data24)) { + var valid14 = true; + const len4 = data24.length; + for (let i4 = 0; i4 < len4; i4++) { + let data25 = data24[i4]; + const _errs59 = errors; + if (errors === _errs59) { + if ( + data25 && + typeof data25 == 'object' && + !Array.isArray(data25) + ) { + let missing5; + if (data25.url === undefined && (missing5 = 'url')) { + const err39 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema178.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema178.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } else { + if (data25.url !== undefined) { + let data26 = data25.url; + const _errs61 = errors; + if (errors === _errs61) { + if (errors === _errs61) { + if (typeof data26 === 'string') { + if (!formats0(data26)) { + const err40 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema178.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } else { + const err41 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[1].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema178.anyOf[1].allOf[0].properties.owner + .items.properties.url, + data: data26, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + } + } + } + } else { + const err42 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema178.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema178.anyOf[1].allOf[0].properties.owner.items, + data: data25, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid14 = _errs59 === errors; + if (!valid14) { + break; + } + } + } else { + const err43 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema178.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema178.anyOf[1].allOf[0].properties.owner, + data: data24, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + } + var valid11 = _errs57 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } else { + const err44 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema178.anyOf[1].allOf[0].type, + parentSchema: schema178.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var valid10 = _errs41 === errors; + if (valid10) { + const _errs63 = errors; + if (errors === _errs63) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data27 = data.type; + const _errs65 = errors; + if ('device' !== data27) { + const err45 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema178.anyOf[1].allOf[1].properties.type, + data: data27, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + var valid16 = _errs65 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data28 = data.experiment; + const _errs66 = errors; + if (errors === _errs66) { + if (errors === _errs66) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err46 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema178.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } else { + const err47 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema178.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema178.anyOf[1].allOf[1].properties.experiment, + data: data28, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + } + var valid16 = _errs66 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data29 = data.services; + const _errs68 = errors; + if (errors === _errs68) { + if (Array.isArray(data29)) { + var valid17 = true; + const len5 = data29.length; + for (let i5 = 0; i5 < len5; i5++) { + let data30 = data29[i5]; + const _errs70 = errors; + if (errors === _errs70) { + if ( + data30 && + typeof data30 == 'object' && + !Array.isArray(data30) + ) { + if (data30.serviceType !== undefined) { + let data31 = data30.serviceType; + const _errs73 = errors; + if (errors === _errs73) { + if (errors === _errs73) { + if (typeof data31 === 'string') { + if (!formats0(data31)) { + const err48 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema178.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } else { + const err49 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema178.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + } + } + var valid18 = _errs73 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceId !== undefined) { + let data32 = data30.serviceId; + const _errs75 = errors; + if (typeof data32 !== 'string') { + const err50 = { + instancePath: + instancePath + '/services/' + i5 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[1].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema178.anyOf[1].allOf[1].properties.services.items + .properties.serviceId, + data: data32, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid18 = _errs75 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data30.serviceDirection !== undefined) { + let data33 = data30.serviceDirection; + const _errs77 = errors; + if (typeof data33 !== 'string') { + const err51 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema178.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + if ( + !( + data33 === 'consumer' || + data33 === 'producer' || + data33 === 'prosumer' + ) + ) { + const err52 = { + instancePath: + instancePath + + '/services/' + + i5 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema178.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema178.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema178.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + var valid18 = _errs77 === errors; + } else { + var valid18 = true; + } + } + } + } else { + const err53 = { + instancePath: instancePath + '/services/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema178.anyOf[1].allOf[1].properties.services.items.type, + parentSchema: + schema178.anyOf[1].allOf[1].properties.services.items, + data: data30, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + var valid17 = _errs70 === errors; + if (!valid17) { + break; + } + } + } else { + const err54 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema178.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema178.anyOf[1].allOf[1].properties.services, + data: data29, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + var valid16 = _errs68 === errors; + } else { + var valid16 = true; + } + } + } + } else { + const err55 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema178.anyOf[1].allOf[1].type, + parentSchema: schema178.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid10 = _errs63 === errors; + } + var _valid0 = _errs40 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs79 = errors; + const _errs80 = errors; + if (errors === _errs80) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.type === undefined && (missing6 = 'type')) || + (data.name === undefined && (missing6 = 'name')) || + (data.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err56 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema178.anyOf[2].allOf[0].required, + parentSchema: schema178.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } else { + if (data.name !== undefined) { + let data34 = data.name; + const _errs82 = errors; + if (typeof data34 !== 'string') { + const err57 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema178.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema178.anyOf[2].allOf[0].properties.name, + data: data34, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + var valid20 = _errs82 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.description !== undefined) { + let data35 = data.description; + const _errs84 = errors; + if (typeof data35 !== 'string') { + const err58 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema178.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema178.anyOf[2].allOf[0].properties.description, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + var valid20 = _errs84 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.type !== undefined) { + let data36 = data.type; + const _errs86 = errors; + if (typeof data36 !== 'string') { + const err59 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema178.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema178.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + if ( + !( + data36 === 'device' || + data36 === 'group' || + data36 === 'edge instantiable' || + data36 === 'cloud instantiable' + ) + ) { + const err60 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema178.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema178.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema178.anyOf[2].allOf[0].properties.type, + data: data36, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + var valid20 = _errs86 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.isPublic !== undefined) { + let data37 = data.isPublic; + const _errs88 = errors; + if (typeof data37 !== 'boolean') { + const err61 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema178.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema178.anyOf[2].allOf[0].properties.isPublic, + data: data37, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs88 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.viewer !== undefined) { + let data38 = data.viewer; + const _errs90 = errors; + if (errors === _errs90) { + if (Array.isArray(data38)) { + var valid21 = true; + const len6 = data38.length; + for (let i6 = 0; i6 < len6; i6++) { + let data39 = data38[i6]; + const _errs92 = errors; + if (errors === _errs92) { + if ( + data39 && + typeof data39 == 'object' && + !Array.isArray(data39) + ) { + let missing7; + if (data39.url === undefined && (missing7 = 'url')) { + const err62 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema178.anyOf[2].allOf[0].properties.viewer.items + .required, + parentSchema: + schema178.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } else { + if (data39.url !== undefined) { + let data40 = data39.url; + const _errs94 = errors; + if (errors === _errs94) { + if (errors === _errs94) { + if (typeof data40 === 'string') { + if (!formats0(data40)) { + const err63 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema178.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + } else { + const err64 = { + instancePath: + instancePath + '/viewer/' + i6 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema178.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data40, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + } + } + } + } else { + const err65 = { + instancePath: instancePath + '/viewer/' + i6, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema178.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema178.anyOf[2].allOf[0].properties.viewer.items, + data: data39, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid21 = _errs92 === errors; + if (!valid21) { + break; + } + } + } else { + const err66 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema178.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema178.anyOf[2].allOf[0].properties.viewer, + data: data38, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid20 = _errs90 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data.owner !== undefined) { + let data41 = data.owner; + const _errs96 = errors; + if (errors === _errs96) { + if (Array.isArray(data41)) { + var valid23 = true; + const len7 = data41.length; + for (let i7 = 0; i7 < len7; i7++) { + let data42 = data41[i7]; + const _errs98 = errors; + if (errors === _errs98) { + if ( + data42 && + typeof data42 == 'object' && + !Array.isArray(data42) + ) { + let missing8; + if (data42.url === undefined && (missing8 = 'url')) { + const err67 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + missing8 + "'", + schema: + schema178.anyOf[2].allOf[0].properties.owner.items + .required, + parentSchema: + schema178.anyOf[2].allOf[0].properties.owner + .items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data42.url !== undefined) { + let data43 = data42.url; + const _errs100 = errors; + if (errors === _errs100) { + if (errors === _errs100) { + if (typeof data43 === 'string') { + if (!formats0(data43)) { + const err68 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema178.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: + instancePath + '/owner/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema178.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data43, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + } + } + } else { + const err70 = { + instancePath: instancePath + '/owner/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema178.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema178.anyOf[2].allOf[0].properties.owner.items, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + } + var valid23 = _errs98 === errors; + if (!valid23) { + break; + } + } + } else { + const err71 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema178.anyOf[2].allOf[0].properties.owner.type, + parentSchema: schema178.anyOf[2].allOf[0].properties.owner, + data: data41, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + } + var valid20 = _errs96 === errors; + } else { + var valid20 = true; + } + } + } + } + } + } + } + } else { + const err72 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema178.anyOf[2].allOf[0].type, + parentSchema: schema178.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + var valid19 = _errs80 === errors; + if (valid19) { + const _errs102 = errors; + if (errors === _errs102) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs104 = errors; + if ('edge instantiable' !== data44) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema178.anyOf[2].allOf[1].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid25 = _errs104 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.codeUrl !== undefined) { + let data45 = data.codeUrl; + const _errs105 = errors; + if (errors === _errs105) { + if (errors === _errs105) { + if (typeof data45 === 'string') { + if (!formats0(data45)) { + const err74 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema178.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } else { + const err75 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema178.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema178.anyOf[2].allOf[1].properties.codeUrl, + data: data45, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + } + var valid25 = _errs105 === errors; + } else { + var valid25 = true; + } + if (valid25) { + if (data.services !== undefined) { + let data46 = data.services; + const _errs107 = errors; + if (errors === _errs107) { + if (Array.isArray(data46)) { + var valid26 = true; + const len8 = data46.length; + for (let i8 = 0; i8 < len8; i8++) { + let data47 = data46[i8]; + const _errs109 = errors; + if (errors === _errs109) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + if (data47.serviceType !== undefined) { + let data48 = data47.serviceType; + const _errs112 = errors; + if (errors === _errs112) { + if (errors === _errs112) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema178.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema178.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + var valid27 = _errs112 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceId !== undefined) { + let data49 = data47.serviceId; + const _errs114 = errors; + if (typeof data49 !== 'string') { + const err78 = { + instancePath: + instancePath + '/services/' + i8 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[2].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema178.anyOf[2].allOf[1].properties.services + .items.properties.serviceId, + data: data49, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + var valid27 = _errs114 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data47.serviceDirection !== undefined) { + let data50 = data47.serviceDirection; + const _errs116 = errors; + if (typeof data50 !== 'string') { + const err79 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema178.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + if ( + !( + data50 === 'consumer' || + data50 === 'producer' || + data50 === 'prosumer' + ) + ) { + const err80 = { + instancePath: + instancePath + + '/services/' + + i8 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema178.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema178.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema178.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + var valid27 = _errs116 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err81 = { + instancePath: instancePath + '/services/' + i8, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema178.anyOf[2].allOf[1].properties.services.items + .type, + parentSchema: + schema178.anyOf[2].allOf[1].properties.services.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + var valid26 = _errs109 === errors; + if (!valid26) { + break; + } + } + } else { + const err82 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema178.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema178.anyOf[2].allOf[1].properties.services, + data: data46, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + var valid25 = _errs107 === errors; + } else { + var valid25 = true; + } + } + } + } else { + const err83 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema178.anyOf[2].allOf[1].type, + parentSchema: schema178.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid19 = _errs102 === errors; + } + var _valid0 = _errs79 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs118 = errors; + const _errs119 = errors; + if (errors === _errs119) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if ( + (data.type === undefined && (missing9 = 'type')) || + (data.name === undefined && (missing9 = 'name')) || + (data.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err84 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema178.anyOf[3].allOf[0].required, + parentSchema: schema178.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } else { + if (data.name !== undefined) { + let data51 = data.name; + const _errs121 = errors; + if (typeof data51 !== 'string') { + const err85 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema178.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema178.anyOf[3].allOf[0].properties.name, + data: data51, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + var valid29 = _errs121 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.description !== undefined) { + let data52 = data.description; + const _errs123 = errors; + if (typeof data52 !== 'string') { + const err86 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema178.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema178.anyOf[3].allOf[0].properties.description, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid29 = _errs123 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.type !== undefined) { + let data53 = data.type; + const _errs125 = errors; + if (typeof data53 !== 'string') { + const err87 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema178.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema178.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + if ( + !( + data53 === 'device' || + data53 === 'group' || + data53 === 'edge instantiable' || + data53 === 'cloud instantiable' + ) + ) { + const err88 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema178.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema178.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema178.anyOf[3].allOf[0].properties.type, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + var valid29 = _errs125 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.isPublic !== undefined) { + let data54 = data.isPublic; + const _errs127 = errors; + if (typeof data54 !== 'boolean') { + const err89 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema178.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema178.anyOf[3].allOf[0].properties.isPublic, + data: data54, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + var valid29 = _errs127 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.viewer !== undefined) { + let data55 = data.viewer; + const _errs129 = errors; + if (errors === _errs129) { + if (Array.isArray(data55)) { + var valid30 = true; + const len9 = data55.length; + for (let i9 = 0; i9 < len9; i9++) { + let data56 = data55[i9]; + const _errs131 = errors; + if (errors === _errs131) { + if ( + data56 && + typeof data56 == 'object' && + !Array.isArray(data56) + ) { + let missing10; + if (data56.url === undefined && (missing10 = 'url')) { + const err90 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + missing10 + "'", + schema: + schema178.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema178.anyOf[3].allOf[0].properties.viewer + .items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } else { + if (data56.url !== undefined) { + let data57 = data56.url; + const _errs133 = errors; + if (errors === _errs133) { + if (errors === _errs133) { + if (typeof data57 === 'string') { + if (!formats0(data57)) { + const err91 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema178.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + } else { + const err92 = { + instancePath: + instancePath + '/viewer/' + i9 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema178.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data57, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + } + } + } + } + } else { + const err93 = { + instancePath: instancePath + '/viewer/' + i9, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema178.anyOf[3].allOf[0].properties.viewer.items + .type, + parentSchema: + schema178.anyOf[3].allOf[0].properties.viewer.items, + data: data56, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + var valid30 = _errs131 === errors; + if (!valid30) { + break; + } + } + } else { + const err94 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema178.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: schema178.anyOf[3].allOf[0].properties.viewer, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid29 = _errs129 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data.owner !== undefined) { + let data58 = data.owner; + const _errs135 = errors; + if (errors === _errs135) { + if (Array.isArray(data58)) { + var valid32 = true; + const len10 = data58.length; + for (let i10 = 0; i10 < len10; i10++) { + let data59 = data58[i10]; + const _errs137 = errors; + if (errors === _errs137) { + if ( + data59 && + typeof data59 == 'object' && + !Array.isArray(data59) + ) { + let missing11; + if (data59.url === undefined && (missing11 = 'url')) { + const err95 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema178.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema178.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } else { + if (data59.url !== undefined) { + let data60 = data59.url; + const _errs139 = errors; + if (errors === _errs139) { + if (errors === _errs139) { + if (typeof data60 === 'string') { + if (!formats0(data60)) { + const err96 = { + instancePath: + instancePath + + '/owner/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema178.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } else { + const err97 = { + instancePath: + instancePath + '/owner/' + i10 + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema178.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data60, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + } + } + } + } + } else { + const err98 = { + instancePath: instancePath + '/owner/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema178.anyOf[3].allOf[0].properties.owner.items + .type, + parentSchema: + schema178.anyOf[3].allOf[0].properties.owner + .items, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } + var valid32 = _errs137 === errors; + if (!valid32) { + break; + } + } + } else { + const err99 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema178.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema178.anyOf[3].allOf[0].properties.owner, + data: data58, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + var valid29 = _errs135 === errors; + } else { + var valid29 = true; + } + } + } + } + } + } + } + } else { + const err100 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema178.anyOf[3].allOf[0].type, + parentSchema: schema178.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + } + var valid28 = _errs119 === errors; + if (valid28) { + const _errs141 = errors; + if (errors === _errs141) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if (data.devices === undefined && (missing12 = 'devices')) { + const err101 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema178.anyOf[3].allOf[1].required, + parentSchema: schema178.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } else { + if (data.type !== undefined) { + let data61 = data.type; + const _errs143 = errors; + if ('group' !== data61) { + const err102 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema178.anyOf[3].allOf[1].properties.type, + data: data61, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + var valid34 = _errs143 === errors; + } else { + var valid34 = true; + } + if (valid34) { + if (data.devices !== undefined) { + let data62 = data.devices; + const _errs144 = errors; + if (errors === _errs144) { + if (Array.isArray(data62)) { + var valid35 = true; + const len11 = data62.length; + for (let i11 = 0; i11 < len11; i11++) { + let data63 = data62[i11]; + const _errs146 = errors; + if (errors === _errs146) { + if ( + data63 && + typeof data63 == 'object' && + !Array.isArray(data63) + ) { + let missing13; + if (data63.url === undefined && (missing13 = 'url')) { + const err103 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: + "must have required property '" + missing13 + "'", + schema: + schema178.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema178.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } else { + if (data63.url !== undefined) { + let data64 = data63.url; + const _errs148 = errors; + if (errors === _errs148) { + if (errors === _errs148) { + if (typeof data64 === 'string') { + if (!formats0(data64)) { + const err104 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema178.anyOf[3].allOf[1].properties + .devices.items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + } else { + const err105 = { + instancePath: + instancePath + '/devices/' + i11 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema178.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema178.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data64, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } + } + } + } + } + } else { + const err106 = { + instancePath: instancePath + '/devices/' + i11, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema178.anyOf[3].allOf[1].properties.devices.items + .type, + parentSchema: + schema178.anyOf[3].allOf[1].properties.devices.items, + data: data63, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } + var valid35 = _errs146 === errors; + if (!valid35) { + break; + } + } + } else { + const err107 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema178.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema178.anyOf[3].allOf[1].properties.devices, + data: data62, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + var valid34 = _errs144 === errors; + } else { + var valid34 = true; + } + } + } + } else { + const err108 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema178.anyOf[3].allOf[1].type, + parentSchema: schema178.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid28 = _errs141 === errors; + } + var _valid0 = _errs118 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err109 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema178.anyOf, + parentSchema: schema178, + data, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + validate193.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate193.errors = vErrors; + return errors === 0; +} +exports.validateUpdateDeviceResponse200Response = validate194; +const schema179 = { + title: 'Device', + anyOf: [ + { + title: 'Instantiable Cloud Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'cloud instantiable' }, + instantiateUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + connected: { + description: + 'If true, the device is connected to the service and can be used.\n', + type: 'boolean', + readOnly: true, + }, + announcedAvailability: { + readOnly: true, + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Instantiable Browser Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'edge instantiable' }, + codeUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + { + title: 'Device Group', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'group' }, + devices: { + type: 'array', + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'updateDeviceResponse200Response', + 'x-location': + '#/paths//devices/{device_id}/patch/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate194( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.name === undefined && (missing0 = 'name')) || + (data.isPublic === undefined && (missing0 = 'isPublic')) + ) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema179.anyOf[0].allOf[0].required, + parentSchema: schema179.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs4 = errors; + if (errors === _errs4) { + if (errors === _errs4) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + const err1 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema179.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } else { + const err2 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/0/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[0].allOf[0].properties.url.type, + parentSchema: schema179.anyOf[0].allOf[0].properties.url, + data: data0, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.name !== undefined) { + let data1 = data.name; + const _errs6 = errors; + if (typeof data1 !== 'string') { + const err3 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/0/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[0].allOf[0].properties.name.type, + parentSchema: schema179.anyOf[0].allOf[0].properties.name, + data: data1, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.description !== undefined) { + let data2 = data.description; + const _errs8 = errors; + if (typeof data2 !== 'string') { + const err4 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/0/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[0].allOf[0].properties.description.type, + parentSchema: schema179.anyOf[0].allOf[0].properties.description, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.type !== undefined) { + let data3 = data.type; + const _errs10 = errors; + if (typeof data3 !== 'string') { + const err5 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[0].allOf[0].properties.type.type, + parentSchema: schema179.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + const err6 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema179.anyOf[0].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema179.anyOf[0].allOf[0].properties.type.enum, + parentSchema: schema179.anyOf[0].allOf[0].properties.type, + data: data3, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.isPublic !== undefined) { + let data4 = data.isPublic; + const _errs12 = errors; + if (typeof data4 !== 'boolean') { + const err7 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/0/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema179.anyOf[0].allOf[0].properties.isPublic.type, + parentSchema: schema179.anyOf[0].allOf[0].properties.isPublic, + data: data4, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.viewer !== undefined) { + let data5 = data.viewer; + const _errs14 = errors; + if (errors === _errs14) { + if (Array.isArray(data5)) { + var valid3 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing1; + if (data6.url === undefined && (missing1 = 'url')) { + const err8 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: + schema179.anyOf[0].allOf[0].properties.viewer.items + .required, + parentSchema: + schema179.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + const err9 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema179.anyOf[0].allOf[0].properties + .viewer.items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } else { + const err10 = { + instancePath: + instancePath + '/viewer/' + i0 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[0].allOf[0].properties.viewer + .items.properties.url.type, + parentSchema: + schema179.anyOf[0].allOf[0].properties.viewer + .items.properties.url, + data: data7, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + } + } + } + } else { + const err11 = { + instancePath: instancePath + '/viewer/' + i0, + schemaPath: + '#/anyOf/0/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema179.anyOf[0].allOf[0].properties.viewer.items + .type, + parentSchema: + schema179.anyOf[0].allOf[0].properties.viewer.items, + data: data6, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } + var valid3 = _errs16 === errors; + if (!valid3) { + break; + } + } + } else { + const err12 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/0/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema179.anyOf[0].allOf[0].properties.viewer.type, + parentSchema: schema179.anyOf[0].allOf[0].properties.viewer, + data: data5, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } + var valid2 = _errs14 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data.owner !== undefined) { + let data8 = data.owner; + const _errs20 = errors; + if (errors === _errs20) { + if (Array.isArray(data8)) { + var valid5 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs22 = errors; + if (errors === _errs22) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing2; + if (data9.url === undefined && (missing2 = 'url')) { + const err13 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema179.anyOf[0].allOf[0].properties.owner.items + .required, + parentSchema: + schema179.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs24 = errors; + if (errors === _errs24) { + if (errors === _errs24) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + const err14 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema179.anyOf[0].allOf[0].properties + .owner.items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } else { + const err15 = { + instancePath: + instancePath + '/owner/' + i1 + '/url', + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[0].allOf[0].properties.owner + .items.properties.url.type, + parentSchema: + schema179.anyOf[0].allOf[0].properties.owner + .items.properties.url, + data: data10, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + } + } + } + } else { + const err16 = { + instancePath: instancePath + '/owner/' + i1, + schemaPath: + '#/anyOf/0/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema179.anyOf[0].allOf[0].properties.owner.items + .type, + parentSchema: + schema179.anyOf[0].allOf[0].properties.owner.items, + data: data9, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + var valid5 = _errs22 === errors; + if (!valid5) { + break; + } + } + } else { + const err17 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/0/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema179.anyOf[0].allOf[0].properties.owner.type, + parentSchema: schema179.anyOf[0].allOf[0].properties.owner, + data: data8, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + } + var valid2 = _errs20 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } + } else { + const err18 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema179.anyOf[0].allOf[0].type, + parentSchema: schema179.anyOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs26 = errors; + if (errors === _errs26) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data11 = data.type; + const _errs28 = errors; + if ('cloud instantiable' !== data11) { + const err19 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/0/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'cloud instantiable' }, + message: 'must be equal to constant', + schema: 'cloud instantiable', + parentSchema: schema179.anyOf[0].allOf[1].properties.type, + data: data11, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + var valid7 = _errs28 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.instantiateUrl !== undefined) { + let data12 = data.instantiateUrl; + const _errs29 = errors; + if (errors === _errs29) { + if (errors === _errs29) { + if (typeof data12 === 'string') { + if (!formats0(data12)) { + const err20 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema179.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } else { + const err21 = { + instancePath: instancePath + '/instantiateUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/instantiateUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[0].allOf[1].properties.instantiateUrl.type, + parentSchema: schema179.anyOf[0].allOf[1].properties.instantiateUrl, + data: data12, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data.services !== undefined) { + let data13 = data.services; + const _errs31 = errors; + if (errors === _errs31) { + if (Array.isArray(data13)) { + var valid8 = true; + const len2 = data13.length; + for (let i2 = 0; i2 < len2; i2++) { + let data14 = data13[i2]; + const _errs33 = errors; + if (errors === _errs33) { + if (data14 && typeof data14 == 'object' && !Array.isArray(data14)) { + if (data14.serviceType !== undefined) { + let data15 = data14.serviceType; + const _errs36 = errors; + if (errors === _errs36) { + if (errors === _errs36) { + if (typeof data15 === 'string') { + if (!formats0(data15)) { + const err22 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema179.anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } else { + const err23 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[0].allOf[1].properties.services.items + .properties.serviceType.type, + parentSchema: + schema179.anyOf[0].allOf[1].properties.services.items + .properties.serviceType, + data: data15, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + } + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceId !== undefined) { + let data16 = data14.serviceId; + const _errs38 = errors; + if (typeof data16 !== 'string') { + const err24 = { + instancePath: + instancePath + '/services/' + i2 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[0].allOf[1].properties.services.items + .properties.serviceId.type, + parentSchema: + schema179.anyOf[0].allOf[1].properties.services.items + .properties.serviceId, + data: data16, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceDirection !== undefined) { + let data17 = data14.serviceDirection; + const _errs40 = errors; + if (typeof data17 !== 'string') { + const err25 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.type, + parentSchema: + schema179.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + if ( + !( + data17 === 'consumer' || + data17 === 'producer' || + data17 === 'prosumer' + ) + ) { + const err26 = { + instancePath: + instancePath + + '/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema179.anyOf[0].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema179.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection.enum, + parentSchema: + schema179.anyOf[0].allOf[1].properties.services.items + .properties.serviceDirection, + data: data17, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + var valid9 = _errs40 === errors; + } else { + var valid9 = true; + } + } + } + } else { + const err27 = { + instancePath: instancePath + '/services/' + i2, + schemaPath: '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema179.anyOf[0].allOf[1].properties.services.items.type, + parentSchema: + schema179.anyOf[0].allOf[1].properties.services.items, + data: data14, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + var valid8 = _errs33 === errors; + if (!valid8) { + break; + } + } + } else { + const err28 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema179.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema179.anyOf[0].allOf[1].properties.services, + data: data13, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + } + var valid7 = _errs31 === errors; + } else { + var valid7 = true; + } + } + } + } else { + const err29 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema179.anyOf[0].allOf[1].type, + parentSchema: schema179.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + } + var valid1 = _errs26 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs42 = errors; + const _errs43 = errors; + if (errors === _errs43) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing3; + if ( + (data.url === undefined && (missing3 = 'url')) || + (data.type === undefined && (missing3 = 'type')) || + (data.name === undefined && (missing3 = 'name')) || + (data.isPublic === undefined && (missing3 = 'isPublic')) + ) { + const err30 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema179.anyOf[1].allOf[0].required, + parentSchema: schema179.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } else { + if (data.url !== undefined) { + let data18 = data.url; + const _errs45 = errors; + if (errors === _errs45) { + if (errors === _errs45) { + if (typeof data18 === 'string') { + if (!formats0(data18)) { + const err31 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema179.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } else { + const err32 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/1/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[1].allOf[0].properties.url.type, + parentSchema: schema179.anyOf[1].allOf[0].properties.url, + data: data18, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.name !== undefined) { + let data19 = data.name; + const _errs47 = errors; + if (typeof data19 !== 'string') { + const err33 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/1/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[1].allOf[0].properties.name.type, + parentSchema: schema179.anyOf[1].allOf[0].properties.name, + data: data19, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + var valid11 = _errs47 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.description !== undefined) { + let data20 = data.description; + const _errs49 = errors; + if (typeof data20 !== 'string') { + const err34 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/1/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[1].allOf[0].properties.description.type, + parentSchema: schema179.anyOf[1].allOf[0].properties.description, + data: data20, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + var valid11 = _errs49 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.type !== undefined) { + let data21 = data.type; + const _errs51 = errors; + if (typeof data21 !== 'string') { + const err35 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[1].allOf[0].properties.type.type, + parentSchema: schema179.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + if ( + !( + data21 === 'device' || + data21 === 'group' || + data21 === 'edge instantiable' || + data21 === 'cloud instantiable' + ) + ) { + const err36 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema179.anyOf[1].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema179.anyOf[1].allOf[0].properties.type.enum, + parentSchema: schema179.anyOf[1].allOf[0].properties.type, + data: data21, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + var valid11 = _errs51 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.isPublic !== undefined) { + let data22 = data.isPublic; + const _errs53 = errors; + if (typeof data22 !== 'boolean') { + const err37 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/1/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema179.anyOf[1].allOf[0].properties.isPublic.type, + parentSchema: schema179.anyOf[1].allOf[0].properties.isPublic, + data: data22, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + var valid11 = _errs53 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.viewer !== undefined) { + let data23 = data.viewer; + const _errs55 = errors; + if (errors === _errs55) { + if (Array.isArray(data23)) { + var valid12 = true; + const len3 = data23.length; + for (let i3 = 0; i3 < len3; i3++) { + let data24 = data23[i3]; + const _errs57 = errors; + if (errors === _errs57) { + if ( + data24 && + typeof data24 == 'object' && + !Array.isArray(data24) + ) { + let missing4; + if (data24.url === undefined && (missing4 = 'url')) { + const err38 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: + "must have required property '" + missing4 + "'", + schema: + schema179.anyOf[1].allOf[0].properties.viewer.items + .required, + parentSchema: + schema179.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } else { + if (data24.url !== undefined) { + let data25 = data24.url; + const _errs59 = errors; + if (errors === _errs59) { + if (errors === _errs59) { + if (typeof data25 === 'string') { + if (!formats0(data25)) { + const err39 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema179.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } else { + const err40 = { + instancePath: + instancePath + '/viewer/' + i3 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[1].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema179.anyOf[1].allOf[0].properties + .viewer.items.properties.url, + data: data25, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + } + } + } + } else { + const err41 = { + instancePath: instancePath + '/viewer/' + i3, + schemaPath: + '#/anyOf/1/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema179.anyOf[1].allOf[0].properties.viewer.items + .type, + parentSchema: + schema179.anyOf[1].allOf[0].properties.viewer.items, + data: data24, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + var valid12 = _errs57 === errors; + if (!valid12) { + break; + } + } + } else { + const err42 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/1/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema179.anyOf[1].allOf[0].properties.viewer.type, + parentSchema: schema179.anyOf[1].allOf[0].properties.viewer, + data: data23, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + var valid11 = _errs55 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.owner !== undefined) { + let data26 = data.owner; + const _errs61 = errors; + if (errors === _errs61) { + if (Array.isArray(data26)) { + var valid14 = true; + const len4 = data26.length; + for (let i4 = 0; i4 < len4; i4++) { + let data27 = data26[i4]; + const _errs63 = errors; + if (errors === _errs63) { + if ( + data27 && + typeof data27 == 'object' && + !Array.isArray(data27) + ) { + let missing5; + if (data27.url === undefined && (missing5 = 'url')) { + const err43 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: + "must have required property '" + missing5 + "'", + schema: + schema179.anyOf[1].allOf[0].properties.owner.items + .required, + parentSchema: + schema179.anyOf[1].allOf[0].properties.owner + .items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } else { + if (data27.url !== undefined) { + let data28 = data27.url; + const _errs65 = errors; + if (errors === _errs65) { + if (errors === _errs65) { + if (typeof data28 === 'string') { + if (!formats0(data28)) { + const err44 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema179.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } else { + const err45 = { + instancePath: + instancePath + '/owner/' + i4 + '/url', + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[1].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema179.anyOf[1].allOf[0].properties + .owner.items.properties.url, + data: data28, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + } + } + } + } + } else { + const err46 = { + instancePath: instancePath + '/owner/' + i4, + schemaPath: + '#/anyOf/1/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema179.anyOf[1].allOf[0].properties.owner.items + .type, + parentSchema: + schema179.anyOf[1].allOf[0].properties.owner.items, + data: data27, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } + var valid14 = _errs63 === errors; + if (!valid14) { + break; + } + } + } else { + const err47 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/1/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema179.anyOf[1].allOf[0].properties.owner.type, + parentSchema: schema179.anyOf[1].allOf[0].properties.owner, + data: data26, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var valid11 = _errs61 === errors; + } else { + var valid11 = true; + } + } + } + } + } + } + } + } + } else { + const err48 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema179.anyOf[1].allOf[0].type, + parentSchema: schema179.anyOf[1].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } + var valid10 = _errs43 === errors; + if (valid10) { + const _errs67 = errors; + if (errors === _errs67) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data29 = data.type; + const _errs69 = errors; + if ('device' !== data29) { + const err49 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/1/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: schema179.anyOf[1].allOf[1].properties.type, + data: data29, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + var valid16 = _errs69 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.connected !== undefined) { + let data30 = data.connected; + const _errs70 = errors; + if (typeof data30 !== 'boolean') { + const err50 = { + instancePath: instancePath + '/connected', + schemaPath: '#/anyOf/1/allOf/1/properties/connected/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema179.anyOf[1].allOf[1].properties.connected.type, + parentSchema: schema179.anyOf[1].allOf[1].properties.connected, + data: data30, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + var valid16 = _errs70 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.announcedAvailability !== undefined) { + let data31 = data.announcedAvailability; + const _errs72 = errors; + if (errors === _errs72) { + if (Array.isArray(data31)) { + var valid17 = true; + const len5 = data31.length; + for (let i5 = 0; i5 < len5; i5++) { + let data32 = data31[i5]; + const _errs74 = errors; + if (errors === _errs74) { + if ( + data32 && + typeof data32 == 'object' && + !Array.isArray(data32) + ) { + if (data32.start !== undefined) { + let data33 = data32.start; + const _errs76 = errors; + if (errors === _errs76) { + if (errors === _errs76) { + if (typeof data33 === 'string') { + if (!formats22.validate(data33)) { + const err51 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema179.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } else { + const err52 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/start', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start + .type, + parentSchema: + schema179.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.start, + data: data33, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + } + } + var valid18 = _errs76 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data32.end !== undefined) { + let data34 = data32.end; + const _errs78 = errors; + if (errors === _errs78) { + if (errors === _errs78) { + if (typeof data34 === 'string') { + if (!formats22.validate(data34)) { + const err53 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema179.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } else { + const err54 = { + instancePath: + instancePath + + '/announcedAvailability/' + + i5 + + '/end', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end + .type, + parentSchema: + schema179.anyOf[1].allOf[1].properties + .announcedAvailability.items.properties.end, + data: data34, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + } + var valid18 = _errs78 === errors; + } else { + var valid18 = true; + } + } + } else { + const err55 = { + instancePath: instancePath + '/announcedAvailability/' + i5, + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema179.anyOf[1].allOf[1].properties.announcedAvailability + .items.type, + parentSchema: + schema179.anyOf[1].allOf[1].properties.announcedAvailability + .items, + data: data32, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid17 = _errs74 === errors; + if (!valid17) { + break; + } + } + } else { + const err56 = { + instancePath: instancePath + '/announcedAvailability', + schemaPath: + '#/anyOf/1/allOf/1/properties/announcedAvailability/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema179.anyOf[1].allOf[1].properties.announcedAvailability.type, + parentSchema: + schema179.anyOf[1].allOf[1].properties.announcedAvailability, + data: data31, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + var valid16 = _errs72 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.experiment !== undefined) { + let data35 = data.experiment; + const _errs80 = errors; + if (errors === _errs80) { + if (errors === _errs80) { + if (typeof data35 === 'string') { + if (!formats0(data35)) { + const err57 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema179.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } else { + const err58 = { + instancePath: instancePath + '/experiment', + schemaPath: '#/anyOf/1/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[1].allOf[1].properties.experiment.type, + parentSchema: schema179.anyOf[1].allOf[1].properties.experiment, + data: data35, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + } + } + var valid16 = _errs80 === errors; + } else { + var valid16 = true; + } + if (valid16) { + if (data.services !== undefined) { + let data36 = data.services; + const _errs82 = errors; + if (errors === _errs82) { + if (Array.isArray(data36)) { + var valid19 = true; + const len6 = data36.length; + for (let i6 = 0; i6 < len6; i6++) { + let data37 = data36[i6]; + const _errs84 = errors; + if (errors === _errs84) { + if ( + data37 && + typeof data37 == 'object' && + !Array.isArray(data37) + ) { + if (data37.serviceType !== undefined) { + let data38 = data37.serviceType; + const _errs87 = errors; + if (errors === _errs87) { + if (errors === _errs87) { + if (typeof data38 === 'string') { + if (!formats0(data38)) { + const err59 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema179.anyOf[1].allOf[1].properties + .services.items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } else { + const err60 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceType', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[1].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema179.anyOf[1].allOf[1].properties.services + .items.properties.serviceType, + data: data38, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + } + var valid20 = _errs87 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceId !== undefined) { + let data39 = data37.serviceId; + const _errs89 = errors; + if (typeof data39 !== 'string') { + const err61 = { + instancePath: + instancePath + '/services/' + i6 + '/serviceId', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[1].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema179.anyOf[1].allOf[1].properties.services + .items.properties.serviceId, + data: data39, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + var valid20 = _errs89 === errors; + } else { + var valid20 = true; + } + if (valid20) { + if (data37.serviceDirection !== undefined) { + let data40 = data37.serviceDirection; + const _errs91 = errors; + if (typeof data40 !== 'string') { + const err62 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema179.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + if ( + !( + data40 === 'consumer' || + data40 === 'producer' || + data40 === 'prosumer' + ) + ) { + const err63 = { + instancePath: + instancePath + + '/services/' + + i6 + + '/serviceDirection', + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema179.anyOf[1].allOf[1].properties + .services.items.properties.serviceDirection + .enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema179.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema179.anyOf[1].allOf[1].properties.services + .items.properties.serviceDirection, + data: data40, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + var valid20 = _errs91 === errors; + } else { + var valid20 = true; + } + } + } + } else { + const err64 = { + instancePath: instancePath + '/services/' + i6, + schemaPath: + '#/anyOf/1/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema179.anyOf[1].allOf[1].properties.services.items + .type, + parentSchema: + schema179.anyOf[1].allOf[1].properties.services.items, + data: data37, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + var valid19 = _errs84 === errors; + if (!valid19) { + break; + } + } + } else { + const err65 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/1/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema179.anyOf[1].allOf[1].properties.services.type, + parentSchema: schema179.anyOf[1].allOf[1].properties.services, + data: data36, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid16 = _errs82 === errors; + } else { + var valid16 = true; + } + } + } + } + } + } else { + const err66 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema179.anyOf[1].allOf[1].type, + parentSchema: schema179.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid10 = _errs67 === errors; + } + var _valid0 = _errs42 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs93 = errors; + const _errs94 = errors; + if (errors === _errs94) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.url === undefined && (missing6 = 'url')) || + (data.type === undefined && (missing6 = 'type')) || + (data.name === undefined && (missing6 = 'name')) || + (data.isPublic === undefined && (missing6 = 'isPublic')) + ) { + const err67 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema179.anyOf[2].allOf[0].required, + parentSchema: schema179.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } else { + if (data.url !== undefined) { + let data41 = data.url; + const _errs96 = errors; + if (errors === _errs96) { + if (errors === _errs96) { + if (typeof data41 === 'string') { + if (!formats0(data41)) { + const err68 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema179.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + } else { + const err69 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/2/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[2].allOf[0].properties.url.type, + parentSchema: schema179.anyOf[2].allOf[0].properties.url, + data: data41, + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + var valid22 = _errs96 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.name !== undefined) { + let data42 = data.name; + const _errs98 = errors; + if (typeof data42 !== 'string') { + const err70 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/2/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[2].allOf[0].properties.name.type, + parentSchema: schema179.anyOf[2].allOf[0].properties.name, + data: data42, + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var valid22 = _errs98 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.description !== undefined) { + let data43 = data.description; + const _errs100 = errors; + if (typeof data43 !== 'string') { + const err71 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/2/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[2].allOf[0].properties.description.type, + parentSchema: schema179.anyOf[2].allOf[0].properties.description, + data: data43, + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + var valid22 = _errs100 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.type !== undefined) { + let data44 = data.type; + const _errs102 = errors; + if (typeof data44 !== 'string') { + const err72 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[2].allOf[0].properties.type.type, + parentSchema: schema179.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + if ( + !( + data44 === 'device' || + data44 === 'group' || + data44 === 'edge instantiable' || + data44 === 'cloud instantiable' + ) + ) { + const err73 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema179.anyOf[2].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema179.anyOf[2].allOf[0].properties.type.enum, + parentSchema: schema179.anyOf[2].allOf[0].properties.type, + data: data44, + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + var valid22 = _errs102 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.isPublic !== undefined) { + let data45 = data.isPublic; + const _errs104 = errors; + if (typeof data45 !== 'boolean') { + const err74 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/2/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema179.anyOf[2].allOf[0].properties.isPublic.type, + parentSchema: schema179.anyOf[2].allOf[0].properties.isPublic, + data: data45, + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + var valid22 = _errs104 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.viewer !== undefined) { + let data46 = data.viewer; + const _errs106 = errors; + if (errors === _errs106) { + if (Array.isArray(data46)) { + var valid23 = true; + const len7 = data46.length; + for (let i7 = 0; i7 < len7; i7++) { + let data47 = data46[i7]; + const _errs108 = errors; + if (errors === _errs108) { + if ( + data47 && + typeof data47 == 'object' && + !Array.isArray(data47) + ) { + let missing7; + if (data47.url === undefined && (missing7 = 'url')) { + const err75 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: + "must have required property '" + missing7 + "'", + schema: + schema179.anyOf[2].allOf[0].properties.viewer + .items.required, + parentSchema: + schema179.anyOf[2].allOf[0].properties.viewer + .items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } else { + if (data47.url !== undefined) { + let data48 = data47.url; + const _errs110 = errors; + if (errors === _errs110) { + if (errors === _errs110) { + if (typeof data48 === 'string') { + if (!formats0(data48)) { + const err76 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema179.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } else { + const err77 = { + instancePath: + instancePath + '/viewer/' + i7 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[2].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema179.anyOf[2].allOf[0].properties + .viewer.items.properties.url, + data: data48, + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } + } + } + } else { + const err78 = { + instancePath: instancePath + '/viewer/' + i7, + schemaPath: + '#/anyOf/2/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema179.anyOf[2].allOf[0].properties.viewer.items + .type, + parentSchema: + schema179.anyOf[2].allOf[0].properties.viewer.items, + data: data47, + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + var valid23 = _errs108 === errors; + if (!valid23) { + break; + } + } + } else { + const err79 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/2/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema179.anyOf[2].allOf[0].properties.viewer.type, + parentSchema: schema179.anyOf[2].allOf[0].properties.viewer, + data: data46, + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + var valid22 = _errs106 === errors; + } else { + var valid22 = true; + } + if (valid22) { + if (data.owner !== undefined) { + let data49 = data.owner; + const _errs112 = errors; + if (errors === _errs112) { + if (Array.isArray(data49)) { + var valid25 = true; + const len8 = data49.length; + for (let i8 = 0; i8 < len8; i8++) { + let data50 = data49[i8]; + const _errs114 = errors; + if (errors === _errs114) { + if ( + data50 && + typeof data50 == 'object' && + !Array.isArray(data50) + ) { + let missing8; + if (data50.url === undefined && (missing8 = 'url')) { + const err80 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: + "must have required property '" + + missing8 + + "'", + schema: + schema179.anyOf[2].allOf[0].properties.owner + .items.required, + parentSchema: + schema179.anyOf[2].allOf[0].properties.owner + .items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } else { + if (data50.url !== undefined) { + let data51 = data50.url; + const _errs116 = errors; + if (errors === _errs116) { + if (errors === _errs116) { + if (typeof data51 === 'string') { + if (!formats0(data51)) { + const err81 = { + instancePath: + instancePath + + '/owner/' + + i8 + + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema179.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } else { + const err82 = { + instancePath: + instancePath + '/owner/' + i8 + '/url', + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[2].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema179.anyOf[2].allOf[0].properties + .owner.items.properties.url, + data: data51, + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + } + } + } + } else { + const err83 = { + instancePath: instancePath + '/owner/' + i8, + schemaPath: + '#/anyOf/2/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema179.anyOf[2].allOf[0].properties.owner.items + .type, + parentSchema: + schema179.anyOf[2].allOf[0].properties.owner + .items, + data: data50, + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + var valid25 = _errs114 === errors; + if (!valid25) { + break; + } + } + } else { + const err84 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/2/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema179.anyOf[2].allOf[0].properties.owner.type, + parentSchema: + schema179.anyOf[2].allOf[0].properties.owner, + data: data49, + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + var valid22 = _errs112 === errors; + } else { + var valid22 = true; + } + } + } + } + } + } + } + } + } else { + const err85 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema179.anyOf[2].allOf[0].type, + parentSchema: schema179.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + } + var valid21 = _errs94 === errors; + if (valid21) { + const _errs118 = errors; + if (errors === _errs118) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.type !== undefined) { + let data52 = data.type; + const _errs120 = errors; + if ('edge instantiable' !== data52) { + const err86 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/2/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'edge instantiable' }, + message: 'must be equal to constant', + schema: 'edge instantiable', + parentSchema: schema179.anyOf[2].allOf[1].properties.type, + data: data52, + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var valid27 = _errs120 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.codeUrl !== undefined) { + let data53 = data.codeUrl; + const _errs121 = errors; + if (errors === _errs121) { + if (errors === _errs121) { + if (typeof data53 === 'string') { + if (!formats0(data53)) { + const err87 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema179.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + } else { + const err88 = { + instancePath: instancePath + '/codeUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/codeUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[2].allOf[1].properties.codeUrl.type, + parentSchema: schema179.anyOf[2].allOf[1].properties.codeUrl, + data: data53, + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + } + } + var valid27 = _errs121 === errors; + } else { + var valid27 = true; + } + if (valid27) { + if (data.services !== undefined) { + let data54 = data.services; + const _errs123 = errors; + if (errors === _errs123) { + if (Array.isArray(data54)) { + var valid28 = true; + const len9 = data54.length; + for (let i9 = 0; i9 < len9; i9++) { + let data55 = data54[i9]; + const _errs125 = errors; + if (errors === _errs125) { + if ( + data55 && + typeof data55 == 'object' && + !Array.isArray(data55) + ) { + if (data55.serviceType !== undefined) { + let data56 = data55.serviceType; + const _errs128 = errors; + if (errors === _errs128) { + if (errors === _errs128) { + if (typeof data56 === 'string') { + if (!formats0(data56)) { + const err89 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema179.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } else { + const err90 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceType', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[2].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema179.anyOf[2].allOf[1].properties.services + .items.properties.serviceType, + data: data56, + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + } + var valid29 = _errs128 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceId !== undefined) { + let data57 = data55.serviceId; + const _errs130 = errors; + if (typeof data57 !== 'string') { + const err91 = { + instancePath: + instancePath + '/services/' + i9 + '/serviceId', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[2].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema179.anyOf[2].allOf[1].properties.services + .items.properties.serviceId, + data: data57, + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + var valid29 = _errs130 === errors; + } else { + var valid29 = true; + } + if (valid29) { + if (data55.serviceDirection !== undefined) { + let data58 = data55.serviceDirection; + const _errs132 = errors; + if (typeof data58 !== 'string') { + const err92 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.type, + parentSchema: + schema179.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + if ( + !( + data58 === 'consumer' || + data58 === 'producer' || + data58 === 'prosumer' + ) + ) { + const err93 = { + instancePath: + instancePath + + '/services/' + + i9 + + '/serviceDirection', + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema179.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema179.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection.enum, + parentSchema: + schema179.anyOf[2].allOf[1].properties.services + .items.properties.serviceDirection, + data: data58, + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + var valid29 = _errs132 === errors; + } else { + var valid29 = true; + } + } + } + } else { + const err94 = { + instancePath: instancePath + '/services/' + i9, + schemaPath: + '#/anyOf/2/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema179.anyOf[2].allOf[1].properties.services.items + .type, + parentSchema: + schema179.anyOf[2].allOf[1].properties.services.items, + data: data55, + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + var valid28 = _errs125 === errors; + if (!valid28) { + break; + } + } + } else { + const err95 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/2/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema179.anyOf[2].allOf[1].properties.services.type, + parentSchema: schema179.anyOf[2].allOf[1].properties.services, + data: data54, + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + var valid27 = _errs123 === errors; + } else { + var valid27 = true; + } + } + } + } else { + const err96 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema179.anyOf[2].allOf[1].type, + parentSchema: schema179.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + var valid21 = _errs118 === errors; + } + var _valid0 = _errs93 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs134 = errors; + const _errs135 = errors; + if (errors === _errs135) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if ( + (data.url === undefined && (missing9 = 'url')) || + (data.type === undefined && (missing9 = 'type')) || + (data.name === undefined && (missing9 = 'name')) || + (data.isPublic === undefined && (missing9 = 'isPublic')) + ) { + const err97 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema179.anyOf[3].allOf[0].required, + parentSchema: schema179.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } else { + if (data.url !== undefined) { + let data59 = data.url; + const _errs137 = errors; + if (errors === _errs137) { + if (errors === _errs137) { + if (typeof data59 === 'string') { + if (!formats0(data59)) { + const err98 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema179.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } else { + const err99 = { + instancePath: instancePath + '/url', + schemaPath: '#/anyOf/3/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[3].allOf[0].properties.url.type, + parentSchema: schema179.anyOf[3].allOf[0].properties.url, + data: data59, + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + } + } + var valid31 = _errs137 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.name !== undefined) { + let data60 = data.name; + const _errs139 = errors; + if (typeof data60 !== 'string') { + const err100 = { + instancePath: instancePath + '/name', + schemaPath: '#/anyOf/3/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[3].allOf[0].properties.name.type, + parentSchema: schema179.anyOf[3].allOf[0].properties.name, + data: data60, + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + var valid31 = _errs139 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.description !== undefined) { + let data61 = data.description; + const _errs141 = errors; + if (typeof data61 !== 'string') { + const err101 = { + instancePath: instancePath + '/description', + schemaPath: '#/anyOf/3/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[3].allOf[0].properties.description.type, + parentSchema: schema179.anyOf[3].allOf[0].properties.description, + data: data61, + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + var valid31 = _errs141 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.type !== undefined) { + let data62 = data.type; + const _errs143 = errors; + if (typeof data62 !== 'string') { + const err102 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema179.anyOf[3].allOf[0].properties.type.type, + parentSchema: schema179.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + if ( + !( + data62 === 'device' || + data62 === 'group' || + data62 === 'edge instantiable' || + data62 === 'cloud instantiable' + ) + ) { + const err103 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema179.anyOf[3].allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema179.anyOf[3].allOf[0].properties.type.enum, + parentSchema: schema179.anyOf[3].allOf[0].properties.type, + data: data62, + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + var valid31 = _errs143 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.isPublic !== undefined) { + let data63 = data.isPublic; + const _errs145 = errors; + if (typeof data63 !== 'boolean') { + const err104 = { + instancePath: instancePath + '/isPublic', + schemaPath: '#/anyOf/3/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema179.anyOf[3].allOf[0].properties.isPublic.type, + parentSchema: schema179.anyOf[3].allOf[0].properties.isPublic, + data: data63, + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + var valid31 = _errs145 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.viewer !== undefined) { + let data64 = data.viewer; + const _errs147 = errors; + if (errors === _errs147) { + if (Array.isArray(data64)) { + var valid32 = true; + const len10 = data64.length; + for (let i10 = 0; i10 < len10; i10++) { + let data65 = data64[i10]; + const _errs149 = errors; + if (errors === _errs149) { + if ( + data65 && + typeof data65 == 'object' && + !Array.isArray(data65) + ) { + let missing10; + if (data65.url === undefined && (missing10 = 'url')) { + const err105 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: + "must have required property '" + + missing10 + + "'", + schema: + schema179.anyOf[3].allOf[0].properties.viewer + .items.required, + parentSchema: + schema179.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err105]; + } else { + vErrors.push(err105); + } + errors++; + } else { + if (data65.url !== undefined) { + let data66 = data65.url; + const _errs151 = errors; + if (errors === _errs151) { + if (errors === _errs151) { + if (typeof data66 === 'string') { + if (!formats0(data66)) { + const err106 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema179.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + } else { + const err107 = { + instancePath: + instancePath + + '/viewer/' + + i10 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[3].allOf[0].properties + .viewer.items.properties.url.type, + parentSchema: + schema179.anyOf[3].allOf[0].properties + .viewer.items.properties.url, + data: data66, + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } + } + } + } + } + } else { + const err108 = { + instancePath: instancePath + '/viewer/' + i10, + schemaPath: + '#/anyOf/3/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema179.anyOf[3].allOf[0].properties.viewer + .items.type, + parentSchema: + schema179.anyOf[3].allOf[0].properties.viewer + .items, + data: data65, + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + var valid32 = _errs149 === errors; + if (!valid32) { + break; + } + } + } else { + const err109 = { + instancePath: instancePath + '/viewer', + schemaPath: '#/anyOf/3/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema179.anyOf[3].allOf[0].properties.viewer.type, + parentSchema: + schema179.anyOf[3].allOf[0].properties.viewer, + data: data64, + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + } + } + var valid31 = _errs147 === errors; + } else { + var valid31 = true; + } + if (valid31) { + if (data.owner !== undefined) { + let data67 = data.owner; + const _errs153 = errors; + if (errors === _errs153) { + if (Array.isArray(data67)) { + var valid34 = true; + const len11 = data67.length; + for (let i11 = 0; i11 < len11; i11++) { + let data68 = data67[i11]; + const _errs155 = errors; + if (errors === _errs155) { + if ( + data68 && + typeof data68 == 'object' && + !Array.isArray(data68) + ) { + let missing11; + if ( + data68.url === undefined && + (missing11 = 'url') + ) { + const err110 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: + "must have required property '" + + missing11 + + "'", + schema: + schema179.anyOf[3].allOf[0].properties.owner + .items.required, + parentSchema: + schema179.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err110]; + } else { + vErrors.push(err110); + } + errors++; + } else { + if (data68.url !== undefined) { + let data69 = data68.url; + const _errs157 = errors; + if (errors === _errs157) { + if (errors === _errs157) { + if (typeof data69 === 'string') { + if (!formats0(data69)) { + const err111 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema179.anyOf[3].allOf[0] + .properties.owner.items.properties + .url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err111]; + } else { + vErrors.push(err111); + } + errors++; + } + } else { + const err112 = { + instancePath: + instancePath + + '/owner/' + + i11 + + '/url', + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[3].allOf[0].properties + .owner.items.properties.url.type, + parentSchema: + schema179.anyOf[3].allOf[0].properties + .owner.items.properties.url, + data: data69, + }; + if (vErrors === null) { + vErrors = [err112]; + } else { + vErrors.push(err112); + } + errors++; + } + } + } + } + } + } else { + const err113 = { + instancePath: instancePath + '/owner/' + i11, + schemaPath: + '#/anyOf/3/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema179.anyOf[3].allOf[0].properties.owner + .items.type, + parentSchema: + schema179.anyOf[3].allOf[0].properties.owner + .items, + data: data68, + }; + if (vErrors === null) { + vErrors = [err113]; + } else { + vErrors.push(err113); + } + errors++; + } + } + var valid34 = _errs155 === errors; + if (!valid34) { + break; + } + } + } else { + const err114 = { + instancePath: instancePath + '/owner', + schemaPath: '#/anyOf/3/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema179.anyOf[3].allOf[0].properties.owner.type, + parentSchema: + schema179.anyOf[3].allOf[0].properties.owner, + data: data67, + }; + if (vErrors === null) { + vErrors = [err114]; + } else { + vErrors.push(err114); + } + errors++; + } + } + var valid31 = _errs153 === errors; + } else { + var valid31 = true; + } + } + } + } + } + } + } + } + } else { + const err115 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema179.anyOf[3].allOf[0].type, + parentSchema: schema179.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err115]; + } else { + vErrors.push(err115); + } + errors++; + } + } + var valid30 = _errs135 === errors; + if (valid30) { + const _errs159 = errors; + if (errors === _errs159) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if (data.devices === undefined && (missing12 = 'devices')) { + const err116 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema179.anyOf[3].allOf[1].required, + parentSchema: schema179.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err116]; + } else { + vErrors.push(err116); + } + errors++; + } else { + if (data.type !== undefined) { + let data70 = data.type; + const _errs161 = errors; + if ('group' !== data70) { + const err117 = { + instancePath: instancePath + '/type', + schemaPath: '#/anyOf/3/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'group' }, + message: 'must be equal to constant', + schema: 'group', + parentSchema: schema179.anyOf[3].allOf[1].properties.type, + data: data70, + }; + if (vErrors === null) { + vErrors = [err117]; + } else { + vErrors.push(err117); + } + errors++; + } + var valid36 = _errs161 === errors; + } else { + var valid36 = true; + } + if (valid36) { + if (data.devices !== undefined) { + let data71 = data.devices; + const _errs162 = errors; + if (errors === _errs162) { + if (Array.isArray(data71)) { + var valid37 = true; + const len12 = data71.length; + for (let i12 = 0; i12 < len12; i12++) { + let data72 = data71[i12]; + const _errs164 = errors; + if (errors === _errs164) { + if ( + data72 && + typeof data72 == 'object' && + !Array.isArray(data72) + ) { + let missing13; + if (data72.url === undefined && (missing13 = 'url')) { + const err118 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: + "must have required property '" + missing13 + "'", + schema: + schema179.anyOf[3].allOf[1].properties.devices.items + .required, + parentSchema: + schema179.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err118]; + } else { + vErrors.push(err118); + } + errors++; + } else { + if (data72.url !== undefined) { + let data73 = data72.url; + const _errs166 = errors; + if (errors === _errs166) { + if (errors === _errs166) { + if (typeof data73 === 'string') { + if (!formats0(data73)) { + const err119 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema179.anyOf[3].allOf[1].properties + .devices.items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err119]; + } else { + vErrors.push(err119); + } + errors++; + } + } else { + const err120 = { + instancePath: + instancePath + '/devices/' + i12 + '/url', + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema179.anyOf[3].allOf[1].properties.devices + .items.properties.url.type, + parentSchema: + schema179.anyOf[3].allOf[1].properties.devices + .items.properties.url, + data: data73, + }; + if (vErrors === null) { + vErrors = [err120]; + } else { + vErrors.push(err120); + } + errors++; + } + } + } + } + } + } else { + const err121 = { + instancePath: instancePath + '/devices/' + i12, + schemaPath: + '#/anyOf/3/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema179.anyOf[3].allOf[1].properties.devices.items + .type, + parentSchema: + schema179.anyOf[3].allOf[1].properties.devices.items, + data: data72, + }; + if (vErrors === null) { + vErrors = [err121]; + } else { + vErrors.push(err121); + } + errors++; + } + } + var valid37 = _errs164 === errors; + if (!valid37) { + break; + } + } + } else { + const err122 = { + instancePath: instancePath + '/devices', + schemaPath: '#/anyOf/3/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema179.anyOf[3].allOf[1].properties.devices.type, + parentSchema: schema179.anyOf[3].allOf[1].properties.devices, + data: data71, + }; + if (vErrors === null) { + vErrors = [err122]; + } else { + vErrors.push(err122); + } + errors++; + } + } + var valid36 = _errs162 === errors; + } else { + var valid36 = true; + } + } + } + } else { + const err123 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema179.anyOf[3].allOf[1].type, + parentSchema: schema179.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err123]; + } else { + vErrors.push(err123); + } + errors++; + } + } + var valid30 = _errs159 === errors; + } + var _valid0 = _errs134 === errors; + valid0 = valid0 || _valid0; + } + } + } + if (!valid0) { + const err124 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema179.anyOf, + parentSchema: schema179, + data, + }; + if (vErrors === null) { + vErrors = [err124]; + } else { + vErrors.push(err124); + } + errors++; + validate194.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate194.errors = vErrors; + return errors === 0; +} +exports.validateInstantiateDeviceResponse201Request = validate195; +const schema180 = { + type: 'object', + properties: { + instance: { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + deviceToken: { type: 'string' }, + }, + required: ['instance', 'deviceToken'], + 'x-standalone': false, + 'x-name': 'instantiateDeviceResponse201Request', + 'x-location': + '#/paths//devices/{device_id}/post/responses/201/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate195( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.instance === undefined && (missing0 = 'instance')) || + (data.deviceToken === undefined && (missing0 = 'deviceToken')) + ) { + validate195.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema180.required, + parentSchema: schema180, + data, + }, + ]; + return false; + } else { + if (data.instance !== undefined) { + let data0 = data.instance; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if ( + (data0.type === undefined && (missing1 = 'type')) || + (data0.name === undefined && (missing1 = 'name')) || + (data0.isPublic === undefined && (missing1 = 'isPublic')) + ) { + validate195.errors = [ + { + instancePath: instancePath + '/instance', + schemaPath: '#/properties/instance/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema180.properties.instance.allOf[0].required, + parentSchema: schema180.properties.instance.allOf[0], + data: data0, + }, + ]; + return false; + } else { + if (data0.name !== undefined) { + let data1 = data0.name; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate195.errors = [ + { + instancePath: instancePath + '/instance/name', + schemaPath: '#/properties/instance/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema180.properties.instance.allOf[0].properties.name.type, + parentSchema: + schema180.properties.instance.allOf[0].properties.name, + data: data1, + }, + ]; + return false; + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.description !== undefined) { + let data2 = data0.description; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate195.errors = [ + { + instancePath: instancePath + '/instance/description', + schemaPath: + '#/properties/instance/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema180.properties.instance.allOf[0].properties.description + .type, + parentSchema: + schema180.properties.instance.allOf[0].properties.description, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.type !== undefined) { + let data3 = data0.type; + const _errs8 = errors; + if (typeof data3 !== 'string') { + validate195.errors = [ + { + instancePath: instancePath + '/instance/type', + schemaPath: + '#/properties/instance/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema180.properties.instance.allOf[0].properties.type.type, + parentSchema: + schema180.properties.instance.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + if ( + !( + data3 === 'device' || + data3 === 'group' || + data3 === 'edge instantiable' || + data3 === 'cloud instantiable' + ) + ) { + validate195.errors = [ + { + instancePath: instancePath + '/instance/type', + schemaPath: + '#/properties/instance/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema180.properties.instance.allOf[0].properties.type + .enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema180.properties.instance.allOf[0].properties.type.enum, + parentSchema: + schema180.properties.instance.allOf[0].properties.type, + data: data3, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.isPublic !== undefined) { + let data4 = data0.isPublic; + const _errs10 = errors; + if (typeof data4 !== 'boolean') { + validate195.errors = [ + { + instancePath: instancePath + '/instance/isPublic', + schemaPath: + '#/properties/instance/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema180.properties.instance.allOf[0].properties.isPublic + .type, + parentSchema: + schema180.properties.instance.allOf[0].properties + .isPublic, + data: data4, + }, + ]; + return false; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.viewer !== undefined) { + let data5 = data0.viewer; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data5)) { + var valid3 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing2; + if (data6.url === undefined && (missing2 = 'url')) { + validate195.errors = [ + { + instancePath: + instancePath + '/instance/viewer/' + i0, + schemaPath: + '#/properties/instance/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + + missing2 + + "'", + schema: + schema180.properties.instance.allOf[0] + .properties.viewer.items.required, + parentSchema: + schema180.properties.instance.allOf[0] + .properties.viewer.items, + data: data6, + }, + ]; + return false; + } else { + if (data6.url !== undefined) { + let data7 = data6.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + validate195.errors = [ + { + instancePath: + instancePath + + '/instance/viewer/' + + i0 + + '/url', + schemaPath: + '#/properties/instance/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema180.properties.instance + .allOf[0].properties.viewer.items + .properties.url, + data: data7, + }, + ]; + return false; + } + } else { + validate195.errors = [ + { + instancePath: + instancePath + + '/instance/viewer/' + + i0 + + '/url', + schemaPath: + '#/properties/instance/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema180.properties.instance.allOf[0] + .properties.viewer.items.properties + .url.type, + parentSchema: + schema180.properties.instance.allOf[0] + .properties.viewer.items.properties + .url, + data: data7, + }, + ]; + return false; + } + } + } + } + } + } else { + validate195.errors = [ + { + instancePath: + instancePath + '/instance/viewer/' + i0, + schemaPath: + '#/properties/instance/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema180.properties.instance.allOf[0] + .properties.viewer.items.type, + parentSchema: + schema180.properties.instance.allOf[0] + .properties.viewer.items, + data: data6, + }, + ]; + return false; + } + } + var valid3 = _errs14 === errors; + if (!valid3) { + break; + } + } + } else { + validate195.errors = [ + { + instancePath: instancePath + '/instance/viewer', + schemaPath: + '#/properties/instance/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema180.properties.instance.allOf[0].properties + .viewer.type, + parentSchema: + schema180.properties.instance.allOf[0].properties + .viewer, + data: data5, + }, + ]; + return false; + } + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.owner !== undefined) { + let data8 = data0.owner; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data8)) { + var valid5 = true; + const len1 = data8.length; + for (let i1 = 0; i1 < len1; i1++) { + let data9 = data8[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data9 && + typeof data9 == 'object' && + !Array.isArray(data9) + ) { + let missing3; + if (data9.url === undefined && (missing3 = 'url')) { + validate195.errors = [ + { + instancePath: + instancePath + '/instance/owner/' + i1, + schemaPath: + '#/properties/instance/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema180.properties.instance.allOf[0] + .properties.owner.items.required, + parentSchema: + schema180.properties.instance.allOf[0] + .properties.owner.items, + data: data9, + }, + ]; + return false; + } else { + if (data9.url !== undefined) { + let data10 = data9.url; + const _errs22 = errors; + if (errors === _errs22) { + if (errors === _errs22) { + if (typeof data10 === 'string') { + if (!formats0(data10)) { + validate195.errors = [ + { + instancePath: + instancePath + + '/instance/owner/' + + i1 + + '/url', + schemaPath: + '#/properties/instance/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema180.properties.instance + .allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } else { + validate195.errors = [ + { + instancePath: + instancePath + + '/instance/owner/' + + i1 + + '/url', + schemaPath: + '#/properties/instance/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema180.properties.instance + .allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema180.properties.instance + .allOf[0].properties.owner.items + .properties.url, + data: data10, + }, + ]; + return false; + } + } + } + } + } + } else { + validate195.errors = [ + { + instancePath: + instancePath + '/instance/owner/' + i1, + schemaPath: + '#/properties/instance/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema180.properties.instance.allOf[0] + .properties.owner.items.type, + parentSchema: + schema180.properties.instance.allOf[0] + .properties.owner.items, + data: data9, + }, + ]; + return false; + } + } + var valid5 = _errs20 === errors; + if (!valid5) { + break; + } + } + } else { + validate195.errors = [ + { + instancePath: instancePath + '/instance/owner', + schemaPath: + '#/properties/instance/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema180.properties.instance.allOf[0].properties + .owner.type, + parentSchema: + schema180.properties.instance.allOf[0].properties + .owner, + data: data8, + }, + ]; + return false; + } + } + var valid2 = _errs18 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } else { + validate195.errors = [ + { + instancePath: instancePath + '/instance', + schemaPath: '#/properties/instance/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema180.properties.instance.allOf[0].type, + parentSchema: schema180.properties.instance.allOf[0], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs24 = errors; + if (errors === _errs24) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.type !== undefined) { + let data11 = data0.type; + const _errs26 = errors; + if ('device' !== data11) { + validate195.errors = [ + { + instancePath: instancePath + '/instance/type', + schemaPath: '#/properties/instance/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: + schema180.properties.instance.allOf[1].properties.type, + data: data11, + }, + ]; + return false; + } + var valid7 = _errs26 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data0.experiment !== undefined) { + let data12 = data0.experiment; + const _errs27 = errors; + if (errors === _errs27) { + if (errors === _errs27) { + if (typeof data12 === 'string') { + if (!formats0(data12)) { + validate195.errors = [ + { + instancePath: instancePath + '/instance/experiment', + schemaPath: + '#/properties/instance/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema180.properties.instance.allOf[1].properties + .experiment, + data: data12, + }, + ]; + return false; + } + } else { + validate195.errors = [ + { + instancePath: instancePath + '/instance/experiment', + schemaPath: + '#/properties/instance/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema180.properties.instance.allOf[1].properties + .experiment.type, + parentSchema: + schema180.properties.instance.allOf[1].properties + .experiment, + data: data12, + }, + ]; + return false; + } + } + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data0.services !== undefined) { + let data13 = data0.services; + const _errs29 = errors; + if (errors === _errs29) { + if (Array.isArray(data13)) { + var valid8 = true; + const len2 = data13.length; + for (let i2 = 0; i2 < len2; i2++) { + let data14 = data13[i2]; + const _errs31 = errors; + if (errors === _errs31) { + if ( + data14 && + typeof data14 == 'object' && + !Array.isArray(data14) + ) { + if (data14.serviceType !== undefined) { + let data15 = data14.serviceType; + const _errs34 = errors; + if (errors === _errs34) { + if (errors === _errs34) { + if (typeof data15 === 'string') { + if (!formats0(data15)) { + validate195.errors = [ + { + instancePath: + instancePath + + '/instance/services/' + + i2 + + '/serviceType', + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema180.properties.instance.allOf[1] + .properties.services.items.properties + .serviceType, + data: data15, + }, + ]; + return false; + } + } else { + validate195.errors = [ + { + instancePath: + instancePath + + '/instance/services/' + + i2 + + '/serviceType', + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema180.properties.instance.allOf[1] + .properties.services.items.properties + .serviceType.type, + parentSchema: + schema180.properties.instance.allOf[1] + .properties.services.items.properties + .serviceType, + data: data15, + }, + ]; + return false; + } + } + } + var valid9 = _errs34 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceId !== undefined) { + let data16 = data14.serviceId; + const _errs36 = errors; + if (typeof data16 !== 'string') { + validate195.errors = [ + { + instancePath: + instancePath + + '/instance/services/' + + i2 + + '/serviceId', + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema180.properties.instance.allOf[1] + .properties.services.items.properties + .serviceId.type, + parentSchema: + schema180.properties.instance.allOf[1] + .properties.services.items.properties + .serviceId, + data: data16, + }, + ]; + return false; + } + var valid9 = _errs36 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data14.serviceDirection !== undefined) { + let data17 = data14.serviceDirection; + const _errs38 = errors; + if (typeof data17 !== 'string') { + validate195.errors = [ + { + instancePath: + instancePath + + '/instance/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema180.properties.instance.allOf[1] + .properties.services.items.properties + .serviceDirection.type, + parentSchema: + schema180.properties.instance.allOf[1] + .properties.services.items.properties + .serviceDirection, + data: data17, + }, + ]; + return false; + } + if ( + !( + data17 === 'consumer' || + data17 === 'producer' || + data17 === 'prosumer' + ) + ) { + validate195.errors = [ + { + instancePath: + instancePath + + '/instance/services/' + + i2 + + '/serviceDirection', + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema180.properties.instance.allOf[1] + .properties.services.items.properties + .serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema180.properties.instance.allOf[1] + .properties.services.items.properties + .serviceDirection.enum, + parentSchema: + schema180.properties.instance.allOf[1] + .properties.services.items.properties + .serviceDirection, + data: data17, + }, + ]; + return false; + } + var valid9 = _errs38 === errors; + } else { + var valid9 = true; + } + } + } + } else { + validate195.errors = [ + { + instancePath: + instancePath + '/instance/services/' + i2, + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema180.properties.instance.allOf[1].properties + .services.items.type, + parentSchema: + schema180.properties.instance.allOf[1].properties + .services.items, + data: data14, + }, + ]; + return false; + } + } + var valid8 = _errs31 === errors; + if (!valid8) { + break; + } + } + } else { + validate195.errors = [ + { + instancePath: instancePath + '/instance/services', + schemaPath: + '#/properties/instance/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema180.properties.instance.allOf[1].properties.services + .type, + parentSchema: + schema180.properties.instance.allOf[1].properties + .services, + data: data13, + }, + ]; + return false; + } + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + } + } + } else { + validate195.errors = [ + { + instancePath: instancePath + '/instance', + schemaPath: '#/properties/instance/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema180.properties.instance.allOf[1].type, + parentSchema: schema180.properties.instance.allOf[1], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs24 === errors; + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.deviceToken !== undefined) { + let data18 = data.deviceToken; + const _errs40 = errors; + if (typeof data18 !== 'string') { + validate195.errors = [ + { + instancePath: instancePath + '/deviceToken', + schemaPath: '#/properties/deviceToken/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema180.properties.deviceToken.type, + parentSchema: schema180.properties.deviceToken, + data: data18, + }, + ]; + return false; + } + var valid0 = _errs40 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate195.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema180.type, + parentSchema: schema180, + data, + }, + ]; + return false; + } + } + validate195.errors = vErrors; + return errors === 0; +} +exports.validateInstantiateDeviceResponse201Response = validate196; +const schema181 = { + type: 'object', + properties: { + instance: { + title: 'Concrete Device', + allOf: [ + { + title: 'Device Overview', + type: 'object', + properties: { + url: { + type: 'string', + description: 'URL of the device', + format: 'uri', + readOnly: true, + }, + name: { type: 'string', description: 'Name of the device' }, + description: { + type: 'string', + description: 'Extended description of the device, features, etc.', + }, + type: { + type: 'string', + description: 'Type of the device', + enum: ['device', 'group', 'edge instantiable', 'cloud instantiable'], + }, + isPublic: { + type: 'boolean', + description: 'If true, the device may be seen and used by every user.', + }, + viewer: { + type: 'array', + description: 'List of users who can view the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + owner: { + type: 'array', + description: 'List of users who own the device', + items: { + title: 'User Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the user', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['url', 'type', 'name', 'isPublic'], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + type: { const: 'device' }, + connected: { + description: + 'If true, the device is connected to the service and can be used.\n', + type: 'boolean', + readOnly: true, + }, + announcedAvailability: { + readOnly: true, + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + }, + experiment: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + title: 'Service Description', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + serviceDirection: { + type: 'string', + enum: ['consumer', 'producer', 'prosumer'], + }, + }, + additionalProperties: true, + }, + }, + }, + }, + ], + 'x-typeguard': true, + }, + deviceToken: { type: 'string' }, + }, + required: ['instance', 'deviceToken'], + 'x-standalone': false, + 'x-name': 'instantiateDeviceResponse201Response', + 'x-location': + '#/paths//devices/{device_id}/post/responses/201/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate196( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.instance === undefined && (missing0 = 'instance')) || + (data.deviceToken === undefined && (missing0 = 'deviceToken')) + ) { + validate196.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema181.required, + parentSchema: schema181, + data, + }, + ]; + return false; + } else { + if (data.instance !== undefined) { + let data0 = data.instance; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if ( + (data0.url === undefined && (missing1 = 'url')) || + (data0.type === undefined && (missing1 = 'type')) || + (data0.name === undefined && (missing1 = 'name')) || + (data0.isPublic === undefined && (missing1 = 'isPublic')) + ) { + validate196.errors = [ + { + instancePath: instancePath + '/instance', + schemaPath: '#/properties/instance/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema181.properties.instance.allOf[0].required, + parentSchema: schema181.properties.instance.allOf[0], + data: data0, + }, + ]; + return false; + } else { + if (data0.url !== undefined) { + let data1 = data0.url; + const _errs4 = errors; + if (errors === _errs4) { + if (errors === _errs4) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate196.errors = [ + { + instancePath: instancePath + '/instance/url', + schemaPath: + '#/properties/instance/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema181.properties.instance.allOf[0].properties.url, + data: data1, + }, + ]; + return false; + } + } else { + validate196.errors = [ + { + instancePath: instancePath + '/instance/url', + schemaPath: + '#/properties/instance/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema181.properties.instance.allOf[0].properties.url.type, + parentSchema: + schema181.properties.instance.allOf[0].properties.url, + data: data1, + }, + ]; + return false; + } + } + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.name !== undefined) { + let data2 = data0.name; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate196.errors = [ + { + instancePath: instancePath + '/instance/name', + schemaPath: + '#/properties/instance/allOf/0/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema181.properties.instance.allOf[0].properties.name.type, + parentSchema: + schema181.properties.instance.allOf[0].properties.name, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.description !== undefined) { + let data3 = data0.description; + const _errs8 = errors; + if (typeof data3 !== 'string') { + validate196.errors = [ + { + instancePath: instancePath + '/instance/description', + schemaPath: + '#/properties/instance/allOf/0/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema181.properties.instance.allOf[0].properties + .description.type, + parentSchema: + schema181.properties.instance.allOf[0].properties + .description, + data: data3, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.type !== undefined) { + let data4 = data0.type; + const _errs10 = errors; + if (typeof data4 !== 'string') { + validate196.errors = [ + { + instancePath: instancePath + '/instance/type', + schemaPath: + '#/properties/instance/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema181.properties.instance.allOf[0].properties.type + .type, + parentSchema: + schema181.properties.instance.allOf[0].properties.type, + data: data4, + }, + ]; + return false; + } + if ( + !( + data4 === 'device' || + data4 === 'group' || + data4 === 'edge instantiable' || + data4 === 'cloud instantiable' + ) + ) { + validate196.errors = [ + { + instancePath: instancePath + '/instance/type', + schemaPath: + '#/properties/instance/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema181.properties.instance.allOf[0].properties.type + .enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema181.properties.instance.allOf[0].properties.type + .enum, + parentSchema: + schema181.properties.instance.allOf[0].properties.type, + data: data4, + }, + ]; + return false; + } + var valid2 = _errs10 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.isPublic !== undefined) { + let data5 = data0.isPublic; + const _errs12 = errors; + if (typeof data5 !== 'boolean') { + validate196.errors = [ + { + instancePath: instancePath + '/instance/isPublic', + schemaPath: + '#/properties/instance/allOf/0/properties/isPublic/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema181.properties.instance.allOf[0].properties + .isPublic.type, + parentSchema: + schema181.properties.instance.allOf[0].properties + .isPublic, + data: data5, + }, + ]; + return false; + } + var valid2 = _errs12 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.viewer !== undefined) { + let data6 = data0.viewer; + const _errs14 = errors; + if (errors === _errs14) { + if (Array.isArray(data6)) { + var valid3 = true; + const len0 = data6.length; + for (let i0 = 0; i0 < len0; i0++) { + let data7 = data6[i0]; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing2; + if (data7.url === undefined && (missing2 = 'url')) { + validate196.errors = [ + { + instancePath: + instancePath + '/instance/viewer/' + i0, + schemaPath: + '#/properties/instance/allOf/0/properties/viewer/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + + missing2 + + "'", + schema: + schema181.properties.instance.allOf[0] + .properties.viewer.items.required, + parentSchema: + schema181.properties.instance.allOf[0] + .properties.viewer.items, + data: data7, + }, + ]; + return false; + } else { + if (data7.url !== undefined) { + let data8 = data7.url; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data8 === 'string') { + if (!formats0(data8)) { + validate196.errors = [ + { + instancePath: + instancePath + + '/instance/viewer/' + + i0 + + '/url', + schemaPath: + '#/properties/instance/allOf/0/properties/viewer/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema181.properties.instance + .allOf[0].properties.viewer + .items.properties.url, + data: data8, + }, + ]; + return false; + } + } else { + validate196.errors = [ + { + instancePath: + instancePath + + '/instance/viewer/' + + i0 + + '/url', + schemaPath: + '#/properties/instance/allOf/0/properties/viewer/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema181.properties.instance + .allOf[0].properties.viewer.items + .properties.url.type, + parentSchema: + schema181.properties.instance + .allOf[0].properties.viewer.items + .properties.url, + data: data8, + }, + ]; + return false; + } + } + } + } + } + } else { + validate196.errors = [ + { + instancePath: + instancePath + '/instance/viewer/' + i0, + schemaPath: + '#/properties/instance/allOf/0/properties/viewer/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema181.properties.instance.allOf[0] + .properties.viewer.items.type, + parentSchema: + schema181.properties.instance.allOf[0] + .properties.viewer.items, + data: data7, + }, + ]; + return false; + } + } + var valid3 = _errs16 === errors; + if (!valid3) { + break; + } + } + } else { + validate196.errors = [ + { + instancePath: instancePath + '/instance/viewer', + schemaPath: + '#/properties/instance/allOf/0/properties/viewer/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema181.properties.instance.allOf[0].properties + .viewer.type, + parentSchema: + schema181.properties.instance.allOf[0].properties + .viewer, + data: data6, + }, + ]; + return false; + } + } + var valid2 = _errs14 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.owner !== undefined) { + let data9 = data0.owner; + const _errs20 = errors; + if (errors === _errs20) { + if (Array.isArray(data9)) { + var valid5 = true; + const len1 = data9.length; + for (let i1 = 0; i1 < len1; i1++) { + let data10 = data9[i1]; + const _errs22 = errors; + if (errors === _errs22) { + if ( + data10 && + typeof data10 == 'object' && + !Array.isArray(data10) + ) { + let missing3; + if ( + data10.url === undefined && + (missing3 = 'url') + ) { + validate196.errors = [ + { + instancePath: + instancePath + '/instance/owner/' + i1, + schemaPath: + '#/properties/instance/allOf/0/properties/owner/items/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema181.properties.instance.allOf[0] + .properties.owner.items.required, + parentSchema: + schema181.properties.instance.allOf[0] + .properties.owner.items, + data: data10, + }, + ]; + return false; + } else { + if (data10.url !== undefined) { + let data11 = data10.url; + const _errs24 = errors; + if (errors === _errs24) { + if (errors === _errs24) { + if (typeof data11 === 'string') { + if (!formats0(data11)) { + validate196.errors = [ + { + instancePath: + instancePath + + '/instance/owner/' + + i1 + + '/url', + schemaPath: + '#/properties/instance/allOf/0/properties/owner/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema181.properties.instance + .allOf[0].properties.owner + .items.properties.url, + data: data11, + }, + ]; + return false; + } + } else { + validate196.errors = [ + { + instancePath: + instancePath + + '/instance/owner/' + + i1 + + '/url', + schemaPath: + '#/properties/instance/allOf/0/properties/owner/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema181.properties.instance + .allOf[0].properties.owner.items + .properties.url.type, + parentSchema: + schema181.properties.instance + .allOf[0].properties.owner.items + .properties.url, + data: data11, + }, + ]; + return false; + } + } + } + } + } + } else { + validate196.errors = [ + { + instancePath: + instancePath + '/instance/owner/' + i1, + schemaPath: + '#/properties/instance/allOf/0/properties/owner/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema181.properties.instance.allOf[0] + .properties.owner.items.type, + parentSchema: + schema181.properties.instance.allOf[0] + .properties.owner.items, + data: data10, + }, + ]; + return false; + } + } + var valid5 = _errs22 === errors; + if (!valid5) { + break; + } + } + } else { + validate196.errors = [ + { + instancePath: instancePath + '/instance/owner', + schemaPath: + '#/properties/instance/allOf/0/properties/owner/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema181.properties.instance.allOf[0].properties + .owner.type, + parentSchema: + schema181.properties.instance.allOf[0].properties + .owner, + data: data9, + }, + ]; + return false; + } + } + var valid2 = _errs20 === errors; + } else { + var valid2 = true; + } + } + } + } + } + } + } + } + } else { + validate196.errors = [ + { + instancePath: instancePath + '/instance', + schemaPath: '#/properties/instance/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema181.properties.instance.allOf[0].type, + parentSchema: schema181.properties.instance.allOf[0], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs26 = errors; + if (errors === _errs26) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.type !== undefined) { + let data12 = data0.type; + const _errs28 = errors; + if ('device' !== data12) { + validate196.errors = [ + { + instancePath: instancePath + '/instance/type', + schemaPath: '#/properties/instance/allOf/1/properties/type/const', + keyword: 'const', + params: { allowedValue: 'device' }, + message: 'must be equal to constant', + schema: 'device', + parentSchema: + schema181.properties.instance.allOf[1].properties.type, + data: data12, + }, + ]; + return false; + } + var valid7 = _errs28 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data0.connected !== undefined) { + let data13 = data0.connected; + const _errs29 = errors; + if (typeof data13 !== 'boolean') { + validate196.errors = [ + { + instancePath: instancePath + '/instance/connected', + schemaPath: + '#/properties/instance/allOf/1/properties/connected/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema181.properties.instance.allOf[1].properties.connected + .type, + parentSchema: + schema181.properties.instance.allOf[1].properties.connected, + data: data13, + }, + ]; + return false; + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data0.announcedAvailability !== undefined) { + let data14 = data0.announcedAvailability; + const _errs31 = errors; + if (errors === _errs31) { + if (Array.isArray(data14)) { + var valid8 = true; + const len2 = data14.length; + for (let i2 = 0; i2 < len2; i2++) { + let data15 = data14[i2]; + const _errs33 = errors; + if (errors === _errs33) { + if ( + data15 && + typeof data15 == 'object' && + !Array.isArray(data15) + ) { + if (data15.start !== undefined) { + let data16 = data15.start; + const _errs35 = errors; + if (errors === _errs35) { + if (errors === _errs35) { + if (typeof data16 === 'string') { + if (!formats22.validate(data16)) { + validate196.errors = [ + { + instancePath: + instancePath + + '/instance/announcedAvailability/' + + i2 + + '/start', + schemaPath: + '#/properties/instance/allOf/1/properties/announcedAvailability/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema181.properties.instance.allOf[1] + .properties.announcedAvailability.items + .properties.start, + data: data16, + }, + ]; + return false; + } + } else { + validate196.errors = [ + { + instancePath: + instancePath + + '/instance/announcedAvailability/' + + i2 + + '/start', + schemaPath: + '#/properties/instance/allOf/1/properties/announcedAvailability/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema181.properties.instance.allOf[1] + .properties.announcedAvailability.items + .properties.start.type, + parentSchema: + schema181.properties.instance.allOf[1] + .properties.announcedAvailability.items + .properties.start, + data: data16, + }, + ]; + return false; + } + } + } + var valid9 = _errs35 === errors; + } else { + var valid9 = true; + } + if (valid9) { + if (data15.end !== undefined) { + let data17 = data15.end; + const _errs37 = errors; + if (errors === _errs37) { + if (errors === _errs37) { + if (typeof data17 === 'string') { + if (!formats22.validate(data17)) { + validate196.errors = [ + { + instancePath: + instancePath + + '/instance/announcedAvailability/' + + i2 + + '/end', + schemaPath: + '#/properties/instance/allOf/1/properties/announcedAvailability/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + + 'date-time' + + '"', + schema: 'date-time', + parentSchema: + schema181.properties.instance.allOf[1] + .properties.announcedAvailability + .items.properties.end, + data: data17, + }, + ]; + return false; + } + } else { + validate196.errors = [ + { + instancePath: + instancePath + + '/instance/announcedAvailability/' + + i2 + + '/end', + schemaPath: + '#/properties/instance/allOf/1/properties/announcedAvailability/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema181.properties.instance.allOf[1] + .properties.announcedAvailability.items + .properties.end.type, + parentSchema: + schema181.properties.instance.allOf[1] + .properties.announcedAvailability.items + .properties.end, + data: data17, + }, + ]; + return false; + } + } + } + var valid9 = _errs37 === errors; + } else { + var valid9 = true; + } + } + } else { + validate196.errors = [ + { + instancePath: + instancePath + + '/instance/announcedAvailability/' + + i2, + schemaPath: + '#/properties/instance/allOf/1/properties/announcedAvailability/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema181.properties.instance.allOf[1].properties + .announcedAvailability.items.type, + parentSchema: + schema181.properties.instance.allOf[1].properties + .announcedAvailability.items, + data: data15, + }, + ]; + return false; + } + } + var valid8 = _errs33 === errors; + if (!valid8) { + break; + } + } + } else { + validate196.errors = [ + { + instancePath: + instancePath + '/instance/announcedAvailability', + schemaPath: + '#/properties/instance/allOf/1/properties/announcedAvailability/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema181.properties.instance.allOf[1].properties + .announcedAvailability.type, + parentSchema: + schema181.properties.instance.allOf[1].properties + .announcedAvailability, + data: data14, + }, + ]; + return false; + } + } + var valid7 = _errs31 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data0.experiment !== undefined) { + let data18 = data0.experiment; + const _errs39 = errors; + if (errors === _errs39) { + if (errors === _errs39) { + if (typeof data18 === 'string') { + if (!formats0(data18)) { + validate196.errors = [ + { + instancePath: instancePath + '/instance/experiment', + schemaPath: + '#/properties/instance/allOf/1/properties/experiment/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema181.properties.instance.allOf[1].properties + .experiment, + data: data18, + }, + ]; + return false; + } + } else { + validate196.errors = [ + { + instancePath: instancePath + '/instance/experiment', + schemaPath: + '#/properties/instance/allOf/1/properties/experiment/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema181.properties.instance.allOf[1].properties + .experiment.type, + parentSchema: + schema181.properties.instance.allOf[1].properties + .experiment, + data: data18, + }, + ]; + return false; + } + } + } + var valid7 = _errs39 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data0.services !== undefined) { + let data19 = data0.services; + const _errs41 = errors; + if (errors === _errs41) { + if (Array.isArray(data19)) { + var valid10 = true; + const len3 = data19.length; + for (let i3 = 0; i3 < len3; i3++) { + let data20 = data19[i3]; + const _errs43 = errors; + if (errors === _errs43) { + if ( + data20 && + typeof data20 == 'object' && + !Array.isArray(data20) + ) { + if (data20.serviceType !== undefined) { + let data21 = data20.serviceType; + const _errs46 = errors; + if (errors === _errs46) { + if (errors === _errs46) { + if (typeof data21 === 'string') { + if (!formats0(data21)) { + validate196.errors = [ + { + instancePath: + instancePath + + '/instance/services/' + + i3 + + '/serviceType', + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema181.properties.instance.allOf[1] + .properties.services.items + .properties.serviceType, + data: data21, + }, + ]; + return false; + } + } else { + validate196.errors = [ + { + instancePath: + instancePath + + '/instance/services/' + + i3 + + '/serviceType', + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema181.properties.instance.allOf[1] + .properties.services.items.properties + .serviceType.type, + parentSchema: + schema181.properties.instance.allOf[1] + .properties.services.items.properties + .serviceType, + data: data21, + }, + ]; + return false; + } + } + } + var valid11 = _errs46 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data20.serviceId !== undefined) { + let data22 = data20.serviceId; + const _errs48 = errors; + if (typeof data22 !== 'string') { + validate196.errors = [ + { + instancePath: + instancePath + + '/instance/services/' + + i3 + + '/serviceId', + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema181.properties.instance.allOf[1] + .properties.services.items.properties + .serviceId.type, + parentSchema: + schema181.properties.instance.allOf[1] + .properties.services.items.properties + .serviceId, + data: data22, + }, + ]; + return false; + } + var valid11 = _errs48 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data20.serviceDirection !== undefined) { + let data23 = data20.serviceDirection; + const _errs50 = errors; + if (typeof data23 !== 'string') { + validate196.errors = [ + { + instancePath: + instancePath + + '/instance/services/' + + i3 + + '/serviceDirection', + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/properties/serviceDirection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema181.properties.instance.allOf[1] + .properties.services.items.properties + .serviceDirection.type, + parentSchema: + schema181.properties.instance.allOf[1] + .properties.services.items.properties + .serviceDirection, + data: data23, + }, + ]; + return false; + } + if ( + !( + data23 === 'consumer' || + data23 === 'producer' || + data23 === 'prosumer' + ) + ) { + validate196.errors = [ + { + instancePath: + instancePath + + '/instance/services/' + + i3 + + '/serviceDirection', + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/properties/serviceDirection/enum', + keyword: 'enum', + params: { + allowedValues: + schema181.properties.instance.allOf[1] + .properties.services.items + .properties.serviceDirection.enum, + }, + message: + 'must be equal to one of the allowed values', + schema: + schema181.properties.instance.allOf[1] + .properties.services.items.properties + .serviceDirection.enum, + parentSchema: + schema181.properties.instance.allOf[1] + .properties.services.items.properties + .serviceDirection, + data: data23, + }, + ]; + return false; + } + var valid11 = _errs50 === errors; + } else { + var valid11 = true; + } + } + } + } else { + validate196.errors = [ + { + instancePath: + instancePath + '/instance/services/' + i3, + schemaPath: + '#/properties/instance/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema181.properties.instance.allOf[1] + .properties.services.items.type, + parentSchema: + schema181.properties.instance.allOf[1] + .properties.services.items, + data: data20, + }, + ]; + return false; + } + } + var valid10 = _errs43 === errors; + if (!valid10) { + break; + } + } + } else { + validate196.errors = [ + { + instancePath: instancePath + '/instance/services', + schemaPath: + '#/properties/instance/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema181.properties.instance.allOf[1].properties + .services.type, + parentSchema: + schema181.properties.instance.allOf[1].properties + .services, + data: data19, + }, + ]; + return false; + } + } + var valid7 = _errs41 === errors; + } else { + var valid7 = true; + } + } + } + } + } + } else { + validate196.errors = [ + { + instancePath: instancePath + '/instance', + schemaPath: '#/properties/instance/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema181.properties.instance.allOf[1].type, + parentSchema: schema181.properties.instance.allOf[1], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs26 === errors; + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.deviceToken !== undefined) { + let data24 = data.deviceToken; + const _errs52 = errors; + if (typeof data24 !== 'string') { + validate196.errors = [ + { + instancePath: instancePath + '/deviceToken', + schemaPath: '#/properties/deviceToken/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema181.properties.deviceToken.type, + parentSchema: schema181.properties.deviceToken, + data: data24, + }, + ]; + return false; + } + var valid0 = _errs52 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate196.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema181.type, + parentSchema: schema181, + data, + }, + ]; + return false; + } + } + validate196.errors = vErrors; + return errors === 0; +} +exports.validateGetDeviceAvailabilityResponse200Request = validate197; +const schema182 = { + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + 'x-standalone': false, + 'x-name': 'getDeviceAvailabilityResponse200Request', + 'x-location': + '#/paths//devices/{device_id}/availability/get/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate197( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.start !== undefined) { + let data1 = data0.start; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate197.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema182.items.properties.start, + data: data1, + }, + ]; + return false; + } + } else { + validate197.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema182.items.properties.start.type, + parentSchema: schema182.items.properties.start, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.end !== undefined) { + let data2 = data0.end; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats22.validate(data2)) { + validate197.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema182.items.properties.end, + data: data2, + }, + ]; + return false; + } + } else { + validate197.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema182.items.properties.end.type, + parentSchema: schema182.items.properties.end, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + validate197.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema182.items.type, + parentSchema: schema182.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate197.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema182.type, + parentSchema: schema182, + data, + }, + ]; + return false; + } + } + validate197.errors = vErrors; + return errors === 0; +} +exports.validateGetDeviceAvailabilityResponse200Response = validate198; +const schema183 = { + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + 'x-standalone': false, + 'x-name': 'getDeviceAvailabilityResponse200Response', + 'x-location': + '#/paths//devices/{device_id}/availability/get/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate198( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.start !== undefined) { + let data1 = data0.start; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate198.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema183.items.properties.start, + data: data1, + }, + ]; + return false; + } + } else { + validate198.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema183.items.properties.start.type, + parentSchema: schema183.items.properties.start, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.end !== undefined) { + let data2 = data0.end; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats22.validate(data2)) { + validate198.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema183.items.properties.end, + data: data2, + }, + ]; + return false; + } + } else { + validate198.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema183.items.properties.end.type, + parentSchema: schema183.items.properties.end, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + validate198.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema183.items.type, + parentSchema: schema183.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate198.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema183.type, + parentSchema: schema183, + data, + }, + ]; + return false; + } + } + validate198.errors = vErrors; + return errors === 0; +} +exports.validateAddDeviceAvailabilityRulesBodyRequest = validate199; +const schema184 = { + title: 'Availability Rules', + description: 'The availability rule to be applied.', + type: 'array', + items: { + title: 'Availability Rule', + type: 'object', + allOf: [ + { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + { + type: 'object', + properties: { + available: { type: 'boolean' }, + repeat: { + description: + 'If specified the time slot is repeated in a fixed offset specified by the frequency', + type: 'object', + properties: { + frequency: { type: 'string', enum: ['HOURLY', 'DAILY', 'WEEKLY'] }, + until: { + description: 'Up to this date-time the time slot will be repeated.', + type: 'string', + format: 'date-time', + }, + count: { + description: 'How often the time slot will be repeated', + type: 'integer', + }, + }, + required: ['frequency'], + }, + }, + }, + ], + }, + 'x-standalone': false, + 'x-name': 'addDeviceAvailabilityRulesBodyRequest', + 'x-location': + '#/paths//devices/{device_id}/availability/post/requestBody/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate199( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (!(data0 && typeof data0 == 'object' && !Array.isArray(data0))) { + validate199.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema184.items.type, + parentSchema: schema184.items, + data: data0, + }, + ]; + return false; + } + const _errs3 = errors; + if (errors === _errs3) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.start !== undefined) { + let data1 = data0.start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate199.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/allOf/0/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema184.items.allOf[0].properties.start, + data: data1, + }, + ]; + return false; + } + } else { + validate199.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/allOf/0/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema184.items.allOf[0].properties.start.type, + parentSchema: schema184.items.allOf[0].properties.start, + data: data1, + }, + ]; + return false; + } + } + } + var valid2 = _errs5 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.end !== undefined) { + let data2 = data0.end; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data2 === 'string') { + if (!formats22.validate(data2)) { + validate199.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/allOf/0/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema184.items.allOf[0].properties.end, + data: data2, + }, + ]; + return false; + } + } else { + validate199.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/allOf/0/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema184.items.allOf[0].properties.end.type, + parentSchema: schema184.items.allOf[0].properties.end, + data: data2, + }, + ]; + return false; + } + } + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + } + } else { + validate199.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema184.items.allOf[0].type, + parentSchema: schema184.items.allOf[0], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (valid1) { + const _errs9 = errors; + if (errors === _errs9) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.available !== undefined) { + let data3 = data0.available; + const _errs11 = errors; + if (typeof data3 !== 'boolean') { + validate199.errors = [ + { + instancePath: instancePath + '/' + i0 + '/available', + schemaPath: '#/items/allOf/1/properties/available/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema184.items.allOf[1].properties.available.type, + parentSchema: schema184.items.allOf[1].properties.available, + data: data3, + }, + ]; + return false; + } + var valid3 = _errs11 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data0.repeat !== undefined) { + let data4 = data0.repeat; + const _errs13 = errors; + if (errors === _errs13) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing0; + if (data4.frequency === undefined && (missing0 = 'frequency')) { + validate199.errors = [ + { + instancePath: instancePath + '/' + i0 + '/repeat', + schemaPath: '#/items/allOf/1/properties/repeat/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema184.items.allOf[1].properties.repeat.required, + parentSchema: schema184.items.allOf[1].properties.repeat, + data: data4, + }, + ]; + return false; + } else { + if (data4.frequency !== undefined) { + let data5 = data4.frequency; + const _errs15 = errors; + if (typeof data5 !== 'string') { + validate199.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/repeat/frequency', + schemaPath: + '#/items/allOf/1/properties/repeat/properties/frequency/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema184.items.allOf[1].properties.repeat.properties + .frequency.type, + parentSchema: + schema184.items.allOf[1].properties.repeat.properties + .frequency, + data: data5, + }, + ]; + return false; + } + if ( + !( + data5 === 'HOURLY' || + data5 === 'DAILY' || + data5 === 'WEEKLY' + ) + ) { + validate199.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/repeat/frequency', + schemaPath: + '#/items/allOf/1/properties/repeat/properties/frequency/enum', + keyword: 'enum', + params: { + allowedValues: + schema184.items.allOf[1].properties.repeat.properties + .frequency.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema184.items.allOf[1].properties.repeat.properties + .frequency.enum, + parentSchema: + schema184.items.allOf[1].properties.repeat.properties + .frequency, + data: data5, + }, + ]; + return false; + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data4.until !== undefined) { + let data6 = data4.until; + const _errs17 = errors; + if (errors === _errs17) { + if (errors === _errs17) { + if (typeof data6 === 'string') { + if (!formats22.validate(data6)) { + validate199.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/repeat/until', + schemaPath: + '#/items/allOf/1/properties/repeat/properties/until/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema184.items.allOf[1].properties.repeat + .properties.until, + data: data6, + }, + ]; + return false; + } + } else { + validate199.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/repeat/until', + schemaPath: + '#/items/allOf/1/properties/repeat/properties/until/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema184.items.allOf[1].properties.repeat + .properties.until.type, + parentSchema: + schema184.items.allOf[1].properties.repeat + .properties.until, + data: data6, + }, + ]; + return false; + } + } + } + var valid4 = _errs17 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data4.count !== undefined) { + let data7 = data4.count; + const _errs19 = errors; + if ( + !( + typeof data7 == 'number' && + !(data7 % 1) && + !isNaN(data7) && + isFinite(data7) + ) + ) { + validate199.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/repeat/count', + schemaPath: + '#/items/allOf/1/properties/repeat/properties/count/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + schema: + schema184.items.allOf[1].properties.repeat + .properties.count.type, + parentSchema: + schema184.items.allOf[1].properties.repeat + .properties.count, + data: data7, + }, + ]; + return false; + } + var valid4 = _errs19 === errors; + } else { + var valid4 = true; + } + } + } + } + } else { + validate199.errors = [ + { + instancePath: instancePath + '/' + i0 + '/repeat', + schemaPath: '#/items/allOf/1/properties/repeat/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema184.items.allOf[1].properties.repeat.type, + parentSchema: schema184.items.allOf[1].properties.repeat, + data: data4, + }, + ]; + return false; + } + } + var valid3 = _errs13 === errors; + } else { + var valid3 = true; + } + } + } else { + validate199.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema184.items.allOf[1].type, + parentSchema: schema184.items.allOf[1], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs9 === errors; + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate199.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema184.type, + parentSchema: schema184, + data, + }, + ]; + return false; + } + } + validate199.errors = vErrors; + return errors === 0; +} +exports.validateAddDeviceAvailabilityRulesBodyResponse = validate200; +const schema185 = { + title: 'Availability Rules', + description: 'The availability rule to be applied.', + type: 'array', + items: { + title: 'Availability Rule', + type: 'object', + allOf: [ + { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + { + type: 'object', + properties: { + available: { type: 'boolean' }, + repeat: { + description: + 'If specified the time slot is repeated in a fixed offset specified by the frequency', + type: 'object', + properties: { + frequency: { type: 'string', enum: ['HOURLY', 'DAILY', 'WEEKLY'] }, + until: { + description: 'Up to this date-time the time slot will be repeated.', + type: 'string', + format: 'date-time', + }, + count: { + description: 'How often the time slot will be repeated', + type: 'integer', + }, + }, + required: ['frequency'], + }, + }, + }, + ], + }, + 'x-standalone': false, + 'x-name': 'addDeviceAvailabilityRulesBodyResponse', + 'x-location': + '#/paths//devices/{device_id}/availability/post/requestBody/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate200( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (!(data0 && typeof data0 == 'object' && !Array.isArray(data0))) { + validate200.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema185.items.type, + parentSchema: schema185.items, + data: data0, + }, + ]; + return false; + } + const _errs3 = errors; + if (errors === _errs3) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.start !== undefined) { + let data1 = data0.start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate200.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/allOf/0/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema185.items.allOf[0].properties.start, + data: data1, + }, + ]; + return false; + } + } else { + validate200.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/allOf/0/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema185.items.allOf[0].properties.start.type, + parentSchema: schema185.items.allOf[0].properties.start, + data: data1, + }, + ]; + return false; + } + } + } + var valid2 = _errs5 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.end !== undefined) { + let data2 = data0.end; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data2 === 'string') { + if (!formats22.validate(data2)) { + validate200.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/allOf/0/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema185.items.allOf[0].properties.end, + data: data2, + }, + ]; + return false; + } + } else { + validate200.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/allOf/0/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema185.items.allOf[0].properties.end.type, + parentSchema: schema185.items.allOf[0].properties.end, + data: data2, + }, + ]; + return false; + } + } + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + } + } else { + validate200.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema185.items.allOf[0].type, + parentSchema: schema185.items.allOf[0], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (valid1) { + const _errs9 = errors; + if (errors === _errs9) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.available !== undefined) { + let data3 = data0.available; + const _errs11 = errors; + if (typeof data3 !== 'boolean') { + validate200.errors = [ + { + instancePath: instancePath + '/' + i0 + '/available', + schemaPath: '#/items/allOf/1/properties/available/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema185.items.allOf[1].properties.available.type, + parentSchema: schema185.items.allOf[1].properties.available, + data: data3, + }, + ]; + return false; + } + var valid3 = _errs11 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data0.repeat !== undefined) { + let data4 = data0.repeat; + const _errs13 = errors; + if (errors === _errs13) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing0; + if (data4.frequency === undefined && (missing0 = 'frequency')) { + validate200.errors = [ + { + instancePath: instancePath + '/' + i0 + '/repeat', + schemaPath: '#/items/allOf/1/properties/repeat/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema185.items.allOf[1].properties.repeat.required, + parentSchema: schema185.items.allOf[1].properties.repeat, + data: data4, + }, + ]; + return false; + } else { + if (data4.frequency !== undefined) { + let data5 = data4.frequency; + const _errs15 = errors; + if (typeof data5 !== 'string') { + validate200.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/repeat/frequency', + schemaPath: + '#/items/allOf/1/properties/repeat/properties/frequency/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema185.items.allOf[1].properties.repeat.properties + .frequency.type, + parentSchema: + schema185.items.allOf[1].properties.repeat.properties + .frequency, + data: data5, + }, + ]; + return false; + } + if ( + !( + data5 === 'HOURLY' || + data5 === 'DAILY' || + data5 === 'WEEKLY' + ) + ) { + validate200.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/repeat/frequency', + schemaPath: + '#/items/allOf/1/properties/repeat/properties/frequency/enum', + keyword: 'enum', + params: { + allowedValues: + schema185.items.allOf[1].properties.repeat.properties + .frequency.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema185.items.allOf[1].properties.repeat.properties + .frequency.enum, + parentSchema: + schema185.items.allOf[1].properties.repeat.properties + .frequency, + data: data5, + }, + ]; + return false; + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data4.until !== undefined) { + let data6 = data4.until; + const _errs17 = errors; + if (errors === _errs17) { + if (errors === _errs17) { + if (typeof data6 === 'string') { + if (!formats22.validate(data6)) { + validate200.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/repeat/until', + schemaPath: + '#/items/allOf/1/properties/repeat/properties/until/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema185.items.allOf[1].properties.repeat + .properties.until, + data: data6, + }, + ]; + return false; + } + } else { + validate200.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/repeat/until', + schemaPath: + '#/items/allOf/1/properties/repeat/properties/until/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema185.items.allOf[1].properties.repeat + .properties.until.type, + parentSchema: + schema185.items.allOf[1].properties.repeat + .properties.until, + data: data6, + }, + ]; + return false; + } + } + } + var valid4 = _errs17 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data4.count !== undefined) { + let data7 = data4.count; + const _errs19 = errors; + if ( + !( + typeof data7 == 'number' && + !(data7 % 1) && + !isNaN(data7) && + isFinite(data7) + ) + ) { + validate200.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/repeat/count', + schemaPath: + '#/items/allOf/1/properties/repeat/properties/count/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + schema: + schema185.items.allOf[1].properties.repeat + .properties.count.type, + parentSchema: + schema185.items.allOf[1].properties.repeat + .properties.count, + data: data7, + }, + ]; + return false; + } + var valid4 = _errs19 === errors; + } else { + var valid4 = true; + } + } + } + } + } else { + validate200.errors = [ + { + instancePath: instancePath + '/' + i0 + '/repeat', + schemaPath: '#/items/allOf/1/properties/repeat/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema185.items.allOf[1].properties.repeat.type, + parentSchema: schema185.items.allOf[1].properties.repeat, + data: data4, + }, + ]; + return false; + } + } + var valid3 = _errs13 === errors; + } else { + var valid3 = true; + } + } + } else { + validate200.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema185.items.allOf[1].type, + parentSchema: schema185.items.allOf[1], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs9 === errors; + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate200.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema185.type, + parentSchema: schema185, + data, + }, + ]; + return false; + } + } + validate200.errors = vErrors; + return errors === 0; +} +exports.validateAddDeviceAvailabilityRulesResponse200Request = validate201; +const schema186 = { + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + 'x-standalone': false, + 'x-name': 'addDeviceAvailabilityRulesResponse200Request', + 'x-location': + '#/paths//devices/{device_id}/availability/post/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate201( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.start !== undefined) { + let data1 = data0.start; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate201.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema186.items.properties.start, + data: data1, + }, + ]; + return false; + } + } else { + validate201.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema186.items.properties.start.type, + parentSchema: schema186.items.properties.start, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.end !== undefined) { + let data2 = data0.end; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats22.validate(data2)) { + validate201.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema186.items.properties.end, + data: data2, + }, + ]; + return false; + } + } else { + validate201.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema186.items.properties.end.type, + parentSchema: schema186.items.properties.end, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + validate201.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema186.items.type, + parentSchema: schema186.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate201.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema186.type, + parentSchema: schema186, + data, + }, + ]; + return false; + } + } + validate201.errors = vErrors; + return errors === 0; +} +exports.validateAddDeviceAvailabilityRulesResponse200Response = validate202; +const schema187 = { + title: 'Availability', + description: + 'A list of time slots that the maintainer of the device announced it is available\n', + type: 'array', + items: { + title: 'Time Slot', + type: 'object', + properties: { + start: { type: 'string', format: 'date-time' }, + end: { type: 'string', format: 'date-time' }, + }, + }, + 'x-standalone': false, + 'x-name': 'addDeviceAvailabilityRulesResponse200Response', + 'x-location': + '#/paths//devices/{device_id}/availability/post/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate202( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.start !== undefined) { + let data1 = data0.start; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats22.validate(data1)) { + validate202.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema187.items.properties.start, + data: data1, + }, + ]; + return false; + } + } else { + validate202.errors = [ + { + instancePath: instancePath + '/' + i0 + '/start', + schemaPath: '#/items/properties/start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema187.items.properties.start.type, + parentSchema: schema187.items.properties.start, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.end !== undefined) { + let data2 = data0.end; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats22.validate(data2)) { + validate202.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema187.items.properties.end, + data: data2, + }, + ]; + return false; + } + } else { + validate202.errors = [ + { + instancePath: instancePath + '/' + i0 + '/end', + schemaPath: '#/items/properties/end/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema187.items.properties.end.type, + parentSchema: schema187.items.properties.end, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + validate202.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema187.items.type, + parentSchema: schema187.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate202.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema187.type, + parentSchema: schema187, + data, + }, + ]; + return false; + } + } + validate202.errors = vErrors; + return errors === 0; +} +exports.validateCreateWebsocketTokenResponse200Request = validate203; +const schema188 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'createWebsocketTokenResponse200Request', + 'x-location': + '#/paths//devices/{device_id}/websocket/post/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate203( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate203.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema188.type, + parentSchema: schema188, + data, + }, + ]; + return false; + } + validate203.errors = vErrors; + return errors === 0; +} +exports.validateCreateWebsocketTokenResponse200Response = validate204; +const schema189 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'createWebsocketTokenResponse200Response', + 'x-location': + '#/paths//devices/{device_id}/websocket/post/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate204( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate204.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema189.type, + parentSchema: schema189, + data, + }, + ]; + return false; + } + validate204.errors = vErrors; + return errors === 0; +} +exports.validateSendSignalingMessageBodyRequest = validate205; +const schema190 = { + title: 'Sig Message', + anyOf: [ + { + title: 'Create Peerconnection Message', + allOf: [ + { + title: 'Command Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'command' }, + command: { type: 'string' }, + }, + required: ['messageType', 'command'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + command: { const: 'createPeerconnection' }, + connectionType: { type: 'string', enum: ['webrtc', 'websocket', 'local'] }, + connectionUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + type: 'object', + required: ['serviceType', 'serviceId', 'remoteServiceId'], + title: 'Service Config', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + additionalProperties: true, + }, + }, + tiebreaker: { type: 'boolean' }, + config: { type: 'object', additionalProperties: true }, + }, + required: [ + 'command', + 'connectionType', + 'connectionUrl', + 'services', + 'tiebreaker', + ], + }, + ], + 'x-typeguard': true, + }, + { + title: 'Close Peerconnection Message', + allOf: [ + { + title: 'Command Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'command' }, + command: { type: 'string' }, + }, + required: ['messageType', 'command'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + command: { const: 'closePeerconnection' }, + connectionUrl: { type: 'string', format: 'uri' }, + }, + required: ['command', 'connectionUrl'], + }, + ], + 'x-typeguard': true, + }, + { + title: 'Signaling Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'signaling' }, + signalingType: { type: 'string' }, + connectionUrl: { type: 'string', format: 'uri' }, + content: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'signalingType', 'connectionUrl', 'content'], + }, + ], + 'x-typeguard': true, + }, + { + title: 'Configuration Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'configuration' }, + configuration: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'configuration'], + }, + ], + 'x-typeguard': true, + }, + { + title: 'Experiment Status Changed Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'experiment-status-changed' }, + status: { type: 'string' }, + message: { type: 'string' }, + }, + required: ['messageType', 'status'], + }, + ], + 'x-typeguard': true, + }, + { + title: 'Logging Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'logging' }, + content: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'content'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-standalone': false, + 'x-name': 'sendSignalingMessageBodyRequest', + 'x-location': + '#/paths//devices/{device_id}/signaling/post/requestBody/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate205( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + const _errs3 = errors; + if (errors === _errs3) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema190.anyOf[0].allOf[0].allOf[0].required, + parentSchema: schema190.anyOf[0].allOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + const err1 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/0/allOf/0/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema190.anyOf[0].allOf[0].allOf[0].properties.messageType.type, + parentSchema: schema190.anyOf[0].allOf[0].allOf[0].properties.messageType, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } + } + } else { + const err2 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema190.anyOf[0].allOf[0].allOf[0].type, + parentSchema: schema190.anyOf[0].allOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + var valid2 = _errs3 === errors; + if (valid2) { + const _errs8 = errors; + if (errors === _errs8) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.command === undefined && (missing1 = 'command')) + ) { + const err3 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema190.anyOf[0].allOf[0].allOf[1].required, + parentSchema: schema190.anyOf[0].allOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs10 = errors; + if ('command' !== data1) { + const err4 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/0/allOf/0/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'command' }, + message: 'must be equal to constant', + schema: 'command', + parentSchema: schema190.anyOf[0].allOf[0].allOf[1].properties.messageType, + data: data1, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid4 = _errs10 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.command !== undefined) { + let data2 = data.command; + const _errs11 = errors; + if (typeof data2 !== 'string') { + const err5 = { + instancePath: instancePath + '/command', + schemaPath: '#/anyOf/0/allOf/0/allOf/1/properties/command/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema190.anyOf[0].allOf[0].allOf[1].properties.command.type, + parentSchema: schema190.anyOf[0].allOf[0].allOf[1].properties.command, + data: data2, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + var valid4 = _errs11 === errors; + } else { + var valid4 = true; + } + } + } + } else { + const err6 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema190.anyOf[0].allOf[0].allOf[1].type, + parentSchema: schema190.anyOf[0].allOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + var valid2 = _errs8 === errors; + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs13 = errors; + if (errors === _errs13) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.command === undefined && (missing2 = 'command')) || + (data.connectionType === undefined && (missing2 = 'connectionType')) || + (data.connectionUrl === undefined && (missing2 = 'connectionUrl')) || + (data.services === undefined && (missing2 = 'services')) || + (data.tiebreaker === undefined && (missing2 = 'tiebreaker')) + ) { + const err7 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema190.anyOf[0].allOf[1].required, + parentSchema: schema190.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } else { + if (data.command !== undefined) { + let data3 = data.command; + const _errs15 = errors; + if ('createPeerconnection' !== data3) { + const err8 = { + instancePath: instancePath + '/command', + schemaPath: '#/anyOf/0/allOf/1/properties/command/const', + keyword: 'const', + params: { allowedValue: 'createPeerconnection' }, + message: 'must be equal to constant', + schema: 'createPeerconnection', + parentSchema: schema190.anyOf[0].allOf[1].properties.command, + data: data3, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + var valid5 = _errs15 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data.connectionType !== undefined) { + let data4 = data.connectionType; + const _errs16 = errors; + if (typeof data4 !== 'string') { + const err9 = { + instancePath: instancePath + '/connectionType', + schemaPath: '#/anyOf/0/allOf/1/properties/connectionType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema190.anyOf[0].allOf[1].properties.connectionType.type, + parentSchema: schema190.anyOf[0].allOf[1].properties.connectionType, + data: data4, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + if (!(data4 === 'webrtc' || data4 === 'websocket' || data4 === 'local')) { + const err10 = { + instancePath: instancePath + '/connectionType', + schemaPath: '#/anyOf/0/allOf/1/properties/connectionType/enum', + keyword: 'enum', + params: { + allowedValues: + schema190.anyOf[0].allOf[1].properties.connectionType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema190.anyOf[0].allOf[1].properties.connectionType.enum, + parentSchema: schema190.anyOf[0].allOf[1].properties.connectionType, + data: data4, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + var valid5 = _errs16 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data.connectionUrl !== undefined) { + let data5 = data.connectionUrl; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + const err11 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema190.anyOf[0].allOf[1].properties.connectionUrl, + data: data5, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } else { + const err12 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema190.anyOf[0].allOf[1].properties.connectionUrl.type, + parentSchema: + schema190.anyOf[0].allOf[1].properties.connectionUrl, + data: data5, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } + } + var valid5 = _errs18 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data.services !== undefined) { + let data6 = data.services; + const _errs20 = errors; + if (errors === _errs20) { + if (Array.isArray(data6)) { + var valid6 = true; + const len0 = data6.length; + for (let i0 = 0; i0 < len0; i0++) { + let data7 = data6[i0]; + const _errs22 = errors; + if (errors === _errs22) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing3; + if ( + (data7.serviceType === undefined && + (missing3 = 'serviceType')) || + (data7.serviceId === undefined && + (missing3 = 'serviceId')) || + (data7.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + const err13 = { + instancePath: instancePath + '/services/' + i0, + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: + schema190.anyOf[0].allOf[1].properties.services.items + .required, + parentSchema: + schema190.anyOf[0].allOf[1].properties.services.items, + data: data7, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } else { + if (data7.serviceType !== undefined) { + let data8 = data7.serviceType; + const _errs25 = errors; + if (errors === _errs25) { + if (errors === _errs25) { + if (typeof data8 === 'string') { + if (!formats0(data8)) { + const err14 = { + instancePath: + instancePath + + '/services/' + + i0 + + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema190.anyOf[0].allOf[1].properties + .services.items.properties.serviceType, + data: data8, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } else { + const err15 = { + instancePath: + instancePath + + '/services/' + + i0 + + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema190.anyOf[0].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema190.anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data8, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + } + var valid7 = _errs25 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data7.serviceId !== undefined) { + let data9 = data7.serviceId; + const _errs27 = errors; + if (typeof data9 !== 'string') { + const err16 = { + instancePath: + instancePath + '/services/' + i0 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema190.anyOf[0].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema190.anyOf[0].allOf[1].properties.services + .items.properties.serviceId, + data: data9, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data7.remoteServiceId !== undefined) { + let data10 = data7.remoteServiceId; + const _errs29 = errors; + if (typeof data10 !== 'string') { + const err17 = { + instancePath: + instancePath + + '/services/' + + i0 + + '/remoteServiceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema190.anyOf[0].allOf[1].properties.services + .items.properties.remoteServiceId.type, + parentSchema: + schema190.anyOf[0].allOf[1].properties.services + .items.properties.remoteServiceId, + data: data10, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + const err18 = { + instancePath: instancePath + '/services/' + i0, + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema190.anyOf[0].allOf[1].properties.services.items + .type, + parentSchema: + schema190.anyOf[0].allOf[1].properties.services.items, + data: data7, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } + var valid6 = _errs22 === errors; + if (!valid6) { + break; + } + } + } else { + const err19 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema190.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema190.anyOf[0].allOf[1].properties.services, + data: data6, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + } + var valid5 = _errs20 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data.tiebreaker !== undefined) { + let data11 = data.tiebreaker; + const _errs31 = errors; + if (typeof data11 !== 'boolean') { + const err20 = { + instancePath: instancePath + '/tiebreaker', + schemaPath: '#/anyOf/0/allOf/1/properties/tiebreaker/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema190.anyOf[0].allOf[1].properties.tiebreaker.type, + parentSchema: schema190.anyOf[0].allOf[1].properties.tiebreaker, + data: data11, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + var valid5 = _errs31 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data.config !== undefined) { + let data12 = data.config; + const _errs33 = errors; + if (errors === _errs33) { + if ( + data12 && + typeof data12 == 'object' && + !Array.isArray(data12) + ) { + } else { + const err21 = { + instancePath: instancePath + '/config', + schemaPath: '#/anyOf/0/allOf/1/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema190.anyOf[0].allOf[1].properties.config.type, + parentSchema: schema190.anyOf[0].allOf[1].properties.config, + data: data12, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + var valid5 = _errs33 === errors; + } else { + var valid5 = true; + } + } + } + } + } + } + } + } else { + const err22 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema190.anyOf[0].allOf[1].type, + parentSchema: schema190.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } + var valid1 = _errs13 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs36 = errors; + const _errs37 = errors; + const _errs38 = errors; + if (errors === _errs38) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing4; + if (data.messageType === undefined && (missing4 = 'messageType')) { + const err23 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: "must have required property '" + missing4 + "'", + schema: schema190.anyOf[1].allOf[0].allOf[0].required, + parentSchema: schema190.anyOf[1].allOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data13 = data.messageType; + if (typeof data13 !== 'string') { + const err24 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/1/allOf/0/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema190.anyOf[1].allOf[0].allOf[0].properties.messageType.type, + parentSchema: schema190.anyOf[1].allOf[0].allOf[0].properties.messageType, + data: data13, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + } + } + } else { + const err25 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema190.anyOf[1].allOf[0].allOf[0].type, + parentSchema: schema190.anyOf[1].allOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + var valid9 = _errs38 === errors; + if (valid9) { + const _errs43 = errors; + if (errors === _errs43) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing5; + if ( + (data.messageType === undefined && (missing5 = 'messageType')) || + (data.command === undefined && (missing5 = 'command')) + ) { + const err26 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: "must have required property '" + missing5 + "'", + schema: schema190.anyOf[1].allOf[0].allOf[1].required, + parentSchema: schema190.anyOf[1].allOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data14 = data.messageType; + const _errs45 = errors; + if ('command' !== data14) { + const err27 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/1/allOf/0/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'command' }, + message: 'must be equal to constant', + schema: 'command', + parentSchema: + schema190.anyOf[1].allOf[0].allOf[1].properties.messageType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.command !== undefined) { + let data15 = data.command; + const _errs46 = errors; + if (typeof data15 !== 'string') { + const err28 = { + instancePath: instancePath + '/command', + schemaPath: '#/anyOf/1/allOf/0/allOf/1/properties/command/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema190.anyOf[1].allOf[0].allOf[1].properties.command.type, + parentSchema: schema190.anyOf[1].allOf[0].allOf[1].properties.command, + data: data15, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + var valid11 = _errs46 === errors; + } else { + var valid11 = true; + } + } + } + } else { + const err29 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema190.anyOf[1].allOf[0].allOf[1].type, + parentSchema: schema190.anyOf[1].allOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + } + var valid9 = _errs43 === errors; + } + var valid8 = _errs37 === errors; + if (valid8) { + const _errs48 = errors; + if (errors === _errs48) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.command === undefined && (missing6 = 'command')) || + (data.connectionUrl === undefined && (missing6 = 'connectionUrl')) + ) { + const err30 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema190.anyOf[1].allOf[1].required, + parentSchema: schema190.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } else { + if (data.command !== undefined) { + let data16 = data.command; + const _errs50 = errors; + if ('closePeerconnection' !== data16) { + const err31 = { + instancePath: instancePath + '/command', + schemaPath: '#/anyOf/1/allOf/1/properties/command/const', + keyword: 'const', + params: { allowedValue: 'closePeerconnection' }, + message: 'must be equal to constant', + schema: 'closePeerconnection', + parentSchema: schema190.anyOf[1].allOf[1].properties.command, + data: data16, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + var valid12 = _errs50 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if (data.connectionUrl !== undefined) { + let data17 = data.connectionUrl; + const _errs51 = errors; + if (errors === _errs51) { + if (errors === _errs51) { + if (typeof data17 === 'string') { + if (!formats0(data17)) { + const err32 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/anyOf/1/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema190.anyOf[1].allOf[1].properties.connectionUrl, + data: data17, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } else { + const err33 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/anyOf/1/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema190.anyOf[1].allOf[1].properties.connectionUrl.type, + parentSchema: + schema190.anyOf[1].allOf[1].properties.connectionUrl, + data: data17, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + } + } + var valid12 = _errs51 === errors; + } else { + var valid12 = true; + } + } + } + } else { + const err34 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema190.anyOf[1].allOf[1].type, + parentSchema: schema190.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + } + var valid8 = _errs48 === errors; + } + var _valid0 = _errs36 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs53 = errors; + const _errs54 = errors; + if (errors === _errs54) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing7; + if (data.messageType === undefined && (missing7 = 'messageType')) { + const err35 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: "must have required property '" + missing7 + "'", + schema: schema190.anyOf[2].allOf[0].required, + parentSchema: schema190.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data18 = data.messageType; + if (typeof data18 !== 'string') { + const err36 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/2/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema190.anyOf[2].allOf[0].properties.messageType.type, + parentSchema: schema190.anyOf[2].allOf[0].properties.messageType, + data: data18, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + } + } else { + const err37 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema190.anyOf[2].allOf[0].type, + parentSchema: schema190.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + var valid13 = _errs54 === errors; + if (valid13) { + const _errs59 = errors; + if (errors === _errs59) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing8; + if ( + (data.messageType === undefined && (missing8 = 'messageType')) || + (data.signalingType === undefined && (missing8 = 'signalingType')) || + (data.connectionUrl === undefined && (missing8 = 'connectionUrl')) || + (data.content === undefined && (missing8 = 'content')) + ) { + const err38 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: "must have required property '" + missing8 + "'", + schema: schema190.anyOf[2].allOf[1].required, + parentSchema: schema190.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data19 = data.messageType; + const _errs61 = errors; + if ('signaling' !== data19) { + const err39 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/2/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'signaling' }, + message: 'must be equal to constant', + schema: 'signaling', + parentSchema: schema190.anyOf[2].allOf[1].properties.messageType, + data: data19, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + var valid15 = _errs61 === errors; + } else { + var valid15 = true; + } + if (valid15) { + if (data.signalingType !== undefined) { + let data20 = data.signalingType; + const _errs62 = errors; + if (typeof data20 !== 'string') { + const err40 = { + instancePath: instancePath + '/signalingType', + schemaPath: '#/anyOf/2/allOf/1/properties/signalingType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema190.anyOf[2].allOf[1].properties.signalingType.type, + parentSchema: schema190.anyOf[2].allOf[1].properties.signalingType, + data: data20, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + var valid15 = _errs62 === errors; + } else { + var valid15 = true; + } + if (valid15) { + if (data.connectionUrl !== undefined) { + let data21 = data.connectionUrl; + const _errs64 = errors; + if (errors === _errs64) { + if (errors === _errs64) { + if (typeof data21 === 'string') { + if (!formats0(data21)) { + const err41 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: + '#/anyOf/2/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema190.anyOf[2].allOf[1].properties.connectionUrl, + data: data21, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } else { + const err42 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema190.anyOf[2].allOf[1].properties.connectionUrl.type, + parentSchema: + schema190.anyOf[2].allOf[1].properties.connectionUrl, + data: data21, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + } + var valid15 = _errs64 === errors; + } else { + var valid15 = true; + } + if (valid15) { + if (data.content !== undefined) { + let data22 = data.content; + const _errs66 = errors; + if (errors === _errs66) { + if ( + data22 && + typeof data22 == 'object' && + !Array.isArray(data22) + ) { + } else { + const err43 = { + instancePath: instancePath + '/content', + schemaPath: '#/anyOf/2/allOf/1/properties/content/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema190.anyOf[2].allOf[1].properties.content.type, + parentSchema: schema190.anyOf[2].allOf[1].properties.content, + data: data22, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + } + var valid15 = _errs66 === errors; + } else { + var valid15 = true; + } + } + } + } + } + } else { + const err44 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema190.anyOf[2].allOf[1].type, + parentSchema: schema190.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var valid13 = _errs59 === errors; + } + var _valid0 = _errs53 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs69 = errors; + const _errs70 = errors; + if (errors === _errs70) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if (data.messageType === undefined && (missing9 = 'messageType')) { + const err45 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema190.anyOf[3].allOf[0].required, + parentSchema: schema190.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data23 = data.messageType; + if (typeof data23 !== 'string') { + const err46 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/3/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema190.anyOf[3].allOf[0].properties.messageType.type, + parentSchema: schema190.anyOf[3].allOf[0].properties.messageType, + data: data23, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } + } + } else { + const err47 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema190.anyOf[3].allOf[0].type, + parentSchema: schema190.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var valid16 = _errs70 === errors; + if (valid16) { + const _errs75 = errors; + if (errors === _errs75) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing10; + if ( + (data.messageType === undefined && (missing10 = 'messageType')) || + (data.configuration === undefined && (missing10 = 'configuration')) + ) { + const err48 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: "must have required property '" + missing10 + "'", + schema: schema190.anyOf[3].allOf[1].required, + parentSchema: schema190.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data24 = data.messageType; + const _errs77 = errors; + if ('configuration' !== data24) { + const err49 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/3/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'configuration' }, + message: 'must be equal to constant', + schema: 'configuration', + parentSchema: schema190.anyOf[3].allOf[1].properties.messageType, + data: data24, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + var valid18 = _errs77 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data.configuration !== undefined) { + let data25 = data.configuration; + const _errs78 = errors; + if (errors === _errs78) { + if (data25 && typeof data25 == 'object' && !Array.isArray(data25)) { + } else { + const err50 = { + instancePath: instancePath + '/configuration', + schemaPath: '#/anyOf/3/allOf/1/properties/configuration/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema190.anyOf[3].allOf[1].properties.configuration.type, + parentSchema: + schema190.anyOf[3].allOf[1].properties.configuration, + data: data25, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + } + var valid18 = _errs78 === errors; + } else { + var valid18 = true; + } + } + } + } else { + const err51 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema190.anyOf[3].allOf[1].type, + parentSchema: schema190.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } + var valid16 = _errs75 === errors; + } + var _valid0 = _errs69 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs81 = errors; + const _errs82 = errors; + if (errors === _errs82) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing11; + if (data.messageType === undefined && (missing11 = 'messageType')) { + const err52 = { + instancePath, + schemaPath: '#/anyOf/4/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: "must have required property '" + missing11 + "'", + schema: schema190.anyOf[4].allOf[0].required, + parentSchema: schema190.anyOf[4].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data26 = data.messageType; + if (typeof data26 !== 'string') { + const err53 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/4/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema190.anyOf[4].allOf[0].properties.messageType.type, + parentSchema: schema190.anyOf[4].allOf[0].properties.messageType, + data: data26, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + } + } else { + const err54 = { + instancePath, + schemaPath: '#/anyOf/4/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema190.anyOf[4].allOf[0].type, + parentSchema: schema190.anyOf[4].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + var valid19 = _errs82 === errors; + if (valid19) { + const _errs87 = errors; + if (errors === _errs87) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if ( + (data.messageType === undefined && (missing12 = 'messageType')) || + (data.status === undefined && (missing12 = 'status')) + ) { + const err55 = { + instancePath, + schemaPath: '#/anyOf/4/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema190.anyOf[4].allOf[1].required, + parentSchema: schema190.anyOf[4].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data27 = data.messageType; + const _errs89 = errors; + if ('experiment-status-changed' !== data27) { + const err56 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/4/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'experiment-status-changed' }, + message: 'must be equal to constant', + schema: 'experiment-status-changed', + parentSchema: schema190.anyOf[4].allOf[1].properties.messageType, + data: data27, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + var valid21 = _errs89 === errors; + } else { + var valid21 = true; + } + if (valid21) { + if (data.status !== undefined) { + let data28 = data.status; + const _errs90 = errors; + if (typeof data28 !== 'string') { + const err57 = { + instancePath: instancePath + '/status', + schemaPath: '#/anyOf/4/allOf/1/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema190.anyOf[4].allOf[1].properties.status.type, + parentSchema: schema190.anyOf[4].allOf[1].properties.status, + data: data28, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + var valid21 = _errs90 === errors; + } else { + var valid21 = true; + } + if (valid21) { + if (data.message !== undefined) { + let data29 = data.message; + const _errs92 = errors; + if (typeof data29 !== 'string') { + const err58 = { + instancePath: instancePath + '/message', + schemaPath: '#/anyOf/4/allOf/1/properties/message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema190.anyOf[4].allOf[1].properties.message.type, + parentSchema: schema190.anyOf[4].allOf[1].properties.message, + data: data29, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + var valid21 = _errs92 === errors; + } else { + var valid21 = true; + } + } + } + } + } else { + const err59 = { + instancePath, + schemaPath: '#/anyOf/4/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema190.anyOf[4].allOf[1].type, + parentSchema: schema190.anyOf[4].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } + var valid19 = _errs87 === errors; + } + var _valid0 = _errs81 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs94 = errors; + const _errs95 = errors; + if (errors === _errs95) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing13; + if (data.messageType === undefined && (missing13 = 'messageType')) { + const err60 = { + instancePath, + schemaPath: '#/anyOf/5/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: "must have required property '" + missing13 + "'", + schema: schema190.anyOf[5].allOf[0].required, + parentSchema: schema190.anyOf[5].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data30 = data.messageType; + if (typeof data30 !== 'string') { + const err61 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/5/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema190.anyOf[5].allOf[0].properties.messageType.type, + parentSchema: schema190.anyOf[5].allOf[0].properties.messageType, + data: data30, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + } + } + } else { + const err62 = { + instancePath, + schemaPath: '#/anyOf/5/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema190.anyOf[5].allOf[0].type, + parentSchema: schema190.anyOf[5].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + } + var valid22 = _errs95 === errors; + if (valid22) { + const _errs100 = errors; + if (errors === _errs100) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing14; + if ( + (data.messageType === undefined && (missing14 = 'messageType')) || + (data.content === undefined && (missing14 = 'content')) + ) { + const err63 = { + instancePath, + schemaPath: '#/anyOf/5/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing14 }, + message: "must have required property '" + missing14 + "'", + schema: schema190.anyOf[5].allOf[1].required, + parentSchema: schema190.anyOf[5].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data31 = data.messageType; + const _errs102 = errors; + if ('logging' !== data31) { + const err64 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/5/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'logging' }, + message: 'must be equal to constant', + schema: 'logging', + parentSchema: + schema190.anyOf[5].allOf[1].properties.messageType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + var valid24 = _errs102 === errors; + } else { + var valid24 = true; + } + if (valid24) { + if (data.content !== undefined) { + let data32 = data.content; + const _errs103 = errors; + if (errors === _errs103) { + if ( + data32 && + typeof data32 == 'object' && + !Array.isArray(data32) + ) { + } else { + const err65 = { + instancePath: instancePath + '/content', + schemaPath: '#/anyOf/5/allOf/1/properties/content/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema190.anyOf[5].allOf[1].properties.content.type, + parentSchema: + schema190.anyOf[5].allOf[1].properties.content, + data: data32, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid24 = _errs103 === errors; + } else { + var valid24 = true; + } + } + } + } else { + const err66 = { + instancePath, + schemaPath: '#/anyOf/5/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema190.anyOf[5].allOf[1].type, + parentSchema: schema190.anyOf[5].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid22 = _errs100 === errors; + } + var _valid0 = _errs94 === errors; + valid0 = valid0 || _valid0; + } + } + } + } + } + if (!valid0) { + const err67 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema190.anyOf, + parentSchema: schema190, + data, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + validate205.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate205.errors = vErrors; + return errors === 0; +} +exports.validateSendSignalingMessageBodyResponse = validate206; +const schema191 = { + title: 'Sig Message', + anyOf: [ + { + title: 'Create Peerconnection Message', + allOf: [ + { + title: 'Command Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'command' }, + command: { type: 'string' }, + }, + required: ['messageType', 'command'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + command: { const: 'createPeerconnection' }, + connectionType: { type: 'string', enum: ['webrtc', 'websocket', 'local'] }, + connectionUrl: { type: 'string', format: 'uri' }, + services: { + type: 'array', + items: { + type: 'object', + required: ['serviceType', 'serviceId', 'remoteServiceId'], + title: 'Service Config', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + additionalProperties: true, + }, + }, + tiebreaker: { type: 'boolean' }, + config: { type: 'object', additionalProperties: true }, + }, + required: [ + 'command', + 'connectionType', + 'connectionUrl', + 'services', + 'tiebreaker', + ], + }, + ], + 'x-typeguard': true, + }, + { + title: 'Close Peerconnection Message', + allOf: [ + { + title: 'Command Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'command' }, + command: { type: 'string' }, + }, + required: ['messageType', 'command'], + }, + ], + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + command: { const: 'closePeerconnection' }, + connectionUrl: { type: 'string', format: 'uri' }, + }, + required: ['command', 'connectionUrl'], + }, + ], + 'x-typeguard': true, + }, + { + title: 'Signaling Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'signaling' }, + signalingType: { type: 'string' }, + connectionUrl: { type: 'string', format: 'uri' }, + content: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'signalingType', 'connectionUrl', 'content'], + }, + ], + 'x-typeguard': true, + }, + { + title: 'Configuration Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'configuration' }, + configuration: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'configuration'], + }, + ], + 'x-typeguard': true, + }, + { + title: 'Experiment Status Changed Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'experiment-status-changed' }, + status: { type: 'string' }, + message: { type: 'string' }, + }, + required: ['messageType', 'status'], + }, + ], + 'x-typeguard': true, + }, + { + title: 'Logging Message', + allOf: [ + { + title: 'Message', + type: 'object', + properties: { messageType: { type: 'string' } }, + required: ['messageType'], + additionalProperties: true, + 'x-typeguard': true, + }, + { + type: 'object', + properties: { + messageType: { const: 'logging' }, + content: { type: 'object', additionalProperties: true }, + }, + required: ['messageType', 'content'], + }, + ], + 'x-typeguard': true, + }, + ], + 'x-standalone': false, + 'x-name': 'sendSignalingMessageBodyResponse', + 'x-location': + '#/paths//devices/{device_id}/signaling/post/requestBody/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate206( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + const _errs2 = errors; + const _errs3 = errors; + if (errors === _errs3) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.messageType === undefined && (missing0 = 'messageType')) { + const err0 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema191.anyOf[0].allOf[0].allOf[0].required, + parentSchema: schema191.anyOf[0].allOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data0 = data.messageType; + if (typeof data0 !== 'string') { + const err1 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/0/allOf/0/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema191.anyOf[0].allOf[0].allOf[0].properties.messageType.type, + parentSchema: schema191.anyOf[0].allOf[0].allOf[0].properties.messageType, + data: data0, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } + } + } else { + const err2 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema191.anyOf[0].allOf[0].allOf[0].type, + parentSchema: schema191.anyOf[0].allOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + var valid2 = _errs3 === errors; + if (valid2) { + const _errs8 = errors; + if (errors === _errs8) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if ( + (data.messageType === undefined && (missing1 = 'messageType')) || + (data.command === undefined && (missing1 = 'command')) + ) { + const err3 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema191.anyOf[0].allOf[0].allOf[1].required, + parentSchema: schema191.anyOf[0].allOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data1 = data.messageType; + const _errs10 = errors; + if ('command' !== data1) { + const err4 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/0/allOf/0/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'command' }, + message: 'must be equal to constant', + schema: 'command', + parentSchema: schema191.anyOf[0].allOf[0].allOf[1].properties.messageType, + data: data1, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + var valid4 = _errs10 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data.command !== undefined) { + let data2 = data.command; + const _errs11 = errors; + if (typeof data2 !== 'string') { + const err5 = { + instancePath: instancePath + '/command', + schemaPath: '#/anyOf/0/allOf/0/allOf/1/properties/command/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema191.anyOf[0].allOf[0].allOf[1].properties.command.type, + parentSchema: schema191.anyOf[0].allOf[0].allOf[1].properties.command, + data: data2, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + var valid4 = _errs11 === errors; + } else { + var valid4 = true; + } + } + } + } else { + const err6 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema191.anyOf[0].allOf[0].allOf[1].type, + parentSchema: schema191.anyOf[0].allOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + var valid2 = _errs8 === errors; + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs13 = errors; + if (errors === _errs13) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing2; + if ( + (data.command === undefined && (missing2 = 'command')) || + (data.connectionType === undefined && (missing2 = 'connectionType')) || + (data.connectionUrl === undefined && (missing2 = 'connectionUrl')) || + (data.services === undefined && (missing2 = 'services')) || + (data.tiebreaker === undefined && (missing2 = 'tiebreaker')) + ) { + const err7 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema191.anyOf[0].allOf[1].required, + parentSchema: schema191.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } else { + if (data.command !== undefined) { + let data3 = data.command; + const _errs15 = errors; + if ('createPeerconnection' !== data3) { + const err8 = { + instancePath: instancePath + '/command', + schemaPath: '#/anyOf/0/allOf/1/properties/command/const', + keyword: 'const', + params: { allowedValue: 'createPeerconnection' }, + message: 'must be equal to constant', + schema: 'createPeerconnection', + parentSchema: schema191.anyOf[0].allOf[1].properties.command, + data: data3, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + var valid5 = _errs15 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data.connectionType !== undefined) { + let data4 = data.connectionType; + const _errs16 = errors; + if (typeof data4 !== 'string') { + const err9 = { + instancePath: instancePath + '/connectionType', + schemaPath: '#/anyOf/0/allOf/1/properties/connectionType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema191.anyOf[0].allOf[1].properties.connectionType.type, + parentSchema: schema191.anyOf[0].allOf[1].properties.connectionType, + data: data4, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + if (!(data4 === 'webrtc' || data4 === 'websocket' || data4 === 'local')) { + const err10 = { + instancePath: instancePath + '/connectionType', + schemaPath: '#/anyOf/0/allOf/1/properties/connectionType/enum', + keyword: 'enum', + params: { + allowedValues: + schema191.anyOf[0].allOf[1].properties.connectionType.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema191.anyOf[0].allOf[1].properties.connectionType.enum, + parentSchema: schema191.anyOf[0].allOf[1].properties.connectionType, + data: data4, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + var valid5 = _errs16 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data.connectionUrl !== undefined) { + let data5 = data.connectionUrl; + const _errs18 = errors; + if (errors === _errs18) { + if (errors === _errs18) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + const err11 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema191.anyOf[0].allOf[1].properties.connectionUrl, + data: data5, + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } else { + const err12 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/anyOf/0/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema191.anyOf[0].allOf[1].properties.connectionUrl.type, + parentSchema: + schema191.anyOf[0].allOf[1].properties.connectionUrl, + data: data5, + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + } + } + var valid5 = _errs18 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data.services !== undefined) { + let data6 = data.services; + const _errs20 = errors; + if (errors === _errs20) { + if (Array.isArray(data6)) { + var valid6 = true; + const len0 = data6.length; + for (let i0 = 0; i0 < len0; i0++) { + let data7 = data6[i0]; + const _errs22 = errors; + if (errors === _errs22) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing3; + if ( + (data7.serviceType === undefined && + (missing3 = 'serviceType')) || + (data7.serviceId === undefined && + (missing3 = 'serviceId')) || + (data7.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + const err13 = { + instancePath: instancePath + '/services/' + i0, + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: + schema191.anyOf[0].allOf[1].properties.services.items + .required, + parentSchema: + schema191.anyOf[0].allOf[1].properties.services.items, + data: data7, + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } else { + if (data7.serviceType !== undefined) { + let data8 = data7.serviceType; + const _errs25 = errors; + if (errors === _errs25) { + if (errors === _errs25) { + if (typeof data8 === 'string') { + if (!formats0(data8)) { + const err14 = { + instancePath: + instancePath + + '/services/' + + i0 + + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema191.anyOf[0].allOf[1].properties + .services.items.properties.serviceType, + data: data8, + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + } else { + const err15 = { + instancePath: + instancePath + + '/services/' + + i0 + + '/serviceType', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema191.anyOf[0].allOf[1].properties.services + .items.properties.serviceType.type, + parentSchema: + schema191.anyOf[0].allOf[1].properties.services + .items.properties.serviceType, + data: data8, + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + } + var valid7 = _errs25 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data7.serviceId !== undefined) { + let data9 = data7.serviceId; + const _errs27 = errors; + if (typeof data9 !== 'string') { + const err16 = { + instancePath: + instancePath + '/services/' + i0 + '/serviceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema191.anyOf[0].allOf[1].properties.services + .items.properties.serviceId.type, + parentSchema: + schema191.anyOf[0].allOf[1].properties.services + .items.properties.serviceId, + data: data9, + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data7.remoteServiceId !== undefined) { + let data10 = data7.remoteServiceId; + const _errs29 = errors; + if (typeof data10 !== 'string') { + const err17 = { + instancePath: + instancePath + + '/services/' + + i0 + + '/remoteServiceId', + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema191.anyOf[0].allOf[1].properties.services + .items.properties.remoteServiceId.type, + parentSchema: + schema191.anyOf[0].allOf[1].properties.services + .items.properties.remoteServiceId, + data: data10, + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var valid7 = _errs29 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + const err18 = { + instancePath: instancePath + '/services/' + i0, + schemaPath: + '#/anyOf/0/allOf/1/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema191.anyOf[0].allOf[1].properties.services.items + .type, + parentSchema: + schema191.anyOf[0].allOf[1].properties.services.items, + data: data7, + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + } + var valid6 = _errs22 === errors; + if (!valid6) { + break; + } + } + } else { + const err19 = { + instancePath: instancePath + '/services', + schemaPath: '#/anyOf/0/allOf/1/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema191.anyOf[0].allOf[1].properties.services.type, + parentSchema: schema191.anyOf[0].allOf[1].properties.services, + data: data6, + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + } + var valid5 = _errs20 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data.tiebreaker !== undefined) { + let data11 = data.tiebreaker; + const _errs31 = errors; + if (typeof data11 !== 'boolean') { + const err20 = { + instancePath: instancePath + '/tiebreaker', + schemaPath: '#/anyOf/0/allOf/1/properties/tiebreaker/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema191.anyOf[0].allOf[1].properties.tiebreaker.type, + parentSchema: schema191.anyOf[0].allOf[1].properties.tiebreaker, + data: data11, + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + var valid5 = _errs31 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data.config !== undefined) { + let data12 = data.config; + const _errs33 = errors; + if (errors === _errs33) { + if ( + data12 && + typeof data12 == 'object' && + !Array.isArray(data12) + ) { + } else { + const err21 = { + instancePath: instancePath + '/config', + schemaPath: '#/anyOf/0/allOf/1/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema191.anyOf[0].allOf[1].properties.config.type, + parentSchema: schema191.anyOf[0].allOf[1].properties.config, + data: data12, + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + var valid5 = _errs33 === errors; + } else { + var valid5 = true; + } + } + } + } + } + } + } + } else { + const err22 = { + instancePath, + schemaPath: '#/anyOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema191.anyOf[0].allOf[1].type, + parentSchema: schema191.anyOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } + var valid1 = _errs13 === errors; + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs36 = errors; + const _errs37 = errors; + const _errs38 = errors; + if (errors === _errs38) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing4; + if (data.messageType === undefined && (missing4 = 'messageType')) { + const err23 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing4 }, + message: "must have required property '" + missing4 + "'", + schema: schema191.anyOf[1].allOf[0].allOf[0].required, + parentSchema: schema191.anyOf[1].allOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data13 = data.messageType; + if (typeof data13 !== 'string') { + const err24 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/1/allOf/0/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema191.anyOf[1].allOf[0].allOf[0].properties.messageType.type, + parentSchema: schema191.anyOf[1].allOf[0].allOf[0].properties.messageType, + data: data13, + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + } + } + } else { + const err25 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema191.anyOf[1].allOf[0].allOf[0].type, + parentSchema: schema191.anyOf[1].allOf[0].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + var valid9 = _errs38 === errors; + if (valid9) { + const _errs43 = errors; + if (errors === _errs43) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing5; + if ( + (data.messageType === undefined && (missing5 = 'messageType')) || + (data.command === undefined && (missing5 = 'command')) + ) { + const err26 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing5 }, + message: "must have required property '" + missing5 + "'", + schema: schema191.anyOf[1].allOf[0].allOf[1].required, + parentSchema: schema191.anyOf[1].allOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data14 = data.messageType; + const _errs45 = errors; + if ('command' !== data14) { + const err27 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/1/allOf/0/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'command' }, + message: 'must be equal to constant', + schema: 'command', + parentSchema: + schema191.anyOf[1].allOf[0].allOf[1].properties.messageType, + data: data14, + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + var valid11 = _errs45 === errors; + } else { + var valid11 = true; + } + if (valid11) { + if (data.command !== undefined) { + let data15 = data.command; + const _errs46 = errors; + if (typeof data15 !== 'string') { + const err28 = { + instancePath: instancePath + '/command', + schemaPath: '#/anyOf/1/allOf/0/allOf/1/properties/command/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema191.anyOf[1].allOf[0].allOf[1].properties.command.type, + parentSchema: schema191.anyOf[1].allOf[0].allOf[1].properties.command, + data: data15, + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + var valid11 = _errs46 === errors; + } else { + var valid11 = true; + } + } + } + } else { + const err29 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/0/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema191.anyOf[1].allOf[0].allOf[1].type, + parentSchema: schema191.anyOf[1].allOf[0].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + } + var valid9 = _errs43 === errors; + } + var valid8 = _errs37 === errors; + if (valid8) { + const _errs48 = errors; + if (errors === _errs48) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing6; + if ( + (data.command === undefined && (missing6 = 'command')) || + (data.connectionUrl === undefined && (missing6 = 'connectionUrl')) + ) { + const err30 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing6 }, + message: "must have required property '" + missing6 + "'", + schema: schema191.anyOf[1].allOf[1].required, + parentSchema: schema191.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } else { + if (data.command !== undefined) { + let data16 = data.command; + const _errs50 = errors; + if ('closePeerconnection' !== data16) { + const err31 = { + instancePath: instancePath + '/command', + schemaPath: '#/anyOf/1/allOf/1/properties/command/const', + keyword: 'const', + params: { allowedValue: 'closePeerconnection' }, + message: 'must be equal to constant', + schema: 'closePeerconnection', + parentSchema: schema191.anyOf[1].allOf[1].properties.command, + data: data16, + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + var valid12 = _errs50 === errors; + } else { + var valid12 = true; + } + if (valid12) { + if (data.connectionUrl !== undefined) { + let data17 = data.connectionUrl; + const _errs51 = errors; + if (errors === _errs51) { + if (errors === _errs51) { + if (typeof data17 === 'string') { + if (!formats0(data17)) { + const err32 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/anyOf/1/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema191.anyOf[1].allOf[1].properties.connectionUrl, + data: data17, + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } else { + const err33 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/anyOf/1/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema191.anyOf[1].allOf[1].properties.connectionUrl.type, + parentSchema: + schema191.anyOf[1].allOf[1].properties.connectionUrl, + data: data17, + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + } + } + var valid12 = _errs51 === errors; + } else { + var valid12 = true; + } + } + } + } else { + const err34 = { + instancePath, + schemaPath: '#/anyOf/1/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema191.anyOf[1].allOf[1].type, + parentSchema: schema191.anyOf[1].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + } + var valid8 = _errs48 === errors; + } + var _valid0 = _errs36 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs53 = errors; + const _errs54 = errors; + if (errors === _errs54) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing7; + if (data.messageType === undefined && (missing7 = 'messageType')) { + const err35 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing7 }, + message: "must have required property '" + missing7 + "'", + schema: schema191.anyOf[2].allOf[0].required, + parentSchema: schema191.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data18 = data.messageType; + if (typeof data18 !== 'string') { + const err36 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/2/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema191.anyOf[2].allOf[0].properties.messageType.type, + parentSchema: schema191.anyOf[2].allOf[0].properties.messageType, + data: data18, + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + } + } else { + const err37 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema191.anyOf[2].allOf[0].type, + parentSchema: schema191.anyOf[2].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + var valid13 = _errs54 === errors; + if (valid13) { + const _errs59 = errors; + if (errors === _errs59) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing8; + if ( + (data.messageType === undefined && (missing8 = 'messageType')) || + (data.signalingType === undefined && (missing8 = 'signalingType')) || + (data.connectionUrl === undefined && (missing8 = 'connectionUrl')) || + (data.content === undefined && (missing8 = 'content')) + ) { + const err38 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing8 }, + message: "must have required property '" + missing8 + "'", + schema: schema191.anyOf[2].allOf[1].required, + parentSchema: schema191.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data19 = data.messageType; + const _errs61 = errors; + if ('signaling' !== data19) { + const err39 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/2/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'signaling' }, + message: 'must be equal to constant', + schema: 'signaling', + parentSchema: schema191.anyOf[2].allOf[1].properties.messageType, + data: data19, + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + var valid15 = _errs61 === errors; + } else { + var valid15 = true; + } + if (valid15) { + if (data.signalingType !== undefined) { + let data20 = data.signalingType; + const _errs62 = errors; + if (typeof data20 !== 'string') { + const err40 = { + instancePath: instancePath + '/signalingType', + schemaPath: '#/anyOf/2/allOf/1/properties/signalingType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema191.anyOf[2].allOf[1].properties.signalingType.type, + parentSchema: schema191.anyOf[2].allOf[1].properties.signalingType, + data: data20, + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + var valid15 = _errs62 === errors; + } else { + var valid15 = true; + } + if (valid15) { + if (data.connectionUrl !== undefined) { + let data21 = data.connectionUrl; + const _errs64 = errors; + if (errors === _errs64) { + if (errors === _errs64) { + if (typeof data21 === 'string') { + if (!formats0(data21)) { + const err41 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: + '#/anyOf/2/allOf/1/properties/connectionUrl/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema191.anyOf[2].allOf[1].properties.connectionUrl, + data: data21, + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } else { + const err42 = { + instancePath: instancePath + '/connectionUrl', + schemaPath: '#/anyOf/2/allOf/1/properties/connectionUrl/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema191.anyOf[2].allOf[1].properties.connectionUrl.type, + parentSchema: + schema191.anyOf[2].allOf[1].properties.connectionUrl, + data: data21, + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + } + var valid15 = _errs64 === errors; + } else { + var valid15 = true; + } + if (valid15) { + if (data.content !== undefined) { + let data22 = data.content; + const _errs66 = errors; + if (errors === _errs66) { + if ( + data22 && + typeof data22 == 'object' && + !Array.isArray(data22) + ) { + } else { + const err43 = { + instancePath: instancePath + '/content', + schemaPath: '#/anyOf/2/allOf/1/properties/content/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema191.anyOf[2].allOf[1].properties.content.type, + parentSchema: schema191.anyOf[2].allOf[1].properties.content, + data: data22, + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + } + var valid15 = _errs66 === errors; + } else { + var valid15 = true; + } + } + } + } + } + } else { + const err44 = { + instancePath, + schemaPath: '#/anyOf/2/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema191.anyOf[2].allOf[1].type, + parentSchema: schema191.anyOf[2].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var valid13 = _errs59 === errors; + } + var _valid0 = _errs53 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs69 = errors; + const _errs70 = errors; + if (errors === _errs70) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing9; + if (data.messageType === undefined && (missing9 = 'messageType')) { + const err45 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing9 }, + message: "must have required property '" + missing9 + "'", + schema: schema191.anyOf[3].allOf[0].required, + parentSchema: schema191.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data23 = data.messageType; + if (typeof data23 !== 'string') { + const err46 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/3/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema191.anyOf[3].allOf[0].properties.messageType.type, + parentSchema: schema191.anyOf[3].allOf[0].properties.messageType, + data: data23, + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + } + } + } else { + const err47 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema191.anyOf[3].allOf[0].type, + parentSchema: schema191.anyOf[3].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var valid16 = _errs70 === errors; + if (valid16) { + const _errs75 = errors; + if (errors === _errs75) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing10; + if ( + (data.messageType === undefined && (missing10 = 'messageType')) || + (data.configuration === undefined && (missing10 = 'configuration')) + ) { + const err48 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing10 }, + message: "must have required property '" + missing10 + "'", + schema: schema191.anyOf[3].allOf[1].required, + parentSchema: schema191.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data24 = data.messageType; + const _errs77 = errors; + if ('configuration' !== data24) { + const err49 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/3/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'configuration' }, + message: 'must be equal to constant', + schema: 'configuration', + parentSchema: schema191.anyOf[3].allOf[1].properties.messageType, + data: data24, + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + var valid18 = _errs77 === errors; + } else { + var valid18 = true; + } + if (valid18) { + if (data.configuration !== undefined) { + let data25 = data.configuration; + const _errs78 = errors; + if (errors === _errs78) { + if (data25 && typeof data25 == 'object' && !Array.isArray(data25)) { + } else { + const err50 = { + instancePath: instancePath + '/configuration', + schemaPath: '#/anyOf/3/allOf/1/properties/configuration/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema191.anyOf[3].allOf[1].properties.configuration.type, + parentSchema: + schema191.anyOf[3].allOf[1].properties.configuration, + data: data25, + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + } + var valid18 = _errs78 === errors; + } else { + var valid18 = true; + } + } + } + } else { + const err51 = { + instancePath, + schemaPath: '#/anyOf/3/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema191.anyOf[3].allOf[1].type, + parentSchema: schema191.anyOf[3].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } + var valid16 = _errs75 === errors; + } + var _valid0 = _errs69 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs81 = errors; + const _errs82 = errors; + if (errors === _errs82) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing11; + if (data.messageType === undefined && (missing11 = 'messageType')) { + const err52 = { + instancePath, + schemaPath: '#/anyOf/4/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing11 }, + message: "must have required property '" + missing11 + "'", + schema: schema191.anyOf[4].allOf[0].required, + parentSchema: schema191.anyOf[4].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data26 = data.messageType; + if (typeof data26 !== 'string') { + const err53 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/4/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema191.anyOf[4].allOf[0].properties.messageType.type, + parentSchema: schema191.anyOf[4].allOf[0].properties.messageType, + data: data26, + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + } + } else { + const err54 = { + instancePath, + schemaPath: '#/anyOf/4/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema191.anyOf[4].allOf[0].type, + parentSchema: schema191.anyOf[4].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + var valid19 = _errs82 === errors; + if (valid19) { + const _errs87 = errors; + if (errors === _errs87) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing12; + if ( + (data.messageType === undefined && (missing12 = 'messageType')) || + (data.status === undefined && (missing12 = 'status')) + ) { + const err55 = { + instancePath, + schemaPath: '#/anyOf/4/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing12 }, + message: "must have required property '" + missing12 + "'", + schema: schema191.anyOf[4].allOf[1].required, + parentSchema: schema191.anyOf[4].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data27 = data.messageType; + const _errs89 = errors; + if ('experiment-status-changed' !== data27) { + const err56 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/4/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'experiment-status-changed' }, + message: 'must be equal to constant', + schema: 'experiment-status-changed', + parentSchema: schema191.anyOf[4].allOf[1].properties.messageType, + data: data27, + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + var valid21 = _errs89 === errors; + } else { + var valid21 = true; + } + if (valid21) { + if (data.status !== undefined) { + let data28 = data.status; + const _errs90 = errors; + if (typeof data28 !== 'string') { + const err57 = { + instancePath: instancePath + '/status', + schemaPath: '#/anyOf/4/allOf/1/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema191.anyOf[4].allOf[1].properties.status.type, + parentSchema: schema191.anyOf[4].allOf[1].properties.status, + data: data28, + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + var valid21 = _errs90 === errors; + } else { + var valid21 = true; + } + if (valid21) { + if (data.message !== undefined) { + let data29 = data.message; + const _errs92 = errors; + if (typeof data29 !== 'string') { + const err58 = { + instancePath: instancePath + '/message', + schemaPath: '#/anyOf/4/allOf/1/properties/message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema191.anyOf[4].allOf[1].properties.message.type, + parentSchema: schema191.anyOf[4].allOf[1].properties.message, + data: data29, + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + var valid21 = _errs92 === errors; + } else { + var valid21 = true; + } + } + } + } + } else { + const err59 = { + instancePath, + schemaPath: '#/anyOf/4/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema191.anyOf[4].allOf[1].type, + parentSchema: schema191.anyOf[4].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } + var valid19 = _errs87 === errors; + } + var _valid0 = _errs81 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs94 = errors; + const _errs95 = errors; + if (errors === _errs95) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing13; + if (data.messageType === undefined && (missing13 = 'messageType')) { + const err60 = { + instancePath, + schemaPath: '#/anyOf/5/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing13 }, + message: "must have required property '" + missing13 + "'", + schema: schema191.anyOf[5].allOf[0].required, + parentSchema: schema191.anyOf[5].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data30 = data.messageType; + if (typeof data30 !== 'string') { + const err61 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/5/allOf/0/properties/messageType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema191.anyOf[5].allOf[0].properties.messageType.type, + parentSchema: schema191.anyOf[5].allOf[0].properties.messageType, + data: data30, + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + } + } + } else { + const err62 = { + instancePath, + schemaPath: '#/anyOf/5/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema191.anyOf[5].allOf[0].type, + parentSchema: schema191.anyOf[5].allOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + } + var valid22 = _errs95 === errors; + if (valid22) { + const _errs100 = errors; + if (errors === _errs100) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing14; + if ( + (data.messageType === undefined && (missing14 = 'messageType')) || + (data.content === undefined && (missing14 = 'content')) + ) { + const err63 = { + instancePath, + schemaPath: '#/anyOf/5/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing14 }, + message: "must have required property '" + missing14 + "'", + schema: schema191.anyOf[5].allOf[1].required, + parentSchema: schema191.anyOf[5].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } else { + if (data.messageType !== undefined) { + let data31 = data.messageType; + const _errs102 = errors; + if ('logging' !== data31) { + const err64 = { + instancePath: instancePath + '/messageType', + schemaPath: '#/anyOf/5/allOf/1/properties/messageType/const', + keyword: 'const', + params: { allowedValue: 'logging' }, + message: 'must be equal to constant', + schema: 'logging', + parentSchema: + schema191.anyOf[5].allOf[1].properties.messageType, + data: data31, + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + var valid24 = _errs102 === errors; + } else { + var valid24 = true; + } + if (valid24) { + if (data.content !== undefined) { + let data32 = data.content; + const _errs103 = errors; + if (errors === _errs103) { + if ( + data32 && + typeof data32 == 'object' && + !Array.isArray(data32) + ) { + } else { + const err65 = { + instancePath: instancePath + '/content', + schemaPath: '#/anyOf/5/allOf/1/properties/content/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema191.anyOf[5].allOf[1].properties.content.type, + parentSchema: + schema191.anyOf[5].allOf[1].properties.content, + data: data32, + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + var valid24 = _errs103 === errors; + } else { + var valid24 = true; + } + } + } + } else { + const err66 = { + instancePath, + schemaPath: '#/anyOf/5/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema191.anyOf[5].allOf[1].type, + parentSchema: schema191.anyOf[5].allOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + var valid22 = _errs100 === errors; + } + var _valid0 = _errs94 === errors; + valid0 = valid0 || _valid0; + } + } + } + } + } + if (!valid0) { + const err67 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema191.anyOf, + parentSchema: schema191, + data, + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + validate206.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate206.errors = vErrors; + return errors === 0; +} +exports.validateListPeerconnectionsResponse200Request = validate207; +const schema192 = { + type: 'array', + items: { + title: 'Peerconnection Overview', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + }, + 'x-standalone': false, + 'x-name': 'listPeerconnectionsResponse200Request', + 'x-location': + '#/paths//peerconnections/get/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate207( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if (data0.type === undefined && (missing0 = 'type')) { + validate207.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema192.items.allOf[0].required, + parentSchema: schema192.items.allOf[0], + data: data0, + }, + ]; + return false; + } else { + if (data0.type !== undefined) { + let data1 = data0.type; + if (typeof data1 !== 'string') { + validate207.errors = [ + { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema192.items.allOf[0].properties.type.type, + parentSchema: schema192.items.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'local' || data1 === 'webrtc')) { + validate207.errors = [ + { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema192.items.allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema192.items.allOf[0].properties.type.enum, + parentSchema: schema192.items.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + } + } + } else { + validate207.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema192.items.allOf[0].type, + parentSchema: schema192.items.allOf[0], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs6 = errors; + if (errors === _errs6) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if (data0.devices === undefined && (missing1 = 'devices')) { + validate207.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema192.items.allOf[1].required, + parentSchema: schema192.items.allOf[1], + data: data0, + }, + ]; + return false; + } else { + if (data0.devices !== undefined) { + let data2 = data0.devices; + const _errs8 = errors; + if (errors === _errs8) { + if (Array.isArray(data2)) { + if (data2.length > 2) { + validate207.errors = [ + { + instancePath: instancePath + '/' + i0 + '/devices', + schemaPath: '#/items/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema192.items.allOf[1].properties.devices, + data: data2, + }, + ]; + return false; + } else { + if (data2.length < 2) { + validate207.errors = [ + { + instancePath: instancePath + '/' + i0 + '/devices', + schemaPath: '#/items/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema192.items.allOf[1].properties.devices, + data: data2, + }, + ]; + return false; + } else { + var valid4 = true; + const len1 = data2.length; + for (let i1 = 0; i1 < len1; i1++) { + let data3 = data2[i1]; + const _errs10 = errors; + if (errors === _errs10) { + if ( + data3 && + typeof data3 == 'object' && + !Array.isArray(data3) + ) { + let missing2; + if (data3.url === undefined && (missing2 = 'url')) { + validate207.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/devices/' + i1, + schemaPath: + '#/items/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema192.items.allOf[1].properties.devices.items + .required, + parentSchema: + schema192.items.allOf[1].properties.devices.items, + data: data3, + }, + ]; + return false; + } else { + if (data3.url !== undefined) { + let data4 = data3.url; + const _errs12 = errors; + if (errors === _errs12) { + if (errors === _errs12) { + if (typeof data4 === 'string') { + if (!formats0(data4)) { + validate207.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/devices/' + + i1 + + '/url', + schemaPath: + '#/items/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema192.items.allOf[1].properties + .devices.items.properties.url, + data: data4, + }, + ]; + return false; + } + } else { + validate207.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/devices/' + + i1 + + '/url', + schemaPath: + '#/items/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema192.items.allOf[1].properties + .devices.items.properties.url.type, + parentSchema: + schema192.items.allOf[1].properties + .devices.items.properties.url, + data: data4, + }, + ]; + return false; + } + } + } + } + } + } else { + validate207.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/devices/' + i1, + schemaPath: + '#/items/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema192.items.allOf[1].properties.devices.items + .type, + parentSchema: + schema192.items.allOf[1].properties.devices.items, + data: data3, + }, + ]; + return false; + } + } + var valid4 = _errs10 === errors; + if (!valid4) { + break; + } + } + } + } + } else { + validate207.errors = [ + { + instancePath: instancePath + '/' + i0 + '/devices', + schemaPath: '#/items/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema192.items.allOf[1].properties.devices.type, + parentSchema: schema192.items.allOf[1].properties.devices, + data: data2, + }, + ]; + return false; + } + } + } + } + } else { + validate207.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema192.items.allOf[1].type, + parentSchema: schema192.items.allOf[1], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs6 === errors; + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate207.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema192.type, + parentSchema: schema192, + data, + }, + ]; + return false; + } + } + validate207.errors = vErrors; + return errors === 0; +} +exports.validateListPeerconnectionsResponse200Response = validate208; +const schema193 = { + type: 'array', + items: { + title: 'Peerconnection Overview', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + }, + 'x-standalone': false, + 'x-name': 'listPeerconnectionsResponse200Response', + 'x-location': + '#/paths//peerconnections/get/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate208( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + const _errs2 = errors; + if (errors === _errs2) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if ( + (data0.url === undefined && (missing0 = 'url')) || + (data0.type === undefined && (missing0 = 'type')) || + (data0.status === undefined && (missing0 = 'status')) + ) { + validate208.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema193.items.allOf[0].required, + parentSchema: schema193.items.allOf[0], + data: data0, + }, + ]; + return false; + } else { + if (data0.url !== undefined) { + let data1 = data0.url; + const _errs4 = errors; + if (errors === _errs4) { + if (errors === _errs4) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate208.errors = [ + { + instancePath: instancePath + '/' + i0 + '/url', + schemaPath: '#/items/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema193.items.allOf[0].properties.url, + data: data1, + }, + ]; + return false; + } + } else { + validate208.errors = [ + { + instancePath: instancePath + '/' + i0 + '/url', + schemaPath: '#/items/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema193.items.allOf[0].properties.url.type, + parentSchema: schema193.items.allOf[0].properties.url, + data: data1, + }, + ]; + return false; + } + } + } + var valid2 = _errs4 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.type !== undefined) { + let data2 = data0.type; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate208.errors = [ + { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema193.items.allOf[0].properties.type.type, + parentSchema: schema193.items.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + if (!(data2 === 'local' || data2 === 'webrtc')) { + validate208.errors = [ + { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/allOf/0/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: schema193.items.allOf[0].properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema193.items.allOf[0].properties.type.enum, + parentSchema: schema193.items.allOf[0].properties.type, + data: data2, + }, + ]; + return false; + } + var valid2 = _errs6 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data0.status !== undefined) { + let data3 = data0.status; + const _errs8 = errors; + if (typeof data3 !== 'string') { + validate208.errors = [ + { + instancePath: instancePath + '/' + i0 + '/status', + schemaPath: '#/items/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema193.items.allOf[0].properties.status.type, + parentSchema: schema193.items.allOf[0].properties.status, + data: data3, + }, + ]; + return false; + } + if ( + !( + data3 === 'new' || + data3 === 'connecting' || + data3 === 'connected' || + data3 === 'disconnected' || + data3 === 'failed' || + data3 === 'closed' + ) + ) { + validate208.errors = [ + { + instancePath: instancePath + '/' + i0 + '/status', + schemaPath: '#/items/allOf/0/properties/status/enum', + keyword: 'enum', + params: { + allowedValues: + schema193.items.allOf[0].properties.status.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema193.items.allOf[0].properties.status.enum, + parentSchema: schema193.items.allOf[0].properties.status, + data: data3, + }, + ]; + return false; + } + var valid2 = _errs8 === errors; + } else { + var valid2 = true; + } + } + } + } + } else { + validate208.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema193.items.allOf[0].type, + parentSchema: schema193.items.allOf[0], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs2 === errors; + if (valid1) { + const _errs10 = errors; + if (errors === _errs10) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if (data0.devices === undefined && (missing1 = 'devices')) { + validate208.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema193.items.allOf[1].required, + parentSchema: schema193.items.allOf[1], + data: data0, + }, + ]; + return false; + } else { + if (data0.devices !== undefined) { + let data4 = data0.devices; + const _errs12 = errors; + if (errors === _errs12) { + if (Array.isArray(data4)) { + if (data4.length > 2) { + validate208.errors = [ + { + instancePath: instancePath + '/' + i0 + '/devices', + schemaPath: '#/items/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema193.items.allOf[1].properties.devices, + data: data4, + }, + ]; + return false; + } else { + if (data4.length < 2) { + validate208.errors = [ + { + instancePath: instancePath + '/' + i0 + '/devices', + schemaPath: '#/items/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema193.items.allOf[1].properties.devices, + data: data4, + }, + ]; + return false; + } else { + var valid4 = true; + const len1 = data4.length; + for (let i1 = 0; i1 < len1; i1++) { + let data5 = data4[i1]; + const _errs14 = errors; + if (errors === _errs14) { + if ( + data5 && + typeof data5 == 'object' && + !Array.isArray(data5) + ) { + let missing2; + if (data5.url === undefined && (missing2 = 'url')) { + validate208.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/devices/' + i1, + schemaPath: + '#/items/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema193.items.allOf[1].properties.devices.items + .required, + parentSchema: + schema193.items.allOf[1].properties.devices.items, + data: data5, + }, + ]; + return false; + } else { + if (data5.url !== undefined) { + let data6 = data5.url; + const _errs16 = errors; + if (errors === _errs16) { + if (errors === _errs16) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate208.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/devices/' + + i1 + + '/url', + schemaPath: + '#/items/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema193.items.allOf[1].properties + .devices.items.properties.url, + data: data6, + }, + ]; + return false; + } + } else { + validate208.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/devices/' + + i1 + + '/url', + schemaPath: + '#/items/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema193.items.allOf[1].properties + .devices.items.properties.url.type, + parentSchema: + schema193.items.allOf[1].properties + .devices.items.properties.url, + data: data6, + }, + ]; + return false; + } + } + } + } + } + } else { + validate208.errors = [ + { + instancePath: + instancePath + '/' + i0 + '/devices/' + i1, + schemaPath: + '#/items/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema193.items.allOf[1].properties.devices.items + .type, + parentSchema: + schema193.items.allOf[1].properties.devices.items, + data: data5, + }, + ]; + return false; + } + } + var valid4 = _errs14 === errors; + if (!valid4) { + break; + } + } + } + } + } else { + validate208.errors = [ + { + instancePath: instancePath + '/' + i0 + '/devices', + schemaPath: '#/items/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema193.items.allOf[1].properties.devices.type, + parentSchema: schema193.items.allOf[1].properties.devices, + data: data4, + }, + ]; + return false; + } + } + } + } + } else { + validate208.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema193.items.allOf[1].type, + parentSchema: schema193.items.allOf[1], + data: data0, + }, + ]; + return false; + } + } + var valid1 = _errs10 === errors; + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate208.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema193.type, + parentSchema: schema193, + data, + }, + ]; + return false; + } + } + validate208.errors = vErrors; + return errors === 0; +} +exports.validateCreatePeerconnectionBodyRequest = validate209; +const schema194 = { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'createPeerconnectionBodyRequest', + 'x-location': + '#/paths//peerconnections/post/requestBody/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate209( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate209.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema194.allOf[0].required, + parentSchema: schema194.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.type !== undefined) { + let data0 = data.type; + if (typeof data0 !== 'string') { + validate209.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema194.allOf[0].properties.type.type, + parentSchema: schema194.allOf[0].properties.type, + data: data0, + }, + ]; + return false; + } + if (!(data0 === 'local' || data0 === 'webrtc')) { + validate209.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema194.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema194.allOf[0].properties.type.enum, + parentSchema: schema194.allOf[0].properties.type, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate209.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema194.allOf[0].type, + parentSchema: schema194.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs4 = errors; + if (errors === _errs4) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate209.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema194.allOf[1].required, + parentSchema: schema194.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data1 = data.devices; + const _errs6 = errors; + if (errors === _errs6) { + if (Array.isArray(data1)) { + if (data1.length > 2) { + validate209.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema194.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } else { + if (data1.length < 2) { + validate209.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema194.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs8 = errors; + if (errors === _errs8) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing2; + if (data2.url === undefined && (missing2 = 'url')) { + validate209.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema194.allOf[1].properties.devices.items.required, + parentSchema: schema194.allOf[1].properties.devices.items, + data: data2, + }, + ]; + return false; + } else { + if (data2.url !== undefined) { + let data3 = data2.url; + const _errs10 = errors; + if (errors === _errs10) { + if (errors === _errs10) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + validate209.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema194.allOf[1].properties.devices.items + .properties.url, + data: data3, + }, + ]; + return false; + } + } else { + validate209.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema194.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema194.allOf[1].properties.devices.items + .properties.url, + data: data3, + }, + ]; + return false; + } + } + } + var valid4 = _errs10 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data2.config !== undefined) { + let data4 = data2.config; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data4 && + typeof data4 == 'object' && + !Array.isArray(data4) + ) { + if (data4.services !== undefined) { + let data5 = data4.services; + const _errs14 = errors; + if (errors === _errs14) { + if (Array.isArray(data5)) { + var valid6 = true; + const len1 = data5.length; + for (let i1 = 0; i1 < len1; i1++) { + let data6 = data5[i1]; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing3; + if ( + (data6.serviceType === undefined && + (missing3 = 'serviceType')) || + (data6.serviceId === undefined && + (missing3 = 'serviceId')) || + (data6.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate209.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: missing3, + }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema194.allOf[1].properties + .devices.items.properties.config + .properties.services.items + .required, + parentSchema: + schema194.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data6, + }, + ]; + return false; + } else { + if (data6.serviceType !== undefined) { + let data7 = data6.serviceType; + const _errs19 = errors; + if (errors === _errs19) { + if (errors === _errs19) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + validate209.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema194.allOf[1] + .properties.devices + .items.properties + .config.properties + .services.items + .properties + .serviceType, + data: data7, + }, + ]; + return false; + } + } else { + validate209.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema194.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType.type, + parentSchema: + schema194.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType, + data: data7, + }, + ]; + return false; + } + } + } + var valid7 = _errs19 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data6.serviceId !== undefined) { + let data8 = data6.serviceId; + const _errs21 = errors; + if (typeof data8 !== 'string') { + validate209.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema194.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId + .type, + parentSchema: + schema194.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId, + data: data8, + }, + ]; + return false; + } + var valid7 = _errs21 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if ( + data6.remoteServiceId !== + undefined + ) { + let data9 = data6.remoteServiceId; + const _errs23 = errors; + if (typeof data9 !== 'string') { + validate209.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema194.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId.type, + parentSchema: + schema194.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId, + data: data9, + }, + ]; + return false; + } + var valid7 = _errs23 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + validate209.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema194.allOf[1].properties + .devices.items.properties.config + .properties.services.items.type, + parentSchema: + schema194.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data6, + }, + ]; + return false; + } + } + var valid6 = _errs16 === errors; + if (!valid6) { + break; + } + } + } else { + validate209.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema194.allOf[1].properties.devices + .items.properties.config.properties + .services.type, + parentSchema: + schema194.allOf[1].properties.devices + .items.properties.config.properties + .services, + data: data5, + }, + ]; + return false; + } + } + } + } else { + validate209.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/config', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema194.allOf[1].properties.devices.items + .properties.config.type, + parentSchema: + schema194.allOf[1].properties.devices.items + .properties.config, + data: data4, + }, + ]; + return false; + } + } + var valid4 = _errs12 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate209.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema194.allOf[1].properties.devices.items.type, + parentSchema: schema194.allOf[1].properties.devices.items, + data: data2, + }, + ]; + return false; + } + } + var valid3 = _errs8 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate209.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema194.allOf[1].properties.devices.type, + parentSchema: schema194.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } + } + } + } + } else { + validate209.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema194.allOf[1].type, + parentSchema: schema194.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs4 === errors; + } + validate209.errors = vErrors; + return errors === 0; +} +exports.validateCreatePeerconnectionBodyResponse = validate210; +const schema195 = { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'createPeerconnectionBodyResponse', + 'x-location': + '#/paths//peerconnections/post/requestBody/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate210( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.status === undefined && (missing0 = 'status')) + ) { + validate210.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema195.allOf[0].required, + parentSchema: schema195.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate210.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema195.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate210.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema195.allOf[0].properties.url.type, + parentSchema: schema195.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data1 = data.type; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate210.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema195.allOf[0].properties.type.type, + parentSchema: schema195.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'local' || data1 === 'webrtc')) { + validate210.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema195.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema195.allOf[0].properties.type.enum, + parentSchema: schema195.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.status !== undefined) { + let data2 = data.status; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate210.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema195.allOf[0].properties.status.type, + parentSchema: schema195.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'new' || + data2 === 'connecting' || + data2 === 'connected' || + data2 === 'disconnected' || + data2 === 'failed' || + data2 === 'closed' + ) + ) { + validate210.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema195.allOf[0].properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema195.allOf[0].properties.status.enum, + parentSchema: schema195.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate210.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema195.allOf[0].type, + parentSchema: schema195.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs8 = errors; + if (errors === _errs8) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate210.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema195.allOf[1].required, + parentSchema: schema195.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data3 = data.devices; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data3)) { + if (data3.length > 2) { + validate210.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema195.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + if (data3.length < 2) { + validate210.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema195.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data3.length; + for (let i0 = 0; i0 < len0; i0++) { + let data4 = data3[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing2; + if (data4.url === undefined && (missing2 = 'url')) { + validate210.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema195.allOf[1].properties.devices.items.required, + parentSchema: schema195.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate210.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema195.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } else { + validate210.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema195.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema195.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } + } + var valid4 = _errs14 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data4.config !== undefined) { + let data6 = data4.config; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + if (data6.services !== undefined) { + let data7 = data6.services; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid6 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing3; + if ( + (data8.serviceType === undefined && + (missing3 = 'serviceType')) || + (data8.serviceId === undefined && + (missing3 = 'serviceId')) || + (data8.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate210.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: missing3, + }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema195.allOf[1].properties + .devices.items.properties.config + .properties.services.items + .required, + parentSchema: + schema195.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.serviceType !== undefined) { + let data9 = data8.serviceType; + const _errs23 = errors; + if (errors === _errs23) { + if (errors === _errs23) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate210.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema195.allOf[1] + .properties.devices + .items.properties + .config.properties + .services.items + .properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } else { + validate210.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema195.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType.type, + parentSchema: + schema195.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } + } + var valid7 = _errs23 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data8.serviceId !== undefined) { + let data10 = data8.serviceId; + const _errs25 = errors; + if (typeof data10 !== 'string') { + validate210.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema195.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId + .type, + parentSchema: + schema195.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId, + data: data10, + }, + ]; + return false; + } + var valid7 = _errs25 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if ( + data8.remoteServiceId !== + undefined + ) { + let data11 = + data8.remoteServiceId; + const _errs27 = errors; + if (typeof data11 !== 'string') { + validate210.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema195.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId.type, + parentSchema: + schema195.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId, + data: data11, + }, + ]; + return false; + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + validate210.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema195.allOf[1].properties + .devices.items.properties.config + .properties.services.items.type, + parentSchema: + schema195.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } + } + var valid6 = _errs20 === errors; + if (!valid6) { + break; + } + } + } else { + validate210.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema195.allOf[1].properties.devices + .items.properties.config.properties + .services.type, + parentSchema: + schema195.allOf[1].properties.devices + .items.properties.config.properties + .services, + data: data7, + }, + ]; + return false; + } + } + } + } else { + validate210.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/config', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema195.allOf[1].properties.devices.items + .properties.config.type, + parentSchema: + schema195.allOf[1].properties.devices.items + .properties.config, + data: data6, + }, + ]; + return false; + } + } + var valid4 = _errs16 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate210.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema195.allOf[1].properties.devices.items.type, + parentSchema: schema195.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } + } + var valid3 = _errs12 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate210.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema195.allOf[1].properties.devices.type, + parentSchema: schema195.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } + } + } + } + } else { + validate210.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema195.allOf[1].type, + parentSchema: schema195.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs8 === errors; + } + validate210.errors = vErrors; + return errors === 0; +} +exports.validateCreatePeerconnectionResponse201Request = validate211; +const schema196 = { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'createPeerconnectionResponse201Request', + 'x-location': + '#/paths//peerconnections/post/responses/201/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate211( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate211.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema196.allOf[0].required, + parentSchema: schema196.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.type !== undefined) { + let data0 = data.type; + if (typeof data0 !== 'string') { + validate211.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema196.allOf[0].properties.type.type, + parentSchema: schema196.allOf[0].properties.type, + data: data0, + }, + ]; + return false; + } + if (!(data0 === 'local' || data0 === 'webrtc')) { + validate211.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema196.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema196.allOf[0].properties.type.enum, + parentSchema: schema196.allOf[0].properties.type, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate211.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema196.allOf[0].type, + parentSchema: schema196.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs4 = errors; + if (errors === _errs4) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate211.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema196.allOf[1].required, + parentSchema: schema196.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data1 = data.devices; + const _errs6 = errors; + if (errors === _errs6) { + if (Array.isArray(data1)) { + if (data1.length > 2) { + validate211.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema196.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } else { + if (data1.length < 2) { + validate211.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema196.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs8 = errors; + if (errors === _errs8) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing2; + if (data2.url === undefined && (missing2 = 'url')) { + validate211.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema196.allOf[1].properties.devices.items.required, + parentSchema: schema196.allOf[1].properties.devices.items, + data: data2, + }, + ]; + return false; + } else { + if (data2.url !== undefined) { + let data3 = data2.url; + const _errs10 = errors; + if (errors === _errs10) { + if (errors === _errs10) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + validate211.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema196.allOf[1].properties.devices.items + .properties.url, + data: data3, + }, + ]; + return false; + } + } else { + validate211.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema196.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema196.allOf[1].properties.devices.items + .properties.url, + data: data3, + }, + ]; + return false; + } + } + } + var valid4 = _errs10 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data2.config !== undefined) { + let data4 = data2.config; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data4 && + typeof data4 == 'object' && + !Array.isArray(data4) + ) { + if (data4.services !== undefined) { + let data5 = data4.services; + const _errs14 = errors; + if (errors === _errs14) { + if (Array.isArray(data5)) { + var valid6 = true; + const len1 = data5.length; + for (let i1 = 0; i1 < len1; i1++) { + let data6 = data5[i1]; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing3; + if ( + (data6.serviceType === undefined && + (missing3 = 'serviceType')) || + (data6.serviceId === undefined && + (missing3 = 'serviceId')) || + (data6.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate211.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: missing3, + }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema196.allOf[1].properties + .devices.items.properties.config + .properties.services.items + .required, + parentSchema: + schema196.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data6, + }, + ]; + return false; + } else { + if (data6.serviceType !== undefined) { + let data7 = data6.serviceType; + const _errs19 = errors; + if (errors === _errs19) { + if (errors === _errs19) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + validate211.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema196.allOf[1] + .properties.devices + .items.properties + .config.properties + .services.items + .properties + .serviceType, + data: data7, + }, + ]; + return false; + } + } else { + validate211.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema196.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType.type, + parentSchema: + schema196.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType, + data: data7, + }, + ]; + return false; + } + } + } + var valid7 = _errs19 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data6.serviceId !== undefined) { + let data8 = data6.serviceId; + const _errs21 = errors; + if (typeof data8 !== 'string') { + validate211.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema196.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId + .type, + parentSchema: + schema196.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId, + data: data8, + }, + ]; + return false; + } + var valid7 = _errs21 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if ( + data6.remoteServiceId !== + undefined + ) { + let data9 = data6.remoteServiceId; + const _errs23 = errors; + if (typeof data9 !== 'string') { + validate211.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema196.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId.type, + parentSchema: + schema196.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId, + data: data9, + }, + ]; + return false; + } + var valid7 = _errs23 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + validate211.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema196.allOf[1].properties + .devices.items.properties.config + .properties.services.items.type, + parentSchema: + schema196.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data6, + }, + ]; + return false; + } + } + var valid6 = _errs16 === errors; + if (!valid6) { + break; + } + } + } else { + validate211.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema196.allOf[1].properties.devices + .items.properties.config.properties + .services.type, + parentSchema: + schema196.allOf[1].properties.devices + .items.properties.config.properties + .services, + data: data5, + }, + ]; + return false; + } + } + } + } else { + validate211.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/config', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema196.allOf[1].properties.devices.items + .properties.config.type, + parentSchema: + schema196.allOf[1].properties.devices.items + .properties.config, + data: data4, + }, + ]; + return false; + } + } + var valid4 = _errs12 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate211.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema196.allOf[1].properties.devices.items.type, + parentSchema: schema196.allOf[1].properties.devices.items, + data: data2, + }, + ]; + return false; + } + } + var valid3 = _errs8 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate211.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema196.allOf[1].properties.devices.type, + parentSchema: schema196.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } + } + } + } + } else { + validate211.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema196.allOf[1].type, + parentSchema: schema196.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs4 === errors; + } + validate211.errors = vErrors; + return errors === 0; +} +exports.validateCreatePeerconnectionResponse201Response = validate212; +const schema197 = { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'createPeerconnectionResponse201Response', + 'x-location': + '#/paths//peerconnections/post/responses/201/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate212( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.status === undefined && (missing0 = 'status')) + ) { + validate212.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema197.allOf[0].required, + parentSchema: schema197.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate212.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema197.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate212.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema197.allOf[0].properties.url.type, + parentSchema: schema197.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data1 = data.type; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate212.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema197.allOf[0].properties.type.type, + parentSchema: schema197.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'local' || data1 === 'webrtc')) { + validate212.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema197.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema197.allOf[0].properties.type.enum, + parentSchema: schema197.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.status !== undefined) { + let data2 = data.status; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate212.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema197.allOf[0].properties.status.type, + parentSchema: schema197.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'new' || + data2 === 'connecting' || + data2 === 'connected' || + data2 === 'disconnected' || + data2 === 'failed' || + data2 === 'closed' + ) + ) { + validate212.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema197.allOf[0].properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema197.allOf[0].properties.status.enum, + parentSchema: schema197.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate212.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema197.allOf[0].type, + parentSchema: schema197.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs8 = errors; + if (errors === _errs8) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate212.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema197.allOf[1].required, + parentSchema: schema197.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data3 = data.devices; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data3)) { + if (data3.length > 2) { + validate212.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema197.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + if (data3.length < 2) { + validate212.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema197.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data3.length; + for (let i0 = 0; i0 < len0; i0++) { + let data4 = data3[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing2; + if (data4.url === undefined && (missing2 = 'url')) { + validate212.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema197.allOf[1].properties.devices.items.required, + parentSchema: schema197.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate212.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema197.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } else { + validate212.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema197.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema197.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } + } + var valid4 = _errs14 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data4.config !== undefined) { + let data6 = data4.config; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + if (data6.services !== undefined) { + let data7 = data6.services; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid6 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing3; + if ( + (data8.serviceType === undefined && + (missing3 = 'serviceType')) || + (data8.serviceId === undefined && + (missing3 = 'serviceId')) || + (data8.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate212.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: missing3, + }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema197.allOf[1].properties + .devices.items.properties.config + .properties.services.items + .required, + parentSchema: + schema197.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.serviceType !== undefined) { + let data9 = data8.serviceType; + const _errs23 = errors; + if (errors === _errs23) { + if (errors === _errs23) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate212.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema197.allOf[1] + .properties.devices + .items.properties + .config.properties + .services.items + .properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } else { + validate212.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema197.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType.type, + parentSchema: + schema197.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } + } + var valid7 = _errs23 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data8.serviceId !== undefined) { + let data10 = data8.serviceId; + const _errs25 = errors; + if (typeof data10 !== 'string') { + validate212.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema197.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId + .type, + parentSchema: + schema197.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId, + data: data10, + }, + ]; + return false; + } + var valid7 = _errs25 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if ( + data8.remoteServiceId !== + undefined + ) { + let data11 = + data8.remoteServiceId; + const _errs27 = errors; + if (typeof data11 !== 'string') { + validate212.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema197.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId.type, + parentSchema: + schema197.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId, + data: data11, + }, + ]; + return false; + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + validate212.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema197.allOf[1].properties + .devices.items.properties.config + .properties.services.items.type, + parentSchema: + schema197.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } + } + var valid6 = _errs20 === errors; + if (!valid6) { + break; + } + } + } else { + validate212.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema197.allOf[1].properties.devices + .items.properties.config.properties + .services.type, + parentSchema: + schema197.allOf[1].properties.devices + .items.properties.config.properties + .services, + data: data7, + }, + ]; + return false; + } + } + } + } else { + validate212.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/config', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema197.allOf[1].properties.devices.items + .properties.config.type, + parentSchema: + schema197.allOf[1].properties.devices.items + .properties.config, + data: data6, + }, + ]; + return false; + } + } + var valid4 = _errs16 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate212.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema197.allOf[1].properties.devices.items.type, + parentSchema: schema197.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } + } + var valid3 = _errs12 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate212.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema197.allOf[1].properties.devices.type, + parentSchema: schema197.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } + } + } + } + } else { + validate212.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema197.allOf[1].type, + parentSchema: schema197.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs8 === errors; + } + validate212.errors = vErrors; + return errors === 0; +} +exports.validateCreatePeerconnectionResponse202Request = validate213; +const schema198 = { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'createPeerconnectionResponse202Request', + 'x-location': + '#/paths//peerconnections/post/responses/202/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate213( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate213.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema198.allOf[0].required, + parentSchema: schema198.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.type !== undefined) { + let data0 = data.type; + if (typeof data0 !== 'string') { + validate213.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema198.allOf[0].properties.type.type, + parentSchema: schema198.allOf[0].properties.type, + data: data0, + }, + ]; + return false; + } + if (!(data0 === 'local' || data0 === 'webrtc')) { + validate213.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema198.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema198.allOf[0].properties.type.enum, + parentSchema: schema198.allOf[0].properties.type, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate213.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema198.allOf[0].type, + parentSchema: schema198.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs4 = errors; + if (errors === _errs4) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate213.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema198.allOf[1].required, + parentSchema: schema198.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data1 = data.devices; + const _errs6 = errors; + if (errors === _errs6) { + if (Array.isArray(data1)) { + if (data1.length > 2) { + validate213.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema198.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } else { + if (data1.length < 2) { + validate213.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema198.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs8 = errors; + if (errors === _errs8) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing2; + if (data2.url === undefined && (missing2 = 'url')) { + validate213.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema198.allOf[1].properties.devices.items.required, + parentSchema: schema198.allOf[1].properties.devices.items, + data: data2, + }, + ]; + return false; + } else { + if (data2.url !== undefined) { + let data3 = data2.url; + const _errs10 = errors; + if (errors === _errs10) { + if (errors === _errs10) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + validate213.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema198.allOf[1].properties.devices.items + .properties.url, + data: data3, + }, + ]; + return false; + } + } else { + validate213.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema198.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema198.allOf[1].properties.devices.items + .properties.url, + data: data3, + }, + ]; + return false; + } + } + } + var valid4 = _errs10 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data2.config !== undefined) { + let data4 = data2.config; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data4 && + typeof data4 == 'object' && + !Array.isArray(data4) + ) { + if (data4.services !== undefined) { + let data5 = data4.services; + const _errs14 = errors; + if (errors === _errs14) { + if (Array.isArray(data5)) { + var valid6 = true; + const len1 = data5.length; + for (let i1 = 0; i1 < len1; i1++) { + let data6 = data5[i1]; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing3; + if ( + (data6.serviceType === undefined && + (missing3 = 'serviceType')) || + (data6.serviceId === undefined && + (missing3 = 'serviceId')) || + (data6.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate213.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: missing3, + }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema198.allOf[1].properties + .devices.items.properties.config + .properties.services.items + .required, + parentSchema: + schema198.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data6, + }, + ]; + return false; + } else { + if (data6.serviceType !== undefined) { + let data7 = data6.serviceType; + const _errs19 = errors; + if (errors === _errs19) { + if (errors === _errs19) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + validate213.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema198.allOf[1] + .properties.devices + .items.properties + .config.properties + .services.items + .properties + .serviceType, + data: data7, + }, + ]; + return false; + } + } else { + validate213.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema198.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType.type, + parentSchema: + schema198.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType, + data: data7, + }, + ]; + return false; + } + } + } + var valid7 = _errs19 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data6.serviceId !== undefined) { + let data8 = data6.serviceId; + const _errs21 = errors; + if (typeof data8 !== 'string') { + validate213.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema198.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId + .type, + parentSchema: + schema198.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId, + data: data8, + }, + ]; + return false; + } + var valid7 = _errs21 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if ( + data6.remoteServiceId !== + undefined + ) { + let data9 = data6.remoteServiceId; + const _errs23 = errors; + if (typeof data9 !== 'string') { + validate213.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema198.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId.type, + parentSchema: + schema198.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId, + data: data9, + }, + ]; + return false; + } + var valid7 = _errs23 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + validate213.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema198.allOf[1].properties + .devices.items.properties.config + .properties.services.items.type, + parentSchema: + schema198.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data6, + }, + ]; + return false; + } + } + var valid6 = _errs16 === errors; + if (!valid6) { + break; + } + } + } else { + validate213.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema198.allOf[1].properties.devices + .items.properties.config.properties + .services.type, + parentSchema: + schema198.allOf[1].properties.devices + .items.properties.config.properties + .services, + data: data5, + }, + ]; + return false; + } + } + } + } else { + validate213.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/config', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema198.allOf[1].properties.devices.items + .properties.config.type, + parentSchema: + schema198.allOf[1].properties.devices.items + .properties.config, + data: data4, + }, + ]; + return false; + } + } + var valid4 = _errs12 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate213.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema198.allOf[1].properties.devices.items.type, + parentSchema: schema198.allOf[1].properties.devices.items, + data: data2, + }, + ]; + return false; + } + } + var valid3 = _errs8 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate213.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema198.allOf[1].properties.devices.type, + parentSchema: schema198.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } + } + } + } + } else { + validate213.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema198.allOf[1].type, + parentSchema: schema198.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs4 === errors; + } + validate213.errors = vErrors; + return errors === 0; +} +exports.validateCreatePeerconnectionResponse202Response = validate214; +const schema199 = { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'createPeerconnectionResponse202Response', + 'x-location': + '#/paths//peerconnections/post/responses/202/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate214( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.status === undefined && (missing0 = 'status')) + ) { + validate214.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema199.allOf[0].required, + parentSchema: schema199.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate214.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema199.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate214.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema199.allOf[0].properties.url.type, + parentSchema: schema199.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data1 = data.type; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate214.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema199.allOf[0].properties.type.type, + parentSchema: schema199.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'local' || data1 === 'webrtc')) { + validate214.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema199.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema199.allOf[0].properties.type.enum, + parentSchema: schema199.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.status !== undefined) { + let data2 = data.status; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate214.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema199.allOf[0].properties.status.type, + parentSchema: schema199.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'new' || + data2 === 'connecting' || + data2 === 'connected' || + data2 === 'disconnected' || + data2 === 'failed' || + data2 === 'closed' + ) + ) { + validate214.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema199.allOf[0].properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema199.allOf[0].properties.status.enum, + parentSchema: schema199.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate214.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema199.allOf[0].type, + parentSchema: schema199.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs8 = errors; + if (errors === _errs8) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate214.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema199.allOf[1].required, + parentSchema: schema199.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data3 = data.devices; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data3)) { + if (data3.length > 2) { + validate214.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema199.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + if (data3.length < 2) { + validate214.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema199.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data3.length; + for (let i0 = 0; i0 < len0; i0++) { + let data4 = data3[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing2; + if (data4.url === undefined && (missing2 = 'url')) { + validate214.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema199.allOf[1].properties.devices.items.required, + parentSchema: schema199.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate214.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema199.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } else { + validate214.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema199.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema199.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } + } + var valid4 = _errs14 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data4.config !== undefined) { + let data6 = data4.config; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + if (data6.services !== undefined) { + let data7 = data6.services; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid6 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing3; + if ( + (data8.serviceType === undefined && + (missing3 = 'serviceType')) || + (data8.serviceId === undefined && + (missing3 = 'serviceId')) || + (data8.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate214.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: missing3, + }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema199.allOf[1].properties + .devices.items.properties.config + .properties.services.items + .required, + parentSchema: + schema199.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.serviceType !== undefined) { + let data9 = data8.serviceType; + const _errs23 = errors; + if (errors === _errs23) { + if (errors === _errs23) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate214.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema199.allOf[1] + .properties.devices + .items.properties + .config.properties + .services.items + .properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } else { + validate214.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema199.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType.type, + parentSchema: + schema199.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } + } + var valid7 = _errs23 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data8.serviceId !== undefined) { + let data10 = data8.serviceId; + const _errs25 = errors; + if (typeof data10 !== 'string') { + validate214.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema199.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId + .type, + parentSchema: + schema199.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId, + data: data10, + }, + ]; + return false; + } + var valid7 = _errs25 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if ( + data8.remoteServiceId !== + undefined + ) { + let data11 = + data8.remoteServiceId; + const _errs27 = errors; + if (typeof data11 !== 'string') { + validate214.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema199.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId.type, + parentSchema: + schema199.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId, + data: data11, + }, + ]; + return false; + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + validate214.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema199.allOf[1].properties + .devices.items.properties.config + .properties.services.items.type, + parentSchema: + schema199.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } + } + var valid6 = _errs20 === errors; + if (!valid6) { + break; + } + } + } else { + validate214.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema199.allOf[1].properties.devices + .items.properties.config.properties + .services.type, + parentSchema: + schema199.allOf[1].properties.devices + .items.properties.config.properties + .services, + data: data7, + }, + ]; + return false; + } + } + } + } else { + validate214.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/config', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema199.allOf[1].properties.devices.items + .properties.config.type, + parentSchema: + schema199.allOf[1].properties.devices.items + .properties.config, + data: data6, + }, + ]; + return false; + } + } + var valid4 = _errs16 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate214.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema199.allOf[1].properties.devices.items.type, + parentSchema: schema199.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } + } + var valid3 = _errs12 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate214.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema199.allOf[1].properties.devices.type, + parentSchema: schema199.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } + } + } + } + } else { + validate214.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema199.allOf[1].type, + parentSchema: schema199.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs8 === errors; + } + validate214.errors = vErrors; + return errors === 0; +} +exports.validateGetPeerconnectionResponse200Request = validate215; +const schema200 = { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + }, + required: ['type'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'getPeerconnectionResponse200Request', + 'x-location': + '#/paths//peerconnections/{peerconnection_id}/get/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate215( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.type === undefined && (missing0 = 'type')) { + validate215.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema200.allOf[0].required, + parentSchema: schema200.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.type !== undefined) { + let data0 = data.type; + if (typeof data0 !== 'string') { + validate215.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema200.allOf[0].properties.type.type, + parentSchema: schema200.allOf[0].properties.type, + data: data0, + }, + ]; + return false; + } + if (!(data0 === 'local' || data0 === 'webrtc')) { + validate215.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema200.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema200.allOf[0].properties.type.enum, + parentSchema: schema200.allOf[0].properties.type, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate215.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema200.allOf[0].type, + parentSchema: schema200.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs4 = errors; + if (errors === _errs4) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate215.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema200.allOf[1].required, + parentSchema: schema200.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data1 = data.devices; + const _errs6 = errors; + if (errors === _errs6) { + if (Array.isArray(data1)) { + if (data1.length > 2) { + validate215.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema200.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } else { + if (data1.length < 2) { + validate215.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema200.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs8 = errors; + if (errors === _errs8) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing2; + if (data2.url === undefined && (missing2 = 'url')) { + validate215.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema200.allOf[1].properties.devices.items.required, + parentSchema: schema200.allOf[1].properties.devices.items, + data: data2, + }, + ]; + return false; + } else { + if (data2.url !== undefined) { + let data3 = data2.url; + const _errs10 = errors; + if (errors === _errs10) { + if (errors === _errs10) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + validate215.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema200.allOf[1].properties.devices.items + .properties.url, + data: data3, + }, + ]; + return false; + } + } else { + validate215.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema200.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema200.allOf[1].properties.devices.items + .properties.url, + data: data3, + }, + ]; + return false; + } + } + } + var valid4 = _errs10 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data2.config !== undefined) { + let data4 = data2.config; + const _errs12 = errors; + if (errors === _errs12) { + if ( + data4 && + typeof data4 == 'object' && + !Array.isArray(data4) + ) { + if (data4.services !== undefined) { + let data5 = data4.services; + const _errs14 = errors; + if (errors === _errs14) { + if (Array.isArray(data5)) { + var valid6 = true; + const len1 = data5.length; + for (let i1 = 0; i1 < len1; i1++) { + let data6 = data5[i1]; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + let missing3; + if ( + (data6.serviceType === undefined && + (missing3 = 'serviceType')) || + (data6.serviceId === undefined && + (missing3 = 'serviceId')) || + (data6.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate215.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: missing3, + }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema200.allOf[1].properties + .devices.items.properties.config + .properties.services.items + .required, + parentSchema: + schema200.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data6, + }, + ]; + return false; + } else { + if (data6.serviceType !== undefined) { + let data7 = data6.serviceType; + const _errs19 = errors; + if (errors === _errs19) { + if (errors === _errs19) { + if (typeof data7 === 'string') { + if (!formats0(data7)) { + validate215.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema200.allOf[1] + .properties.devices + .items.properties + .config.properties + .services.items + .properties + .serviceType, + data: data7, + }, + ]; + return false; + } + } else { + validate215.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema200.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType.type, + parentSchema: + schema200.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType, + data: data7, + }, + ]; + return false; + } + } + } + var valid7 = _errs19 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data6.serviceId !== undefined) { + let data8 = data6.serviceId; + const _errs21 = errors; + if (typeof data8 !== 'string') { + validate215.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema200.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId + .type, + parentSchema: + schema200.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId, + data: data8, + }, + ]; + return false; + } + var valid7 = _errs21 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if ( + data6.remoteServiceId !== + undefined + ) { + let data9 = data6.remoteServiceId; + const _errs23 = errors; + if (typeof data9 !== 'string') { + validate215.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema200.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId.type, + parentSchema: + schema200.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId, + data: data9, + }, + ]; + return false; + } + var valid7 = _errs23 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + validate215.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema200.allOf[1].properties + .devices.items.properties.config + .properties.services.items.type, + parentSchema: + schema200.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data6, + }, + ]; + return false; + } + } + var valid6 = _errs16 === errors; + if (!valid6) { + break; + } + } + } else { + validate215.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema200.allOf[1].properties.devices + .items.properties.config.properties + .services.type, + parentSchema: + schema200.allOf[1].properties.devices + .items.properties.config.properties + .services, + data: data5, + }, + ]; + return false; + } + } + } + } else { + validate215.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/config', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema200.allOf[1].properties.devices.items + .properties.config.type, + parentSchema: + schema200.allOf[1].properties.devices.items + .properties.config, + data: data4, + }, + ]; + return false; + } + } + var valid4 = _errs12 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate215.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema200.allOf[1].properties.devices.items.type, + parentSchema: schema200.allOf[1].properties.devices.items, + data: data2, + }, + ]; + return false; + } + } + var valid3 = _errs8 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate215.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema200.allOf[1].properties.devices.type, + parentSchema: schema200.allOf[1].properties.devices, + data: data1, + }, + ]; + return false; + } + } + } + } + } else { + validate215.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema200.allOf[1].type, + parentSchema: schema200.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs4 === errors; + } + validate215.errors = vErrors; + return errors === 0; +} +exports.validateGetPeerconnectionResponse200Response = validate216; +const schema201 = { + title: 'Peerconnection', + allOf: [ + { + type: 'object', + title: 'Peerconnection Common', + properties: { + url: { + type: 'string', + description: 'URL of the peerconnection', + format: 'uri', + readOnly: true, + }, + type: { + type: 'string', + description: 'Type of the peerconnection', + enum: ['local', 'webrtc'], + }, + status: { + readOnly: true, + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['url', 'type', 'status'], + }, + { + type: 'object', + properties: { + devices: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + title: 'Configured Device Reference', + type: 'object', + properties: { + url: { type: 'string', description: 'URL of the device', format: 'uri' }, + config: { + type: 'object', + properties: { + services: { + type: 'array', + items: { + title: 'Service Config', + type: 'object', + properties: { + serviceType: { type: 'string', format: 'uri' }, + serviceId: { type: 'string' }, + remoteServiceId: { type: 'string' }, + }, + required: ['serviceType', 'serviceId', 'remoteServiceId'], + additionalProperties: true, + }, + }, + }, + }, + }, + required: ['url'], + }, + }, + }, + required: ['devices'], + }, + ], + 'x-typeguard': true, + 'x-standalone': false, + 'x-name': 'getPeerconnectionResponse200Response', + 'x-location': + '#/paths//peerconnections/{peerconnection_id}/get/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate216( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + if (errors === _errs0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.url === undefined && (missing0 = 'url')) || + (data.type === undefined && (missing0 = 'type')) || + (data.status === undefined && (missing0 = 'status')) + ) { + validate216.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema201.allOf[0].required, + parentSchema: schema201.allOf[0], + data, + }, + ]; + return false; + } else { + if (data.url !== undefined) { + let data0 = data.url; + const _errs2 = errors; + if (errors === _errs2) { + if (errors === _errs2) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate216.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema201.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } else { + validate216.errors = [ + { + instancePath: instancePath + '/url', + schemaPath: '#/allOf/0/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema201.allOf[0].properties.url.type, + parentSchema: schema201.allOf[0].properties.url, + data: data0, + }, + ]; + return false; + } + } + } + var valid1 = _errs2 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.type !== undefined) { + let data1 = data.type; + const _errs4 = errors; + if (typeof data1 !== 'string') { + validate216.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema201.allOf[0].properties.type.type, + parentSchema: schema201.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + if (!(data1 === 'local' || data1 === 'webrtc')) { + validate216.errors = [ + { + instancePath: instancePath + '/type', + schemaPath: '#/allOf/0/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema201.allOf[0].properties.type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema201.allOf[0].properties.type.enum, + parentSchema: schema201.allOf[0].properties.type, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs4 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.status !== undefined) { + let data2 = data.status; + const _errs6 = errors; + if (typeof data2 !== 'string') { + validate216.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema201.allOf[0].properties.status.type, + parentSchema: schema201.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + if ( + !( + data2 === 'new' || + data2 === 'connecting' || + data2 === 'connected' || + data2 === 'disconnected' || + data2 === 'failed' || + data2 === 'closed' + ) + ) { + validate216.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/allOf/0/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema201.allOf[0].properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema201.allOf[0].properties.status.enum, + parentSchema: schema201.allOf[0].properties.status, + data: data2, + }, + ]; + return false; + } + var valid1 = _errs6 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate216.errors = [ + { + instancePath, + schemaPath: '#/allOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema201.allOf[0].type, + parentSchema: schema201.allOf[0], + data, + }, + ]; + return false; + } + } + var valid0 = _errs0 === errors; + if (valid0) { + const _errs8 = errors; + if (errors === _errs8) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing1; + if (data.devices === undefined && (missing1 = 'devices')) { + validate216.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema201.allOf[1].required, + parentSchema: schema201.allOf[1], + data, + }, + ]; + return false; + } else { + if (data.devices !== undefined) { + let data3 = data.devices; + const _errs10 = errors; + if (errors === _errs10) { + if (Array.isArray(data3)) { + if (data3.length > 2) { + validate216.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/maxItems', + keyword: 'maxItems', + params: { limit: 2 }, + message: 'must NOT have more than 2 items', + schema: 2, + parentSchema: schema201.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + if (data3.length < 2) { + validate216.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + schema: 2, + parentSchema: schema201.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } else { + var valid3 = true; + const len0 = data3.length; + for (let i0 = 0; i0 < len0; i0++) { + let data4 = data3[i0]; + const _errs12 = errors; + if (errors === _errs12) { + if (data4 && typeof data4 == 'object' && !Array.isArray(data4)) { + let missing2; + if (data4.url === undefined && (missing2 = 'url')) { + validate216.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema201.allOf[1].properties.devices.items.required, + parentSchema: schema201.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } else { + if (data4.url !== undefined) { + let data5 = data4.url; + const _errs14 = errors; + if (errors === _errs14) { + if (errors === _errs14) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate216.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema201.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } else { + validate216.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/url', + schemaPath: + '#/allOf/1/properties/devices/items/properties/url/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema201.allOf[1].properties.devices.items + .properties.url.type, + parentSchema: + schema201.allOf[1].properties.devices.items + .properties.url, + data: data5, + }, + ]; + return false; + } + } + } + var valid4 = _errs14 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data4.config !== undefined) { + let data6 = data4.config; + const _errs16 = errors; + if (errors === _errs16) { + if ( + data6 && + typeof data6 == 'object' && + !Array.isArray(data6) + ) { + if (data6.services !== undefined) { + let data7 = data6.services; + const _errs18 = errors; + if (errors === _errs18) { + if (Array.isArray(data7)) { + var valid6 = true; + const len1 = data7.length; + for (let i1 = 0; i1 < len1; i1++) { + let data8 = data7[i1]; + const _errs20 = errors; + if (errors === _errs20) { + if ( + data8 && + typeof data8 == 'object' && + !Array.isArray(data8) + ) { + let missing3; + if ( + (data8.serviceType === undefined && + (missing3 = 'serviceType')) || + (data8.serviceId === undefined && + (missing3 = 'serviceId')) || + (data8.remoteServiceId === undefined && + (missing3 = 'remoteServiceId')) + ) { + validate216.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/required', + keyword: 'required', + params: { + missingProperty: missing3, + }, + message: + "must have required property '" + + missing3 + + "'", + schema: + schema201.allOf[1].properties + .devices.items.properties.config + .properties.services.items + .required, + parentSchema: + schema201.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } else { + if (data8.serviceType !== undefined) { + let data9 = data8.serviceType; + const _errs23 = errors; + if (errors === _errs23) { + if (errors === _errs23) { + if (typeof data9 === 'string') { + if (!formats0(data9)) { + validate216.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/format', + keyword: 'format', + params: { format: 'uri' }, + message: + 'must match format "' + + 'uri' + + '"', + schema: 'uri', + parentSchema: + schema201.allOf[1] + .properties.devices + .items.properties + .config.properties + .services.items + .properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } else { + validate216.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceType', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceType/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema201.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType.type, + parentSchema: + schema201.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .serviceType, + data: data9, + }, + ]; + return false; + } + } + } + var valid7 = _errs23 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if (data8.serviceId !== undefined) { + let data10 = data8.serviceId; + const _errs25 = errors; + if (typeof data10 !== 'string') { + validate216.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/serviceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/serviceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema201.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId + .type, + parentSchema: + schema201.allOf[1] + .properties.devices.items + .properties.config + .properties.services.items + .properties.serviceId, + data: data10, + }, + ]; + return false; + } + var valid7 = _errs25 === errors; + } else { + var valid7 = true; + } + if (valid7) { + if ( + data8.remoteServiceId !== + undefined + ) { + let data11 = + data8.remoteServiceId; + const _errs27 = errors; + if (typeof data11 !== 'string') { + validate216.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1 + + '/remoteServiceId', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/properties/remoteServiceId/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema201.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId.type, + parentSchema: + schema201.allOf[1] + .properties.devices + .items.properties.config + .properties.services + .items.properties + .remoteServiceId, + data: data11, + }, + ]; + return false; + } + var valid7 = _errs27 === errors; + } else { + var valid7 = true; + } + } + } + } + } else { + validate216.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services/' + + i1, + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema201.allOf[1].properties + .devices.items.properties.config + .properties.services.items.type, + parentSchema: + schema201.allOf[1].properties + .devices.items.properties.config + .properties.services.items, + data: data8, + }, + ]; + return false; + } + } + var valid6 = _errs20 === errors; + if (!valid6) { + break; + } + } + } else { + validate216.errors = [ + { + instancePath: + instancePath + + '/devices/' + + i0 + + '/config/services', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/properties/services/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: + schema201.allOf[1].properties.devices + .items.properties.config.properties + .services.type, + parentSchema: + schema201.allOf[1].properties.devices + .items.properties.config.properties + .services, + data: data7, + }, + ]; + return false; + } + } + } + } else { + validate216.errors = [ + { + instancePath: + instancePath + '/devices/' + i0 + '/config', + schemaPath: + '#/allOf/1/properties/devices/items/properties/config/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema201.allOf[1].properties.devices.items + .properties.config.type, + parentSchema: + schema201.allOf[1].properties.devices.items + .properties.config, + data: data6, + }, + ]; + return false; + } + } + var valid4 = _errs16 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate216.errors = [ + { + instancePath: instancePath + '/devices/' + i0, + schemaPath: '#/allOf/1/properties/devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema201.allOf[1].properties.devices.items.type, + parentSchema: schema201.allOf[1].properties.devices.items, + data: data4, + }, + ]; + return false; + } + } + var valid3 = _errs12 === errors; + if (!valid3) { + break; + } + } + } + } + } else { + validate216.errors = [ + { + instancePath: instancePath + '/devices', + schemaPath: '#/allOf/1/properties/devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema201.allOf[1].properties.devices.type, + parentSchema: schema201.allOf[1].properties.devices, + data: data3, + }, + ]; + return false; + } + } + } + } + } else { + validate216.errors = [ + { + instancePath, + schemaPath: '#/allOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema201.allOf[1].type, + parentSchema: schema201.allOf[1], + data, + }, + ]; + return false; + } + } + var valid0 = _errs8 === errors; + } + validate216.errors = vErrors; + return errors === 0; +} +exports.validatePatchPeerconnectionDeviceStatusBodyRequest = validate217; +const schema202 = { + type: 'object', + properties: { + status: { + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['status'], + 'x-standalone': false, + 'x-name': 'patchPeerconnectionDeviceStatusBodyRequest', + 'x-location': + '#/paths//peerconnections/{peerconnection_id}/device_status/patch/requestBody/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate217( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.status === undefined && (missing0 = 'status')) { + validate217.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema202.required, + parentSchema: schema202, + data, + }, + ]; + return false; + } else { + if (data.status !== undefined) { + let data0 = data.status; + if (typeof data0 !== 'string') { + validate217.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema202.properties.status.type, + parentSchema: schema202.properties.status, + data: data0, + }, + ]; + return false; + } + if ( + !( + data0 === 'new' || + data0 === 'connecting' || + data0 === 'connected' || + data0 === 'disconnected' || + data0 === 'failed' || + data0 === 'closed' + ) + ) { + validate217.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema202.properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema202.properties.status.enum, + parentSchema: schema202.properties.status, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate217.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema202.type, + parentSchema: schema202, + data, + }, + ]; + return false; + } + } + validate217.errors = vErrors; + return errors === 0; +} +exports.validatePatchPeerconnectionDeviceStatusBodyResponse = validate218; +const schema203 = { + type: 'object', + properties: { + status: { + title: 'Connection Status', + type: 'string', + description: 'The status of the peerconnection.', + enum: ['new', 'connecting', 'connected', 'disconnected', 'failed', 'closed'], + }, + }, + required: ['status'], + 'x-standalone': false, + 'x-name': 'patchPeerconnectionDeviceStatusBodyResponse', + 'x-location': + '#/paths//peerconnections/{peerconnection_id}/device_status/patch/requestBody/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate218( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.status === undefined && (missing0 = 'status')) { + validate218.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema203.required, + parentSchema: schema203, + data, + }, + ]; + return false; + } else { + if (data.status !== undefined) { + let data0 = data.status; + if (typeof data0 !== 'string') { + validate218.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/properties/status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema203.properties.status.type, + parentSchema: schema203.properties.status, + data: data0, + }, + ]; + return false; + } + if ( + !( + data0 === 'new' || + data0 === 'connecting' || + data0 === 'connected' || + data0 === 'disconnected' || + data0 === 'failed' || + data0 === 'closed' + ) + ) { + validate218.errors = [ + { + instancePath: instancePath + '/status', + schemaPath: '#/properties/status/enum', + keyword: 'enum', + params: { allowedValues: schema203.properties.status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema203.properties.status.enum, + parentSchema: schema203.properties.status, + data: data0, + }, + ]; + return false; + } + } + } + } else { + validate218.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema203.type, + parentSchema: schema203, + data, + }, + ]; + return false; + } + } + validate218.errors = vErrors; + return errors === 0; +} diff --git a/services/booking/src/common/src/clients/device/basicValidation.d.cts b/services/booking/src/common/src/clients/device/basicValidation.d.cts new file mode 100644 index 00000000..0b0f3281 --- /dev/null +++ b/services/booking/src/common/src/clients/device/basicValidation.d.cts @@ -0,0 +1,791 @@ +export declare function validateAuthenticationMessage< + T extends 'request' | 'response' | 'all', +>(object: unknown): AuthenticationMessage; + +export declare function validateConnectionStateChangedMessage< + T extends 'request' | 'response' | 'all', +>(object: unknown): ConnectionStateChangedMessage; + +export declare function validateUserReference( + object: unknown, +): UserReference; + +export declare function validateDeviceOverview( + object: unknown, +): DeviceOverview; + +export declare function validateServiceDescription< + T extends 'request' | 'response' | 'all', +>(object: unknown): ServiceDescription; + +export declare function validateInstantiableCloudDevice< + T extends 'request' | 'response' | 'all', +>(object: unknown): InstantiableCloudDevice; + +export declare function validateTimeSlot( + object: unknown, +): TimeSlot; + +export declare function validateAvailability( + object: unknown, +): Availability; + +export declare function validateConcreteDevice( + object: unknown, +): ConcreteDevice; + +export declare function validateInstantiableBrowserDevice< + T extends 'request' | 'response' | 'all', +>(object: unknown): InstantiableBrowserDevice; + +export declare function validateDeviceReference( + object: unknown, +): DeviceReference; + +export declare function validateDeviceGroup( + object: unknown, +): DeviceGroup; + +export declare function validateDevice( + object: unknown, +): Device; + +export declare function validateCallback( + object: unknown, +): Callback; + +export declare function validateEventCallback( + object: unknown, +): EventCallback; + +export declare function validateDeviceChangedEventCallback< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceChangedEventCallback; + +export declare function validateDeviceOverviewUpdate< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceOverviewUpdate; + +export declare function validateInstantiableCloudDeviceUpdate< + T extends 'request' | 'response' | 'all', +>(object: unknown): InstantiableCloudDeviceUpdate; + +export declare function validateConcreteDeviceUpdate< + T extends 'request' | 'response' | 'all', +>(object: unknown): ConcreteDeviceUpdate; + +export declare function validateInstantiableBrowserDeviceUpdate< + T extends 'request' | 'response' | 'all', +>(object: unknown): InstantiableBrowserDeviceUpdate; + +export declare function validateDeviceGroupUpdate< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceGroupUpdate; + +export declare function validateDeviceUpdate( + object: unknown, +): DeviceUpdate; + +export declare function validateAvailabilityRule< + T extends 'request' | 'response' | 'all', +>(object: unknown): AvailabilityRule; + +export declare function validateMessage( + object: unknown, +): Message; + +export declare function validateCommandMessage( + object: unknown, +): CommandMessage; + +export declare function validateServiceConfig( + object: unknown, +): ServiceConfig; + +export declare function validateCreatePeerconnectionMessage< + T extends 'request' | 'response' | 'all', +>(object: unknown): CreatePeerconnectionMessage; + +export declare function validateClosePeerconnectionMessage< + T extends 'request' | 'response' | 'all', +>(object: unknown): ClosePeerconnectionMessage; + +export declare function validateSignalingMessage< + T extends 'request' | 'response' | 'all', +>(object: unknown): SignalingMessage; + +export declare function validateConfigurationMessage< + T extends 'request' | 'response' | 'all', +>(object: unknown): ConfigurationMessage; + +export declare function validateExperimentStatusChangedMessage< + T extends 'request' | 'response' | 'all', +>(object: unknown): ExperimentStatusChangedMessage; + +export declare function validateLoggingMessage( + object: unknown, +): LoggingMessage; + +export declare function validateConnectionStatus< + T extends 'request' | 'response' | 'all', +>(object: unknown): ConnectionStatus; + +export declare function validatePeerconnectionCommon< + T extends 'request' | 'response' | 'all', +>(object: unknown): PeerconnectionCommon; + +export declare function validatePeerconnectionOverview< + T extends 'request' | 'response' | 'all', +>(object: unknown): PeerconnectionOverview; + +export declare function validateConfiguredDeviceReference< + T extends 'request' | 'response' | 'all', +>(object: unknown): ConfiguredDeviceReference; + +export declare function validatePeerconnection( + object: unknown, +): Peerconnection; + +export declare function validatePeerconnectionClosedEventCallback< + T extends 'request' | 'response' | 'all', +>(object: unknown): PeerconnectionClosedEventCallback; + +export declare function validatePeerconnectionStatusChangedEventCallback< + T extends 'request' | 'response' | 'all', +>(object: unknown): PeerconnectionStatusChangedEventCallback; + +export declare function validateChangedUrl( + object: unknown, +): ChangedUrl; + +export declare function validateDeviceId( + object: unknown, +): DeviceId; + +export declare function validateFlatGroup( + object: unknown, +): FlatGroup; + +export declare function validateStartTime( + object: unknown, +): StartTime; + +export declare function validateEndTime( + object: unknown, +): EndTime; + +export declare function validateClosedUrl( + object: unknown, +): ClosedUrl; + +export declare function validateStatusChangedUrl< + T extends 'request' | 'response' | 'all', +>(object: unknown): StatusChangedUrl; + +export declare function validatePeerconnectionId< + T extends 'request' | 'response' | 'all', +>(object: unknown): PeerconnectionId; + +export declare function validateDeviceUrl( + object: unknown, +): DeviceUrl; + +export declare function validateListDevicesResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): listDevicesResponse200; + +export declare function validateCreateDeviceBody< + T extends 'request' | 'response' | 'all', +>(object: unknown): createDeviceBody; + +export declare function validateCreateDeviceResponse201< + T extends 'request' | 'response' | 'all', +>(object: unknown): createDeviceResponse201; + +export declare function validateGetDeviceResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): getDeviceResponse200; + +export declare function validateUpdateDeviceBody< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateDeviceBody; + +export declare function validateUpdateDeviceResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateDeviceResponse200; + +export declare function validateInstantiateDeviceResponse201< + T extends 'request' | 'response' | 'all', +>(object: unknown): instantiateDeviceResponse201; + +export declare function validateGetDeviceAvailabilityResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): getDeviceAvailabilityResponse200; + +export declare function validateAddDeviceAvailabilityRulesBody< + T extends 'request' | 'response' | 'all', +>(object: unknown): addDeviceAvailabilityRulesBody; + +export declare function validateAddDeviceAvailabilityRulesResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): addDeviceAvailabilityRulesResponse200; + +export declare function validateCreateWebsocketTokenResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): createWebsocketTokenResponse200; + +export declare function validateSendSignalingMessageBody< + T extends 'request' | 'response' | 'all', +>(object: unknown): sendSignalingMessageBody; + +export declare function validateListPeerconnectionsResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): listPeerconnectionsResponse200; + +export declare function validateCreatePeerconnectionBody< + T extends 'request' | 'response' | 'all', +>(object: unknown): createPeerconnectionBody; + +export declare function validateCreatePeerconnectionResponse201< + T extends 'request' | 'response' | 'all', +>(object: unknown): createPeerconnectionResponse201; + +export declare function validateCreatePeerconnectionResponse202< + T extends 'request' | 'response' | 'all', +>(object: unknown): createPeerconnectionResponse202; + +export declare function validateGetPeerconnectionResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): getPeerconnectionResponse200; + +export declare function validatePatchPeerconnectionDeviceStatusBody< + T extends 'request' | 'response' | 'all', +>(object: unknown): patchPeerconnectionDeviceStatusBody; + +export declare function validateAuthenticationMessageRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): AuthenticationMessageRequest; + +export declare function validateAuthenticationMessageResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): AuthenticationMessageResponse; + +export declare function validateConnectionStateChangedMessageRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ConnectionStateChangedMessageRequest; + +export declare function validateConnectionStateChangedMessageResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ConnectionStateChangedMessageResponse; + +export declare function validateUserReferenceRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): UserReferenceRequest; + +export declare function validateUserReferenceResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): UserReferenceResponse; + +export declare function validateDeviceOverviewRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceOverviewRequest; + +export declare function validateDeviceOverviewResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceOverviewResponse; + +export declare function validateServiceDescriptionRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ServiceDescriptionRequest; + +export declare function validateServiceDescriptionResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ServiceDescriptionResponse; + +export declare function validateInstantiableCloudDeviceRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): InstantiableCloudDeviceRequest; + +export declare function validateInstantiableCloudDeviceResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): InstantiableCloudDeviceResponse; + +export declare function validateTimeSlotRequest( + object: unknown, +): TimeSlotRequest; + +export declare function validateTimeSlotResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): TimeSlotResponse; + +export declare function validateAvailabilityRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): AvailabilityRequest; + +export declare function validateAvailabilityResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): AvailabilityResponse; + +export declare function validateConcreteDeviceRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ConcreteDeviceRequest; + +export declare function validateConcreteDeviceResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ConcreteDeviceResponse; + +export declare function validateInstantiableBrowserDeviceRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): InstantiableBrowserDeviceRequest; + +export declare function validateInstantiableBrowserDeviceResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): InstantiableBrowserDeviceResponse; + +export declare function validateDeviceReferenceRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceReferenceRequest; + +export declare function validateDeviceReferenceResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceReferenceResponse; + +export declare function validateDeviceGroupRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceGroupRequest; + +export declare function validateDeviceGroupResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceGroupResponse; + +export declare function validateDeviceRequest( + object: unknown, +): DeviceRequest; + +export declare function validateDeviceResponse( + object: unknown, +): DeviceResponse; + +export declare function validateCallbackRequest( + object: unknown, +): CallbackRequest; + +export declare function validateCallbackResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): CallbackResponse; + +export declare function validateEventCallbackRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): EventCallbackRequest; + +export declare function validateEventCallbackResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): EventCallbackResponse; + +export declare function validateDeviceChangedEventCallbackRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceChangedEventCallbackRequest; + +export declare function validateDeviceChangedEventCallbackResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceChangedEventCallbackResponse; + +export declare function validateDeviceOverviewUpdateRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceOverviewUpdateRequest; + +export declare function validateDeviceOverviewUpdateResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceOverviewUpdateResponse; + +export declare function validateInstantiableCloudDeviceUpdateRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): InstantiableCloudDeviceUpdateRequest; + +export declare function validateInstantiableCloudDeviceUpdateResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): InstantiableCloudDeviceUpdateResponse; + +export declare function validateConcreteDeviceUpdateRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ConcreteDeviceUpdateRequest; + +export declare function validateConcreteDeviceUpdateResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ConcreteDeviceUpdateResponse; + +export declare function validateInstantiableBrowserDeviceUpdateRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): InstantiableBrowserDeviceUpdateRequest; + +export declare function validateInstantiableBrowserDeviceUpdateResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): InstantiableBrowserDeviceUpdateResponse; + +export declare function validateDeviceGroupUpdateRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceGroupUpdateRequest; + +export declare function validateDeviceGroupUpdateResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceGroupUpdateResponse; + +export declare function validateDeviceUpdateRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceUpdateRequest; + +export declare function validateDeviceUpdateResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceUpdateResponse; + +export declare function validateAvailabilityRuleRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): AvailabilityRuleRequest; + +export declare function validateAvailabilityRuleResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): AvailabilityRuleResponse; + +export declare function validateMessageRequest( + object: unknown, +): MessageRequest; + +export declare function validateMessageResponse( + object: unknown, +): MessageResponse; + +export declare function validateCommandMessageRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): CommandMessageRequest; + +export declare function validateCommandMessageResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): CommandMessageResponse; + +export declare function validateServiceConfigRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ServiceConfigRequest; + +export declare function validateServiceConfigResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ServiceConfigResponse; + +export declare function validateCreatePeerconnectionMessageRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): CreatePeerconnectionMessageRequest; + +export declare function validateCreatePeerconnectionMessageResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): CreatePeerconnectionMessageResponse; + +export declare function validateClosePeerconnectionMessageRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ClosePeerconnectionMessageRequest; + +export declare function validateClosePeerconnectionMessageResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ClosePeerconnectionMessageResponse; + +export declare function validateSignalingMessageRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): SignalingMessageRequest; + +export declare function validateSignalingMessageResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): SignalingMessageResponse; + +export declare function validateConfigurationMessageRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ConfigurationMessageRequest; + +export declare function validateConfigurationMessageResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ConfigurationMessageResponse; + +export declare function validateExperimentStatusChangedMessageRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ExperimentStatusChangedMessageRequest; + +export declare function validateExperimentStatusChangedMessageResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ExperimentStatusChangedMessageResponse; + +export declare function validateLoggingMessageRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): LoggingMessageRequest; + +export declare function validateLoggingMessageResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): LoggingMessageResponse; + +export declare function validateConnectionStatusRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ConnectionStatusRequest; + +export declare function validateConnectionStatusResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ConnectionStatusResponse; + +export declare function validatePeerconnectionCommonRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): PeerconnectionCommonRequest; + +export declare function validatePeerconnectionCommonResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): PeerconnectionCommonResponse; + +export declare function validatePeerconnectionOverviewRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): PeerconnectionOverviewRequest; + +export declare function validatePeerconnectionOverviewResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): PeerconnectionOverviewResponse; + +export declare function validateConfiguredDeviceReferenceRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ConfiguredDeviceReferenceRequest; + +export declare function validateConfiguredDeviceReferenceResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ConfiguredDeviceReferenceResponse; + +export declare function validatePeerconnectionRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): PeerconnectionRequest; + +export declare function validatePeerconnectionResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): PeerconnectionResponse; + +export declare function validatePeerconnectionClosedEventCallbackRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): PeerconnectionClosedEventCallbackRequest; + +export declare function validatePeerconnectionClosedEventCallbackResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): PeerconnectionClosedEventCallbackResponse; + +export declare function validatePeerconnectionStatusChangedEventCallbackRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): PeerconnectionStatusChangedEventCallbackRequest; + +export declare function validatePeerconnectionStatusChangedEventCallbackResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): PeerconnectionStatusChangedEventCallbackResponse; + +export declare function validateChangedUrlRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ChangedUrlRequest; + +export declare function validateChangedUrlResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ChangedUrlResponse; + +export declare function validateDeviceIdRequest( + object: unknown, +): DeviceIdRequest; + +export declare function validateDeviceIdResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceIdResponse; + +export declare function validateFlatGroupRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): FlatGroupRequest; + +export declare function validateFlatGroupResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): FlatGroupResponse; + +export declare function validateStartTimeRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): StartTimeRequest; + +export declare function validateStartTimeResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): StartTimeResponse; + +export declare function validateEndTimeRequest( + object: unknown, +): EndTimeRequest; + +export declare function validateEndTimeResponse( + object: unknown, +): EndTimeResponse; + +export declare function validateClosedUrlRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ClosedUrlRequest; + +export declare function validateClosedUrlResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ClosedUrlResponse; + +export declare function validateStatusChangedUrlRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): StatusChangedUrlRequest; + +export declare function validateStatusChangedUrlResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): StatusChangedUrlResponse; + +export declare function validatePeerconnectionIdRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): PeerconnectionIdRequest; + +export declare function validatePeerconnectionIdResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): PeerconnectionIdResponse; + +export declare function validateDeviceUrlRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceUrlRequest; + +export declare function validateDeviceUrlResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): DeviceUrlResponse; + +export declare function validateListDevicesResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): listDevicesResponse200Request; + +export declare function validateListDevicesResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): listDevicesResponse200Response; + +export declare function validateCreateDeviceBodyRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): createDeviceBodyRequest; + +export declare function validateCreateDeviceBodyResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): createDeviceBodyResponse; + +export declare function validateCreateDeviceResponse201Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): createDeviceResponse201Request; + +export declare function validateCreateDeviceResponse201Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): createDeviceResponse201Response; + +export declare function validateGetDeviceResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): getDeviceResponse200Request; + +export declare function validateGetDeviceResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): getDeviceResponse200Response; + +export declare function validateUpdateDeviceBodyRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateDeviceBodyRequest; + +export declare function validateUpdateDeviceBodyResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateDeviceBodyResponse; + +export declare function validateUpdateDeviceResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateDeviceResponse200Request; + +export declare function validateUpdateDeviceResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateDeviceResponse200Response; + +export declare function validateInstantiateDeviceResponse201Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): instantiateDeviceResponse201Request; + +export declare function validateInstantiateDeviceResponse201Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): instantiateDeviceResponse201Response; + +export declare function validateGetDeviceAvailabilityResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): getDeviceAvailabilityResponse200Request; + +export declare function validateGetDeviceAvailabilityResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): getDeviceAvailabilityResponse200Response; + +export declare function validateAddDeviceAvailabilityRulesBodyRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): addDeviceAvailabilityRulesBodyRequest; + +export declare function validateAddDeviceAvailabilityRulesBodyResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): addDeviceAvailabilityRulesBodyResponse; + +export declare function validateAddDeviceAvailabilityRulesResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): addDeviceAvailabilityRulesResponse200Request; + +export declare function validateAddDeviceAvailabilityRulesResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): addDeviceAvailabilityRulesResponse200Response; + +export declare function validateCreateWebsocketTokenResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): createWebsocketTokenResponse200Request; + +export declare function validateCreateWebsocketTokenResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): createWebsocketTokenResponse200Response; + +export declare function validateSendSignalingMessageBodyRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): sendSignalingMessageBodyRequest; + +export declare function validateSendSignalingMessageBodyResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): sendSignalingMessageBodyResponse; + +export declare function validateListPeerconnectionsResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): listPeerconnectionsResponse200Request; + +export declare function validateListPeerconnectionsResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): listPeerconnectionsResponse200Response; + +export declare function validateCreatePeerconnectionBodyRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): createPeerconnectionBodyRequest; + +export declare function validateCreatePeerconnectionBodyResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): createPeerconnectionBodyResponse; + +export declare function validateCreatePeerconnectionResponse201Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): createPeerconnectionResponse201Request; + +export declare function validateCreatePeerconnectionResponse201Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): createPeerconnectionResponse201Response; + +export declare function validateCreatePeerconnectionResponse202Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): createPeerconnectionResponse202Request; + +export declare function validateCreatePeerconnectionResponse202Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): createPeerconnectionResponse202Response; + +export declare function validateGetPeerconnectionResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): getPeerconnectionResponse200Request; + +export declare function validateGetPeerconnectionResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): getPeerconnectionResponse200Response; + +export declare function validatePatchPeerconnectionDeviceStatusBodyRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): patchPeerconnectionDeviceStatusBodyRequest; + +export declare function validatePatchPeerconnectionDeviceStatusBodyResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): patchPeerconnectionDeviceStatusBodyResponse; diff --git a/services/booking/src/common/src/clients/device/client.ts b/services/booking/src/common/src/clients/device/client.ts new file mode 100644 index 00000000..46a0ace9 --- /dev/null +++ b/services/booking/src/common/src/clients/device/client.ts @@ -0,0 +1,1569 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import fetch, { RequestInfo, RequestInit, Response } from 'node-fetch'; + +import * as RequestValidation from './requestValidation.js'; +import * as Signatures from './signatures.js'; +import * as Types from './types.js'; +// @ts-ignore +import { type Require } from './types.js'; + +/** + * This error class should be used if an error occurs during validation of a request/response. + * @category Errors + */ +export class ValidationError extends Error { + public errors: unknown; + + constructor(message: string, errors: unknown) { + super(message); + this.name = 'ValidationError'; + this.errors = errors; + } +} + +/** + * This error class should be used if an error occurs while fetching a request. + * @category Errors + */ +export class FetchError extends Error { + constructor(message: string) { + super(message); + this.name = 'FetchError'; + } +} + +/** + * This error class should be used if the response of the server has a status + * greater than or equal to 400. This error should contain the validated response. + * @category Errors + */ +export class UnsuccessfulRequestError extends Error { + public response: Types.ResponseData; + + constructor(message: string, response: Types.ResponseData) { + super(message); + this.response = response; + this.name = 'UnsuccessfulRequestError'; + } +} + +/** + * This error class should be used if the validation of an url fails. + * @category Errors + */ +export class InvalidUrlError extends Error { + constructor(message: string) { + super(message); + this.name = 'InvalidUrlError'; + } +} + +/** + * This function attempts to parse a Response as ResponseData. + */ +async function parseResponse(response: Response): Promise { + let text = null; + try { + text = await response.text(); + const json = JSON.parse(text); + return { status: response.status, body: json }; + } catch { + return { status: response.status, body: text }; + } +} + +/** + * This function checks if a string is a valid http url. + * @param string The string to be checked. + * @returns True if the string is a valid http url. + */ +function isValidHttpUrl(string: string) { + let url; + + try { + url = new URL(string); + } catch (_) { + return false; + } + + return url.protocol === 'http:' || url.protocol === 'https:'; +} + +/** + * This function takes an url and a pattern for the requested endpoint and parses the contained path parameters. + * @param url The url to be parsed. + * @param endpoint Pattern of the requested endpoint. + * @throws {InvalidUrlError} Thrown if the provided url does not end with the provided endpoint. + * @returns An array containing all parsed path parameters in order of appearance. + * @example + * // returns ["username", "role_name"] + * parsePathParameters("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") + */ +function parsePathParameters(url: string, endpoint: string): string[] { + const parameterRegex = '([^/]+)'; + const regex = new RegExp(endpoint.replaceAll('{}', parameterRegex) + '(?:.(?!\\\\))?$'); + const matches = url.match(regex); + + if (!matches) throw new InvalidUrlError('Url does not end with the provided endpoint'); + + return matches.slice(1); +} + +/** + * This function validates a given http url and parses its path parameters. + * @param url The url to be validated. + * @param endpoint Pattern of the requested endpoint. + * @throws {InvalidUrlError} Thrown if the validation of the provided url fails. + * @returns An array containing all parsed path parameters in order of appearance (see {@link parsePathParameters}). + * @example + * // returns ["username", "role_name"] + * validateUrl("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") + */ +function validateUrl(url: string, endpoint: string): string[] { + if (!isValidHttpUrl(url)) + throw new InvalidUrlError('Provided url is not a valid http url'); + return parsePathParameters(url, endpoint); +} + +/** + * This function appends a given endpoint to an url. + * @param url The url to append the endpoint to. + * @param endpoint The endpoint to be appended. + * @example + * // returns "https://api.example.com/devices/device_id/token" + * appendToUrl("https://api.example.com/devices/device_id", "/token") + * @example + * // returns "https://api.example.com/devices/device_id/token" + * appendToUrl("https://api.example.com/devices/device_id/", "/token") + * @returns The url with the appended endpoint. + */ +function appendToUrl(url: string, endpoint: string) { + return url.endsWith('/') ? `${url.slice(0, -1)}${endpoint}` : `${url}${endpoint}`; +} + +/** + * Client for the use of the Crosslab API + * @category Client + */ +export class Client { + public readonly baseUrl: string; + public readonly serviceUrl: string; + public accessToken: string; + private fixedHeaders: [string, string][]; + private fetch = async (url: RequestInfo | URL, init: RequestInit) => { + let raw_response; + const parsedUrl = new URL(url.toString()); + try { + if ( + parsedUrl.toString().startsWith(this.baseUrl) || + parsedUrl.toString().startsWith(this.serviceUrl) + ) { + raw_response = await fetch(url, init); + } else { + raw_response = await fetch( + appendToUrl( + this.baseUrl, + '/proxy?' + new URLSearchParams([['URL', url.toString()]]).toString(), + ), + init, + ); + } + } catch (error) { + if (error instanceof Error) { + throw new FetchError(error.message); + } else if (typeof error === 'string') { + throw new FetchError(error); + } else { + throw new FetchError('Something went wrong while trying to fetch the request'); + } + } + return await parseResponse(raw_response); + }; + + /** + * @category Constructors + */ + constructor( + baseUrl: string, + options: { + serviceUrl?: string; + accessToken?: string; + fixedHeaders?: [string, string][]; + }, + ) { + this.baseUrl = new URL(baseUrl).toString().slice(0, -1); + this.serviceUrl = new URL(options.serviceUrl ?? this.baseUrl).toString().slice(0, -1); + this.accessToken = options.accessToken ?? ''; + this.fixedHeaders = options.fixedHeaders ?? []; + } + + /** + * List devices + * + * @param options.url + * Url of the to be used. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The list of all devices. + */ + public async listDevices(options?: { + headers?: [string, string][]; + url?: string; + }): Promise { + const url = appendToUrl(options?.url ?? this.baseUrl, '/devices'); + console.log('trying to fetch url:', url); + + if (!RequestValidation.validateListDevicesInput()) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateListDevicesInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'GET', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateListDevicesOutput(response)) + throw new ValidationError( + 'Response validation failed!', + (RequestValidation.validateListDevicesOutput as Types.FunctionWithErrors).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * Create a new device + * + * @param device + * The device to be created. + * @param options.changedUrl + * **An URL that will be called once the device changes.** + * + * Once the device was given a changedUrl parameter the contained URL will be called every time a device is changed + * as long as every callback resolves with a successful status code. + * + * If the callback fails the url MIGHT not be called in the future. + * + * There can be multiple callbacks registered with the same device. + * @param options.url + * Url of the to be used. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The device was created. A JSON representation of the new device is returned. + */ + public async createDevice( + device: Types.Device<'request'>, + options?: { + headers?: [string, string][]; + changedUrl?: string; + url?: string; + }, + ): Promise { + const url = appendToUrl(options?.url ?? this.baseUrl, '/devices'); + console.log('trying to fetch url:', url); + + const body = device; + + const parameters = { + changedUrl: options?.changedUrl, + }; + + const query: [string, string][] = []; + + if (parameters['changedUrl']) + query.push(['changedUrl', parameters['changedUrl'].toString()]); + + if (!RequestValidation.validateCreateDeviceInput(parameters, body)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateCreateDeviceInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); + + if (!RequestValidation.validateCreateDeviceOutput(response)) + throw new ValidationError( + 'Response validation failed!', + (RequestValidation.validateCreateDeviceOutput as Types.FunctionWithErrors).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * View a registered device + * + * @param url + * Url of the resource to be accessed. + * @param options.flat_group + * If true the returned device group will only contain concrete devices. I.e. any subgroups will be flattend. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The JSON Representation of the device. + */ + public async getDevice( + url: string, + options?: { + headers?: [string, string][]; + flat_group?: boolean; + }, + ): Promise { + const urlSuffix = '/devices/{}'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}'); + console.log('trying to fetch url:', url); + + const parameters = { + device_id: device_id, + flat_group: options?.flat_group, + }; + + const query: [string, string][] = []; + + if (parameters['flat_group']) + query.push(['flat_group', parameters['flat_group'].toString()]); + + if (!RequestValidation.validateGetDeviceInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateGetDeviceInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + { + method: 'GET', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateGetDeviceOutput(response)) + throw new ValidationError( + 'Response validation failed!', + (RequestValidation.validateGetDeviceOutput as Types.FunctionWithErrors).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * Update an existing device + * + * @param url + * Url of the resource to be accessed. + * @param deviceUpdate + * Updated device. + * @param options.changedUrl + * **An URL that will be called once the device changes.** + * + * Once the device was given a changedUrl parameter the contained URL will be called every time a device is changed + * as long as every callback resolves with a successful status code. + * + * If the callback fails the url MIGHT not be called in the future. + * + * There can be multiple callbacks registered with the same device. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The JSON Representation of the changed device. + */ + public async updateDevice( + url: string, + deviceUpdate: Types.DeviceUpdate<'request'> | undefined, + options?: { + headers?: [string, string][]; + changedUrl?: string; + }, + ): Promise { + const urlSuffix = '/devices/{}'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}'); + console.log('trying to fetch url:', url); + + const body = deviceUpdate; + + const parameters = { + device_id: device_id, + changedUrl: options?.changedUrl, + }; + + const query: [string, string][] = []; + + if (parameters['changedUrl']) + query.push(['changedUrl', parameters['changedUrl'].toString()]); + + if (!RequestValidation.validateUpdateDeviceInput(parameters, body)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateUpdateDeviceInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + { + method: 'PATCH', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); + + if (!RequestValidation.validateUpdateDeviceOutput(response)) + throw new ValidationError( + 'Response validation failed!', + (RequestValidation.validateUpdateDeviceOutput as Types.FunctionWithErrors).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * Delete a registered device + * + * @param url + * Url of the resource to be accessed. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The device was deleted. + */ + public async deleteDevice( + url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/devices/{}'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}'); + console.log('trying to fetch url:', url); + + const parameters = { + device_id: device_id, + }; + + if (!RequestValidation.validateDeleteDeviceInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateDeleteDeviceInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'DELETE', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateDeleteDeviceOutput(response)) + throw new ValidationError( + 'Response validation failed!', + (RequestValidation.validateDeleteDeviceOutput as Types.FunctionWithErrors).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + } + + /** + * Instantiate a cloud instantiable device + * + * @param url + * Url of the resource to be accessed. + * @param options.changedUrl + * **An URL that will be called once the device changes.** + * + * Once the device was given a changedUrl parameter the contained URL will be called every time a device is changed + * as long as every callback resolves with a successful status code. + * + * If the callback fails the url MIGHT not be called in the future. + * + * There can be multiple callbacks registered with the same device. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The JSON Representation of the created instance. + */ + public async instantiateDevice( + url: string, + options?: { + headers?: [string, string][]; + changedUrl?: string; + }, + ): Promise { + const urlSuffix = '/devices/{}'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}'); + console.log('trying to fetch url:', url); + + const parameters = { + device_id: device_id, + changedUrl: options?.changedUrl, + }; + + const query: [string, string][] = []; + + if (parameters['changedUrl']) + query.push(['changedUrl', parameters['changedUrl'].toString()]); + + if (!RequestValidation.validateInstantiateDeviceInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + ( + RequestValidation.validateInstantiateDeviceInput as Types.FunctionWithErrors + ).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateInstantiateDeviceOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateInstantiateDeviceOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * Get the availability of a device + * + * @param url + * Url of the resource to be accessed. + * @param options.startTime + * Start time of the requested availability + * @param options.endTime + * End time of the requested availability + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The JSON Representation of the availability of the device. + */ + public async getDeviceAvailability( + url: string, + options?: { + headers?: [string, string][]; + startTime?: string; + endTime?: string; + }, + ): Promise { + const urlSuffix = '/devices/{}/availability'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}/availability'); + console.log('trying to fetch url:', url); + + const parameters = { + device_id: device_id, + startTime: options?.startTime, + endTime: options?.endTime, + }; + + const query: [string, string][] = []; + + if (parameters['startTime']) + query.push(['startTime', parameters['startTime'].toString()]); + + if (parameters['endTime']) query.push(['endTime', parameters['endTime'].toString()]); + + if (!RequestValidation.validateGetDeviceAvailabilityInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + ( + RequestValidation.validateGetDeviceAvailabilityInput as Types.FunctionWithErrors + ).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + { + method: 'GET', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateGetDeviceAvailabilityOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateGetDeviceAvailabilityOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * Delete the availability rules of a device + * + * @param url + * Url of the resource to be accessed. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The availability rules of the device were deleted successfully. + */ + public async deleteDeviceAvailabilityRules( + url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/devices/{}/availability'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}/availability'); + console.log('trying to fetch url:', url); + + const parameters = { + device_id: device_id, + }; + + if (!RequestValidation.validateDeleteDeviceAvailabilityRulesInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + ( + RequestValidation.validateDeleteDeviceAvailabilityRulesInput as Types.FunctionWithErrors + ).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'DELETE', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateDeleteDeviceAvailabilityRulesOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateDeleteDeviceAvailabilityRulesOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + } + + /** + * Add availability rules for a device + * + * @param url + * Url of the resource to be accessed. + * @param availabilityRules + * The availability rules to be applied. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The JSON Representation of the changed availability. + */ + public async addDeviceAvailabilityRules( + url: string, + availabilityRules: Types.AvailabilityRule<'request'>[] | undefined, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/devices/{}/availability'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}/availability'); + console.log('trying to fetch url:', url); + + const body = availabilityRules; + + const parameters = { + device_id: device_id, + }; + + if (!RequestValidation.validateAddDeviceAvailabilityRulesInput(parameters, body)) + throw new ValidationError( + 'Request validation failed!', + ( + RequestValidation.validateAddDeviceAvailabilityRulesInput as Types.FunctionWithErrors + ).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); + + if (!RequestValidation.validateAddDeviceAvailabilityRulesOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateAddDeviceAvailabilityRulesOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * Create new websocket token for device + * + * @param url + * Url of the resource to be accessed. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The newly generated websocket token for the device. + */ + public async createWebsocketToken( + url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/devices/{}/websocket'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}/websocket'); + console.log('trying to fetch url:', url); + + const parameters = { + device_id: device_id, + }; + + if (!RequestValidation.validateCreateWebsocketTokenInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + ( + RequestValidation.validateCreateWebsocketTokenInput as Types.FunctionWithErrors + ).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateCreateWebsocketTokenOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateCreateWebsocketTokenOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * Send signaling message to device + * + * @param url + * Url of the resource to be accessed. + * @param sigMessage + * The signaling message to be sent. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The signaling message was delivered successfully. + */ + public async sendSignalingMessage( + url: string, + sigMessage: + | Types.CreatePeerconnectionMessage<'request'> + | Types.ClosePeerconnectionMessage<'request'> + | Types.SignalingMessage<'request'> + | Types.ConfigurationMessage<'request'> + | Types.ExperimentStatusChangedMessage<'request'> + | Types.LoggingMessage<'request'>, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/devices/{}/signaling'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}/signaling'); + console.log('trying to fetch url:', url); + + const body = sigMessage; + + const parameters = { + device_id: device_id, + }; + + if (!RequestValidation.validateSendSignalingMessageInput(parameters, body)) + throw new ValidationError( + 'Request validation failed!', + ( + RequestValidation.validateSendSignalingMessageInput as Types.FunctionWithErrors + ).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); + + if (!RequestValidation.validateSendSignalingMessageOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateSendSignalingMessageOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + } + + /** + * List Peer Connection + * + * @param options.url + * Url of the to be used. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The list of all peerconnections. + */ + public async listPeerconnections(options?: { + headers?: [string, string][]; + url?: string; + }): Promise { + const url = appendToUrl(options?.url ?? this.baseUrl, '/peerconnections'); + console.log('trying to fetch url:', url); + + if (!RequestValidation.validateListPeerconnectionsInput()) + throw new ValidationError( + 'Request validation failed!', + ( + RequestValidation.validateListPeerconnectionsInput as Types.FunctionWithErrors + ).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'GET', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateListPeerconnectionsOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateListPeerconnectionsOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * Create a new Peer Connection + * + * @param peerconnection + * The peerconnection to be created. + * @param options.closedUrl + * An URL that will be called once the peer connection is closed. + * @param options.statusChangedUrl + * An URL that will be called if the status of the peerconnection changes. + * @param options.url + * Url of the to be used. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * 201: The peerconnection was created. A JSON representation of the new peer connection is returned. + * 202: The device service will attempt to create the peerconnection as soon as possible. + */ + public async createPeerconnection( + peerconnection: Types.Peerconnection<'request'>, + options?: { + headers?: [string, string][]; + closedUrl?: string; + statusChangedUrl?: string; + url?: string; + }, + ): Promise { + const url = appendToUrl(options?.url ?? this.baseUrl, '/peerconnections'); + console.log('trying to fetch url:', url); + + const body = peerconnection; + + const parameters = { + closedUrl: options?.closedUrl, + statusChangedUrl: options?.statusChangedUrl, + }; + + const query: [string, string][] = []; + + if (parameters['closedUrl']) + query.push(['closedUrl', parameters['closedUrl'].toString()]); + + if (parameters['statusChangedUrl']) + query.push(['statusChangedUrl', parameters['statusChangedUrl'].toString()]); + + if (!RequestValidation.validateCreatePeerconnectionInput(parameters, body)) + throw new ValidationError( + 'Request validation failed!', + ( + RequestValidation.validateCreatePeerconnectionInput as Types.FunctionWithErrors + ).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); + + if (!RequestValidation.validateCreatePeerconnectionOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateCreatePeerconnectionOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * View a peer connection + * + * @param url + * Url of the resource to be accessed. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The JSON Representation of the device peer connection. + */ + public async getPeerconnection( + url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/peerconnections/{}'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [peerconnection_id] = validateUrl( + new URL(url).toString(), + '/peerconnections/{}', + ); + console.log('trying to fetch url:', url); + + const parameters = { + peerconnection_id: peerconnection_id, + }; + + if (!RequestValidation.validateGetPeerconnectionInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + ( + RequestValidation.validateGetPeerconnectionInput as Types.FunctionWithErrors + ).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'GET', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateGetPeerconnectionOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateGetPeerconnectionOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * Delete a peer connection + * + * @param url + * Url of the resource to be accessed. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * 202: The peerconnection will be deleted as soon as it's closed. + * 204: The peerconnection was deleted successfully. + */ + public async deletePeerconnection( + url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/peerconnections/{}'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [peerconnection_id] = validateUrl( + new URL(url).toString(), + '/peerconnections/{}', + ); + console.log('trying to fetch url:', url); + + const parameters = { + peerconnection_id: peerconnection_id, + }; + + if (!RequestValidation.validateDeletePeerconnectionInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + ( + RequestValidation.validateDeletePeerconnectionInput as Types.FunctionWithErrors + ).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'DELETE', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateDeletePeerconnectionOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateDeletePeerconnectionOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + } + + /** + * Sets the peerconnection status of a single device. + * + * @param url + * Url of the resource to be accessed. + * @param body + * The JSON Representation of the device peer connection. + * @param device_url + * URL of the device + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * OK. + */ + public async patchPeerconnectionDeviceStatus( + url: string, + body: { + /** + * The status of the peerconnection. + */ + status: Types.ConnectionStatus<'request'>; + [k: string]: unknown; + }, + device_url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/peerconnections/{}/device_status'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [peerconnection_id] = validateUrl( + new URL(url).toString(), + '/peerconnections/{}/device_status', + ); + console.log('trying to fetch url:', url); + + const parameters = { + peerconnection_id: peerconnection_id, + device_url: device_url, + }; + + const query: [string, string][] = []; + + if (parameters['device_url']) + query.push(['device_url', parameters['device_url'].toString()]); + + if (!RequestValidation.validatePatchPeerconnectionDeviceStatusInput(parameters, body)) + throw new ValidationError( + 'Request validation failed!', + ( + RequestValidation.validatePatchPeerconnectionDeviceStatusInput as Types.FunctionWithErrors + ).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + { + method: 'PATCH', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); + + if (!RequestValidation.validatePatchPeerconnectionDeviceStatusOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validatePatchPeerconnectionDeviceStatusOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + } +} diff --git a/services/booking/src/common/src/clients/device/requestValidation.ts b/services/booking/src/common/src/clients/device/requestValidation.ts new file mode 100644 index 00000000..13992cce --- /dev/null +++ b/services/booking/src/common/src/clients/device/requestValidation.ts @@ -0,0 +1,1136 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +import * as BasicValidation from './basicValidation.cjs'; +import * as Signatures from './signatures.js'; +import { FunctionWithErrors, ResponseData } from './types.js'; + +/** + * This function validates the inputs to listDevices() + */ +export function validateListDevicesInput() { + return true; +} + +/** + * This function validates the outputs of listDevices() + */ +export function validateListDevicesOutput( + response: ResponseData, +): response is Signatures.ListDevicesResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if (!BasicValidation.validateListDevicesResponse200Response(response.body)) { + (validateListDevicesOutput as FunctionWithErrors).errors = ( + BasicValidation.validateListDevicesResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + return true; + } + + (validateListDevicesOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to createDevice() + */ +export function validateCreateDeviceInput( + parameters: Signatures.CreateDeviceParameters, + body: Signatures.CreateDeviceBody, +) { + if (parameters) { + if ( + !BasicValidation.validateChangedUrlRequest(parameters['changedUrl']) && + parameters['changedUrl'] !== undefined + ) { + (validateCreateDeviceInput as FunctionWithErrors).errors = ( + BasicValidation.validateChangedUrlRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + if (parameters !== undefined) { + return false; + } + } + + if (!BasicValidation.validateCreateDeviceBodyRequest(body)) { + (validateCreateDeviceInput as FunctionWithErrors).errors = ( + BasicValidation.validateCreateDeviceBodyRequest as FunctionWithErrors + ).errors; + return false; + } + + return true; +} + +/** + * This function validates the outputs of createDevice() + */ +export function validateCreateDeviceOutput( + response: ResponseData, +): response is Signatures.CreateDeviceResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 201) { + if (!BasicValidation.validateCreateDeviceResponse201Response(response.body)) { + (validateCreateDeviceOutput as FunctionWithErrors).errors = ( + BasicValidation.validateCreateDeviceResponse201Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + return true; + } + + (validateCreateDeviceOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to getDevice() + */ +export function validateGetDeviceInput(parameters: Signatures.GetDeviceParameters) { + if (parameters) { + if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) { + (validateGetDeviceInput as FunctionWithErrors).errors = ( + BasicValidation.validateDeviceIdRequest as FunctionWithErrors + ).errors; + return false; + } + if ( + !BasicValidation.validateFlatGroupRequest(parameters['flat_group']) && + parameters['flat_group'] !== undefined + ) { + (validateGetDeviceInput as FunctionWithErrors).errors = ( + BasicValidation.validateFlatGroupRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of getDevice() + */ +export function validateGetDeviceOutput( + response: ResponseData, +): response is Signatures.GetDeviceResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if (!BasicValidation.validateGetDeviceResponse200Response(response.body)) { + (validateGetDeviceOutput as FunctionWithErrors).errors = ( + BasicValidation.validateGetDeviceResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + return true; + } + + (validateGetDeviceOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to updateDevice() + */ +export function validateUpdateDeviceInput( + parameters: Signatures.UpdateDeviceParameters, + body: Signatures.UpdateDeviceBody, +) { + if (parameters) { + if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) { + (validateUpdateDeviceInput as FunctionWithErrors).errors = ( + BasicValidation.validateDeviceIdRequest as FunctionWithErrors + ).errors; + return false; + } + if ( + !BasicValidation.validateChangedUrlRequest(parameters['changedUrl']) && + parameters['changedUrl'] !== undefined + ) { + (validateUpdateDeviceInput as FunctionWithErrors).errors = ( + BasicValidation.validateChangedUrlRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + if (body === undefined) { + return true; + } + + if (!BasicValidation.validateUpdateDeviceBodyRequest(body)) { + (validateUpdateDeviceInput as FunctionWithErrors).errors = ( + BasicValidation.validateUpdateDeviceBodyRequest as FunctionWithErrors + ).errors; + return false; + } + + return true; +} + +/** + * This function validates the outputs of updateDevice() + */ +export function validateUpdateDeviceOutput( + response: ResponseData, +): response is Signatures.UpdateDeviceResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if (!BasicValidation.validateUpdateDeviceResponse200Response(response.body)) { + (validateUpdateDeviceOutput as FunctionWithErrors).errors = ( + BasicValidation.validateUpdateDeviceResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + return true; + } + + (validateUpdateDeviceOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to deleteDevice() + */ +export function validateDeleteDeviceInput(parameters: Signatures.DeleteDeviceParameters) { + if (parameters) { + if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) { + (validateDeleteDeviceInput as FunctionWithErrors).errors = ( + BasicValidation.validateDeviceIdRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of deleteDevice() + */ +export function validateDeleteDeviceOutput( + response: ResponseData, +): response is Signatures.DeleteDeviceResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 204) { + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + return true; + } + + (validateDeleteDeviceOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to instantiateDevice() + */ +export function validateInstantiateDeviceInput( + parameters: Signatures.InstantiateDeviceParameters, +) { + if (parameters) { + if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) { + (validateInstantiateDeviceInput as FunctionWithErrors).errors = ( + BasicValidation.validateDeviceIdRequest as FunctionWithErrors + ).errors; + return false; + } + if ( + !BasicValidation.validateChangedUrlRequest(parameters['changedUrl']) && + parameters['changedUrl'] !== undefined + ) { + (validateInstantiateDeviceInput as FunctionWithErrors).errors = ( + BasicValidation.validateChangedUrlRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of instantiateDevice() + */ +export function validateInstantiateDeviceOutput( + response: ResponseData, +): response is Signatures.InstantiateDeviceResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 201) { + if (!BasicValidation.validateInstantiateDeviceResponse201Response(response.body)) { + (validateInstantiateDeviceOutput as FunctionWithErrors).errors = ( + BasicValidation.validateInstantiateDeviceResponse201Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + return true; + } + + (validateInstantiateDeviceOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to getDeviceAvailability() + */ +export function validateGetDeviceAvailabilityInput( + parameters: Signatures.GetDeviceAvailabilityParameters, +) { + if (parameters) { + if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) { + (validateGetDeviceAvailabilityInput as FunctionWithErrors).errors = ( + BasicValidation.validateDeviceIdRequest as FunctionWithErrors + ).errors; + return false; + } + if ( + !BasicValidation.validateStartTimeRequest(parameters['startTime']) && + parameters['startTime'] !== undefined + ) { + (validateGetDeviceAvailabilityInput as FunctionWithErrors).errors = ( + BasicValidation.validateStartTimeRequest as FunctionWithErrors + ).errors; + return false; + } + if ( + !BasicValidation.validateEndTimeRequest(parameters['endTime']) && + parameters['endTime'] !== undefined + ) { + (validateGetDeviceAvailabilityInput as FunctionWithErrors).errors = ( + BasicValidation.validateEndTimeRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of getDeviceAvailability() + */ +export function validateGetDeviceAvailabilityOutput( + response: ResponseData, +): response is Signatures.GetDeviceAvailabilityResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if ( + !BasicValidation.validateGetDeviceAvailabilityResponse200Response(response.body) + ) { + (validateGetDeviceAvailabilityOutput as FunctionWithErrors).errors = ( + BasicValidation.validateGetDeviceAvailabilityResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + return true; + } + + (validateGetDeviceAvailabilityOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to deleteDeviceAvailabilityRules() + */ +export function validateDeleteDeviceAvailabilityRulesInput( + parameters: Signatures.DeleteDeviceAvailabilityRulesParameters, +) { + if (parameters) { + if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) { + (validateDeleteDeviceAvailabilityRulesInput as FunctionWithErrors).errors = ( + BasicValidation.validateDeviceIdRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of deleteDeviceAvailabilityRules() + */ +export function validateDeleteDeviceAvailabilityRulesOutput( + response: ResponseData, +): response is Signatures.DeleteDeviceAvailabilityRulesResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 204) { + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + return true; + } + + (validateDeleteDeviceAvailabilityRulesOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to addDeviceAvailabilityRules() + */ +export function validateAddDeviceAvailabilityRulesInput( + parameters: Signatures.AddDeviceAvailabilityRulesParameters, + body: Signatures.AddDeviceAvailabilityRulesBody, +) { + if (parameters) { + if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) { + (validateAddDeviceAvailabilityRulesInput as FunctionWithErrors).errors = ( + BasicValidation.validateDeviceIdRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + if (body === undefined) { + return true; + } + + if (!BasicValidation.validateAddDeviceAvailabilityRulesBodyRequest(body)) { + (validateAddDeviceAvailabilityRulesInput as FunctionWithErrors).errors = ( + BasicValidation.validateAddDeviceAvailabilityRulesBodyRequest as FunctionWithErrors + ).errors; + return false; + } + + return true; +} + +/** + * This function validates the outputs of addDeviceAvailabilityRules() + */ +export function validateAddDeviceAvailabilityRulesOutput( + response: ResponseData, +): response is Signatures.AddDeviceAvailabilityRulesResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if ( + !BasicValidation.validateAddDeviceAvailabilityRulesResponse200Response( + response.body, + ) + ) { + (validateAddDeviceAvailabilityRulesOutput as FunctionWithErrors).errors = ( + BasicValidation.validateAddDeviceAvailabilityRulesResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + return true; + } + + (validateAddDeviceAvailabilityRulesOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to createWebsocketToken() + */ +export function validateCreateWebsocketTokenInput( + parameters: Signatures.CreateWebsocketTokenParameters, +) { + if (parameters) { + if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) { + (validateCreateWebsocketTokenInput as FunctionWithErrors).errors = ( + BasicValidation.validateDeviceIdRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of createWebsocketToken() + */ +export function validateCreateWebsocketTokenOutput( + response: ResponseData, +): response is Signatures.CreateWebsocketTokenResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if (!BasicValidation.validateCreateWebsocketTokenResponse200Response(response.body)) { + (validateCreateWebsocketTokenOutput as FunctionWithErrors).errors = ( + BasicValidation.validateCreateWebsocketTokenResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + return true; + } + + (validateCreateWebsocketTokenOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to sendSignalingMessage() + */ +export function validateSendSignalingMessageInput( + parameters: Signatures.SendSignalingMessageParameters, + body: Signatures.SendSignalingMessageBody, +) { + if (parameters) { + if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) { + (validateSendSignalingMessageInput as FunctionWithErrors).errors = ( + BasicValidation.validateDeviceIdRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + if (!BasicValidation.validateSendSignalingMessageBodyRequest(body)) { + (validateSendSignalingMessageInput as FunctionWithErrors).errors = ( + BasicValidation.validateSendSignalingMessageBodyRequest as FunctionWithErrors + ).errors; + return false; + } + + return true; +} + +/** + * This function validates the outputs of sendSignalingMessage() + */ +export function validateSendSignalingMessageOutput( + response: ResponseData, +): response is Signatures.SendSignalingMessageResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + return true; + } + + (validateSendSignalingMessageOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to listPeerconnections() + */ +export function validateListPeerconnectionsInput() { + return true; +} + +/** + * This function validates the outputs of listPeerconnections() + */ +export function validateListPeerconnectionsOutput( + response: ResponseData, +): response is Signatures.ListPeerconnectionsResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if (!BasicValidation.validateListPeerconnectionsResponse200Response(response.body)) { + (validateListPeerconnectionsOutput as FunctionWithErrors).errors = ( + BasicValidation.validateListPeerconnectionsResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + return true; + } + + (validateListPeerconnectionsOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to createPeerconnection() + */ +export function validateCreatePeerconnectionInput( + parameters: Signatures.CreatePeerconnectionParameters, + body: Signatures.CreatePeerconnectionBody, +) { + if (parameters) { + if ( + !BasicValidation.validateClosedUrlRequest(parameters['closedUrl']) && + parameters['closedUrl'] !== undefined + ) { + (validateCreatePeerconnectionInput as FunctionWithErrors).errors = ( + BasicValidation.validateClosedUrlRequest as FunctionWithErrors + ).errors; + return false; + } + if ( + !BasicValidation.validateStatusChangedUrlRequest(parameters['statusChangedUrl']) && + parameters['statusChangedUrl'] !== undefined + ) { + (validateCreatePeerconnectionInput as FunctionWithErrors).errors = ( + BasicValidation.validateStatusChangedUrlRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + if (parameters !== undefined) { + return false; + } + } + + if (!BasicValidation.validateCreatePeerconnectionBodyRequest(body)) { + (validateCreatePeerconnectionInput as FunctionWithErrors).errors = ( + BasicValidation.validateCreatePeerconnectionBodyRequest as FunctionWithErrors + ).errors; + return false; + } + + return true; +} + +/** + * This function validates the outputs of createPeerconnection() + */ +export function validateCreatePeerconnectionOutput( + response: ResponseData, +): response is Signatures.CreatePeerconnectionResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 201) { + if (!BasicValidation.validateCreatePeerconnectionResponse201Response(response.body)) { + (validateCreatePeerconnectionOutput as FunctionWithErrors).errors = ( + BasicValidation.validateCreatePeerconnectionResponse201Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 202) { + if (!BasicValidation.validateCreatePeerconnectionResponse202Response(response.body)) { + (validateCreatePeerconnectionOutput as FunctionWithErrors).errors = ( + BasicValidation.validateCreatePeerconnectionResponse202Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + return true; + } + + (validateCreatePeerconnectionOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to getPeerconnection() + */ +export function validateGetPeerconnectionInput( + parameters: Signatures.GetPeerconnectionParameters, +) { + if (parameters) { + if ( + !BasicValidation.validatePeerconnectionIdRequest(parameters['peerconnection_id']) + ) { + (validateGetPeerconnectionInput as FunctionWithErrors).errors = ( + BasicValidation.validatePeerconnectionIdRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of getPeerconnection() + */ +export function validateGetPeerconnectionOutput( + response: ResponseData, +): response is Signatures.GetPeerconnectionResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if (!BasicValidation.validateGetPeerconnectionResponse200Response(response.body)) { + (validateGetPeerconnectionOutput as FunctionWithErrors).errors = ( + BasicValidation.validateGetPeerconnectionResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + return true; + } + + (validateGetPeerconnectionOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to deletePeerconnection() + */ +export function validateDeletePeerconnectionInput( + parameters: Signatures.DeletePeerconnectionParameters, +) { + if (parameters) { + if ( + !BasicValidation.validatePeerconnectionIdRequest(parameters['peerconnection_id']) + ) { + (validateDeletePeerconnectionInput as FunctionWithErrors).errors = ( + BasicValidation.validatePeerconnectionIdRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of deletePeerconnection() + */ +export function validateDeletePeerconnectionOutput( + response: ResponseData, +): response is Signatures.DeletePeerconnectionResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 202) { + return true; + } + + if (response.status === 204) { + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + return true; + } + + (validateDeletePeerconnectionOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to patchPeerconnectionDeviceStatus() + */ +export function validatePatchPeerconnectionDeviceStatusInput( + parameters: Signatures.PatchPeerconnectionDeviceStatusParameters, + body: Signatures.PatchPeerconnectionDeviceStatusBody, +) { + if (parameters) { + if ( + !BasicValidation.validatePeerconnectionIdRequest(parameters['peerconnection_id']) + ) { + (validatePatchPeerconnectionDeviceStatusInput as FunctionWithErrors).errors = ( + BasicValidation.validatePeerconnectionIdRequest as FunctionWithErrors + ).errors; + return false; + } + if (!BasicValidation.validateDeviceUrlRequest(parameters['device_url'])) { + (validatePatchPeerconnectionDeviceStatusInput as FunctionWithErrors).errors = ( + BasicValidation.validateDeviceUrlRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + if (!BasicValidation.validatePatchPeerconnectionDeviceStatusBodyRequest(body)) { + (validatePatchPeerconnectionDeviceStatusInput as FunctionWithErrors).errors = ( + BasicValidation.validatePatchPeerconnectionDeviceStatusBodyRequest as FunctionWithErrors + ).errors; + return false; + } + + return true; +} + +/** + * This function validates the outputs of patchPeerconnectionDeviceStatus() + */ +export function validatePatchPeerconnectionDeviceStatusOutput( + response: ResponseData, +): response is Signatures.PatchPeerconnectionDeviceStatusResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 204) { + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + return true; + } + + (validatePatchPeerconnectionDeviceStatusOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} diff --git a/services/booking/src/common/src/clients/device/signatures.ts b/services/booking/src/common/src/clients/device/signatures.ts new file mode 100644 index 00000000..0a17a42c --- /dev/null +++ b/services/booking/src/common/src/clients/device/signatures.ts @@ -0,0 +1,1765 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import * as Types from './types.js'; +// @ts-ignore +import { type Require } from './types.js'; + +/** + * Typing for all possible responses to the request made by listDevices() + * @category listDevices() + */ +export type ListDevicesResponse = ListDevicesSuccessResponse | ListDevicesErrorResponse; + +/** + * Typing for all successful responses to the request made by listDevices() + * @category listDevices() + */ +export type ListDevicesSuccessResponse = ListDevicesResponse200; + +/** + * Typing for all error responses to the request made by listDevices() + * @category listDevices() + */ +export type ListDevicesErrorResponse = + | ListDevicesResponse400 + | ListDevicesResponse401 + | ListDevicesResponse403 + | ListDevicesResponse404 + | ListDevicesResponse500; + +/** + * Typing for a response with status 200 to the request made by listDevices() + * @category listDevices() + */ +export interface ListDevicesResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: Types.DeviceOverview<'response'>[]; +} + +/** + * Typing for a response with status 400 to the request made by listDevices() + * @category listDevices() + */ +export interface ListDevicesResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by listDevices() + * @category listDevices() + */ +export interface ListDevicesResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by listDevices() + * @category listDevices() + */ +export interface ListDevicesResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by listDevices() + * @category listDevices() + */ +export interface ListDevicesResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by listDevices() + * @category listDevices() + */ +export interface ListDevicesResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by createDevice() + * @category createDevice() + */ +export type CreateDeviceParameters = { + changedUrl?: string; +}; + +/** + * Typing for the body of the request made by createDevice() + * @category createDevice() + */ +export type CreateDeviceBody = Types.Device<'request'>; + +/** + * Typing for all possible responses to the request made by createDevice() + * @category createDevice() + */ +export type CreateDeviceResponse = + | CreateDeviceSuccessResponse + | CreateDeviceErrorResponse; + +/** + * Typing for all successful responses to the request made by createDevice() + * @category createDevice() + */ +export type CreateDeviceSuccessResponse = CreateDeviceResponse201; + +/** + * Typing for all error responses to the request made by createDevice() + * @category createDevice() + */ +export type CreateDeviceErrorResponse = + | CreateDeviceResponse400 + | CreateDeviceResponse401 + | CreateDeviceResponse403 + | CreateDeviceResponse404 + | CreateDeviceResponse500; + +/** + * Typing for a response with status 201 to the request made by createDevice() + * @category createDevice() + */ +export interface CreateDeviceResponse201 extends Types.SuccessResponse { + status: 201; + headers?: { + [k: string]: string | undefined; + }; + body: Types.Device<'response'>; +} + +/** + * Typing for a response with status 400 to the request made by createDevice() + * @category createDevice() + */ +export interface CreateDeviceResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by createDevice() + * @category createDevice() + */ +export interface CreateDeviceResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by createDevice() + * @category createDevice() + */ +export interface CreateDeviceResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by createDevice() + * @category createDevice() + */ +export interface CreateDeviceResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by createDevice() + * @category createDevice() + */ +export interface CreateDeviceResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by getDevice() + * @category getDevice() + */ +export type GetDeviceParameters = { + device_id: string; + flat_group?: boolean; +}; + +/** + * Typing for all possible responses to the request made by getDevice() + * @category getDevice() + */ +export type GetDeviceResponse = GetDeviceSuccessResponse | GetDeviceErrorResponse; + +/** + * Typing for all successful responses to the request made by getDevice() + * @category getDevice() + */ +export type GetDeviceSuccessResponse = GetDeviceResponse200; + +/** + * Typing for all error responses to the request made by getDevice() + * @category getDevice() + */ +export type GetDeviceErrorResponse = + | GetDeviceResponse400 + | GetDeviceResponse401 + | GetDeviceResponse403 + | GetDeviceResponse404 + | GetDeviceResponse500; + +/** + * Typing for a response with status 200 to the request made by getDevice() + * @category getDevice() + */ +export interface GetDeviceResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: Types.Device<'response'>; +} + +/** + * Typing for a response with status 400 to the request made by getDevice() + * @category getDevice() + */ +export interface GetDeviceResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by getDevice() + * @category getDevice() + */ +export interface GetDeviceResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by getDevice() + * @category getDevice() + */ +export interface GetDeviceResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by getDevice() + * @category getDevice() + */ +export interface GetDeviceResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by getDevice() + * @category getDevice() + */ +export interface GetDeviceResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by updateDevice() + * @category updateDevice() + */ +export type UpdateDeviceParameters = { + device_id: string; + changedUrl?: string; +}; + +/** + * Typing for the body of the request made by updateDevice() + * @category updateDevice() + */ +export type UpdateDeviceBody = Types.DeviceUpdate<'request'> | undefined; + +/** + * Typing for all possible responses to the request made by updateDevice() + * @category updateDevice() + */ +export type UpdateDeviceResponse = + | UpdateDeviceSuccessResponse + | UpdateDeviceErrorResponse; + +/** + * Typing for all successful responses to the request made by updateDevice() + * @category updateDevice() + */ +export type UpdateDeviceSuccessResponse = UpdateDeviceResponse200; + +/** + * Typing for all error responses to the request made by updateDevice() + * @category updateDevice() + */ +export type UpdateDeviceErrorResponse = + | UpdateDeviceResponse400 + | UpdateDeviceResponse401 + | UpdateDeviceResponse403 + | UpdateDeviceResponse404 + | UpdateDeviceResponse500; + +/** + * Typing for a response with status 200 to the request made by updateDevice() + * @category updateDevice() + */ +export interface UpdateDeviceResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: Types.Device<'response'>; +} + +/** + * Typing for a response with status 400 to the request made by updateDevice() + * @category updateDevice() + */ +export interface UpdateDeviceResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by updateDevice() + * @category updateDevice() + */ +export interface UpdateDeviceResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by updateDevice() + * @category updateDevice() + */ +export interface UpdateDeviceResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by updateDevice() + * @category updateDevice() + */ +export interface UpdateDeviceResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by updateDevice() + * @category updateDevice() + */ +export interface UpdateDeviceResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by deleteDevice() + * @category deleteDevice() + */ +export type DeleteDeviceParameters = { + device_id: string; +}; + +/** + * Typing for all possible responses to the request made by deleteDevice() + * @category deleteDevice() + */ +export type DeleteDeviceResponse = + | DeleteDeviceSuccessResponse + | DeleteDeviceErrorResponse; + +/** + * Typing for all successful responses to the request made by deleteDevice() + * @category deleteDevice() + */ +export type DeleteDeviceSuccessResponse = DeleteDeviceResponse204; + +/** + * Typing for all error responses to the request made by deleteDevice() + * @category deleteDevice() + */ +export type DeleteDeviceErrorResponse = + | DeleteDeviceResponse400 + | DeleteDeviceResponse401 + | DeleteDeviceResponse403 + | DeleteDeviceResponse404 + | DeleteDeviceResponse500; + +/** + * Typing for a response with status 204 to the request made by deleteDevice() + * @category deleteDevice() + */ +export interface DeleteDeviceResponse204 extends Types.SuccessResponse { + status: 204; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 400 to the request made by deleteDevice() + * @category deleteDevice() + */ +export interface DeleteDeviceResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by deleteDevice() + * @category deleteDevice() + */ +export interface DeleteDeviceResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by deleteDevice() + * @category deleteDevice() + */ +export interface DeleteDeviceResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by deleteDevice() + * @category deleteDevice() + */ +export interface DeleteDeviceResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by deleteDevice() + * @category deleteDevice() + */ +export interface DeleteDeviceResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by instantiateDevice() + * @category instantiateDevice() + */ +export type InstantiateDeviceParameters = { + device_id: string; + changedUrl?: string; +}; + +/** + * Typing for all possible responses to the request made by instantiateDevice() + * @category instantiateDevice() + */ +export type InstantiateDeviceResponse = + | InstantiateDeviceSuccessResponse + | InstantiateDeviceErrorResponse; + +/** + * Typing for all successful responses to the request made by instantiateDevice() + * @category instantiateDevice() + */ +export type InstantiateDeviceSuccessResponse = InstantiateDeviceResponse201; + +/** + * Typing for all error responses to the request made by instantiateDevice() + * @category instantiateDevice() + */ +export type InstantiateDeviceErrorResponse = + | InstantiateDeviceResponse400 + | InstantiateDeviceResponse401 + | InstantiateDeviceResponse403 + | InstantiateDeviceResponse404 + | InstantiateDeviceResponse500; + +/** + * Typing for a response with status 201 to the request made by instantiateDevice() + * @category instantiateDevice() + */ +export interface InstantiateDeviceResponse201 extends Types.SuccessResponse { + status: 201; + headers?: { + [k: string]: string | undefined; + }; + body: { + instance: Types.ConcreteDevice<'response'>; + deviceToken: string; + [k: string]: unknown; + }; +} + +/** + * Typing for a response with status 400 to the request made by instantiateDevice() + * @category instantiateDevice() + */ +export interface InstantiateDeviceResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by instantiateDevice() + * @category instantiateDevice() + */ +export interface InstantiateDeviceResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by instantiateDevice() + * @category instantiateDevice() + */ +export interface InstantiateDeviceResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by instantiateDevice() + * @category instantiateDevice() + */ +export interface InstantiateDeviceResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by instantiateDevice() + * @category instantiateDevice() + */ +export interface InstantiateDeviceResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by getDeviceAvailability() + * @category getDeviceAvailability() + */ +export type GetDeviceAvailabilityParameters = { + device_id: string; + startTime?: string; + endTime?: string; +}; + +/** + * Typing for all possible responses to the request made by getDeviceAvailability() + * @category getDeviceAvailability() + */ +export type GetDeviceAvailabilityResponse = + | GetDeviceAvailabilitySuccessResponse + | GetDeviceAvailabilityErrorResponse; + +/** + * Typing for all successful responses to the request made by getDeviceAvailability() + * @category getDeviceAvailability() + */ +export type GetDeviceAvailabilitySuccessResponse = GetDeviceAvailabilityResponse200; + +/** + * Typing for all error responses to the request made by getDeviceAvailability() + * @category getDeviceAvailability() + */ +export type GetDeviceAvailabilityErrorResponse = + | GetDeviceAvailabilityResponse400 + | GetDeviceAvailabilityResponse401 + | GetDeviceAvailabilityResponse403 + | GetDeviceAvailabilityResponse404 + | GetDeviceAvailabilityResponse500; + +/** + * Typing for a response with status 200 to the request made by getDeviceAvailability() + * @category getDeviceAvailability() + */ +export interface GetDeviceAvailabilityResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: Types.Availability<'response'>; +} + +/** + * Typing for a response with status 400 to the request made by getDeviceAvailability() + * @category getDeviceAvailability() + */ +export interface GetDeviceAvailabilityResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by getDeviceAvailability() + * @category getDeviceAvailability() + */ +export interface GetDeviceAvailabilityResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by getDeviceAvailability() + * @category getDeviceAvailability() + */ +export interface GetDeviceAvailabilityResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by getDeviceAvailability() + * @category getDeviceAvailability() + */ +export interface GetDeviceAvailabilityResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by getDeviceAvailability() + * @category getDeviceAvailability() + */ +export interface GetDeviceAvailabilityResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by deleteDeviceAvailabilityRules() + * @category deleteDeviceAvailabilityRules() + */ +export type DeleteDeviceAvailabilityRulesParameters = { + device_id: string; +}; + +/** + * Typing for all possible responses to the request made by deleteDeviceAvailabilityRules() + * @category deleteDeviceAvailabilityRules() + */ +export type DeleteDeviceAvailabilityRulesResponse = + | DeleteDeviceAvailabilityRulesSuccessResponse + | DeleteDeviceAvailabilityRulesErrorResponse; + +/** + * Typing for all successful responses to the request made by deleteDeviceAvailabilityRules() + * @category deleteDeviceAvailabilityRules() + */ +export type DeleteDeviceAvailabilityRulesSuccessResponse = + DeleteDeviceAvailabilityRulesResponse204; + +/** + * Typing for all error responses to the request made by deleteDeviceAvailabilityRules() + * @category deleteDeviceAvailabilityRules() + */ +export type DeleteDeviceAvailabilityRulesErrorResponse = + | DeleteDeviceAvailabilityRulesResponse400 + | DeleteDeviceAvailabilityRulesResponse401 + | DeleteDeviceAvailabilityRulesResponse403 + | DeleteDeviceAvailabilityRulesResponse404 + | DeleteDeviceAvailabilityRulesResponse500; + +/** + * Typing for a response with status 204 to the request made by deleteDeviceAvailabilityRules() + * @category deleteDeviceAvailabilityRules() + */ +export interface DeleteDeviceAvailabilityRulesResponse204 extends Types.SuccessResponse { + status: 204; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 400 to the request made by deleteDeviceAvailabilityRules() + * @category deleteDeviceAvailabilityRules() + */ +export interface DeleteDeviceAvailabilityRulesResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by deleteDeviceAvailabilityRules() + * @category deleteDeviceAvailabilityRules() + */ +export interface DeleteDeviceAvailabilityRulesResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by deleteDeviceAvailabilityRules() + * @category deleteDeviceAvailabilityRules() + */ +export interface DeleteDeviceAvailabilityRulesResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by deleteDeviceAvailabilityRules() + * @category deleteDeviceAvailabilityRules() + */ +export interface DeleteDeviceAvailabilityRulesResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by deleteDeviceAvailabilityRules() + * @category deleteDeviceAvailabilityRules() + */ +export interface DeleteDeviceAvailabilityRulesResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by addDeviceAvailabilityRules() + * @category addDeviceAvailabilityRules() + */ +export type AddDeviceAvailabilityRulesParameters = { + device_id: string; +}; + +/** + * Typing for the body of the request made by addDeviceAvailabilityRules() + * @category addDeviceAvailabilityRules() + */ +export type AddDeviceAvailabilityRulesBody = + | Types.AvailabilityRule<'request'>[] + | undefined; + +/** + * Typing for all possible responses to the request made by addDeviceAvailabilityRules() + * @category addDeviceAvailabilityRules() + */ +export type AddDeviceAvailabilityRulesResponse = + | AddDeviceAvailabilityRulesSuccessResponse + | AddDeviceAvailabilityRulesErrorResponse; + +/** + * Typing for all successful responses to the request made by addDeviceAvailabilityRules() + * @category addDeviceAvailabilityRules() + */ +export type AddDeviceAvailabilityRulesSuccessResponse = + AddDeviceAvailabilityRulesResponse200; + +/** + * Typing for all error responses to the request made by addDeviceAvailabilityRules() + * @category addDeviceAvailabilityRules() + */ +export type AddDeviceAvailabilityRulesErrorResponse = + | AddDeviceAvailabilityRulesResponse400 + | AddDeviceAvailabilityRulesResponse401 + | AddDeviceAvailabilityRulesResponse403 + | AddDeviceAvailabilityRulesResponse404 + | AddDeviceAvailabilityRulesResponse500; + +/** + * Typing for a response with status 200 to the request made by addDeviceAvailabilityRules() + * @category addDeviceAvailabilityRules() + */ +export interface AddDeviceAvailabilityRulesResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: Types.Availability<'response'>; +} + +/** + * Typing for a response with status 400 to the request made by addDeviceAvailabilityRules() + * @category addDeviceAvailabilityRules() + */ +export interface AddDeviceAvailabilityRulesResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by addDeviceAvailabilityRules() + * @category addDeviceAvailabilityRules() + */ +export interface AddDeviceAvailabilityRulesResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by addDeviceAvailabilityRules() + * @category addDeviceAvailabilityRules() + */ +export interface AddDeviceAvailabilityRulesResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by addDeviceAvailabilityRules() + * @category addDeviceAvailabilityRules() + */ +export interface AddDeviceAvailabilityRulesResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by addDeviceAvailabilityRules() + * @category addDeviceAvailabilityRules() + */ +export interface AddDeviceAvailabilityRulesResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by createWebsocketToken() + * @category createWebsocketToken() + */ +export type CreateWebsocketTokenParameters = { + device_id: string; +}; + +/** + * Typing for all possible responses to the request made by createWebsocketToken() + * @category createWebsocketToken() + */ +export type CreateWebsocketTokenResponse = + | CreateWebsocketTokenSuccessResponse + | CreateWebsocketTokenErrorResponse; + +/** + * Typing for all successful responses to the request made by createWebsocketToken() + * @category createWebsocketToken() + */ +export type CreateWebsocketTokenSuccessResponse = CreateWebsocketTokenResponse200; + +/** + * Typing for all error responses to the request made by createWebsocketToken() + * @category createWebsocketToken() + */ +export type CreateWebsocketTokenErrorResponse = + | CreateWebsocketTokenResponse400 + | CreateWebsocketTokenResponse401 + | CreateWebsocketTokenResponse403 + | CreateWebsocketTokenResponse404 + | CreateWebsocketTokenResponse500; + +/** + * Typing for a response with status 200 to the request made by createWebsocketToken() + * @category createWebsocketToken() + */ +export interface CreateWebsocketTokenResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 400 to the request made by createWebsocketToken() + * @category createWebsocketToken() + */ +export interface CreateWebsocketTokenResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by createWebsocketToken() + * @category createWebsocketToken() + */ +export interface CreateWebsocketTokenResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by createWebsocketToken() + * @category createWebsocketToken() + */ +export interface CreateWebsocketTokenResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by createWebsocketToken() + * @category createWebsocketToken() + */ +export interface CreateWebsocketTokenResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by createWebsocketToken() + * @category createWebsocketToken() + */ +export interface CreateWebsocketTokenResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by sendSignalingMessage() + * @category sendSignalingMessage() + */ +export type SendSignalingMessageParameters = { + device_id: string; +}; + +/** + * Typing for the body of the request made by sendSignalingMessage() + * @category sendSignalingMessage() + */ +export type SendSignalingMessageBody = + | Types.CreatePeerconnectionMessage<'request'> + | Types.ClosePeerconnectionMessage<'request'> + | Types.SignalingMessage<'request'> + | Types.ConfigurationMessage<'request'> + | Types.ExperimentStatusChangedMessage<'request'> + | Types.LoggingMessage<'request'>; + +/** + * Typing for all possible responses to the request made by sendSignalingMessage() + * @category sendSignalingMessage() + */ +export type SendSignalingMessageResponse = + | SendSignalingMessageSuccessResponse + | SendSignalingMessageErrorResponse; + +/** + * Typing for all successful responses to the request made by sendSignalingMessage() + * @category sendSignalingMessage() + */ +export type SendSignalingMessageSuccessResponse = SendSignalingMessageResponse200; + +/** + * Typing for all error responses to the request made by sendSignalingMessage() + * @category sendSignalingMessage() + */ +export type SendSignalingMessageErrorResponse = + | SendSignalingMessageResponse400 + | SendSignalingMessageResponse401 + | SendSignalingMessageResponse403 + | SendSignalingMessageResponse404 + | SendSignalingMessageResponse500; + +/** + * Typing for a response with status 200 to the request made by sendSignalingMessage() + * @category sendSignalingMessage() + */ +export interface SendSignalingMessageResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 400 to the request made by sendSignalingMessage() + * @category sendSignalingMessage() + */ +export interface SendSignalingMessageResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by sendSignalingMessage() + * @category sendSignalingMessage() + */ +export interface SendSignalingMessageResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by sendSignalingMessage() + * @category sendSignalingMessage() + */ +export interface SendSignalingMessageResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by sendSignalingMessage() + * @category sendSignalingMessage() + */ +export interface SendSignalingMessageResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by sendSignalingMessage() + * @category sendSignalingMessage() + */ +export interface SendSignalingMessageResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for all possible responses to the request made by listPeerconnections() + * @category listPeerconnections() + */ +export type ListPeerconnectionsResponse = + | ListPeerconnectionsSuccessResponse + | ListPeerconnectionsErrorResponse; + +/** + * Typing for all successful responses to the request made by listPeerconnections() + * @category listPeerconnections() + */ +export type ListPeerconnectionsSuccessResponse = ListPeerconnectionsResponse200; + +/** + * Typing for all error responses to the request made by listPeerconnections() + * @category listPeerconnections() + */ +export type ListPeerconnectionsErrorResponse = + | ListPeerconnectionsResponse400 + | ListPeerconnectionsResponse401 + | ListPeerconnectionsResponse403 + | ListPeerconnectionsResponse404 + | ListPeerconnectionsResponse500; + +/** + * Typing for a response with status 200 to the request made by listPeerconnections() + * @category listPeerconnections() + */ +export interface ListPeerconnectionsResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: Types.PeerconnectionOverview<'response'>[]; +} + +/** + * Typing for a response with status 400 to the request made by listPeerconnections() + * @category listPeerconnections() + */ +export interface ListPeerconnectionsResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by listPeerconnections() + * @category listPeerconnections() + */ +export interface ListPeerconnectionsResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by listPeerconnections() + * @category listPeerconnections() + */ +export interface ListPeerconnectionsResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by listPeerconnections() + * @category listPeerconnections() + */ +export interface ListPeerconnectionsResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by listPeerconnections() + * @category listPeerconnections() + */ +export interface ListPeerconnectionsResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by createPeerconnection() + * @category createPeerconnection() + */ +export type CreatePeerconnectionParameters = { + closedUrl?: string; + statusChangedUrl?: string; +}; + +/** + * Typing for the body of the request made by createPeerconnection() + * @category createPeerconnection() + */ +export type CreatePeerconnectionBody = Types.Peerconnection<'request'>; + +/** + * Typing for all possible responses to the request made by createPeerconnection() + * @category createPeerconnection() + */ +export type CreatePeerconnectionResponse = + | CreatePeerconnectionSuccessResponse + | CreatePeerconnectionErrorResponse; + +/** + * Typing for all successful responses to the request made by createPeerconnection() + * @category createPeerconnection() + */ +export type CreatePeerconnectionSuccessResponse = + | CreatePeerconnectionResponse201 + | CreatePeerconnectionResponse202; + +/** + * Typing for all error responses to the request made by createPeerconnection() + * @category createPeerconnection() + */ +export type CreatePeerconnectionErrorResponse = + | CreatePeerconnectionResponse400 + | CreatePeerconnectionResponse401 + | CreatePeerconnectionResponse403 + | CreatePeerconnectionResponse404 + | CreatePeerconnectionResponse500; + +/** + * Typing for a response with status 201 to the request made by createPeerconnection() + * @category createPeerconnection() + */ +export interface CreatePeerconnectionResponse201 extends Types.SuccessResponse { + status: 201; + headers?: { + [k: string]: string | undefined; + }; + body: Types.Peerconnection<'response'>; +} + +/** + * Typing for a response with status 202 to the request made by createPeerconnection() + * @category createPeerconnection() + */ +export interface CreatePeerconnectionResponse202 extends Types.SuccessResponse { + status: 202; + headers?: { + [k: string]: string | undefined; + }; + body: Types.Peerconnection<'response'>; +} + +/** + * Typing for a response with status 400 to the request made by createPeerconnection() + * @category createPeerconnection() + */ +export interface CreatePeerconnectionResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by createPeerconnection() + * @category createPeerconnection() + */ +export interface CreatePeerconnectionResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by createPeerconnection() + * @category createPeerconnection() + */ +export interface CreatePeerconnectionResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by createPeerconnection() + * @category createPeerconnection() + */ +export interface CreatePeerconnectionResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by createPeerconnection() + * @category createPeerconnection() + */ +export interface CreatePeerconnectionResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by getPeerconnection() + * @category getPeerconnection() + */ +export type GetPeerconnectionParameters = { + peerconnection_id: string; +}; + +/** + * Typing for all possible responses to the request made by getPeerconnection() + * @category getPeerconnection() + */ +export type GetPeerconnectionResponse = + | GetPeerconnectionSuccessResponse + | GetPeerconnectionErrorResponse; + +/** + * Typing for all successful responses to the request made by getPeerconnection() + * @category getPeerconnection() + */ +export type GetPeerconnectionSuccessResponse = GetPeerconnectionResponse200; + +/** + * Typing for all error responses to the request made by getPeerconnection() + * @category getPeerconnection() + */ +export type GetPeerconnectionErrorResponse = + | GetPeerconnectionResponse400 + | GetPeerconnectionResponse401 + | GetPeerconnectionResponse403 + | GetPeerconnectionResponse404 + | GetPeerconnectionResponse500; + +/** + * Typing for a response with status 200 to the request made by getPeerconnection() + * @category getPeerconnection() + */ +export interface GetPeerconnectionResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: Types.Peerconnection<'response'>; +} + +/** + * Typing for a response with status 400 to the request made by getPeerconnection() + * @category getPeerconnection() + */ +export interface GetPeerconnectionResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by getPeerconnection() + * @category getPeerconnection() + */ +export interface GetPeerconnectionResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by getPeerconnection() + * @category getPeerconnection() + */ +export interface GetPeerconnectionResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by getPeerconnection() + * @category getPeerconnection() + */ +export interface GetPeerconnectionResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by getPeerconnection() + * @category getPeerconnection() + */ +export interface GetPeerconnectionResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by deletePeerconnection() + * @category deletePeerconnection() + */ +export type DeletePeerconnectionParameters = { + peerconnection_id: string; +}; + +/** + * Typing for all possible responses to the request made by deletePeerconnection() + * @category deletePeerconnection() + */ +export type DeletePeerconnectionResponse = + | DeletePeerconnectionSuccessResponse + | DeletePeerconnectionErrorResponse; + +/** + * Typing for all successful responses to the request made by deletePeerconnection() + * @category deletePeerconnection() + */ +export type DeletePeerconnectionSuccessResponse = + | DeletePeerconnectionResponse202 + | DeletePeerconnectionResponse204; + +/** + * Typing for all error responses to the request made by deletePeerconnection() + * @category deletePeerconnection() + */ +export type DeletePeerconnectionErrorResponse = + | DeletePeerconnectionResponse400 + | DeletePeerconnectionResponse401 + | DeletePeerconnectionResponse403 + | DeletePeerconnectionResponse404 + | DeletePeerconnectionResponse500; + +/** + * Typing for a response with status 202 to the request made by deletePeerconnection() + * @category deletePeerconnection() + */ +export interface DeletePeerconnectionResponse202 extends Types.SuccessResponse { + status: 202; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 204 to the request made by deletePeerconnection() + * @category deletePeerconnection() + */ +export interface DeletePeerconnectionResponse204 extends Types.SuccessResponse { + status: 204; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 400 to the request made by deletePeerconnection() + * @category deletePeerconnection() + */ +export interface DeletePeerconnectionResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by deletePeerconnection() + * @category deletePeerconnection() + */ +export interface DeletePeerconnectionResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by deletePeerconnection() + * @category deletePeerconnection() + */ +export interface DeletePeerconnectionResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by deletePeerconnection() + * @category deletePeerconnection() + */ +export interface DeletePeerconnectionResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by deletePeerconnection() + * @category deletePeerconnection() + */ +export interface DeletePeerconnectionResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by patchPeerconnectionDeviceStatus() + * @category patchPeerconnectionDeviceStatus() + */ +export type PatchPeerconnectionDeviceStatusParameters = { + peerconnection_id: string; + device_url: string; +}; + +/** + * Typing for the body of the request made by patchPeerconnectionDeviceStatus() + * @category patchPeerconnectionDeviceStatus() + */ +export type PatchPeerconnectionDeviceStatusBody = { + /** + * The status of the peerconnection. + */ + status: Types.ConnectionStatus<'request'>; + [k: string]: unknown; +}; + +/** + * Typing for all possible responses to the request made by patchPeerconnectionDeviceStatus() + * @category patchPeerconnectionDeviceStatus() + */ +export type PatchPeerconnectionDeviceStatusResponse = + | PatchPeerconnectionDeviceStatusSuccessResponse + | PatchPeerconnectionDeviceStatusErrorResponse; + +/** + * Typing for all successful responses to the request made by patchPeerconnectionDeviceStatus() + * @category patchPeerconnectionDeviceStatus() + */ +export type PatchPeerconnectionDeviceStatusSuccessResponse = + PatchPeerconnectionDeviceStatusResponse204; + +/** + * Typing for all error responses to the request made by patchPeerconnectionDeviceStatus() + * @category patchPeerconnectionDeviceStatus() + */ +export type PatchPeerconnectionDeviceStatusErrorResponse = + | PatchPeerconnectionDeviceStatusResponse400 + | PatchPeerconnectionDeviceStatusResponse401 + | PatchPeerconnectionDeviceStatusResponse403 + | PatchPeerconnectionDeviceStatusResponse404 + | PatchPeerconnectionDeviceStatusResponse500; + +/** + * Typing for a response with status 204 to the request made by patchPeerconnectionDeviceStatus() + * @category patchPeerconnectionDeviceStatus() + */ +export interface PatchPeerconnectionDeviceStatusResponse204 + extends Types.SuccessResponse { + status: 204; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 400 to the request made by patchPeerconnectionDeviceStatus() + * @category patchPeerconnectionDeviceStatus() + */ +export interface PatchPeerconnectionDeviceStatusResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by patchPeerconnectionDeviceStatus() + * @category patchPeerconnectionDeviceStatus() + */ +export interface PatchPeerconnectionDeviceStatusResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by patchPeerconnectionDeviceStatus() + * @category patchPeerconnectionDeviceStatus() + */ +export interface PatchPeerconnectionDeviceStatusResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by patchPeerconnectionDeviceStatus() + * @category patchPeerconnectionDeviceStatus() + */ +export interface PatchPeerconnectionDeviceStatusResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by patchPeerconnectionDeviceStatus() + * @category patchPeerconnectionDeviceStatus() + */ +export interface PatchPeerconnectionDeviceStatusResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} diff --git a/services/booking/src/common/src/clients/device/types.ts b/services/booking/src/common/src/clients/device/types.ts new file mode 100644 index 00000000..9c244751 --- /dev/null +++ b/services/booking/src/common/src/clients/device/types.ts @@ -0,0 +1,3855 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +import * as BasicValidation from './basicValidation.cjs'; + +/** + * @internal + */ +export interface FunctionWithErrors { + (...args: unknown[]): unknown; + errors?: unknown; +} + +/** + * @internal + */ +export interface RequestInfo { + method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'TRACE' | 'OPTIONS' | 'PATCH' | 'HEAD'; + body?: string; + headers?: [string, string][]; +} + +/** + * @internal + */ +export type FetchFunction = ( + url: string, + info?: RequestInfo, +) => Promise | ResponseData; + +export interface ResponseData { + status: number; + headers?: { + [key: string]: string | undefined; + }; + body?: unknown; +} + +export interface SuccessResponse extends ResponseData { + success?: true; +} + +export interface ErrorResponse extends ResponseData { + success?: false; +} + +/** + * @internal + */ +export function isSuccessResponse(response: ResponseData): response is SuccessResponse { + return response.status < 400; +} + +/** + * @internal + */ +export function isErrorResponse(response: ResponseData): response is ErrorResponse { + return response.status >= 400; +} + +/** + * This type allows to pick the required properties of another type. + */ +export type Require = Partial & { + [Property in Key]-?: Type[Property]; +}; + +export type SizedTuple< + T, + MIN extends number | undefined = undefined, + MAX extends number | undefined = undefined, +> = MIN extends number + ? MAX extends number + ? _SizedTuple> + : TupleObject> & T[] + : MAX extends number + ? _SizedTuple, true> + : T[]; + +type _SizedTuple = ARR extends [ + infer HEAD extends number, + ...infer TAIL extends number[], +] + ? Tuple | _SizedTuple + : never; + +type Tuple = _Tuple< + T, + NumericRangeTuple +>; + +type _Tuple = N extends [ + infer HEAD, + ...infer TAIL extends number[], +] + ? HEAD extends 0 + ? [] | _Tuple + : [T, ..._Tuple] + : []; + +type TupleObject = N extends [ + infer HEAD extends number, + ...infer TAIL extends number[], +] + ? TAIL extends [] + ? Record + : { [P in HEAD]: T } & TupleObject + : Record; + +export type NumericRange< + START extends number, + END extends number, + ARR extends unknown[] = [], + ACC extends number = never, +> = ARR['length'] extends END + ? ACC | START | END + : NumericRange< + START, + END, + [...ARR, 1], + ARR[START] extends undefined ? ACC : ACC | ARR['length'] + >; + +type NumericRangeTuple< + START extends number, + END extends number, + ARR extends unknown[] = [], + ACC extends number[] = [], +> = ARR['length'] extends END + ? [START, ...ACC, END] + : NumericRangeTuple< + START, + END, + [...ARR, 1], + ARR[START] extends undefined ? ACC : [...ACC, ARR['length']] + >; + +export type AuthenticationMessage = + T extends 'all' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'authenticate'; + token?: string; + authenticated?: boolean; + [k: string]: unknown; + } + : T extends 'request' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'authenticate'; + token?: string; + authenticated?: boolean; + [k: string]: unknown; + } + : T extends 'response' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'authenticate'; + token?: string; + authenticated?: boolean; + [k: string]: unknown; + } + : never; + +export type ConnectionStateChangedMessage< + T extends 'request' | 'response' | 'all' = 'all', +> = T extends 'all' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType?: 'connection-state-changed'; + connectionUrl: string; + /** + * The status of the peerconnection. + */ + status: 'new' | 'connecting' | 'connected' | 'disconnected' | 'failed' | 'closed'; + [k: string]: unknown; + } + : T extends 'request' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType?: 'connection-state-changed'; + connectionUrl: string; + /** + * The status of the peerconnection. + */ + status: 'new' | 'connecting' | 'connected' | 'disconnected' | 'failed' | 'closed'; + [k: string]: unknown; + } + : T extends 'response' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType?: 'connection-state-changed'; + connectionUrl: string; + /** + * The status of the peerconnection. + */ + status: + | 'new' + | 'connecting' + | 'connected' + | 'disconnected' + | 'failed' + | 'closed'; + [k: string]: unknown; + } + : never; + +export type UserReference = + T extends 'all' + ? { + /** + * URL of the user + */ + url: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * URL of the user + */ + url: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * URL of the user + */ + url: string; + [k: string]: unknown; + } + : never; + +export type DeviceOverview = + T extends 'all' + ? { + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } + : never; + +export type ServiceDescription = + T extends 'all' + ? { + serviceType?: string; + serviceId?: string; + serviceDirection?: 'consumer' | 'producer' | 'prosumer'; + [k: string]: unknown; + } + : T extends 'request' + ? { + serviceType?: string; + serviceId?: string; + serviceDirection?: 'consumer' | 'producer' | 'prosumer'; + [k: string]: unknown; + } + : T extends 'response' + ? { + serviceType?: string; + serviceId?: string; + serviceDirection?: 'consumer' | 'producer' | 'prosumer'; + [k: string]: unknown; + } + : never; + +export type InstantiableCloudDevice = + T extends 'all' + ? { + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'cloud instantiable'; + instantiateUrl?: string; + services?: ServiceDescription[]; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'cloud instantiable'; + instantiateUrl?: string; + services?: ServiceDescription<'request'>[]; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'cloud instantiable'; + instantiateUrl?: string; + services?: ServiceDescription<'response'>[]; + [k: string]: unknown; + } + : never; + +export type TimeSlot = T extends 'all' + ? { + start?: string; + end?: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + start?: string; + end?: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + start?: string; + end?: string; + [k: string]: unknown; + } + : never; + +/** + * A list of time slots that the maintainer of the device announced it is available + * + */ +export type Availability = + T extends 'all' + ? TimeSlot[] + : T extends 'request' + ? TimeSlot<'request'>[] + : T extends 'response' + ? TimeSlot<'response'>[] + : never; + +export type ConcreteDevice = + T extends 'all' + ? { + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'device'; + /** + * If true, the device is connected to the service and can be used. + * + */ + connected?: boolean; + /** + * A list of time slots that the maintainer of the device announced it is available + * + */ + announcedAvailability?: TimeSlot[]; + experiment?: string; + services?: ServiceDescription[]; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'device'; + experiment?: string; + services?: ServiceDescription<'request'>[]; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'device'; + /** + * If true, the device is connected to the service and can be used. + * + */ + connected?: boolean; + /** + * A list of time slots that the maintainer of the device announced it is available + * + */ + announcedAvailability?: TimeSlot<'response'>[]; + experiment?: string; + services?: ServiceDescription<'response'>[]; + [k: string]: unknown; + } + : never; + +export type InstantiableBrowserDevice = + T extends 'all' + ? { + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'edge instantiable'; + codeUrl?: string; + services?: ServiceDescription[]; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'edge instantiable'; + codeUrl?: string; + services?: ServiceDescription<'request'>[]; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'edge instantiable'; + codeUrl?: string; + services?: ServiceDescription<'response'>[]; + [k: string]: unknown; + } + : never; + +export type DeviceReference = + T extends 'all' + ? { + /** + * URL of the device + */ + url: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * URL of the device + */ + url: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * URL of the device + */ + url: string; + [k: string]: unknown; + } + : never; + +export type DeviceGroup = + T extends 'all' + ? { + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'group'; + devices: DeviceReference[]; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'group'; + devices: DeviceReference<'request'>[]; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'group'; + devices: DeviceReference<'response'>[]; + [k: string]: unknown; + } + : never; + +export type Device = T extends 'all' + ? + | ({ + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'cloud instantiable'; + instantiateUrl?: string; + services?: ServiceDescription[]; + [k: string]: unknown; + }) + | ({ + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'device'; + /** + * If true, the device is connected to the service and can be used. + * + */ + connected?: boolean; + /** + * A list of time slots that the maintainer of the device announced it is available + * + */ + announcedAvailability?: TimeSlot[]; + experiment?: string; + services?: ServiceDescription[]; + [k: string]: unknown; + }) + | ({ + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'edge instantiable'; + codeUrl?: string; + services?: ServiceDescription[]; + [k: string]: unknown; + }) + | ({ + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'group'; + devices: DeviceReference[]; + [k: string]: unknown; + }) + : T extends 'request' + ? + | ({ + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'cloud instantiable'; + instantiateUrl?: string; + services?: ServiceDescription<'request'>[]; + [k: string]: unknown; + }) + | ({ + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'device'; + experiment?: string; + services?: ServiceDescription<'request'>[]; + [k: string]: unknown; + }) + | ({ + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'edge instantiable'; + codeUrl?: string; + services?: ServiceDescription<'request'>[]; + [k: string]: unknown; + }) + | ({ + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'group'; + devices: DeviceReference<'request'>[]; + [k: string]: unknown; + }) + : T extends 'response' + ? + | ({ + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'cloud instantiable'; + instantiateUrl?: string; + services?: ServiceDescription<'response'>[]; + [k: string]: unknown; + }) + | ({ + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'device'; + /** + * If true, the device is connected to the service and can be used. + * + */ + connected?: boolean; + /** + * A list of time slots that the maintainer of the device announced it is available + * + */ + announcedAvailability?: TimeSlot<'response'>[]; + experiment?: string; + services?: ServiceDescription<'response'>[]; + [k: string]: unknown; + }) + | ({ + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'edge instantiable'; + codeUrl?: string; + services?: ServiceDescription<'response'>[]; + [k: string]: unknown; + }) + | ({ + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'group'; + devices: DeviceReference<'response'>[]; + [k: string]: unknown; + }) + : never; + +export type Callback = T extends 'all' + ? { + callbackType: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + callbackType: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + callbackType: string; + [k: string]: unknown; + } + : never; + +export type EventCallback = + T extends 'all' + ? { + callbackType: string; + [k: string]: unknown; + } & { + callbackType: 'event'; + eventType: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + callbackType: string; + [k: string]: unknown; + } & { + callbackType: 'event'; + eventType: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + callbackType: string; + [k: string]: unknown; + } & { + callbackType: 'event'; + eventType: string; + [k: string]: unknown; + } + : never; + +export type DeviceChangedEventCallback = + T extends 'all' + ? { + callbackType: string; + [k: string]: unknown; + } & { + callbackType: 'event'; + eventType: string; + [k: string]: unknown; + } & { + eventType: 'device-changed'; + device: + | ({ + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'cloud instantiable'; + instantiateUrl?: string; + services?: ServiceDescription[]; + [k: string]: unknown; + }) + | ({ + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'device'; + /** + * If true, the device is connected to the service and can be used. + * + */ + connected?: boolean; + /** + * A list of time slots that the maintainer of the device announced it is available + * + */ + announcedAvailability?: TimeSlot[]; + experiment?: string; + services?: ServiceDescription[]; + [k: string]: unknown; + }) + | ({ + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'edge instantiable'; + codeUrl?: string; + services?: ServiceDescription[]; + [k: string]: unknown; + }) + | ({ + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'group'; + devices: DeviceReference[]; + [k: string]: unknown; + }); + [k: string]: unknown; + } + : T extends 'request' + ? { + callbackType: string; + [k: string]: unknown; + } & { + callbackType: 'event'; + eventType: string; + [k: string]: unknown; + } & { + eventType: 'device-changed'; + device: + | ({ + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'cloud instantiable'; + instantiateUrl?: string; + services?: ServiceDescription<'request'>[]; + [k: string]: unknown; + }) + | ({ + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'device'; + experiment?: string; + services?: ServiceDescription<'request'>[]; + [k: string]: unknown; + }) + | ({ + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'edge instantiable'; + codeUrl?: string; + services?: ServiceDescription<'request'>[]; + [k: string]: unknown; + }) + | ({ + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'group'; + devices: DeviceReference<'request'>[]; + [k: string]: unknown; + }); + [k: string]: unknown; + } + : T extends 'response' + ? { + callbackType: string; + [k: string]: unknown; + } & { + callbackType: 'event'; + eventType: string; + [k: string]: unknown; + } & { + eventType: 'device-changed'; + device: + | ({ + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'cloud instantiable'; + instantiateUrl?: string; + services?: ServiceDescription<'response'>[]; + [k: string]: unknown; + }) + | ({ + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'device'; + /** + * If true, the device is connected to the service and can be used. + * + */ + connected?: boolean; + /** + * A list of time slots that the maintainer of the device announced it is available + * + */ + announcedAvailability?: TimeSlot<'response'>[]; + experiment?: string; + services?: ServiceDescription<'response'>[]; + [k: string]: unknown; + }) + | ({ + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'edge instantiable'; + codeUrl?: string; + services?: ServiceDescription<'response'>[]; + [k: string]: unknown; + }) + | ({ + /** + * URL of the device + */ + url: string; + /** + * Name of the device + */ + name: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'group'; + devices: DeviceReference<'response'>[]; + [k: string]: unknown; + }); + [k: string]: unknown; + } + : never; + +export type DeviceOverviewUpdate = + T extends 'all' + ? { + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } + : never; + +export type InstantiableCloudDeviceUpdate< + T extends 'request' | 'response' | 'all' = 'all', +> = T extends 'all' + ? { + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'cloud instantiable'; + instantiateUrl?: string; + services?: ServiceDescription[]; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'cloud instantiable'; + instantiateUrl?: string; + services?: ServiceDescription<'request'>[]; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'cloud instantiable'; + instantiateUrl?: string; + services?: ServiceDescription<'response'>[]; + [k: string]: unknown; + } + : never; + +export type ConcreteDeviceUpdate = + T extends 'all' + ? { + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'device'; + experiment?: string; + services?: ServiceDescription[]; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'device'; + experiment?: string; + services?: ServiceDescription<'request'>[]; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'device'; + experiment?: string; + services?: ServiceDescription<'response'>[]; + [k: string]: unknown; + } + : never; + +export type InstantiableBrowserDeviceUpdate< + T extends 'request' | 'response' | 'all' = 'all', +> = T extends 'all' + ? { + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'edge instantiable'; + codeUrl?: string; + services?: ServiceDescription[]; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'edge instantiable'; + codeUrl?: string; + services?: ServiceDescription<'request'>[]; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'edge instantiable'; + codeUrl?: string; + services?: ServiceDescription<'response'>[]; + [k: string]: unknown; + } + : never; + +export type DeviceGroupUpdate = + T extends 'all' + ? { + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'group'; + devices?: DeviceReference[]; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'group'; + devices?: DeviceReference<'request'>[]; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'group'; + devices?: DeviceReference<'response'>[]; + [k: string]: unknown; + } + : never; + +export type DeviceUpdate = + T extends 'all' + ? + | ({ + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'cloud instantiable'; + instantiateUrl?: string; + services?: ServiceDescription[]; + [k: string]: unknown; + }) + | ({ + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'device'; + experiment?: string; + services?: ServiceDescription[]; + [k: string]: unknown; + }) + | ({ + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'edge instantiable'; + codeUrl?: string; + services?: ServiceDescription[]; + [k: string]: unknown; + }) + | ({ + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference[]; + /** + * List of users who own the device + */ + owner?: UserReference[]; + [k: string]: unknown; + } & { + type?: 'group'; + devices?: DeviceReference[]; + [k: string]: unknown; + }) + : T extends 'request' + ? + | ({ + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'cloud instantiable'; + instantiateUrl?: string; + services?: ServiceDescription<'request'>[]; + [k: string]: unknown; + }) + | ({ + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'device'; + experiment?: string; + services?: ServiceDescription<'request'>[]; + [k: string]: unknown; + }) + | ({ + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'edge instantiable'; + codeUrl?: string; + services?: ServiceDescription<'request'>[]; + [k: string]: unknown; + }) + | ({ + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'request'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'request'>[]; + [k: string]: unknown; + } & { + type?: 'group'; + devices?: DeviceReference<'request'>[]; + [k: string]: unknown; + }) + : T extends 'response' + ? + | ({ + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'cloud instantiable'; + instantiateUrl?: string; + services?: ServiceDescription<'response'>[]; + [k: string]: unknown; + }) + | ({ + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'device'; + experiment?: string; + services?: ServiceDescription<'response'>[]; + [k: string]: unknown; + }) + | ({ + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'edge instantiable'; + codeUrl?: string; + services?: ServiceDescription<'response'>[]; + [k: string]: unknown; + }) + | ({ + /** + * Name of the device + */ + name?: string; + /** + * Extended description of the device, features, etc. + */ + description?: string; + /** + * Type of the device + */ + type: 'device' | 'group' | 'edge instantiable' | 'cloud instantiable'; + /** + * If true, the device may be seen and used by every user. + */ + isPublic?: boolean; + /** + * List of users who can view the device + */ + viewer?: UserReference<'response'>[]; + /** + * List of users who own the device + */ + owner?: UserReference<'response'>[]; + [k: string]: unknown; + } & { + type?: 'group'; + devices?: DeviceReference<'response'>[]; + [k: string]: unknown; + }) + : never; + +export type AvailabilityRule = + T extends 'all' + ? { + start?: string; + end?: string; + [k: string]: unknown; + } & { + available?: boolean; + /** + * If specified the time slot is repeated in a fixed offset specified by the frequency + */ + repeat?: { + frequency: 'HOURLY' | 'DAILY' | 'WEEKLY'; + /** + * Up to this date-time the time slot will be repeated. + */ + until?: string; + /** + * How often the time slot will be repeated + */ + count?: number; + [k: string]: unknown; + }; + [k: string]: unknown; + } + : T extends 'request' + ? { + start?: string; + end?: string; + [k: string]: unknown; + } & { + available?: boolean; + /** + * If specified the time slot is repeated in a fixed offset specified by the frequency + */ + repeat?: { + frequency: 'HOURLY' | 'DAILY' | 'WEEKLY'; + /** + * Up to this date-time the time slot will be repeated. + */ + until?: string; + /** + * How often the time slot will be repeated + */ + count?: number; + [k: string]: unknown; + }; + [k: string]: unknown; + } + : T extends 'response' + ? { + start?: string; + end?: string; + [k: string]: unknown; + } & { + available?: boolean; + /** + * If specified the time slot is repeated in a fixed offset specified by the frequency + */ + repeat?: { + frequency: 'HOURLY' | 'DAILY' | 'WEEKLY'; + /** + * Up to this date-time the time slot will be repeated. + */ + until?: string; + /** + * How often the time slot will be repeated + */ + count?: number; + [k: string]: unknown; + }; + [k: string]: unknown; + } + : never; + +export type Message = T extends 'all' + ? { + messageType: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + messageType: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + messageType: string; + [k: string]: unknown; + } + : never; + +export type CommandMessage = + T extends 'all' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'command'; + command: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'command'; + command: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'command'; + command: string; + [k: string]: unknown; + } + : never; + +export type ServiceConfig = + T extends 'all' + ? { + serviceType: string; + serviceId: string; + remoteServiceId: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + serviceType: string; + serviceId: string; + remoteServiceId: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + serviceType: string; + serviceId: string; + remoteServiceId: string; + [k: string]: unknown; + } + : never; + +export type CreatePeerconnectionMessage< + T extends 'request' | 'response' | 'all' = 'all', +> = T extends 'all' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'command'; + command: string; + [k: string]: unknown; + } & { + command: 'createPeerconnection'; + connectionType: 'webrtc' | 'websocket' | 'local'; + connectionUrl: string; + services: ServiceConfig[]; + tiebreaker: boolean; + config?: { + [k: string]: unknown; + }; + [k: string]: unknown; + } + : T extends 'request' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'command'; + command: string; + [k: string]: unknown; + } & { + command: 'createPeerconnection'; + connectionType: 'webrtc' | 'websocket' | 'local'; + connectionUrl: string; + services: ServiceConfig<'request'>[]; + tiebreaker: boolean; + config?: { + [k: string]: unknown; + }; + [k: string]: unknown; + } + : T extends 'response' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'command'; + command: string; + [k: string]: unknown; + } & { + command: 'createPeerconnection'; + connectionType: 'webrtc' | 'websocket' | 'local'; + connectionUrl: string; + services: ServiceConfig<'response'>[]; + tiebreaker: boolean; + config?: { + [k: string]: unknown; + }; + [k: string]: unknown; + } + : never; + +export type ClosePeerconnectionMessage = + T extends 'all' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'command'; + command: string; + [k: string]: unknown; + } & { + command: 'closePeerconnection'; + connectionUrl: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'command'; + command: string; + [k: string]: unknown; + } & { + command: 'closePeerconnection'; + connectionUrl: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'command'; + command: string; + [k: string]: unknown; + } & { + command: 'closePeerconnection'; + connectionUrl: string; + [k: string]: unknown; + } + : never; + +export type SignalingMessage = + T extends 'all' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'signaling'; + signalingType: string; + connectionUrl: string; + content: { + [k: string]: unknown; + }; + [k: string]: unknown; + } + : T extends 'request' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'signaling'; + signalingType: string; + connectionUrl: string; + content: { + [k: string]: unknown; + }; + [k: string]: unknown; + } + : T extends 'response' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'signaling'; + signalingType: string; + connectionUrl: string; + content: { + [k: string]: unknown; + }; + [k: string]: unknown; + } + : never; + +export type ConfigurationMessage = + T extends 'all' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'configuration'; + configuration: { + [k: string]: unknown; + }; + [k: string]: unknown; + } + : T extends 'request' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'configuration'; + configuration: { + [k: string]: unknown; + }; + [k: string]: unknown; + } + : T extends 'response' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'configuration'; + configuration: { + [k: string]: unknown; + }; + [k: string]: unknown; + } + : never; + +export type ExperimentStatusChangedMessage< + T extends 'request' | 'response' | 'all' = 'all', +> = T extends 'all' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'experiment-status-changed'; + status: string; + message?: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'experiment-status-changed'; + status: string; + message?: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'experiment-status-changed'; + status: string; + message?: string; + [k: string]: unknown; + } + : never; + +export type LoggingMessage = + T extends 'all' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'logging'; + content: { + [k: string]: unknown; + }; + [k: string]: unknown; + } + : T extends 'request' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'logging'; + content: { + [k: string]: unknown; + }; + [k: string]: unknown; + } + : T extends 'response' + ? { + messageType: string; + [k: string]: unknown; + } & { + messageType: 'logging'; + content: { + [k: string]: unknown; + }; + [k: string]: unknown; + } + : never; + +/** + * The status of the peerconnection. + */ +export type ConnectionStatus = + T extends 'all' + ? 'new' | 'connecting' | 'connected' | 'disconnected' | 'failed' | 'closed' + : T extends 'request' + ? 'new' | 'connecting' | 'connected' | 'disconnected' | 'failed' | 'closed' + : T extends 'response' + ? 'new' | 'connecting' | 'connected' | 'disconnected' | 'failed' | 'closed' + : never; + +export type PeerconnectionCommon = + T extends 'all' + ? { + /** + * URL of the peerconnection + */ + url: string; + /** + * Type of the peerconnection + */ + type: 'local' | 'webrtc'; + /** + * The status of the peerconnection. + */ + status: 'new' | 'connecting' | 'connected' | 'disconnected' | 'failed' | 'closed'; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Type of the peerconnection + */ + type: 'local' | 'webrtc'; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * URL of the peerconnection + */ + url: string; + /** + * Type of the peerconnection + */ + type: 'local' | 'webrtc'; + /** + * The status of the peerconnection. + */ + status: + | 'new' + | 'connecting' + | 'connected' + | 'disconnected' + | 'failed' + | 'closed'; + [k: string]: unknown; + } + : never; + +export type PeerconnectionOverview = + T extends 'all' + ? { + /** + * URL of the peerconnection + */ + url: string; + /** + * Type of the peerconnection + */ + type: 'local' | 'webrtc'; + /** + * The status of the peerconnection. + */ + status: 'new' | 'connecting' | 'connected' | 'disconnected' | 'failed' | 'closed'; + [k: string]: unknown; + } & { + devices: SizedTuple; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Type of the peerconnection + */ + type: 'local' | 'webrtc'; + [k: string]: unknown; + } & { + devices: SizedTuple, 2, 2>; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * URL of the peerconnection + */ + url: string; + /** + * Type of the peerconnection + */ + type: 'local' | 'webrtc'; + /** + * The status of the peerconnection. + */ + status: + | 'new' + | 'connecting' + | 'connected' + | 'disconnected' + | 'failed' + | 'closed'; + [k: string]: unknown; + } & { + devices: SizedTuple, 2, 2>; + [k: string]: unknown; + } + : never; + +export type ConfiguredDeviceReference = + T extends 'all' + ? { + /** + * URL of the device + */ + url: string; + config?: { + services?: ServiceConfig[]; + [k: string]: unknown; + }; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * URL of the device + */ + url: string; + config?: { + services?: ServiceConfig<'request'>[]; + [k: string]: unknown; + }; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * URL of the device + */ + url: string; + config?: { + services?: ServiceConfig<'response'>[]; + [k: string]: unknown; + }; + [k: string]: unknown; + } + : never; + +export type Peerconnection = + T extends 'all' + ? { + /** + * URL of the peerconnection + */ + url: string; + /** + * Type of the peerconnection + */ + type: 'local' | 'webrtc'; + /** + * The status of the peerconnection. + */ + status: 'new' | 'connecting' | 'connected' | 'disconnected' | 'failed' | 'closed'; + [k: string]: unknown; + } & { + devices: SizedTuple; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Type of the peerconnection + */ + type: 'local' | 'webrtc'; + [k: string]: unknown; + } & { + devices: SizedTuple, 2, 2>; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * URL of the peerconnection + */ + url: string; + /** + * Type of the peerconnection + */ + type: 'local' | 'webrtc'; + /** + * The status of the peerconnection. + */ + status: + | 'new' + | 'connecting' + | 'connected' + | 'disconnected' + | 'failed' + | 'closed'; + [k: string]: unknown; + } & { + devices: SizedTuple, 2, 2>; + [k: string]: unknown; + } + : never; + +export type PeerconnectionClosedEventCallback< + T extends 'request' | 'response' | 'all' = 'all', +> = T extends 'all' + ? { + callbackType: string; + [k: string]: unknown; + } & { + callbackType: 'event'; + eventType: string; + [k: string]: unknown; + } & { + eventType: 'peerconnection-closed'; + peerconnection: { + /** + * URL of the peerconnection + */ + url: string; + /** + * Type of the peerconnection + */ + type: 'local' | 'webrtc'; + /** + * The status of the peerconnection. + */ + status: 'new' | 'connecting' | 'connected' | 'disconnected' | 'failed' | 'closed'; + [k: string]: unknown; + } & { + devices: SizedTuple; + [k: string]: unknown; + }; + [k: string]: unknown; + } + : T extends 'request' + ? { + callbackType: string; + [k: string]: unknown; + } & { + callbackType: 'event'; + eventType: string; + [k: string]: unknown; + } & { + eventType: 'peerconnection-closed'; + peerconnection: { + /** + * Type of the peerconnection + */ + type: 'local' | 'webrtc'; + [k: string]: unknown; + } & { + devices: SizedTuple, 2, 2>; + [k: string]: unknown; + }; + [k: string]: unknown; + } + : T extends 'response' + ? { + callbackType: string; + [k: string]: unknown; + } & { + callbackType: 'event'; + eventType: string; + [k: string]: unknown; + } & { + eventType: 'peerconnection-closed'; + peerconnection: { + /** + * URL of the peerconnection + */ + url: string; + /** + * Type of the peerconnection + */ + type: 'local' | 'webrtc'; + /** + * The status of the peerconnection. + */ + status: + | 'new' + | 'connecting' + | 'connected' + | 'disconnected' + | 'failed' + | 'closed'; + [k: string]: unknown; + } & { + devices: SizedTuple, 2, 2>; + [k: string]: unknown; + }; + [k: string]: unknown; + } + : never; + +export type PeerconnectionStatusChangedEventCallback< + T extends 'request' | 'response' | 'all' = 'all', +> = T extends 'all' + ? { + callbackType: string; + [k: string]: unknown; + } & { + callbackType: 'event'; + eventType: string; + [k: string]: unknown; + } & { + eventType: 'peerconnection-status-changed'; + peerconnection: { + /** + * URL of the peerconnection + */ + url: string; + /** + * Type of the peerconnection + */ + type: 'local' | 'webrtc'; + /** + * The status of the peerconnection. + */ + status: 'new' | 'connecting' | 'connected' | 'disconnected' | 'failed' | 'closed'; + [k: string]: unknown; + } & { + devices: SizedTuple; + [k: string]: unknown; + }; + [k: string]: unknown; + } + : T extends 'request' + ? { + callbackType: string; + [k: string]: unknown; + } & { + callbackType: 'event'; + eventType: string; + [k: string]: unknown; + } & { + eventType: 'peerconnection-status-changed'; + peerconnection: { + /** + * Type of the peerconnection + */ + type: 'local' | 'webrtc'; + [k: string]: unknown; + } & { + devices: SizedTuple, 2, 2>; + [k: string]: unknown; + }; + [k: string]: unknown; + } + : T extends 'response' + ? { + callbackType: string; + [k: string]: unknown; + } & { + callbackType: 'event'; + eventType: string; + [k: string]: unknown; + } & { + eventType: 'peerconnection-status-changed'; + peerconnection: { + /** + * URL of the peerconnection + */ + url: string; + /** + * Type of the peerconnection + */ + type: 'local' | 'webrtc'; + /** + * The status of the peerconnection. + */ + status: + | 'new' + | 'connecting' + | 'connected' + | 'disconnected' + | 'failed' + | 'closed'; + [k: string]: unknown; + } & { + devices: SizedTuple, 2, 2>; + [k: string]: unknown; + }; + [k: string]: unknown; + } + : never; + +export function isAuthenticationMessage( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is AuthenticationMessage { + switch (type) { + case 'request': + return BasicValidation.validateAuthenticationMessageRequest(obj); + case 'response': + return BasicValidation.validateAuthenticationMessageResponse(obj); + default: + return BasicValidation.validateAuthenticationMessage(obj); + } +} + +export function isConnectionStateChangedMessage< + T extends 'request' | 'response' | 'all' = 'all', +>( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is ConnectionStateChangedMessage { + switch (type) { + case 'request': + return BasicValidation.validateConnectionStateChangedMessageRequest(obj); + case 'response': + return BasicValidation.validateConnectionStateChangedMessageResponse(obj); + default: + return BasicValidation.validateConnectionStateChangedMessage(obj); + } +} + +export function isDeviceOverview( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is DeviceOverview { + switch (type) { + case 'request': + return BasicValidation.validateDeviceOverviewRequest(obj); + case 'response': + return BasicValidation.validateDeviceOverviewResponse(obj); + default: + return BasicValidation.validateDeviceOverview(obj); + } +} + +export function isInstantiableCloudDevice< + T extends 'request' | 'response' | 'all' = 'all', +>( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is InstantiableCloudDevice { + switch (type) { + case 'request': + return BasicValidation.validateInstantiableCloudDeviceRequest(obj); + case 'response': + return BasicValidation.validateInstantiableCloudDeviceResponse(obj); + default: + return BasicValidation.validateInstantiableCloudDevice(obj); + } +} + +export function isConcreteDevice( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is ConcreteDevice { + switch (type) { + case 'request': + return BasicValidation.validateConcreteDeviceRequest(obj); + case 'response': + return BasicValidation.validateConcreteDeviceResponse(obj); + default: + return BasicValidation.validateConcreteDevice(obj); + } +} + +export function isInstantiableBrowserDevice< + T extends 'request' | 'response' | 'all' = 'all', +>( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is InstantiableBrowserDevice { + switch (type) { + case 'request': + return BasicValidation.validateInstantiableBrowserDeviceRequest(obj); + case 'response': + return BasicValidation.validateInstantiableBrowserDeviceResponse(obj); + default: + return BasicValidation.validateInstantiableBrowserDevice(obj); + } +} + +export function isDeviceGroup( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is DeviceGroup { + switch (type) { + case 'request': + return BasicValidation.validateDeviceGroupRequest(obj); + case 'response': + return BasicValidation.validateDeviceGroupResponse(obj); + default: + return BasicValidation.validateDeviceGroup(obj); + } +} + +export function isDevice( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is Device { + switch (type) { + case 'request': + return BasicValidation.validateDeviceRequest(obj); + case 'response': + return BasicValidation.validateDeviceResponse(obj); + default: + return BasicValidation.validateDevice(obj); + } +} + +export function isCallback( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is Callback { + switch (type) { + case 'request': + return BasicValidation.validateCallbackRequest(obj); + case 'response': + return BasicValidation.validateCallbackResponse(obj); + default: + return BasicValidation.validateCallback(obj); + } +} + +export function isEventCallback( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is EventCallback { + switch (type) { + case 'request': + return BasicValidation.validateEventCallbackRequest(obj); + case 'response': + return BasicValidation.validateEventCallbackResponse(obj); + default: + return BasicValidation.validateEventCallback(obj); + } +} + +export function isDeviceChangedEventCallback< + T extends 'request' | 'response' | 'all' = 'all', +>( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is DeviceChangedEventCallback { + switch (type) { + case 'request': + return BasicValidation.validateDeviceChangedEventCallbackRequest(obj); + case 'response': + return BasicValidation.validateDeviceChangedEventCallbackResponse(obj); + default: + return BasicValidation.validateDeviceChangedEventCallback(obj); + } +} + +export function isMessage( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is Message { + switch (type) { + case 'request': + return BasicValidation.validateMessageRequest(obj); + case 'response': + return BasicValidation.validateMessageResponse(obj); + default: + return BasicValidation.validateMessage(obj); + } +} + +export function isCommandMessage( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is CommandMessage { + switch (type) { + case 'request': + return BasicValidation.validateCommandMessageRequest(obj); + case 'response': + return BasicValidation.validateCommandMessageResponse(obj); + default: + return BasicValidation.validateCommandMessage(obj); + } +} + +export function isCreatePeerconnectionMessage< + T extends 'request' | 'response' | 'all' = 'all', +>( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is CreatePeerconnectionMessage { + switch (type) { + case 'request': + return BasicValidation.validateCreatePeerconnectionMessageRequest(obj); + case 'response': + return BasicValidation.validateCreatePeerconnectionMessageResponse(obj); + default: + return BasicValidation.validateCreatePeerconnectionMessage(obj); + } +} + +export function isClosePeerconnectionMessage< + T extends 'request' | 'response' | 'all' = 'all', +>( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is ClosePeerconnectionMessage { + switch (type) { + case 'request': + return BasicValidation.validateClosePeerconnectionMessageRequest(obj); + case 'response': + return BasicValidation.validateClosePeerconnectionMessageResponse(obj); + default: + return BasicValidation.validateClosePeerconnectionMessage(obj); + } +} + +export function isSignalingMessage( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is SignalingMessage { + switch (type) { + case 'request': + return BasicValidation.validateSignalingMessageRequest(obj); + case 'response': + return BasicValidation.validateSignalingMessageResponse(obj); + default: + return BasicValidation.validateSignalingMessage(obj); + } +} + +export function isConfigurationMessage( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is ConfigurationMessage { + switch (type) { + case 'request': + return BasicValidation.validateConfigurationMessageRequest(obj); + case 'response': + return BasicValidation.validateConfigurationMessageResponse(obj); + default: + return BasicValidation.validateConfigurationMessage(obj); + } +} + +export function isExperimentStatusChangedMessage< + T extends 'request' | 'response' | 'all' = 'all', +>( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is ExperimentStatusChangedMessage { + switch (type) { + case 'request': + return BasicValidation.validateExperimentStatusChangedMessageRequest(obj); + case 'response': + return BasicValidation.validateExperimentStatusChangedMessageResponse(obj); + default: + return BasicValidation.validateExperimentStatusChangedMessage(obj); + } +} + +export function isLoggingMessage( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is LoggingMessage { + switch (type) { + case 'request': + return BasicValidation.validateLoggingMessageRequest(obj); + case 'response': + return BasicValidation.validateLoggingMessageResponse(obj); + default: + return BasicValidation.validateLoggingMessage(obj); + } +} + +export function isPeerconnection( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is Peerconnection { + switch (type) { + case 'request': + return BasicValidation.validatePeerconnectionRequest(obj); + case 'response': + return BasicValidation.validatePeerconnectionResponse(obj); + default: + return BasicValidation.validatePeerconnection(obj); + } +} + +export function isPeerconnectionClosedEventCallback< + T extends 'request' | 'response' | 'all' = 'all', +>( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is PeerconnectionClosedEventCallback { + switch (type) { + case 'request': + return BasicValidation.validatePeerconnectionClosedEventCallbackRequest(obj); + case 'response': + return BasicValidation.validatePeerconnectionClosedEventCallbackResponse(obj); + default: + return BasicValidation.validatePeerconnectionClosedEventCallback(obj); + } +} + +export function isPeerconnectionStatusChangedEventCallback< + T extends 'request' | 'response' | 'all' = 'all', +>( + obj: unknown, + type: 'request' | 'response' | 'all' | T = 'all', +): obj is PeerconnectionStatusChangedEventCallback { + switch (type) { + case 'request': + return BasicValidation.validatePeerconnectionStatusChangedEventCallbackRequest(obj); + case 'response': + return BasicValidation.validatePeerconnectionStatusChangedEventCallbackResponse( + obj, + ); + default: + return BasicValidation.validatePeerconnectionStatusChangedEventCallback(obj); + } +} diff --git a/services/booking/src/common/src/clients/index.ts b/services/booking/src/common/src/clients/index.ts new file mode 100644 index 00000000..5cb61223 --- /dev/null +++ b/services/booking/src/common/src/clients/index.ts @@ -0,0 +1,72 @@ +import { RequestHandler } from 'express'; + +import { baseConfig } from '../config.js'; +import { Client as BookingBackendClient } from './booking-backend/client.js'; +import { Client as BookingFrontendClient } from './booking-frontend/client.js'; +import { Client as DeviceClient } from './device/client.js'; +import { Client as ScheduleServiceClient } from './schedule-service/client.js'; + +export const device = new DeviceClient(baseConfig.BASE_URL, { + serviceUrl: baseConfig.DEVICE_SERVICE_URL, + fixedHeaders: [['x-request-authentication', 'experiment-service']], +}); +export const booking = { + backend: new BookingBackendClient(baseConfig.BASE_URL, { + serviceUrl: baseConfig.BOOKING_BACKEND_URL, + fixedHeaders: [['x-request-authentication', 'experiment-service']], + }), + frontend: new BookingFrontendClient(baseConfig.BASE_URL, { + serviceUrl: baseConfig.BOOKING_FRONTEND_URL, + fixedHeaders: [['x-request-authentication', 'experiment-service']], + }), + schedule: new ScheduleServiceClient(baseConfig.BASE_URL, { + serviceUrl: baseConfig.SCHEDULE_SERVICE_URL, + fixedHeaders: [['x-request-authentication', 'experiment-service']], + }), +}; +export const clients = { device, booking }; +export type Clients = typeof clients; + +declare global { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace Express { + export interface Request { + clients: typeof clients; + } + } +} + +export const middleware: RequestHandler = (req, _res, next) => { + const forward_headers = ['x-request-authentication']; + const fixed_headers = forward_headers + .map(forward_header => { + const value = req.header(forward_header); + if (value) return [forward_header, value] as [string, string]; + else return undefined; + }) + .filter(fixed_header => !!fixed_header) as [string, string][]; + + const bound_device = new DeviceClient(baseConfig.BASE_URL, { + serviceUrl: baseConfig.DEVICE_SERVICE_URL, + fixedHeaders: fixed_headers, + }); + + const bound_booking = { + backend: new BookingBackendClient(baseConfig.BASE_URL, { + serviceUrl: baseConfig.BOOKING_BACKEND_URL, + fixedHeaders: fixed_headers, + }), + frontend: new BookingFrontendClient(baseConfig.BASE_URL, { + serviceUrl: baseConfig.BOOKING_FRONTEND_URL, + fixedHeaders: fixed_headers, + }), + schedule: new ScheduleServiceClient(baseConfig.BASE_URL, { + serviceUrl: baseConfig.SCHEDULE_SERVICE_URL, + fixedHeaders: fixed_headers, + }), + }; + + req.clients = { device: bound_device, booking: bound_booking }; + + next(); +}; diff --git a/services/booking/src/common/src/clients/schedule-service/basicValidation.cjs b/services/booking/src/common/src/clients/schedule-service/basicValidation.cjs new file mode 100644 index 00000000..ff4febf8 --- /dev/null +++ b/services/booking/src/common/src/clients/schedule-service/basicValidation.cjs @@ -0,0 +1,6650 @@ +/* eslint-disable */ +//@ts-nocheck +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +'use strict'; +exports.validateBooking = validate21; +const schema6 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'Booking', + 'x-location': '#/components/schemas/Booking', + 'x-schema-type': 'all', +}; +const formats0 = require('ajv-formats/dist/formats').fullFormats.uri; +const formats2 = require('ajv-formats/dist/formats').fullFormats['date-time']; +function validate21( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate21.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema6.required, + parentSchema: schema6, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate21.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema6.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.ID.type, + parentSchema: schema6.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate21.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema6.properties.Time.required, + parentSchema: schema6.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate21.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema6.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Time.properties.Start.type, + parentSchema: schema6.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate21.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema6.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Time.properties.End.type, + parentSchema: schema6.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema6.properties.Time.type, + parentSchema: schema6.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate21.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema6.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Devices.items.type, + parentSchema: schema6.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema6.properties.Devices.type, + parentSchema: schema6.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Type.type, + parentSchema: schema6.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate21.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema6.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema6.properties.Type.enum, + parentSchema: schema6.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Status.type, + parentSchema: schema6.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate21.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema6.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema6.properties.Status.enum, + parentSchema: schema6.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate21.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema6.properties.You.type, + parentSchema: schema6.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate21.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema6.properties.External.type, + parentSchema: schema6.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Message.type, + parentSchema: schema6.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate21.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema6.type, + parentSchema: schema6, + data, + }, + ]; + return false; + } + } + validate21.errors = vErrors; + return errors === 0; +} +exports.validateDevice = validate22; +const schema7 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'Device', + 'x-location': '#/components/schemas/Device', + 'x-schema-type': 'all', +}; +function validate22( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate22.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema7.required, + parentSchema: schema7, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate22.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema7.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate22.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema7.properties.ID.type, + parentSchema: schema7.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate22.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema7.type, + parentSchema: schema7, + data, + }, + ]; + return false; + } + } + validate22.errors = vErrors; + return errors === 0; +} +exports.validateExperiment = validate23; +const schema8 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'Experiment', + 'x-location': '#/components/schemas/Experiment', + 'x-schema-type': 'all', +}; +function validate23( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate23.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema8.required, + parentSchema: schema8, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema8.properties.Devices.items.required, + parentSchema: schema8.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema8.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema8.properties.Devices.items.properties.ID.type, + parentSchema: + schema8.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema8.properties.Devices.items.type, + parentSchema: schema8.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema8.properties.Devices.type, + parentSchema: schema8.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate23.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema8.properties.Description.type, + parentSchema: schema8.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate23.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema8.type, + parentSchema: schema8, + data, + }, + ]; + return false; + } + } + validate23.errors = vErrors; + return errors === 0; +} +exports.validateTimeslot = validate24; +const schema9 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'Timeslot', + 'x-location': '#/components/schemas/Timeslot', + 'x-schema-type': 'all', +}; +function validate24( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate24.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema9.required, + parentSchema: schema9, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate24.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema9.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate24.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema9.properties.Start.type, + parentSchema: schema9.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate24.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema9.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate24.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema9.properties.End.type, + parentSchema: schema9.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate24.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema9.type, + parentSchema: schema9, + data, + }, + ]; + return false; + } + } + validate24.errors = vErrors; + return errors === 0; +} +exports.validateID = validate25; +const schema10 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'ID', + 'x-location': '#/components/parameters/ID/schema', + 'x-schema-type': 'all', +}; +function validate25( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate25.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema10.type, + parentSchema: schema10, + data, + }, + ]; + return false; + } + validate25.errors = vErrors; + return errors === 0; +} +exports.validateScheduleBody = validate26; +const schema11 = { + type: 'object', + required: ['Experiment', 'Time'], + properties: { + Experiment: { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Combined: { + type: 'boolean', + description: + 'If true, show only one timetable per device instead of one for all available physical devices.', + }, + onlyOwn: { + type: 'boolean', + description: + '(private) Show only devices of this institution. Give an error if a device of an other institution is requested.', + }, + }, + 'x-standalone': false, + 'x-name': 'scheduleBody', + 'x-location': '#/paths//schedule/post/requestBody/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate26( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Experiment === undefined && (missing0 = 'Experiment')) || + (data.Time === undefined && (missing0 = 'Time')) + ) { + validate26.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema11.required, + parentSchema: schema11, + data, + }, + ]; + return false; + } else { + if (data.Experiment !== undefined) { + let data0 = data.Experiment; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if (data0.Devices === undefined && (missing1 = 'Devices')) { + validate26.errors = [ + { + instancePath: instancePath + '/Experiment', + schemaPath: '#/properties/Experiment/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema11.properties.Experiment.required, + parentSchema: schema11.properties.Experiment, + data: data0, + }, + ]; + return false; + } else { + if (data0.Devices !== undefined) { + let data1 = data0.Devices; + const _errs3 = errors; + if (errors === _errs3) { + if (Array.isArray(data1)) { + var valid2 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs5 = errors; + if (errors === _errs5) { + if ( + data2 && + typeof data2 == 'object' && + !Array.isArray(data2) + ) { + let missing2; + if (data2.ID === undefined && (missing2 = 'ID')) { + validate26.errors = [ + { + instancePath: + instancePath + '/Experiment/Devices/' + i0, + schemaPath: + '#/properties/Experiment/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema11.properties.Experiment.properties.Devices + .items.required, + parentSchema: + schema11.properties.Experiment.properties.Devices + .items, + data: data2, + }, + ]; + return false; + } else { + if (data2.ID !== undefined) { + let data3 = data2.ID; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + validate26.errors = [ + { + instancePath: + instancePath + + '/Experiment/Devices/' + + i0 + + '/ID', + schemaPath: + '#/properties/Experiment/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema11.properties.Experiment.properties + .Devices.items.properties.ID, + data: data3, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: + instancePath + + '/Experiment/Devices/' + + i0 + + '/ID', + schemaPath: + '#/properties/Experiment/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema11.properties.Experiment.properties + .Devices.items.properties.ID.type, + parentSchema: + schema11.properties.Experiment.properties + .Devices.items.properties.ID, + data: data3, + }, + ]; + return false; + } + } + } + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Experiment/Devices/' + i0, + schemaPath: + '#/properties/Experiment/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema11.properties.Experiment.properties.Devices.items + .type, + parentSchema: + schema11.properties.Experiment.properties.Devices.items, + data: data2, + }, + ]; + return false; + } + } + var valid2 = _errs5 === errors; + if (!valid2) { + break; + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Experiment/Devices', + schemaPath: '#/properties/Experiment/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema11.properties.Experiment.properties.Devices.type, + parentSchema: schema11.properties.Experiment.properties.Devices, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Description !== undefined) { + let data4 = data0.Description; + const _errs9 = errors; + if (typeof data4 !== 'string') { + validate26.errors = [ + { + instancePath: instancePath + '/Experiment/Description', + schemaPath: + '#/properties/Experiment/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema11.properties.Experiment.properties.Description.type, + parentSchema: + schema11.properties.Experiment.properties.Description, + data: data4, + }, + ]; + return false; + } + var valid1 = _errs9 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Experiment', + schemaPath: '#/properties/Experiment/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.properties.Experiment.type, + parentSchema: schema11.properties.Experiment, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data5 = data.Time; + const _errs11 = errors; + if (errors === _errs11) { + if (data5 && typeof data5 == 'object' && !Array.isArray(data5)) { + let missing3; + if ( + (data5.Start === undefined && (missing3 = 'Start')) || + (data5.End === undefined && (missing3 = 'End')) + ) { + validate26.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema11.properties.Time.required, + parentSchema: schema11.properties.Time, + data: data5, + }, + ]; + return false; + } else { + if (data5.Start !== undefined) { + let data6 = data5.Start; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data6 === 'string') { + if (!formats2.validate(data6)) { + validate26.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema11.properties.Time.properties.Start, + data: data6, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.properties.Time.properties.Start.type, + parentSchema: schema11.properties.Time.properties.Start, + data: data6, + }, + ]; + return false; + } + } + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data5.End !== undefined) { + let data7 = data5.End; + const _errs15 = errors; + if (errors === _errs15) { + if (errors === _errs15) { + if (typeof data7 === 'string') { + if (!formats2.validate(data7)) { + validate26.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema11.properties.Time.properties.End, + data: data7, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.properties.Time.properties.End.type, + parentSchema: schema11.properties.Time.properties.End, + data: data7, + }, + ]; + return false; + } + } + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.properties.Time.type, + parentSchema: schema11.properties.Time, + data: data5, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Combined !== undefined) { + let data8 = data.Combined; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate26.errors = [ + { + instancePath: instancePath + '/Combined', + schemaPath: '#/properties/Combined/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema11.properties.Combined.type, + parentSchema: schema11.properties.Combined, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.onlyOwn !== undefined) { + let data9 = data.onlyOwn; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate26.errors = [ + { + instancePath: instancePath + '/onlyOwn', + schemaPath: '#/properties/onlyOwn/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema11.properties.onlyOwn.type, + parentSchema: schema11.properties.onlyOwn, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } else { + validate26.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.type, + parentSchema: schema11, + data, + }, + ]; + return false; + } + } + validate26.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse200 = validate27; +const schema12 = { + type: 'array', + items: { + type: 'object', + required: ['Device', 'Booked', 'Free'], + properties: { + Device: { type: 'string', description: 'ID of the device (or * if combined).' }, + Booked: { + type: 'array', + description: 'Array of booked times.', + items: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + }, + Free: { + type: 'array', + description: 'Array of free times.', + items: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + }, + }, + }, + 'x-standalone': false, + 'x-name': 'scheduleResponse200', + 'x-location': '#/paths//schedule/post/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate27( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if ( + (data0.Device === undefined && (missing0 = 'Device')) || + (data0.Booked === undefined && (missing0 = 'Booked')) || + (data0.Free === undefined && (missing0 = 'Free')) + ) { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema12.items.required, + parentSchema: schema12.items, + data: data0, + }, + ]; + return false; + } else { + if (data0.Device !== undefined) { + let data1 = data0.Device; + const _errs3 = errors; + if (typeof data1 !== 'string') { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Device', + schemaPath: '#/items/properties/Device/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema12.items.properties.Device.type, + parentSchema: schema12.items.properties.Device, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Booked !== undefined) { + let data2 = data0.Booked; + const _errs5 = errors; + if (errors === _errs5) { + if (Array.isArray(data2)) { + var valid2 = true; + const len1 = data2.length; + for (let i1 = 0; i1 < len1; i1++) { + let data3 = data2[i1]; + const _errs7 = errors; + if (errors === _errs7) { + if ( + data3 && + typeof data3 == 'object' && + !Array.isArray(data3) + ) { + let missing1; + if ( + (data3.Start === undefined && (missing1 = 'Start')) || + (data3.End === undefined && (missing1 = 'End')) + ) { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked/' + i1, + schemaPath: '#/items/properties/Booked/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: schema12.items.properties.Booked.items.required, + parentSchema: schema12.items.properties.Booked.items, + data: data3, + }, + ]; + return false; + } else { + if (data3.Start !== undefined) { + let data4 = data3.Start; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate27.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/Start', + schemaPath: + '#/items/properties/Booked/items/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema12.items.properties.Booked.items + .properties.Start, + data: data4, + }, + ]; + return false; + } + } else { + validate27.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/Start', + schemaPath: + '#/items/properties/Booked/items/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema12.items.properties.Booked.items + .properties.Start.type, + parentSchema: + schema12.items.properties.Booked.items + .properties.Start, + data: data4, + }, + ]; + return false; + } + } + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.End !== undefined) { + let data5 = data3.End; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats2.validate(data5)) { + validate27.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/End', + schemaPath: + '#/items/properties/Booked/items/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema12.items.properties.Booked.items + .properties.End, + data: data5, + }, + ]; + return false; + } + } else { + validate27.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/End', + schemaPath: + '#/items/properties/Booked/items/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema12.items.properties.Booked.items + .properties.End.type, + parentSchema: + schema12.items.properties.Booked.items + .properties.End, + data: data5, + }, + ]; + return false; + } + } + } + var valid3 = _errs11 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked/' + i1, + schemaPath: '#/items/properties/Booked/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema12.items.properties.Booked.items.type, + parentSchema: schema12.items.properties.Booked.items, + data: data3, + }, + ]; + return false; + } + } + var valid2 = _errs7 === errors; + if (!valid2) { + break; + } + } + } else { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked', + schemaPath: '#/items/properties/Booked/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema12.items.properties.Booked.type, + parentSchema: schema12.items.properties.Booked, + data: data2, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Free !== undefined) { + let data6 = data0.Free; + const _errs13 = errors; + if (errors === _errs13) { + if (Array.isArray(data6)) { + var valid4 = true; + const len2 = data6.length; + for (let i2 = 0; i2 < len2; i2++) { + let data7 = data6[i2]; + const _errs15 = errors; + if (errors === _errs15) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing2; + if ( + (data7.Start === undefined && (missing2 = 'Start')) || + (data7.End === undefined && (missing2 = 'End')) + ) { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free/' + i2, + schemaPath: '#/items/properties/Free/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: schema12.items.properties.Free.items.required, + parentSchema: schema12.items.properties.Free.items, + data: data7, + }, + ]; + return false; + } else { + if (data7.Start !== undefined) { + let data8 = data7.Start; + const _errs17 = errors; + if (errors === _errs17) { + if (errors === _errs17) { + if (typeof data8 === 'string') { + if (!formats2.validate(data8)) { + validate27.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/Start', + schemaPath: + '#/items/properties/Free/items/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema12.items.properties.Free.items + .properties.Start, + data: data8, + }, + ]; + return false; + } + } else { + validate27.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/Start', + schemaPath: + '#/items/properties/Free/items/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema12.items.properties.Free.items + .properties.Start.type, + parentSchema: + schema12.items.properties.Free.items + .properties.Start, + data: data8, + }, + ]; + return false; + } + } + } + var valid5 = _errs17 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data7.End !== undefined) { + let data9 = data7.End; + const _errs19 = errors; + if (errors === _errs19) { + if (errors === _errs19) { + if (typeof data9 === 'string') { + if (!formats2.validate(data9)) { + validate27.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/End', + schemaPath: + '#/items/properties/Free/items/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + + 'date-time' + + '"', + schema: 'date-time', + parentSchema: + schema12.items.properties.Free.items + .properties.End, + data: data9, + }, + ]; + return false; + } + } else { + validate27.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/End', + schemaPath: + '#/items/properties/Free/items/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema12.items.properties.Free.items + .properties.End.type, + parentSchema: + schema12.items.properties.Free.items + .properties.End, + data: data9, + }, + ]; + return false; + } + } + } + var valid5 = _errs19 === errors; + } else { + var valid5 = true; + } + } + } + } else { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free/' + i2, + schemaPath: '#/items/properties/Free/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema12.items.properties.Free.items.type, + parentSchema: schema12.items.properties.Free.items, + data: data7, + }, + ]; + return false; + } + } + var valid4 = _errs15 === errors; + if (!valid4) { + break; + } + } + } else { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free', + schemaPath: '#/items/properties/Free/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema12.items.properties.Free.type, + parentSchema: schema12.items.properties.Free, + data: data6, + }, + ]; + return false; + } + } + var valid1 = _errs13 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema12.items.type, + parentSchema: schema12.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate27.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema12.type, + parentSchema: schema12, + data, + }, + ]; + return false; + } + } + validate27.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse404 = validate28; +const schema13 = { + type: 'string', + description: 'First unknown device ID.', + 'x-standalone': false, + 'x-name': 'scheduleResponse404', + 'x-location': '#/paths//schedule/post/responses/404/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate28( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate28.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema13.type, + parentSchema: schema13, + data, + }, + ]; + return false; + } + validate28.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse422 = validate29; +const schema14 = { + type: 'string', + description: 'First virtual device ID.', + 'x-standalone': false, + 'x-name': 'scheduleResponse422', + 'x-location': '#/paths//schedule/post/responses/422/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate29( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate29.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema14.type, + parentSchema: schema14, + data, + }, + ]; + return false; + } + validate29.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse500 = validate30; +const schema15 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'scheduleResponse500', + 'x-location': '#/paths//schedule/post/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate30( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate30.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.type, + parentSchema: schema15, + data, + }, + ]; + return false; + } + validate30.errors = vErrors; + return errors === 0; +} +exports.validateBookingRequest = validate31; +const schema16 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'BookingRequest', + 'x-location': '#/components/schemas/Booking_request', + 'x-schema-type': 'request', +}; +function validate31( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate31.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema16.required, + parentSchema: schema16, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate31.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema16.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.ID.type, + parentSchema: schema16.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate31.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema16.properties.Time.required, + parentSchema: schema16.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate31.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema16.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Time.properties.Start.type, + parentSchema: schema16.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate31.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema16.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Time.properties.End.type, + parentSchema: schema16.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema16.properties.Time.type, + parentSchema: schema16.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate31.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema16.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Devices.items.type, + parentSchema: schema16.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema16.properties.Devices.type, + parentSchema: schema16.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate31.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Type.type, + parentSchema: schema16.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate31.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema16.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema16.properties.Type.enum, + parentSchema: schema16.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate31.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Status.type, + parentSchema: schema16.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate31.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema16.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema16.properties.Status.enum, + parentSchema: schema16.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate31.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema16.properties.You.type, + parentSchema: schema16.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate31.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema16.properties.External.type, + parentSchema: schema16.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate31.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Message.type, + parentSchema: schema16.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate31.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema16.type, + parentSchema: schema16, + data, + }, + ]; + return false; + } + } + validate31.errors = vErrors; + return errors === 0; +} +exports.validateBookingResponse = validate32; +const schema17 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'BookingResponse', + 'x-location': '#/components/schemas/Booking_response', + 'x-schema-type': 'response', +}; +function validate32( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate32.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema17.required, + parentSchema: schema17, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate32.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema17.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.properties.ID.type, + parentSchema: schema17.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate32.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema17.properties.Time.required, + parentSchema: schema17.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate32.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema17.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.properties.Time.properties.Start.type, + parentSchema: schema17.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate32.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema17.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.properties.Time.properties.End.type, + parentSchema: schema17.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema17.properties.Time.type, + parentSchema: schema17.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate32.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema17.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.properties.Devices.items.type, + parentSchema: schema17.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema17.properties.Devices.type, + parentSchema: schema17.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate32.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.properties.Type.type, + parentSchema: schema17.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate32.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema17.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema17.properties.Type.enum, + parentSchema: schema17.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate32.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.properties.Status.type, + parentSchema: schema17.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate32.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema17.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema17.properties.Status.enum, + parentSchema: schema17.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate32.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema17.properties.You.type, + parentSchema: schema17.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate32.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema17.properties.External.type, + parentSchema: schema17.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate32.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.properties.Message.type, + parentSchema: schema17.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate32.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema17.type, + parentSchema: schema17, + data, + }, + ]; + return false; + } + } + validate32.errors = vErrors; + return errors === 0; +} +exports.validateDeviceRequest = validate33; +const schema18 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'DeviceRequest', + 'x-location': '#/components/schemas/Device_request', + 'x-schema-type': 'request', +}; +function validate33( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate33.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema18.required, + parentSchema: schema18, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate33.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema18.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate33.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.properties.ID.type, + parentSchema: schema18.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate33.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema18.type, + parentSchema: schema18, + data, + }, + ]; + return false; + } + } + validate33.errors = vErrors; + return errors === 0; +} +exports.validateDeviceResponse = validate34; +const schema19 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'DeviceResponse', + 'x-location': '#/components/schemas/Device_response', + 'x-schema-type': 'response', +}; +function validate34( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate34.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema19.required, + parentSchema: schema19, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate34.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema19.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema19.properties.ID.type, + parentSchema: schema19.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate34.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema19.type, + parentSchema: schema19, + data, + }, + ]; + return false; + } + } + validate34.errors = vErrors; + return errors === 0; +} +exports.validateExperimentRequest = validate35; +const schema20 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'ExperimentRequest', + 'x-location': '#/components/schemas/Experiment_request', + 'x-schema-type': 'request', +}; +function validate35( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate35.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema20.required, + parentSchema: schema20, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate35.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema20.properties.Devices.items.required, + parentSchema: schema20.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate35.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema20.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate35.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema20.properties.Devices.items.properties.ID.type, + parentSchema: + schema20.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate35.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema20.properties.Devices.items.type, + parentSchema: schema20.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate35.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema20.properties.Devices.type, + parentSchema: schema20.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate35.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema20.properties.Description.type, + parentSchema: schema20.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate35.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema20.type, + parentSchema: schema20, + data, + }, + ]; + return false; + } + } + validate35.errors = vErrors; + return errors === 0; +} +exports.validateExperimentResponse = validate36; +const schema21 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'ExperimentResponse', + 'x-location': '#/components/schemas/Experiment_response', + 'x-schema-type': 'response', +}; +function validate36( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate36.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema21.required, + parentSchema: schema21, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate36.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema21.properties.Devices.items.required, + parentSchema: schema21.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate36.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema21.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate36.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.properties.Devices.items.properties.ID.type, + parentSchema: + schema21.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate36.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema21.properties.Devices.items.type, + parentSchema: schema21.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate36.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema21.properties.Devices.type, + parentSchema: schema21.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate36.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema21.properties.Description.type, + parentSchema: schema21.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate36.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema21.type, + parentSchema: schema21, + data, + }, + ]; + return false; + } + } + validate36.errors = vErrors; + return errors === 0; +} +exports.validateTimeslotRequest = validate37; +const schema22 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'TimeslotRequest', + 'x-location': '#/components/schemas/Timeslot_request', + 'x-schema-type': 'request', +}; +function validate37( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate37.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema22.required, + parentSchema: schema22, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate37.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema22.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.Start.type, + parentSchema: schema22.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate37.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema22.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.End.type, + parentSchema: schema22.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate37.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema22.type, + parentSchema: schema22, + data, + }, + ]; + return false; + } + } + validate37.errors = vErrors; + return errors === 0; +} +exports.validateTimeslotResponse = validate38; +const schema23 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'TimeslotResponse', + 'x-location': '#/components/schemas/Timeslot_response', + 'x-schema-type': 'response', +}; +function validate38( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate38.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema23.required, + parentSchema: schema23, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate38.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema23.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.Start.type, + parentSchema: schema23.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate38.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema23.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.End.type, + parentSchema: schema23.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate38.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema23.type, + parentSchema: schema23, + data, + }, + ]; + return false; + } + } + validate38.errors = vErrors; + return errors === 0; +} +exports.validateIDRequest = validate39; +const schema24 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'IDRequest', + 'x-location': '#/components/parameters/ID/schema_request', + 'x-schema-type': 'request', +}; +function validate39( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate39.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema24.type, + parentSchema: schema24, + data, + }, + ]; + return false; + } + validate39.errors = vErrors; + return errors === 0; +} +exports.validateIDResponse = validate40; +const schema25 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'IDResponse', + 'x-location': '#/components/parameters/ID/schema_response', + 'x-schema-type': 'response', +}; +function validate40( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate40.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema25.type, + parentSchema: schema25, + data, + }, + ]; + return false; + } + validate40.errors = vErrors; + return errors === 0; +} +exports.validateScheduleBodyRequest = validate41; +const schema26 = { + type: 'object', + required: ['Experiment', 'Time'], + properties: { + Experiment: { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Combined: { + type: 'boolean', + description: + 'If true, show only one timetable per device instead of one for all available physical devices.', + }, + onlyOwn: { + type: 'boolean', + description: + '(private) Show only devices of this institution. Give an error if a device of an other institution is requested.', + }, + }, + 'x-standalone': false, + 'x-name': 'scheduleBodyRequest', + 'x-location': + '#/paths//schedule/post/requestBody/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate41( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Experiment === undefined && (missing0 = 'Experiment')) || + (data.Time === undefined && (missing0 = 'Time')) + ) { + validate41.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema26.required, + parentSchema: schema26, + data, + }, + ]; + return false; + } else { + if (data.Experiment !== undefined) { + let data0 = data.Experiment; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if (data0.Devices === undefined && (missing1 = 'Devices')) { + validate41.errors = [ + { + instancePath: instancePath + '/Experiment', + schemaPath: '#/properties/Experiment/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema26.properties.Experiment.required, + parentSchema: schema26.properties.Experiment, + data: data0, + }, + ]; + return false; + } else { + if (data0.Devices !== undefined) { + let data1 = data0.Devices; + const _errs3 = errors; + if (errors === _errs3) { + if (Array.isArray(data1)) { + var valid2 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs5 = errors; + if (errors === _errs5) { + if ( + data2 && + typeof data2 == 'object' && + !Array.isArray(data2) + ) { + let missing2; + if (data2.ID === undefined && (missing2 = 'ID')) { + validate41.errors = [ + { + instancePath: + instancePath + '/Experiment/Devices/' + i0, + schemaPath: + '#/properties/Experiment/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema26.properties.Experiment.properties.Devices + .items.required, + parentSchema: + schema26.properties.Experiment.properties.Devices + .items, + data: data2, + }, + ]; + return false; + } else { + if (data2.ID !== undefined) { + let data3 = data2.ID; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + validate41.errors = [ + { + instancePath: + instancePath + + '/Experiment/Devices/' + + i0 + + '/ID', + schemaPath: + '#/properties/Experiment/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema26.properties.Experiment.properties + .Devices.items.properties.ID, + data: data3, + }, + ]; + return false; + } + } else { + validate41.errors = [ + { + instancePath: + instancePath + + '/Experiment/Devices/' + + i0 + + '/ID', + schemaPath: + '#/properties/Experiment/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema26.properties.Experiment.properties + .Devices.items.properties.ID.type, + parentSchema: + schema26.properties.Experiment.properties + .Devices.items.properties.ID, + data: data3, + }, + ]; + return false; + } + } + } + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Experiment/Devices/' + i0, + schemaPath: + '#/properties/Experiment/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema26.properties.Experiment.properties.Devices.items + .type, + parentSchema: + schema26.properties.Experiment.properties.Devices.items, + data: data2, + }, + ]; + return false; + } + } + var valid2 = _errs5 === errors; + if (!valid2) { + break; + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Experiment/Devices', + schemaPath: '#/properties/Experiment/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema26.properties.Experiment.properties.Devices.type, + parentSchema: schema26.properties.Experiment.properties.Devices, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Description !== undefined) { + let data4 = data0.Description; + const _errs9 = errors; + if (typeof data4 !== 'string') { + validate41.errors = [ + { + instancePath: instancePath + '/Experiment/Description', + schemaPath: + '#/properties/Experiment/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema26.properties.Experiment.properties.Description.type, + parentSchema: + schema26.properties.Experiment.properties.Description, + data: data4, + }, + ]; + return false; + } + var valid1 = _errs9 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Experiment', + schemaPath: '#/properties/Experiment/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema26.properties.Experiment.type, + parentSchema: schema26.properties.Experiment, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data5 = data.Time; + const _errs11 = errors; + if (errors === _errs11) { + if (data5 && typeof data5 == 'object' && !Array.isArray(data5)) { + let missing3; + if ( + (data5.Start === undefined && (missing3 = 'Start')) || + (data5.End === undefined && (missing3 = 'End')) + ) { + validate41.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema26.properties.Time.required, + parentSchema: schema26.properties.Time, + data: data5, + }, + ]; + return false; + } else { + if (data5.Start !== undefined) { + let data6 = data5.Start; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data6 === 'string') { + if (!formats2.validate(data6)) { + validate41.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema26.properties.Time.properties.Start, + data: data6, + }, + ]; + return false; + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema26.properties.Time.properties.Start.type, + parentSchema: schema26.properties.Time.properties.Start, + data: data6, + }, + ]; + return false; + } + } + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data5.End !== undefined) { + let data7 = data5.End; + const _errs15 = errors; + if (errors === _errs15) { + if (errors === _errs15) { + if (typeof data7 === 'string') { + if (!formats2.validate(data7)) { + validate41.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema26.properties.Time.properties.End, + data: data7, + }, + ]; + return false; + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema26.properties.Time.properties.End.type, + parentSchema: schema26.properties.Time.properties.End, + data: data7, + }, + ]; + return false; + } + } + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema26.properties.Time.type, + parentSchema: schema26.properties.Time, + data: data5, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Combined !== undefined) { + let data8 = data.Combined; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate41.errors = [ + { + instancePath: instancePath + '/Combined', + schemaPath: '#/properties/Combined/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema26.properties.Combined.type, + parentSchema: schema26.properties.Combined, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.onlyOwn !== undefined) { + let data9 = data.onlyOwn; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate41.errors = [ + { + instancePath: instancePath + '/onlyOwn', + schemaPath: '#/properties/onlyOwn/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema26.properties.onlyOwn.type, + parentSchema: schema26.properties.onlyOwn, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } else { + validate41.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema26.type, + parentSchema: schema26, + data, + }, + ]; + return false; + } + } + validate41.errors = vErrors; + return errors === 0; +} +exports.validateScheduleBodyResponse = validate42; +const schema27 = { + type: 'object', + required: ['Experiment', 'Time'], + properties: { + Experiment: { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Combined: { + type: 'boolean', + description: + 'If true, show only one timetable per device instead of one for all available physical devices.', + }, + onlyOwn: { + type: 'boolean', + description: + '(private) Show only devices of this institution. Give an error if a device of an other institution is requested.', + }, + }, + 'x-standalone': false, + 'x-name': 'scheduleBodyResponse', + 'x-location': + '#/paths//schedule/post/requestBody/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate42( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Experiment === undefined && (missing0 = 'Experiment')) || + (data.Time === undefined && (missing0 = 'Time')) + ) { + validate42.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema27.required, + parentSchema: schema27, + data, + }, + ]; + return false; + } else { + if (data.Experiment !== undefined) { + let data0 = data.Experiment; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if (data0.Devices === undefined && (missing1 = 'Devices')) { + validate42.errors = [ + { + instancePath: instancePath + '/Experiment', + schemaPath: '#/properties/Experiment/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema27.properties.Experiment.required, + parentSchema: schema27.properties.Experiment, + data: data0, + }, + ]; + return false; + } else { + if (data0.Devices !== undefined) { + let data1 = data0.Devices; + const _errs3 = errors; + if (errors === _errs3) { + if (Array.isArray(data1)) { + var valid2 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs5 = errors; + if (errors === _errs5) { + if ( + data2 && + typeof data2 == 'object' && + !Array.isArray(data2) + ) { + let missing2; + if (data2.ID === undefined && (missing2 = 'ID')) { + validate42.errors = [ + { + instancePath: + instancePath + '/Experiment/Devices/' + i0, + schemaPath: + '#/properties/Experiment/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema27.properties.Experiment.properties.Devices + .items.required, + parentSchema: + schema27.properties.Experiment.properties.Devices + .items, + data: data2, + }, + ]; + return false; + } else { + if (data2.ID !== undefined) { + let data3 = data2.ID; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + validate42.errors = [ + { + instancePath: + instancePath + + '/Experiment/Devices/' + + i0 + + '/ID', + schemaPath: + '#/properties/Experiment/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema27.properties.Experiment.properties + .Devices.items.properties.ID, + data: data3, + }, + ]; + return false; + } + } else { + validate42.errors = [ + { + instancePath: + instancePath + + '/Experiment/Devices/' + + i0 + + '/ID', + schemaPath: + '#/properties/Experiment/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.properties.Experiment.properties + .Devices.items.properties.ID.type, + parentSchema: + schema27.properties.Experiment.properties + .Devices.items.properties.ID, + data: data3, + }, + ]; + return false; + } + } + } + } + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Experiment/Devices/' + i0, + schemaPath: + '#/properties/Experiment/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema27.properties.Experiment.properties.Devices.items + .type, + parentSchema: + schema27.properties.Experiment.properties.Devices.items, + data: data2, + }, + ]; + return false; + } + } + var valid2 = _errs5 === errors; + if (!valid2) { + break; + } + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Experiment/Devices', + schemaPath: '#/properties/Experiment/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema27.properties.Experiment.properties.Devices.type, + parentSchema: schema27.properties.Experiment.properties.Devices, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Description !== undefined) { + let data4 = data0.Description; + const _errs9 = errors; + if (typeof data4 !== 'string') { + validate42.errors = [ + { + instancePath: instancePath + '/Experiment/Description', + schemaPath: + '#/properties/Experiment/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.properties.Experiment.properties.Description.type, + parentSchema: + schema27.properties.Experiment.properties.Description, + data: data4, + }, + ]; + return false; + } + var valid1 = _errs9 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Experiment', + schemaPath: '#/properties/Experiment/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.properties.Experiment.type, + parentSchema: schema27.properties.Experiment, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data5 = data.Time; + const _errs11 = errors; + if (errors === _errs11) { + if (data5 && typeof data5 == 'object' && !Array.isArray(data5)) { + let missing3; + if ( + (data5.Start === undefined && (missing3 = 'Start')) || + (data5.End === undefined && (missing3 = 'End')) + ) { + validate42.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema27.properties.Time.required, + parentSchema: schema27.properties.Time, + data: data5, + }, + ]; + return false; + } else { + if (data5.Start !== undefined) { + let data6 = data5.Start; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data6 === 'string') { + if (!formats2.validate(data6)) { + validate42.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema27.properties.Time.properties.Start, + data: data6, + }, + ]; + return false; + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.properties.Time.properties.Start.type, + parentSchema: schema27.properties.Time.properties.Start, + data: data6, + }, + ]; + return false; + } + } + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data5.End !== undefined) { + let data7 = data5.End; + const _errs15 = errors; + if (errors === _errs15) { + if (errors === _errs15) { + if (typeof data7 === 'string') { + if (!formats2.validate(data7)) { + validate42.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema27.properties.Time.properties.End, + data: data7, + }, + ]; + return false; + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.properties.Time.properties.End.type, + parentSchema: schema27.properties.Time.properties.End, + data: data7, + }, + ]; + return false; + } + } + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.properties.Time.type, + parentSchema: schema27.properties.Time, + data: data5, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Combined !== undefined) { + let data8 = data.Combined; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate42.errors = [ + { + instancePath: instancePath + '/Combined', + schemaPath: '#/properties/Combined/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema27.properties.Combined.type, + parentSchema: schema27.properties.Combined, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.onlyOwn !== undefined) { + let data9 = data.onlyOwn; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate42.errors = [ + { + instancePath: instancePath + '/onlyOwn', + schemaPath: '#/properties/onlyOwn/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema27.properties.onlyOwn.type, + parentSchema: schema27.properties.onlyOwn, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } else { + validate42.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.type, + parentSchema: schema27, + data, + }, + ]; + return false; + } + } + validate42.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse200Request = validate43; +const schema28 = { + type: 'array', + items: { + type: 'object', + required: ['Device', 'Booked', 'Free'], + properties: { + Device: { type: 'string', description: 'ID of the device (or * if combined).' }, + Booked: { + type: 'array', + description: 'Array of booked times.', + items: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + }, + Free: { + type: 'array', + description: 'Array of free times.', + items: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + }, + }, + }, + 'x-standalone': false, + 'x-name': 'scheduleResponse200Request', + 'x-location': + '#/paths//schedule/post/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate43( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if ( + (data0.Device === undefined && (missing0 = 'Device')) || + (data0.Booked === undefined && (missing0 = 'Booked')) || + (data0.Free === undefined && (missing0 = 'Free')) + ) { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema28.items.required, + parentSchema: schema28.items, + data: data0, + }, + ]; + return false; + } else { + if (data0.Device !== undefined) { + let data1 = data0.Device; + const _errs3 = errors; + if (typeof data1 !== 'string') { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Device', + schemaPath: '#/items/properties/Device/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema28.items.properties.Device.type, + parentSchema: schema28.items.properties.Device, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Booked !== undefined) { + let data2 = data0.Booked; + const _errs5 = errors; + if (errors === _errs5) { + if (Array.isArray(data2)) { + var valid2 = true; + const len1 = data2.length; + for (let i1 = 0; i1 < len1; i1++) { + let data3 = data2[i1]; + const _errs7 = errors; + if (errors === _errs7) { + if ( + data3 && + typeof data3 == 'object' && + !Array.isArray(data3) + ) { + let missing1; + if ( + (data3.Start === undefined && (missing1 = 'Start')) || + (data3.End === undefined && (missing1 = 'End')) + ) { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked/' + i1, + schemaPath: '#/items/properties/Booked/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: schema28.items.properties.Booked.items.required, + parentSchema: schema28.items.properties.Booked.items, + data: data3, + }, + ]; + return false; + } else { + if (data3.Start !== undefined) { + let data4 = data3.Start; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate43.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/Start', + schemaPath: + '#/items/properties/Booked/items/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema28.items.properties.Booked.items + .properties.Start, + data: data4, + }, + ]; + return false; + } + } else { + validate43.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/Start', + schemaPath: + '#/items/properties/Booked/items/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema28.items.properties.Booked.items + .properties.Start.type, + parentSchema: + schema28.items.properties.Booked.items + .properties.Start, + data: data4, + }, + ]; + return false; + } + } + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.End !== undefined) { + let data5 = data3.End; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats2.validate(data5)) { + validate43.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/End', + schemaPath: + '#/items/properties/Booked/items/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema28.items.properties.Booked.items + .properties.End, + data: data5, + }, + ]; + return false; + } + } else { + validate43.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/End', + schemaPath: + '#/items/properties/Booked/items/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema28.items.properties.Booked.items + .properties.End.type, + parentSchema: + schema28.items.properties.Booked.items + .properties.End, + data: data5, + }, + ]; + return false; + } + } + } + var valid3 = _errs11 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked/' + i1, + schemaPath: '#/items/properties/Booked/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema28.items.properties.Booked.items.type, + parentSchema: schema28.items.properties.Booked.items, + data: data3, + }, + ]; + return false; + } + } + var valid2 = _errs7 === errors; + if (!valid2) { + break; + } + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked', + schemaPath: '#/items/properties/Booked/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema28.items.properties.Booked.type, + parentSchema: schema28.items.properties.Booked, + data: data2, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Free !== undefined) { + let data6 = data0.Free; + const _errs13 = errors; + if (errors === _errs13) { + if (Array.isArray(data6)) { + var valid4 = true; + const len2 = data6.length; + for (let i2 = 0; i2 < len2; i2++) { + let data7 = data6[i2]; + const _errs15 = errors; + if (errors === _errs15) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing2; + if ( + (data7.Start === undefined && (missing2 = 'Start')) || + (data7.End === undefined && (missing2 = 'End')) + ) { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free/' + i2, + schemaPath: '#/items/properties/Free/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: schema28.items.properties.Free.items.required, + parentSchema: schema28.items.properties.Free.items, + data: data7, + }, + ]; + return false; + } else { + if (data7.Start !== undefined) { + let data8 = data7.Start; + const _errs17 = errors; + if (errors === _errs17) { + if (errors === _errs17) { + if (typeof data8 === 'string') { + if (!formats2.validate(data8)) { + validate43.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/Start', + schemaPath: + '#/items/properties/Free/items/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema28.items.properties.Free.items + .properties.Start, + data: data8, + }, + ]; + return false; + } + } else { + validate43.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/Start', + schemaPath: + '#/items/properties/Free/items/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema28.items.properties.Free.items + .properties.Start.type, + parentSchema: + schema28.items.properties.Free.items + .properties.Start, + data: data8, + }, + ]; + return false; + } + } + } + var valid5 = _errs17 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data7.End !== undefined) { + let data9 = data7.End; + const _errs19 = errors; + if (errors === _errs19) { + if (errors === _errs19) { + if (typeof data9 === 'string') { + if (!formats2.validate(data9)) { + validate43.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/End', + schemaPath: + '#/items/properties/Free/items/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + + 'date-time' + + '"', + schema: 'date-time', + parentSchema: + schema28.items.properties.Free.items + .properties.End, + data: data9, + }, + ]; + return false; + } + } else { + validate43.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/End', + schemaPath: + '#/items/properties/Free/items/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema28.items.properties.Free.items + .properties.End.type, + parentSchema: + schema28.items.properties.Free.items + .properties.End, + data: data9, + }, + ]; + return false; + } + } + } + var valid5 = _errs19 === errors; + } else { + var valid5 = true; + } + } + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free/' + i2, + schemaPath: '#/items/properties/Free/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema28.items.properties.Free.items.type, + parentSchema: schema28.items.properties.Free.items, + data: data7, + }, + ]; + return false; + } + } + var valid4 = _errs15 === errors; + if (!valid4) { + break; + } + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free', + schemaPath: '#/items/properties/Free/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema28.items.properties.Free.type, + parentSchema: schema28.items.properties.Free, + data: data6, + }, + ]; + return false; + } + } + var valid1 = _errs13 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema28.items.type, + parentSchema: schema28.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate43.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema28.type, + parentSchema: schema28, + data, + }, + ]; + return false; + } + } + validate43.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse200Response = validate44; +const schema29 = { + type: 'array', + items: { + type: 'object', + required: ['Device', 'Booked', 'Free'], + properties: { + Device: { type: 'string', description: 'ID of the device (or * if combined).' }, + Booked: { + type: 'array', + description: 'Array of booked times.', + items: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + }, + Free: { + type: 'array', + description: 'Array of free times.', + items: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + }, + }, + }, + 'x-standalone': false, + 'x-name': 'scheduleResponse200Response', + 'x-location': + '#/paths//schedule/post/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate44( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if ( + (data0.Device === undefined && (missing0 = 'Device')) || + (data0.Booked === undefined && (missing0 = 'Booked')) || + (data0.Free === undefined && (missing0 = 'Free')) + ) { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema29.items.required, + parentSchema: schema29.items, + data: data0, + }, + ]; + return false; + } else { + if (data0.Device !== undefined) { + let data1 = data0.Device; + const _errs3 = errors; + if (typeof data1 !== 'string') { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Device', + schemaPath: '#/items/properties/Device/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema29.items.properties.Device.type, + parentSchema: schema29.items.properties.Device, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Booked !== undefined) { + let data2 = data0.Booked; + const _errs5 = errors; + if (errors === _errs5) { + if (Array.isArray(data2)) { + var valid2 = true; + const len1 = data2.length; + for (let i1 = 0; i1 < len1; i1++) { + let data3 = data2[i1]; + const _errs7 = errors; + if (errors === _errs7) { + if ( + data3 && + typeof data3 == 'object' && + !Array.isArray(data3) + ) { + let missing1; + if ( + (data3.Start === undefined && (missing1 = 'Start')) || + (data3.End === undefined && (missing1 = 'End')) + ) { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked/' + i1, + schemaPath: '#/items/properties/Booked/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: schema29.items.properties.Booked.items.required, + parentSchema: schema29.items.properties.Booked.items, + data: data3, + }, + ]; + return false; + } else { + if (data3.Start !== undefined) { + let data4 = data3.Start; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate44.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/Start', + schemaPath: + '#/items/properties/Booked/items/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema29.items.properties.Booked.items + .properties.Start, + data: data4, + }, + ]; + return false; + } + } else { + validate44.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/Start', + schemaPath: + '#/items/properties/Booked/items/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema29.items.properties.Booked.items + .properties.Start.type, + parentSchema: + schema29.items.properties.Booked.items + .properties.Start, + data: data4, + }, + ]; + return false; + } + } + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.End !== undefined) { + let data5 = data3.End; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats2.validate(data5)) { + validate44.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/End', + schemaPath: + '#/items/properties/Booked/items/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema29.items.properties.Booked.items + .properties.End, + data: data5, + }, + ]; + return false; + } + } else { + validate44.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/End', + schemaPath: + '#/items/properties/Booked/items/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema29.items.properties.Booked.items + .properties.End.type, + parentSchema: + schema29.items.properties.Booked.items + .properties.End, + data: data5, + }, + ]; + return false; + } + } + } + var valid3 = _errs11 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked/' + i1, + schemaPath: '#/items/properties/Booked/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema29.items.properties.Booked.items.type, + parentSchema: schema29.items.properties.Booked.items, + data: data3, + }, + ]; + return false; + } + } + var valid2 = _errs7 === errors; + if (!valid2) { + break; + } + } + } else { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked', + schemaPath: '#/items/properties/Booked/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema29.items.properties.Booked.type, + parentSchema: schema29.items.properties.Booked, + data: data2, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Free !== undefined) { + let data6 = data0.Free; + const _errs13 = errors; + if (errors === _errs13) { + if (Array.isArray(data6)) { + var valid4 = true; + const len2 = data6.length; + for (let i2 = 0; i2 < len2; i2++) { + let data7 = data6[i2]; + const _errs15 = errors; + if (errors === _errs15) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing2; + if ( + (data7.Start === undefined && (missing2 = 'Start')) || + (data7.End === undefined && (missing2 = 'End')) + ) { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free/' + i2, + schemaPath: '#/items/properties/Free/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: schema29.items.properties.Free.items.required, + parentSchema: schema29.items.properties.Free.items, + data: data7, + }, + ]; + return false; + } else { + if (data7.Start !== undefined) { + let data8 = data7.Start; + const _errs17 = errors; + if (errors === _errs17) { + if (errors === _errs17) { + if (typeof data8 === 'string') { + if (!formats2.validate(data8)) { + validate44.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/Start', + schemaPath: + '#/items/properties/Free/items/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema29.items.properties.Free.items + .properties.Start, + data: data8, + }, + ]; + return false; + } + } else { + validate44.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/Start', + schemaPath: + '#/items/properties/Free/items/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema29.items.properties.Free.items + .properties.Start.type, + parentSchema: + schema29.items.properties.Free.items + .properties.Start, + data: data8, + }, + ]; + return false; + } + } + } + var valid5 = _errs17 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data7.End !== undefined) { + let data9 = data7.End; + const _errs19 = errors; + if (errors === _errs19) { + if (errors === _errs19) { + if (typeof data9 === 'string') { + if (!formats2.validate(data9)) { + validate44.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/End', + schemaPath: + '#/items/properties/Free/items/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + + 'date-time' + + '"', + schema: 'date-time', + parentSchema: + schema29.items.properties.Free.items + .properties.End, + data: data9, + }, + ]; + return false; + } + } else { + validate44.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/End', + schemaPath: + '#/items/properties/Free/items/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema29.items.properties.Free.items + .properties.End.type, + parentSchema: + schema29.items.properties.Free.items + .properties.End, + data: data9, + }, + ]; + return false; + } + } + } + var valid5 = _errs19 === errors; + } else { + var valid5 = true; + } + } + } + } else { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free/' + i2, + schemaPath: '#/items/properties/Free/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema29.items.properties.Free.items.type, + parentSchema: schema29.items.properties.Free.items, + data: data7, + }, + ]; + return false; + } + } + var valid4 = _errs15 === errors; + if (!valid4) { + break; + } + } + } else { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free', + schemaPath: '#/items/properties/Free/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema29.items.properties.Free.type, + parentSchema: schema29.items.properties.Free, + data: data6, + }, + ]; + return false; + } + } + var valid1 = _errs13 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema29.items.type, + parentSchema: schema29.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate44.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema29.type, + parentSchema: schema29, + data, + }, + ]; + return false; + } + } + validate44.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse404Request = validate45; +const schema30 = { + type: 'string', + description: 'First unknown device ID.', + 'x-standalone': false, + 'x-name': 'scheduleResponse404Request', + 'x-location': + '#/paths//schedule/post/responses/404/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate45( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate45.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema30.type, + parentSchema: schema30, + data, + }, + ]; + return false; + } + validate45.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse404Response = validate46; +const schema31 = { + type: 'string', + description: 'First unknown device ID.', + 'x-standalone': false, + 'x-name': 'scheduleResponse404Response', + 'x-location': + '#/paths//schedule/post/responses/404/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate46( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate46.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema31.type, + parentSchema: schema31, + data, + }, + ]; + return false; + } + validate46.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse422Request = validate47; +const schema32 = { + type: 'string', + description: 'First virtual device ID.', + 'x-standalone': false, + 'x-name': 'scheduleResponse422Request', + 'x-location': + '#/paths//schedule/post/responses/422/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate47( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate47.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema32.type, + parentSchema: schema32, + data, + }, + ]; + return false; + } + validate47.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse422Response = validate48; +const schema33 = { + type: 'string', + description: 'First virtual device ID.', + 'x-standalone': false, + 'x-name': 'scheduleResponse422Response', + 'x-location': + '#/paths//schedule/post/responses/422/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate48( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate48.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema33.type, + parentSchema: schema33, + data, + }, + ]; + return false; + } + validate48.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse500Request = validate49; +const schema34 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'scheduleResponse500Request', + 'x-location': + '#/paths//schedule/post/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate49( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate49.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema34.type, + parentSchema: schema34, + data, + }, + ]; + return false; + } + validate49.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse500Response = validate50; +const schema35 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'scheduleResponse500Response', + 'x-location': + '#/paths//schedule/post/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate50( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate50.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema35.type, + parentSchema: schema35, + data, + }, + ]; + return false; + } + validate50.errors = vErrors; + return errors === 0; +} diff --git a/services/booking/src/common/src/clients/schedule-service/basicValidation.d.cts b/services/booking/src/common/src/clients/schedule-service/basicValidation.d.cts new file mode 100644 index 00000000..2a3299fc --- /dev/null +++ b/services/booking/src/common/src/clients/schedule-service/basicValidation.d.cts @@ -0,0 +1,119 @@ +export declare function validateBooking( + object: unknown, +): Booking; + +export declare function validateDevice( + object: unknown, +): Device; + +export declare function validateExperiment( + object: unknown, +): Experiment; + +export declare function validateTimeslot( + object: unknown, +): Timeslot; + +export declare function validateID( + object: unknown, +): ID; + +export declare function validateScheduleBody( + object: unknown, +): scheduleBody; + +export declare function validateScheduleResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse200; + +export declare function validateScheduleResponse404< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse404; + +export declare function validateScheduleResponse422< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse422; + +export declare function validateScheduleResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse500; + +export declare function validateBookingRequest( + object: unknown, +): BookingRequest; + +export declare function validateBookingResponse( + object: unknown, +): BookingResponse; + +export declare function validateDeviceRequest( + object: unknown, +): DeviceRequest; + +export declare function validateDeviceResponse( + object: unknown, +): DeviceResponse; + +export declare function validateExperimentRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ExperimentRequest; + +export declare function validateExperimentResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ExperimentResponse; + +export declare function validateTimeslotRequest( + object: unknown, +): TimeslotRequest; + +export declare function validateTimeslotResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): TimeslotResponse; + +export declare function validateIDRequest( + object: unknown, +): IDRequest; + +export declare function validateIDResponse( + object: unknown, +): IDResponse; + +export declare function validateScheduleBodyRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleBodyRequest; + +export declare function validateScheduleBodyResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleBodyResponse; + +export declare function validateScheduleResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse200Request; + +export declare function validateScheduleResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse200Response; + +export declare function validateScheduleResponse404Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse404Request; + +export declare function validateScheduleResponse404Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse404Response; + +export declare function validateScheduleResponse422Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse422Request; + +export declare function validateScheduleResponse422Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse422Response; + +export declare function validateScheduleResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse500Request; + +export declare function validateScheduleResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse500Response; diff --git a/services/booking/src/common/src/clients/schedule-service/client.ts b/services/booking/src/common/src/clients/schedule-service/client.ts new file mode 100644 index 00000000..f88d6c98 --- /dev/null +++ b/services/booking/src/common/src/clients/schedule-service/client.ts @@ -0,0 +1,244 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import fetch, { RequestInfo, RequestInit, Response } from 'node-fetch'; + +import * as RequestValidation from './requestValidation.js'; +import * as Signatures from './signatures.js'; +import * as Types from './types.js'; +// @ts-ignore +import { type Require } from './types.js'; + +/** + * This error class should be used if an error occurs during validation of a request/response. + * @category Errors + */ +export class ValidationError extends Error { + public errors: unknown; + + constructor(message: string, errors: unknown) { + super(message); + this.name = 'ValidationError'; + this.errors = errors; + } +} + +/** + * This error class should be used if an error occurs while fetching a request. + * @category Errors + */ +export class FetchError extends Error { + constructor(message: string) { + super(message); + this.name = 'FetchError'; + } +} + +/** + * This error class should be used if the response of the server has a status + * greater than or equal to 400. This error should contain the validated response. + * @category Errors + */ +export class UnsuccessfulRequestError extends Error { + public response: Types.ResponseData; + + constructor(message: string, response: Types.ResponseData) { + super(message); + this.response = response; + this.name = 'UnsuccessfulRequestError'; + } +} + +/** + * This error class should be used if the validation of an url fails. + * @category Errors + */ +export class InvalidUrlError extends Error { + constructor(message: string) { + super(message); + this.name = 'InvalidUrlError'; + } +} + +/** + * This function attempts to parse a Response as ResponseData. + */ +async function parseResponse(response: Response): Promise { + let text = null; + try { + text = await response.text(); + const json = JSON.parse(text); + return { status: response.status, body: json }; + } catch { + return { status: response.status, body: text }; + } +} + +/** + * This function appends a given endpoint to an url. + * @param url The url to append the endpoint to. + * @param endpoint The endpoint to be appended. + * @example + * // returns "https://api.example.com/devices/device_id/token" + * appendToUrl("https://api.example.com/devices/device_id", "/token") + * @example + * // returns "https://api.example.com/devices/device_id/token" + * appendToUrl("https://api.example.com/devices/device_id/", "/token") + * @returns The url with the appended endpoint. + */ +function appendToUrl(url: string, endpoint: string) { + return url.endsWith('/') ? `${url.slice(0, -1)}${endpoint}` : `${url}${endpoint}`; +} + +/** + * Client for the use of the Crosslab API + * @category Client + */ +export class Client { + public readonly baseUrl: string; + public readonly serviceUrl: string; + public accessToken: string; + private fixedHeaders: [string, string][]; + private fetch = async (url: RequestInfo | URL, init: RequestInit) => { + let raw_response; + const parsedUrl = new URL(url.toString()); + try { + if ( + parsedUrl.toString().startsWith(this.baseUrl) || + parsedUrl.toString().startsWith(this.serviceUrl) + ) { + raw_response = await fetch(url, init); + } else { + raw_response = await fetch( + appendToUrl( + this.baseUrl, + '/proxy?' + new URLSearchParams([['URL', url.toString()]]).toString(), + ), + init, + ); + } + } catch (error) { + if (error instanceof Error) { + throw new FetchError(error.message); + } else if (typeof error === 'string') { + throw new FetchError(error); + } else { + throw new FetchError('Something went wrong while trying to fetch the request'); + } + } + return await parseResponse(raw_response); + }; + + /** + * @category Constructors + */ + constructor( + baseUrl: string, + options: { + serviceUrl?: string; + accessToken?: string; + fixedHeaders?: [string, string][]; + }, + ) { + this.baseUrl = new URL(baseUrl).toString().slice(0, -1); + this.serviceUrl = new URL(options.serviceUrl ?? this.baseUrl).toString().slice(0, -1); + this.accessToken = options.accessToken ?? ''; + this.fixedHeaders = options.fixedHeaders ?? []; + } + + /** + * Returns the free / booked times for given experiment. + * + * @param body + * @param options.url + * Url of the to be used. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * Timetable of free/booked time. If 'Combined' is set to true, an array with only one entry is returned containing the combined timetable. + */ + public async schedule( + body: + | { + /** + * An experiment describes a set of devices and how they should be connected (potentially among other metadata). + */ + Experiment: Types.Experiment<'request'>; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: Types.Timeslot<'request'>; + /** + * If true, show only one timetable per device instead of one for all available physical devices. + */ + Combined?: boolean; + /** + * (private) Show only devices of this institution. Give an error if a device of an other institution is requested. + */ + onlyOwn?: boolean; + [k: string]: unknown; + } + | undefined, + options?: { + headers?: [string, string][]; + url?: string; + }, + ): Promise { + const url = appendToUrl(options?.url ?? this.baseUrl, '/schedule'); + console.log('trying to fetch url:', url); + + if (!RequestValidation.validateScheduleInput(body)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateScheduleInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); + + if (!RequestValidation.validateScheduleOutput(response)) + throw new ValidationError( + 'Response validation failed!', + (RequestValidation.validateScheduleOutput as Types.FunctionWithErrors).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } +} diff --git a/services/booking/src/common/src/clients/schedule-service/requestValidation.ts b/services/booking/src/common/src/clients/schedule-service/requestValidation.ts new file mode 100644 index 00000000..8803e553 --- /dev/null +++ b/services/booking/src/common/src/clients/schedule-service/requestValidation.ts @@ -0,0 +1,100 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +import * as BasicValidation from './basicValidation.cjs'; +import * as Signatures from './signatures.js'; +import { FunctionWithErrors, ResponseData } from './types.js'; + +/** + * This function validates the inputs to schedule() + */ +export function validateScheduleInput(body: Signatures.ScheduleBody) { + if (body === undefined) { + return true; + } + + if (!BasicValidation.validateScheduleBodyRequest(body)) { + (validateScheduleInput as FunctionWithErrors).errors = ( + BasicValidation.validateScheduleBodyRequest as FunctionWithErrors + ).errors; + return false; + } + + return true; +} + +/** + * This function validates the outputs of schedule() + */ +export function validateScheduleOutput( + response: ResponseData, +): response is Signatures.ScheduleResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if (!BasicValidation.validateScheduleResponse200Response(response.body)) { + (validateScheduleOutput as FunctionWithErrors).errors = ( + BasicValidation.validateScheduleResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + if (!BasicValidation.validateScheduleResponse404Response(response.body)) { + (validateScheduleOutput as FunctionWithErrors).errors = ( + BasicValidation.validateScheduleResponse404Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 422) { + if (!BasicValidation.validateScheduleResponse422Response(response.body)) { + (validateScheduleOutput as FunctionWithErrors).errors = ( + BasicValidation.validateScheduleResponse422Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateScheduleResponse500Response(response.body)) { + (validateScheduleOutput as FunctionWithErrors).errors = ( + BasicValidation.validateScheduleResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateScheduleOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} diff --git a/services/booking/src/common/src/clients/schedule-service/signatures.ts b/services/booking/src/common/src/clients/schedule-service/signatures.ts new file mode 100644 index 00000000..32de25f3 --- /dev/null +++ b/services/booking/src/common/src/clients/schedule-service/signatures.ts @@ -0,0 +1,173 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import * as Types from './types.js'; +// @ts-ignore +import { type Require } from './types.js'; + +/** + * Typing for the body of the request made by schedule() + * @category schedule() + */ +export type ScheduleBody = + | { + /** + * An experiment describes a set of devices and how they should be connected (potentially among other metadata). + */ + Experiment: Types.Experiment<'request'>; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: Types.Timeslot<'request'>; + /** + * If true, show only one timetable per device instead of one for all available physical devices. + */ + Combined?: boolean; + /** + * (private) Show only devices of this institution. Give an error if a device of an other institution is requested. + */ + onlyOwn?: boolean; + [k: string]: unknown; + } + | undefined; + +/** + * Typing for all possible responses to the request made by schedule() + * @category schedule() + */ +export type ScheduleResponse = ScheduleSuccessResponse | ScheduleErrorResponse; + +/** + * Typing for all successful responses to the request made by schedule() + * @category schedule() + */ +export type ScheduleSuccessResponse = ScheduleResponse200; + +/** + * Typing for all error responses to the request made by schedule() + * @category schedule() + */ +export type ScheduleErrorResponse = + | ScheduleResponse400 + | ScheduleResponse401 + | ScheduleResponse403 + | ScheduleResponse404 + | ScheduleResponse422 + | ScheduleResponse500 + | ScheduleResponse503; + +/** + * Typing for a response with status 200 to the request made by schedule() + * @category schedule() + */ +export interface ScheduleResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: { + /** + * ID of the device (or * if combined). + */ + Device: string; + /** + * Array of booked times. + */ + Booked: Types.Timeslot<'response'>[]; + /** + * Array of free times. + */ + Free: Types.Timeslot<'response'>[]; + [k: string]: unknown; + }[]; +} + +/** + * Typing for a response with status 400 to the request made by schedule() + * @category schedule() + */ +export interface ScheduleResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by schedule() + * @category schedule() + */ +export interface ScheduleResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by schedule() + * @category schedule() + */ +export interface ScheduleResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by schedule() + * @category schedule() + */ +export interface ScheduleResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 422 to the request made by schedule() + * @category schedule() + */ +export interface ScheduleResponse422 extends Types.ErrorResponse { + status: 422; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 500 to the request made by schedule() + * @category schedule() + */ +export interface ScheduleResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by schedule() + * @category schedule() + */ +export interface ScheduleResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} diff --git a/services/booking/src/common/src/clients/schedule-service/types.ts b/services/booking/src/common/src/clients/schedule-service/types.ts new file mode 100644 index 00000000..8d0b0be8 --- /dev/null +++ b/services/booking/src/common/src/clients/schedule-service/types.ts @@ -0,0 +1,410 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +import * as _BasicValidation from './basicValidation.cjs'; + +/** + * @internal + */ +export interface FunctionWithErrors { + (...args: unknown[]): unknown; + errors?: unknown; +} + +/** + * @internal + */ +export interface RequestInfo { + method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'TRACE' | 'OPTIONS' | 'PATCH' | 'HEAD'; + body?: string; + headers?: [string, string][]; +} + +/** + * @internal + */ +export type FetchFunction = ( + url: string, + info?: RequestInfo, +) => Promise | ResponseData; + +export interface ResponseData { + status: number; + headers?: { + [key: string]: string | undefined; + }; + body?: unknown; +} + +export interface SuccessResponse extends ResponseData { + success?: true; +} + +export interface ErrorResponse extends ResponseData { + success?: false; +} + +/** + * @internal + */ +export function isSuccessResponse(response: ResponseData): response is SuccessResponse { + return response.status < 400; +} + +/** + * @internal + */ +export function isErrorResponse(response: ResponseData): response is ErrorResponse { + return response.status >= 400; +} + +/** + * This type allows to pick the required properties of another type. + */ +export type Require = Partial & { + [Property in Key]-?: Type[Property]; +}; + +export type SizedTuple< + T, + MIN extends number | undefined = undefined, + MAX extends number | undefined = undefined, +> = MIN extends number + ? MAX extends number + ? _SizedTuple> + : TupleObject> & T[] + : MAX extends number + ? _SizedTuple, true> + : T[]; + +type _SizedTuple = ARR extends [ + infer HEAD extends number, + ...infer TAIL extends number[], +] + ? Tuple | _SizedTuple + : never; + +type Tuple = _Tuple< + T, + NumericRangeTuple +>; + +type _Tuple = N extends [ + infer HEAD, + ...infer TAIL extends number[], +] + ? HEAD extends 0 + ? [] | _Tuple + : [T, ..._Tuple] + : []; + +type TupleObject = N extends [ + infer HEAD extends number, + ...infer TAIL extends number[], +] + ? TAIL extends [] + ? Record + : { [P in HEAD]: T } & TupleObject + : Record; + +export type NumericRange< + START extends number, + END extends number, + ARR extends unknown[] = [], + ACC extends number = never, +> = ARR['length'] extends END + ? ACC | START | END + : NumericRange< + START, + END, + [...ARR, 1], + ARR[START] extends undefined ? ACC : ACC | ARR['length'] + >; + +type NumericRangeTuple< + START extends number, + END extends number, + ARR extends unknown[] = [], + ACC extends number[] = [], +> = ARR['length'] extends END + ? [START, ...ACC, END] + : NumericRangeTuple< + START, + END, + [...ARR, 1], + ARR[START] extends undefined ? ACC : [...ACC, ARR['length']] + >; + +/** + * A booking in the booking system. + */ +export type Booking = T extends 'all' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : never; + +/** + * A device might either be a physical/virtual device or a group of device. + */ +export type Device = T extends 'all' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : never; + +/** + * An experiment describes a set of devices and how they should be connected (potentially among other metadata). + */ +export type Experiment = T extends 'all' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device<'request'>[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device<'response'>[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : never; + +/** + * A time slot represents a slice of time used for bookings. + */ +export type Timeslot = T extends 'all' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : never; diff --git a/services/booking/src/common/src/config.ts b/services/booking/src/common/src/config.ts index 85fdaf99..d26df98e 100644 --- a/services/booking/src/common/src/config.ts +++ b/services/booking/src/common/src/config.ts @@ -1,5 +1,5 @@ export function die(reason: string): never { - console.error(reason); + console.error('Died because of', reason); process.exit(1); } @@ -8,7 +8,12 @@ export const baseConfig = { 'mysql://test:test@localhost/test?supportBigNumbers=true&bigNumberStrings=true', ReservationDSN: 'mysql://test:test@localhost/test', CallbackDSN: 'mysql://test:test@localhost/test', - OwnURL: 'http://localhost', - InstitutePrefix: ['http://localhost'], + OwnURL: process.env.BASE_URL ?? 'http://localhost', + InstitutePrefix: [process.env.BASE_URL ?? 'http://localhost'], AmqpUrl: 'amqp://localhost:5672/', + BASE_URL: process.env.BASE_URL ?? 'http://localhost', + DEVICE_SERVICE_URL: process.env.DEVICE_SERVICE_URL ?? 'http://localhost:3001', + BOOKING_FRONTEND_URL: process.env.BOOKING_FRONTEND_URL ?? 'http://localhost:3004', + BOOKING_BACKEND_URL: process.env.BOOKING_BACKEND_URL ?? 'http://localhost:3005', + SCHEDULE_SERVICE_URL: process.env.SCHEDULE_SERVICE_URL ?? 'http://localhost:3006', }; diff --git a/services/booking/src/common/src/hacks.ts b/services/booking/src/common/src/hacks.ts new file mode 100644 index 00000000..a5b74e1a --- /dev/null +++ b/services/booking/src/common/src/hacks.ts @@ -0,0 +1,24 @@ +export function hackURLWithPort(u: string | URL): string { + if (typeof (u) == "string") { + u = new URL(u); + } + + if (u.hostname == "localhost") { + let portstring = u.port + if (portstring === "") { + switch (u.protocol) { + case "http:": + portstring = "80" + break; + case "https:": + portstring = "443" + break; + default: + throw new Error("Unknow protocol " + u.protocol + " - can not derive port"); + } + } + + return u.protocol + "//" + u.hostname + ":" + portstring + u.pathname + u.search; + } + return u.toString() +} \ No newline at end of file diff --git a/services/booking/src/common/src/index.ts b/services/booking/src/common/src/index.ts index 0092b2b2..ecdeb0ac 100644 --- a/services/booking/src/common/src/index.ts +++ b/services/booking/src/common/src/index.ts @@ -1,3 +1,5 @@ -export * from './auth'; -export * from './config'; -export * from './sleep'; +export * from './auth.js'; +export * from './config.js'; +export * from './sleep.js'; +export * from './hacks.js'; +export * from './clients/index.js'; diff --git a/services/booking/src/common/tsconfig.json b/services/booking/src/common/tsconfig.json index e807d467..13bcd3bf 100644 --- a/services/booking/src/common/tsconfig.json +++ b/services/booking/src/common/tsconfig.json @@ -1,13 +1,25 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "Node", - "target": "ES2020", + "module": "Node16", + "moduleResolution": "Node16", + "allowSyntheticDefaultImports": true, + "target": "ES2022", + "lib": ["ES2022"], + "esModuleInterop": true, "outDir": "lib", "rootDir": "src", - "declaration": true, - "declarationMap": true, + "strict": true, + "noImplicitAny": true, + // "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + // "noFallthroughCasesInSwitch": true, "sourceMap": true, - "esModuleInterop": true - } + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "skipLibCheck": true, + "declaration": true, + "declarationMap": true + }, + "include": ["src"] } diff --git a/services/booking/src/device-reservation/Dockerfile b/services/booking/src/device-reservation/Dockerfile new file mode 100644 index 00000000..e3d1b7eb --- /dev/null +++ b/services/booking/src/device-reservation/Dockerfile @@ -0,0 +1,15 @@ +# Build Image +FROM node:lts-alpine AS build +WORKDIR /tmp +COPY .packages /tmp/packages +RUN npm install --global /tmp/packages/* +RUN rm -rf /tmp/packages + +RUN apk add dumb-init +WORKDIR /app +RUN mkdir db +RUN chown node:node /app/* +USER node + +ENV NODE_ENV production +CMD ["dumb-init", "crosslab-device-reservation"] \ No newline at end of file diff --git a/services/booking/src/device-reservation/package-lock.json b/services/booking/src/device-reservation/package-lock.json new file mode 100644 index 00000000..a91fe5b1 --- /dev/null +++ b/services/booking/src/device-reservation/package-lock.json @@ -0,0 +1,3646 @@ +{ + "name": "@crosslab/service-device-reservation", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@crosslab/service-device-reservation", + "version": "0.1.0", + "license": "Apache-2.0", + "dependencies": { + "@crosslab/booking-service-common": "file:../common", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/amqplib": "^0.10.1", + "amqplib": "^0.10.0", + "async-mutex": "^0.5.0", + "dayjs": "^1.11.5", + "mysql2": "^3.6.0", + "typescript": "^5.5.4" + }, + "bin": { + "crosslab-device-reservation": "app/index.js" + }, + "devDependencies": { + "@types/mocha": "^10.0.0", + "c8": "^10.1.0", + "mocha": "^10.0.0", + "mocha-suppress-logs": "^0.5.1", + "npm-run-all": "^4.1.5", + "prettier": "^3.0.3" + } + }, + "../common": { + "name": "@crosslab/booking-service-common", + "version": "0.0.1", + "license": "Apache-2.0", + "dependencies": { + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/express": "^4.17.13", + "ajv-formats": "^3.0.1", + "express": "^4.18.1", + "node-fetch": "^3.3.2" + }, + "devDependencies": { + "@cross-lab-project/codegen-typescript-addon": "file:../../../../helper/crosslab-typescript-addon", + "@cross-lab-project/openapi-codegen": "file:../../../../helper/openapi-codegeneration", + "@types/express": "^4.17.13", + "@types/node": "^20.5.9", + "@types/node-fetch": "^2.6.4", + "npm-run-all": "^4.1.5", + "prettier": "^3.0.3", + "typescript": "^5.2.2" + } + }, + "node_modules/@acuminous/bitsyntax": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@acuminous/bitsyntax/-/bitsyntax-0.1.2.tgz", + "integrity": "sha512-29lUK80d1muEQqiUsSo+3A0yP6CdspgC95EnKBMi22Xlwt79i/En4Vr67+cXhU+cZjbti3TgGGC5wy1stIywVQ==", + "dependencies": { + "buffer-more-ints": "~1.0.0", + "debug": "^4.3.4", + "safe-buffer": "~5.1.2" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "dependencies": { + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/generator": { + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", + "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "dependencies": { + "@babel/types": "^7.17.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", + "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-environment-visitor/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", + "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", + "dependencies": { + "@babel/template": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", + "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", + "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", + "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", + "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", + "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/generator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", + "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==", + "dependencies": { + "@babel/types": "^7.24.7", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", + "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@crosslab/booking-service-common": { + "resolved": "../common", + "link": true + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.3.0.tgz", + "integrity": "sha512-r3n0onD3BTOVUNPhR4lhVK4/pABGpbA7bW3eumZnYdKaHkf1qEC+Mag6DPbGNuuh0eG8AaYj+YqmVHSiGslaTQ==", + "dependencies": { + "@babel/generator": "7.17.7", + "@babel/parser": "^7.20.5", + "@babel/traverse": "7.23.2", + "@babel/types": "7.17.0", + "javascript-natural-sort": "0.7.1", + "lodash": "^4.17.21" + }, + "peerDependencies": { + "@vue/compiler-sfc": "3.x", + "prettier": "2.x - 3.x" + }, + "peerDependenciesMeta": { + "@vue/compiler-sfc": { + "optional": true + } + } + }, + "node_modules/@types/amqplib": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@types/amqplib/-/amqplib-0.10.5.tgz", + "integrity": "sha512-/cSykxROY7BWwDoi4Y4/jLAuZTshZxd8Ey1QYa/VaXriMotBDoou7V/twJiOSHzU6t1Kp1AHAUXGCgqq+6DNeg==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true + }, + "node_modules/@types/mocha": { + "version": "10.0.6", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.6.tgz", + "integrity": "sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.14.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", + "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/amqplib": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/amqplib/-/amqplib-0.10.4.tgz", + "integrity": "sha512-DMZ4eCEjAVdX1II2TfIUpJhfKAuoCeDIo/YyETbfAqehHTXxxs7WOOd+N1Xxr4cKhx12y23zk8/os98FxlZHrw==", + "dependencies": { + "@acuminous/bitsyntax": "^0.1.2", + "buffer-more-ints": "~1.0.0", + "readable-stream": "1.x >=1.1.9", + "url-parse": "~1.5.10" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/async-mutex": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/async-mutex/-/async-mutex-0.5.0.tgz", + "integrity": "sha512-1A94B18jkJ3DYq284ohPxoXbfTA5HsQ7/Mf4DEhcyLx3Bz27Rh59iScbB6EPiP+B+joue6YCxcMXSbFC1tZKwA==", + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "node_modules/buffer-more-ints": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-more-ints/-/buffer-more-ints-1.0.0.tgz", + "integrity": "sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg==" + }, + "node_modules/c8": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/c8/-/c8-10.1.2.tgz", + "integrity": "sha512-Qr6rj76eSshu5CgRYvktW0uM0CFY0yi4Fd5D0duDXO6sYinyopmftUiJVuzBQxQcwQLor7JWDVRP+dUfCmzgJw==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.3", + "find-up": "^5.0.0", + "foreground-child": "^3.1.1", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.1.6", + "test-exclude": "^7.0.1", + "v8-to-istanbul": "^9.0.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1" + }, + "bin": { + "c8": "bin/c8.js" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "monocart-coverage-reports": "^2" + }, + "peerDependenciesMeta": { + "monocart-coverage-reports": { + "optional": true + } + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/dayjs": { + "version": "1.11.11", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.11.tgz", + "integrity": "sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==" + }, + "node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "bin": { + "flat": "cli.js" + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/foreground-child": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.0.tgz", + "integrity": "sha512-CrWQNaEl1/6WeZoarcM9LHupTo3RpZO2Pdk1vktwzPiQTsJnAKJmm3TACKeG5UZbWDfaH2AbvYxzP96y0MT7fA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "dependencies": { + "is-property": "^1.0.2" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", + "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", + "dev": true, + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.0.tgz", + "integrity": "sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/javascript-natural-sort": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "node_modules/load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/log-symbols/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "node_modules/lru-cache": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz", + "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==", + "engines": { + "node": ">=16.14" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mocha": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.4.0.tgz", + "integrity": "sha512-eqhGB8JKapEYcC4ytX/xrzKforgEc3j1pGlAXVy3eRwrtAy5/nIfT1SvgGzfN0XZZxeLq0aQWkOUAmqIJiv+bA==", + "dev": true, + "dependencies": { + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.4", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "8.1.0", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "5.0.1", + "ms": "2.1.3", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "workerpool": "6.2.1", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/mocha-suppress-logs": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mocha-suppress-logs/-/mocha-suppress-logs-0.5.1.tgz", + "integrity": "sha512-f4BhMiCABgCt3tlXiOcRydWreNCkfvgXgNL2ZclfXPdLNcY7jfyNy3Oi5wwPuxx++UyuNiIx3F7orvckAfrKzw==", + "dev": true, + "dependencies": { + "clone": "^2.1.2" + } + }, + "node_modules/mocha/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/mocha/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/mocha/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/mocha/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/mysql2": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.10.1.tgz", + "integrity": "sha512-6zo1T3GILsXMCex3YEu7hCz2OXLUarxFsxvFcUHWMpkPtmZLeTTWgRdc1gWyNJiYt6AxITmIf9bZDRy/jAfWew==", + "dependencies": { + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.6.3", + "long": "^5.2.1", + "lru-cache": "^8.0.0", + "named-placeholders": "^1.1.3", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", + "dependencies": { + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/named-placeholders/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/npm-run-all/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/npm-run-all/node_modules/cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/npm-run-all/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/npm-run-all/node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/npm-run-all/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true, + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/prettier": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/seq-queue": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", + "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" + }, + "node_modules/serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.18", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.18.tgz", + "integrity": "sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==", + "dev": true + }, + "node_modules/sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.padend": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.6.tgz", + "integrity": "sha512-XZpspuSB7vJWhvJc9DLSlrXl1mcA2BdoY5jjnS135ydXqLoqhs96JjDtCkjJEQHvfqZIp9hBuBMgI589peyx9Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/test-exclude": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.1.tgz", + "integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^10.4.1", + "minimatch": "^9.0.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", + "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tslib": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" + }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/v8-to-istanbul": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", + "integrity": "sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/workerpool": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", + "dev": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/services/booking/src/device-reservation/package.json b/services/booking/src/device-reservation/package.json index f6d12af4..5dd6f08c 100644 --- a/services/booking/src/device-reservation/package.json +++ b/services/booking/src/device-reservation/package.json @@ -1,11 +1,21 @@ { + "type": "module", "name": "@crosslab/service-device-reservation", "version": "0.1.0", "description": "Part of booking service. Responsible for low level device reservation.", - "main": "app/index.js", + "main": "app/lib.js", + "dockerName": "device-reservation", + "bin": { + "crosslab-device-reservation": "./app/index.js" + }, + "files": [ + "app" + ], "scripts": { - "test": "npm run build && npx nyc --include=\"app/mainLoop.js\" --include=\"app/messageDefinition.js\" mocha --require mocha-suppress-logs --exit app/*_test.js", - "build": "npx tsc", + "test": "npm run build && npx c8 --include=\"app/mainLoop.js\" --include=\"app/messageDefinition.js\" mocha --require mocha-suppress-logs --exit app/*_test.js", + "build:compile": "npx tsc", + "build:add-shebang": "bash scripts/add-shebang.sh", + "build": "npm-run-all build:*", "start": "npm run build && node app/index.js", "format": "prettier . --write", "lint": "eslint ." @@ -15,18 +25,19 @@ "dependencies": { "@crosslab/booking-service-common": "file:../common", "@trivago/prettier-plugin-sort-imports": "^4.2.0", - "@types/amqplib": "^0.10.5", - "amqplib": "^0.10.4", + "@types/amqplib": "^0.10.1", + "amqplib": "^0.10.0", "async-mutex": "^0.5.0", - "dayjs": "^1.11.12", + "dayjs": "^1.11.5", "mysql2": "^3.6.0", "typescript": "^5.5.4" }, "devDependencies": { - "@types/mocha": "^10.0.7", - "mocha": "^10.7.0", + "@types/mocha": "^10.0.0", + "c8": "^10.1.0", + "mocha": "^10.0.0", "mocha-suppress-logs": "^0.5.1", - "nyc": "^17.0.0", - "prettier": "^3.3.3" + "prettier": "^3.0.3", + "npm-run-all": "^4.1.5" } } diff --git a/services/booking/src/device-reservation/scripts/add-shebang.sh b/services/booking/src/device-reservation/scripts/add-shebang.sh new file mode 120000 index 00000000..1a5fdd47 --- /dev/null +++ b/services/booking/src/device-reservation/scripts/add-shebang.sh @@ -0,0 +1 @@ +../../../../../common/node/scripts/add-shebang.sh \ No newline at end of file diff --git a/services/booking/src/device-reservation/scripts/build-docker.sh b/services/booking/src/device-reservation/scripts/build-docker.sh new file mode 120000 index 00000000..31019032 --- /dev/null +++ b/services/booking/src/device-reservation/scripts/build-docker.sh @@ -0,0 +1 @@ +../../../../../common/docker/scripts/build-node.sh \ No newline at end of file diff --git a/services/booking/src/device-reservation/scripts/set-scene.sh b/services/booking/src/device-reservation/scripts/set-scene.sh new file mode 120000 index 00000000..d41e06af --- /dev/null +++ b/services/booking/src/device-reservation/scripts/set-scene.sh @@ -0,0 +1 @@ +../../../../../common/node/scripts/set-scene.sh \ No newline at end of file diff --git a/services/booking/src/device-reservation/scripts/test.sh b/services/booking/src/device-reservation/scripts/test.sh new file mode 100755 index 00000000..3b22f459 --- /dev/null +++ b/services/booking/src/device-reservation/scripts/test.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +sudo service rabbitmq-server start +sudo service mariadb start +sudo mysql -e "DROP DATABASE IF EXISTS unittest;" +sudo mysql -e "CREATE DATABASE unittest DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;" +sudo mysql -e "DROP USER IF EXISTS 'test'@localhost;" +sudo mysql -e "CREATE USER 'test'@localhost IDENTIFIED BY 'test';" +sudo mysql -e "GRANT ALL PRIVILEGES ON unittest.* to 'test'@localhost;" +sudo mysql -e "FLUSH PRIVILEGES;" + +npm ci +npm test +result=$? + +sudo mysql -e "DROP USER 'test'@localhost;" +sudo mysql -e "DROP DATABASE unittest;" +sudo service mariadb stop +sudo service rabbitmq-server stop + +exit $result \ No newline at end of file diff --git a/services/booking/src/device-reservation/src/config.ts b/services/booking/src/device-reservation/src/config.ts new file mode 100644 index 00000000..e3962433 --- /dev/null +++ b/services/booking/src/device-reservation/src/config.ts @@ -0,0 +1,14 @@ +import { baseConfig, die } from '@crosslab/booking-service-common'; + +const PORT = parseInt(process.env.PORT ?? '3004'); +const DEFAULT_BASE_URL = 'http://localhost:' + PORT; + +export const config = { + ...baseConfig, + BookingDSN: process.env.BOOKING_DSN ?? baseConfig.BookingDSN, + ReservationDSN: process.env.BOOKING_DSN ?? baseConfig.BookingDSN, + CallbackDSN: process.env.BOOKING_DSN ?? baseConfig.BookingDSN, + OwnURL: process.env.BASE_URL ?? DEFAULT_BASE_URL, + InstitutePrefix:[process.env.BASE_URL ?? DEFAULT_BASE_URL], + AmqpUrl: process.env.AMQP_URL ?? baseConfig.AmqpUrl, +}; diff --git a/services/booking/src/device-reservation/src/index.ts b/services/booking/src/device-reservation/src/index.ts index eb4db477..7eeb3136 100644 --- a/services/booking/src/device-reservation/src/index.ts +++ b/services/booking/src/device-reservation/src/index.ts @@ -1,8 +1,5 @@ -import { mainLoop } from './mainLoop'; - -export * from './mainLoop'; -export * from './messageDefinition'; +import { mainLoop } from './mainLoop.js'; console.log('Starting reservation service'); -if (require.main === module) mainLoop(); +mainLoop(); diff --git a/services/booking/src/device-reservation/src/lib.ts b/services/booking/src/device-reservation/src/lib.ts new file mode 100644 index 00000000..1763c813 --- /dev/null +++ b/services/booking/src/device-reservation/src/lib.ts @@ -0,0 +1,3 @@ +export * from './mainLoop.js'; +export * from './messageDefinition.js'; +export * from './config.js'; diff --git a/services/booking/src/device-reservation/src/mainLoop.ts b/services/booking/src/device-reservation/src/mainLoop.ts index c4030d72..a775dcb3 100644 --- a/services/booking/src/device-reservation/src/mainLoop.ts +++ b/services/booking/src/device-reservation/src/mainLoop.ts @@ -1,15 +1,16 @@ -import { BelongsToUs, baseConfig, sleep } from '@crosslab/booking-service-common'; +import { BelongsToUs, sleep } from '@crosslab/booking-service-common'; import * as amqplib from 'amqplib'; import { Mutex, withTimeout } from 'async-mutex'; import * as crypto from 'crypto'; import * as mysql from 'mysql2/promise'; +import { config } from './config.js'; import { ErrorTimeoutText, ReservationAnswer, ReservationMessage, ReservationRequest, -} from './messageDefinition'; +} from './messageDefinition.js'; (BigInt.prototype as any).toJSON = function () { return this.toString(); @@ -22,7 +23,7 @@ var mutex = withTimeout(new Mutex(), 5000, new Error(ErrorTimeoutText)); export async function mainLoop(): Promise { while (true) { try { - let connection = await amqplib.connect(baseConfig.AmqpUrl); + let connection = await amqplib.connect(config.AmqpUrl); let channel = await connection.createChannel(); await channel.assertQueue('device-reservation', { @@ -46,11 +47,11 @@ export async function mainLoop(): Promise { try { data = ReservationMessage.fromString(msg.content.toString()); } catch (error) { - console.log('Can not parse message:', error); + console.error('Can not parse message:', error); try { channel.ack(msg); } catch (error) { - console.log('Can not ack message:', error); + console.error('Can not ack message:', error); } continue; } @@ -59,7 +60,7 @@ export async function mainLoop(): Promise { try { // Process message let answer: ReservationAnswer; - let db = await mysql.createConnection(baseConfig.ReservationDSN); + let db = await mysql.createConnection(config.ReservationDSN); await db.connect(); try { let rows: any, fields: any; @@ -67,9 +68,10 @@ export async function mainLoop(): Promise { case ReservationRequest.Stop: // This should never be called by any service, we still need it to stop main loop for testing... channel.ack(msg); - sleep(250); - channel.close(); - connection.close(); + await sleep(250); + await channel.close(); + await sleep(250); + await connection.close(); return; case ReservationRequest.New: answer = { @@ -304,6 +306,7 @@ export async function mainLoop(): Promise { break; } } catch (error) { + console.error('Can not process request: ' + error); // Do not jump out here, always send an answer to caller answer = { Type: data.Type, @@ -327,7 +330,7 @@ export async function mainLoop(): Promise { channel.sendToQueue(data.AnswerQueue, Buffer.from(JSON.stringify(answer))); channel.ack(msg); } catch (error) { - console.log('Can not ack message:', error); + console.error('Can not ack message:', error); } } catch (error) { try { @@ -346,15 +349,16 @@ export async function mainLoop(): Promise { channel.sendToQueue(data.AnswerQueue, Buffer.from(JSON.stringify(answer))); channel.ack(msg); } catch (e) { - console.log('Can not ack message:', e); + console.error('Can not ack message:', e); } } finally { release(); } } } catch (err) { - console.log(err); + console.error('Uncaught error in mainLoop:', err); console.log('Reconnecting...'); + await sleep(1000); } } } diff --git a/services/booking/src/device-reservation/src/mainLoop_test.ts b/services/booking/src/device-reservation/src/mainLoop_test.ts index 54e12f1f..54f4b644 100644 --- a/services/booking/src/device-reservation/src/mainLoop_test.ts +++ b/services/booking/src/device-reservation/src/mainLoop_test.ts @@ -1,16 +1,17 @@ -import { baseConfig, sleep } from '@crosslab/booking-service-common'; +import { sleep } from '@crosslab/booking-service-common'; import * as amqplib from 'amqplib'; import dayjs from 'dayjs'; import * as mocha from 'mocha'; import * as mysql from 'mysql2/promise'; -import { mainLoop } from './mainLoop'; +import { config } from './config.js'; +import { mainLoop } from './mainLoop.js'; import { ErrorTimeoutText, ReservationAnswer, ReservationMessage, ReservationRequest, -} from './messageDefinition'; +} from './messageDefinition.js'; let connection: amqplib.Connection; let channel: amqplib.Channel; @@ -22,17 +23,17 @@ mocha.describe('mainLoop.ts', function () { this.timeout(10000); mocha.before(function () { - // baseConfig - baseConfig.OwnURL = 'http://localhost:10801'; - baseConfig.InstitutePrefix = ['http://localhost:10801']; - baseConfig.ReservationDSN = + // config + config.OwnURL = 'http://localhost:10801'; + config.InstitutePrefix = ['http://localhost:10801']; + config.ReservationDSN = 'mysql://test:test@localhost/unittest?supportBigNumbers=true&bigNumberStrings=true'; }); mocha.beforeEach(async function () { // Setup database try { - let db = await mysql.createConnection(baseConfig.ReservationDSN); + let db = await mysql.createConnection(config.ReservationDSN); await db.connect(); await db.execute( 'CREATE TABLE reservation (`id` BIGINT UNSIGNED AUTO_INCREMENT, `device` TEXT NOT NULL, `start` DATETIME NOT NULL, `end` DATETIME NOT NULL, `bookingreference` TEXT NOT NULL, PRIMARY KEY (`id`))', @@ -71,7 +72,7 @@ mocha.describe('mainLoop.ts', function () { } // Connect to amqp - connection = await amqplib.connect(baseConfig.AmqpUrl); + connection = await amqplib.connect(config.AmqpUrl); channel = await connection.createChannel(); await channel.assertQueue(receiveQueue, { @@ -92,7 +93,7 @@ mocha.describe('mainLoop.ts', function () { }); mocha.afterEach(async function () { - let db = await mysql.createConnection(baseConfig.ReservationDSN); + let db = await mysql.createConnection(config.ReservationDSN); await db.connect(); await db.execute('DROP TABLE reservation'); db.end(); @@ -104,6 +105,7 @@ mocha.describe('mainLoop.ts', function () { await channel.deleteQueue(receiveQueue); await channel.close(); + await sleep(250); await connection.close(); }); @@ -581,6 +583,48 @@ mocha.describe('mainLoop.ts', function () { } }); + mocha.it('mainLoop.ts bad dates', async () => { + let m = new ReservationMessage(ReservationRequest.New, receiveQueue); + m.Device = new URL('http://localhost/device/superDevice'); + m.End = dayjs('2022-06-27T02:15:00Z'); + m.Start = dayjs('2022-06-27T03:45:00Z'); + + channel.sendToQueue(sendQueue, Buffer.from(JSON.stringify(m))); + await sleep(1000); + + let a = await channel.get(receiveQueue, { noAck: true }); + + if (a == null || typeof a === 'boolean') { + throw new Error('Did not receive answer message'); + } + + let data = JSON.parse(a.content.toString()); + + if (data.Successful) { + throw new Error("Reservation (1) was successful but shouldn't"); + } + + m = new ReservationMessage(ReservationRequest.New, receiveQueue); + m.Device = new URL('http://localhost/device/superDevice'); + m.End = dayjs('2022-06-27T02:15:00Z'); + m.Start = dayjs('2022-06-27T02:15:00Z'); + + channel.sendToQueue(sendQueue, Buffer.from(JSON.stringify(m))); + await sleep(1000); + + a = await channel.get(receiveQueue, { noAck: true }); + + if (a == null || typeof a === 'boolean') { + throw new Error('Did not receive answer message'); + } + + data = JSON.parse(a.content.toString()); + + if (data.Successful) { + throw new Error("Reservation (2) was successful but shouldn't"); + } + }); + mocha.it('mainLoop.ts delete missing values', async () => { let m = new ReservationMessage(ReservationRequest.Delete, receiveQueue); diff --git a/services/booking/src/device-reservation/src/messageDefinition.ts b/services/booking/src/device-reservation/src/messageDefinition.ts index 1c7facfa..2ded2d54 100644 --- a/services/booking/src/device-reservation/src/messageDefinition.ts +++ b/services/booking/src/device-reservation/src/messageDefinition.ts @@ -1,5 +1,5 @@ import dayjs from 'dayjs'; -import isSameOrBefore from 'dayjs/plugin/isSameOrBefore'; +import isSameOrBefore from 'dayjs/plugin/isSameOrBefore.js'; export const ErrorTimeoutText = 'Operation timed out, please retry later'; diff --git a/services/booking/src/device-reservation/src/messageDefinition_test.ts b/services/booking/src/device-reservation/src/messageDefinition_test.ts index cae72755..d3731e0e 100644 --- a/services/booking/src/device-reservation/src/messageDefinition_test.ts +++ b/services/booking/src/device-reservation/src/messageDefinition_test.ts @@ -5,7 +5,7 @@ import { ReservationAnswer, ReservationMessage, ReservationRequest, -} from './messageDefinition'; +} from './messageDefinition.js'; (BigInt.prototype as any).toJSON = function () { return this.toString(); diff --git a/services/booking/src/device-reservation/tsconfig.json b/services/booking/src/device-reservation/tsconfig.json index 61b5acc3..a61a2361 100644 --- a/services/booking/src/device-reservation/tsconfig.json +++ b/services/booking/src/device-reservation/tsconfig.json @@ -1,13 +1,24 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "Node", - "target": "ES2020", + "module": "Node16", + "moduleResolution": "Node16", + "allowSyntheticDefaultImports": true, + "target": "ES2022", + "lib": ["ES2022"], + "esModuleInterop": true, "outDir": "app", "rootDir": "src", - "declaration": true, - "declarationMap": true, + "noImplicitAny": true, + // "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + // "noFallthroughCasesInSwitch": true, "sourceMap": true, - "esModuleInterop": true - } + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "skipLibCheck": true, + "declarationMap": true, + "declaration": true + }, + "include": ["src"] } diff --git a/services/booking/src/schedule-service/.env-cmdrc b/services/booking/src/schedule-service/.env-cmdrc index 88810370..a1f80d1e 100644 --- a/services/booking/src/schedule-service/.env-cmdrc +++ b/services/booking/src/schedule-service/.env-cmdrc @@ -1,9 +1,7 @@ { - "development": { - "SECURITY_ISSUER": "http://localhost", - "SECURITY_AUDIENCE": "http://localhost", - "BASE_URL": "http://localhost", - "PORT": "3000", - "API_TOKEN": "booking-service-dev-token" - } -} \ No newline at end of file + "development": { + "BASE_URL": "http://localhost:10801", + "DEVICE_SERVICE_URL": "http://localhost:10801", + "PORT": "10801" + } +} diff --git a/services/booking/src/schedule-service/Dockerfile b/services/booking/src/schedule-service/Dockerfile new file mode 100644 index 00000000..af68a9b1 --- /dev/null +++ b/services/booking/src/schedule-service/Dockerfile @@ -0,0 +1,17 @@ +# Build Image +FROM node:lts-alpine AS build +WORKDIR /tmp +COPY .packages /tmp/packages +RUN npm install --global /tmp/packages/* +RUN rm -rf /tmp/packages + +RUN apk add dumb-init +WORKDIR /app +RUN mkdir db +RUN chown node:node /app/* +USER node + +ENV NODE_ENV production +ENV PORT 3006 +EXPOSE 3006/tcp +CMD ["dumb-init", "crosslab-schedule-service"] \ No newline at end of file diff --git a/services/booking/src/schedule-service/api/component.yml b/services/booking/src/schedule-service/api/component.yml index a77319ca..2b9101cd 100644 --- a/services/booking/src/schedule-service/api/component.yml +++ b/services/booking/src/schedule-service/api/component.yml @@ -1,85 +1,90 @@ -/schedule: - post: - operationId: 'schedule' - security: - - JWT: [] - tags: - - schedule-service - summary: Returns the free / booked times for given experiment. - x-optional-url: true - requestBody: - content: - application/json: - schema: - type: object - required: - - Experiment - - Time - properties: - Experiment: - $ref: '#/components/schemas/Experiment' - Time: - $ref: '#/components/schemas/Timeslot' - Combined: - type: boolean - description: If true, show only one timetable per device instead of one for all available physical devices. - onlyOwn: - type: boolean - description: (private) Show only devices of this institution. Give an error if a device of an other institution is requested. - responses: - '200': - description: Timetable of free/booked time. If 'Combined' is set to true, an array with only one entry is returned containing the combined timetable. + /schedule: + post: + operationId: 'schedule' + security: + - JWT: + - booking + - booking:use + tags: + - schedule-service + summary: Returns the free / booked times for given experiment. + x-optional-url: true + requestBody: content: application/json: schema: - type: array - items: - type: object - required: - - Device - - Booked - - Free - properties: - Device: - type: string - description: ID of the device (or * if combined). - Booked: - type: array - description: Array of booked times. - items: - $ref: '#/components/schemas/Timeslot' - Free: - type: array - description: Array of free times. - items: - $ref: '#/components/schemas/Timeslot' - '400': - description: onlyOwn was set, but devices not belonging to that institution were requested. - '401': - description: No authorisation header found. - '404': - description: Request contains unknown type IDs. The first unknown ID will be returned. - content: - application/json: - schema: - type: string - description: First unknown device ID. - '422': - description: Request contains virtual devices and can thus not be processed. - content: - application/json: - schema: - type: string - description: First virtual device ID. - '500': - description: >- - Request could not be answered. An error string containing the reason - will be returned. - content: - application/json: - schema: - type: string - description: Error description. - '503': - description: >- - Service is unable to respond in time, possibly overloaded. Try again in a few minutes. + type: object + required: + - Experiment + - Time + properties: + Experiment: + $ref: '#/components/schemas/Experiment' + Time: + $ref: '#/components/schemas/Timeslot' + Combined: + type: boolean + description: If true, show only one timetable per device instead of one for all available physical devices. + onlyOwn: + type: boolean + description: (private) Show only devices of this institution. Give an error if a device of an other institution is requested. + responses: + '200': + description: Timetable of free/booked time. If 'Combined' is set to true, an array with only one entry is returned containing the combined timetable. + content: + application/json: + schema: + type: array + items: + type: object + required: + - Device + - Booked + - Free + properties: + Device: + type: string + description: ID of the device (or * if combined). + Booked: + type: array + description: Array of booked times. + items: + $ref: '#/components/schemas/Timeslot' + Free: + type: array + description: Array of free times. + items: + $ref: '#/components/schemas/Timeslot' + '400': + description: onlyOwn was set, but devices not belonging to that institution were requested. + '401': + description: No authorisation header found. + '403': + description: >- + Caller is not allowed to call this method. Usually, caller is missing required scopes. + '404': + description: Request contains unknown type IDs. The first unknown ID will be returned. + content: + application/json: + schema: + type: string + description: First unknown device ID. + '422': + description: Request contains virtual devices and can thus not be processed. + content: + application/json: + schema: + type: string + description: First virtual device ID. + '500': + description: >- + Request could not be answered. An error string containing the reason + will be returned. + content: + application/json: + schema: + type: string + description: Error description. + '503': + description: >- + Service is unable to respond in time, possibly overloaded. Try again in a few minutes. diff --git a/services/booking/src/schedule-service/package-lock.json b/services/booking/src/schedule-service/package-lock.json new file mode 100644 index 00000000..9b78a40c --- /dev/null +++ b/services/booking/src/schedule-service/package-lock.json @@ -0,0 +1,4455 @@ +{ + "name": "@crosslab/service-schedule-service", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@crosslab/service-schedule-service", + "version": "0.0.1", + "license": "Apache-2.0", + "dependencies": { + "@cross-lab-project/api-client": "file:../../../../clients/api/js", + "@crosslab/booking-service-common": "file:../common", + "@crosslab/service-common": "file:../../../common", + "ajv-formats": "^3.0.1", + "dayjs": "^1.11.5", + "express": "^4.18.1", + "lodash": "^4.17.21", + "mysql2": "^3.11.0" + }, + "bin": { + "crosslab-schedule-service": "app/index.js" + }, + "devDependencies": { + "@cross-lab-project/codegen-typescript-addon": "file:../../../../helper/crosslab-typescript-addon", + "@cross-lab-project/openapi-codegen": "file:../../../../helper/openapi-codegeneration", + "@crosslab/booking-service-test-common": "file:../test_common", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/express": "^4.17.13", + "@types/lodash": "^4.14.198", + "@types/mocha": "^10.0.0", + "c8": "^10.1.0", + "env-cmd": "^10.1.0", + "mocha": "^10.0.0", + "npm-run-all": "^4.1.5", + "prettier": "^3.0.3", + "typescript": "^5.5.4" + } + }, + "../../../../clients/api/js": { + "name": "@cross-lab-project/api-client", + "license": "ISC", + "dependencies": { + "ajv-formats": "^3.0.1", + "cross-fetch": "^4.0.0" + }, + "devDependencies": { + "@cross-lab-project/codegen-typescript-addon": "file:../../../helper/crosslab-typescript-addon", + "@cross-lab-project/openapi-codegen": "file:../../../helper/openapi-codegeneration", + "@eslint/js": "^9.9.0", + "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@types/eslint__js": "^8.42.3", + "@types/node": "^22.1.0", + "eslint": "^9.8.0", + "prettier": "^3.3.3", + "typedoc": "^0.26.5", + "typescript": "^5.5.4", + "typescript-eslint": "^8.1.0" + } + }, + "../../../../helper/crosslab-typescript-addon": { + "name": "@cross-lab-project/codegen-typescript-addon", + "dev": true, + "license": "UNLICENSED", + "dependencies": { + "@apidevtools/swagger-parser": "^10.1.0", + "nunjucks": "^3.2.3" + }, + "devDependencies": { + "@cross-lab-project/openapi-codegen": "file:../openapi-codegeneration", + "@eslint/js": "^9.9.0", + "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@types/eslint__js": "^8.42.3", + "@types/node": "^22.1.0", + "@types/nunjucks": "^3.2.6", + "@types/seedrandom": "^3.0.8", + "copyfiles": "^2.4.1", + "eslint": "^9.8.0", + "openapi-types": "^12.1.3", + "prettier": "^3.3.3", + "tsc-watch": "^6.2.0", + "typescript": "^5.5.4", + "typescript-eslint": "^8.1.0" + }, + "peerDependencies": { + "@cross-lab-project/openapi-codegen": "file:../openapi-codegeneration", + "ajv": "^8.11.0", + "ajv-formats": "^3.0.1" + } + }, + "../../../../helper/openapi-codegeneration": { + "name": "@cross-lab-project/openapi-codegen", + "dev": true, + "license": "UNLICENSED", + "dependencies": { + "@apidevtools/swagger-parser": "^10.1.0", + "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", + "commander": "^12.1.0", + "deterministic-json-schema-faker": "^0.5.0-rcv.46", + "glob": "^11.0.0", + "json-schema-merge-allof": "^0.8.1", + "json-schema-to-typescript": "^15.0.0", + "nunjucks": "^3.2.4", + "quicktype-core": "^23.0.170", + "seedrandom": "^3.0.5", + "tiny-typed-emitter": "^2.1.0", + "yaml": "^2.5.0" + }, + "bin": { + "openapi-codegen": "lib/cjs/index.js" + }, + "devDependencies": { + "@eslint/js": "^9.9.0", + "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@types/eslint__js": "^8.42.3", + "@types/node": "^22.1.0", + "@types/nunjucks": "^3.2.6", + "@types/seedrandom": "^3.0.8", + "eslint": "^9.8.0", + "openapi-types": "^12.1.3", + "prettier": "^3.0.3", + "tsc-watch": "^6.2.0", + "typescript": "^5.5.4", + "typescript-eslint": "^8.1.0" + } + }, + "../../../common": { + "name": "@crosslab/service-common", + "license": "UNLICENSED", + "dependencies": { + "express": "^4.18.1", + "express-winston": "^4.2.0", + "fetch-retry": "^6.0.0", + "jose": "^5.6.3", + "mysql": "^2.18.1", + "sqlite3": "^5.1.7", + "typeorm": "^0.3.20", + "uuid": "^10.0.0", + "winston": "^3.14.1", + "winston-loki": "^6.1.2" + }, + "devDependencies": { + "@eslint/js": "^9.9.0", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/eslint__js": "^8.42.3", + "@types/express": "^4.17.21", + "@types/mocha": "^10.0.7", + "@types/node": "^22.1.0", + "@types/uuid": "^10.0.0", + "eslint": "^9.8.0", + "mocha": "^10.7.0", + "prettier": "^3.3.3", + "typescript": "^5.5.4", + "typescript-eslint": "^8.1.0" + } + }, + "../common": { + "name": "@crosslab/booking-service-common", + "version": "0.0.1", + "license": "Apache-2.0", + "dependencies": { + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/express": "^4.17.13", + "ajv-formats": "^3.0.1", + "express": "^4.18.1", + "node-fetch": "^3.3.2" + }, + "devDependencies": { + "@cross-lab-project/codegen-typescript-addon": "file:../../../../helper/crosslab-typescript-addon", + "@cross-lab-project/openapi-codegen": "file:../../../../helper/openapi-codegeneration", + "@types/express": "^4.17.13", + "@types/node": "^20.5.9", + "@types/node-fetch": "^2.6.4", + "npm-run-all": "^4.1.5", + "prettier": "^3.0.3", + "typescript": "^5.2.2" + } + }, + "../test_common": { + "name": "@crosslab/booking-service-test-common", + "version": "0.0.1", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@crosslab/booking-service-common": "file:../common", + "@crosslab/service-device-reservation": "file:../device-reservation", + "amqplib": "^0.10.3", + "dayjs": "^1.11.5", + "express": "^4.18.1", + "mysql2": "^3.6.0", + "typescript": "^5.5.4" + }, + "devDependencies": { + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/amqplib": "^0.10.1", + "@types/express": "^4.17.13", + "node-mocks-http": "^1.14.1", + "prettier": "^3.0.3" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/generator": { + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", + "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "dev": true, + "dependencies": { + "@babel/types": "^7.17.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", + "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-environment-visitor/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", + "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", + "dev": true, + "dependencies": { + "@babel/template": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", + "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", + "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", + "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", + "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", + "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/generator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", + "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.24.7", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", + "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@cross-lab-project/api-client": { + "resolved": "../../../../clients/api/js", + "link": true + }, + "node_modules/@cross-lab-project/codegen-typescript-addon": { + "resolved": "../../../../helper/crosslab-typescript-addon", + "link": true + }, + "node_modules/@cross-lab-project/openapi-codegen": { + "resolved": "../../../../helper/openapi-codegeneration", + "link": true + }, + "node_modules/@crosslab/booking-service-common": { + "resolved": "../common", + "link": true + }, + "node_modules/@crosslab/booking-service-test-common": { + "resolved": "../test_common", + "link": true + }, + "node_modules/@crosslab/service-common": { + "resolved": "../../../common", + "link": true + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.3.0.tgz", + "integrity": "sha512-r3n0onD3BTOVUNPhR4lhVK4/pABGpbA7bW3eumZnYdKaHkf1qEC+Mag6DPbGNuuh0eG8AaYj+YqmVHSiGslaTQ==", + "dev": true, + "dependencies": { + "@babel/generator": "7.17.7", + "@babel/parser": "^7.20.5", + "@babel/traverse": "7.23.2", + "@babel/types": "7.17.0", + "javascript-natural-sort": "0.7.1", + "lodash": "^4.17.21" + }, + "peerDependencies": { + "@vue/compiler-sfc": "3.x", + "prettier": "2.x - 3.x" + }, + "peerDependenciesMeta": { + "@vue/compiler-sfc": { + "optional": true + } + } + }, + "node_modules/@types/body-parser": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "dev": true, + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", + "dev": true, + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.19.3", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.3.tgz", + "integrity": "sha512-KOzM7MhcBFlmnlr/fzISFF5vGWVSvN6fTd4T+ExOt08bA/dA5kpSzY52nMsI1KDFmUREpJelPYyuslLRSjjgCg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", + "dev": true + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true + }, + "node_modules/@types/lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-MBIOHVZqVqgfro1euRDWX7OO0fBVUUMrN6Pwm8LQsz8cWhEpihlvR70ENj3f40j58TNxZaWv2ndSkInykNBBJw==", + "dev": true + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true + }, + "node_modules/@types/mocha": { + "version": "10.0.6", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.6.tgz", + "integrity": "sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.14.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", + "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/qs": { + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", + "dev": true + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true + }, + "node_modules/@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", + "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", + "dev": true, + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ajv": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz", + "integrity": "sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.4.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/aws-ssl-profiles": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz", + "integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/c8": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/c8/-/c8-10.1.2.tgz", + "integrity": "sha512-Qr6rj76eSshu5CgRYvktW0uM0CFY0yi4Fd5D0duDXO6sYinyopmftUiJVuzBQxQcwQLor7JWDVRP+dUfCmzgJw==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.3", + "find-up": "^5.0.0", + "foreground-child": "^3.1.1", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.1.6", + "test-exclude": "^7.0.1", + "v8-to-istanbul": "^9.0.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1" + }, + "bin": { + "c8": "bin/c8.js" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "monocart-coverage-reports": "^2" + }, + "peerDependenciesMeta": { + "monocart-coverage-reports": { + "optional": true + } + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/dayjs": { + "version": "1.11.11", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.11.tgz", + "integrity": "sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==" + }, + "node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/env-cmd": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/env-cmd/-/env-cmd-10.1.0.tgz", + "integrity": "sha512-mMdWTT9XKN7yNth/6N6g2GuKuJTsKMDHlQFUDacb/heQRRWOTIZ42t1rMHnQu4jYxU1ajdTeJM+9eEETlqToMA==", + "dev": true, + "dependencies": { + "commander": "^4.0.0", + "cross-spawn": "^7.0.0" + }, + "bin": { + "env-cmd": "bin/env-cmd.js" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "bin": { + "flat": "cli.js" + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/foreground-child": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.0.tgz", + "integrity": "sha512-CrWQNaEl1/6WeZoarcM9LHupTo3RpZO2Pdk1vktwzPiQTsJnAKJmm3TACKeG5UZbWDfaH2AbvYxzP96y0MT7fA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "dependencies": { + "is-property": "^1.0.2" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", + "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", + "dev": true, + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.0.tgz", + "integrity": "sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/javascript-natural-sort": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/log-symbols/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "node_modules/lru.min": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.1.tgz", + "integrity": "sha512-FbAj6lXil6t8z4z3j0E5mfRlPzxkySotzUHwRXjlpRh10vc6AI6WN62ehZj82VG7M20rqogJ0GLwar2Xa05a8Q==", + "license": "MIT", + "engines": { + "bun": ">=1.0.0", + "deno": ">=1.30.0", + "node": ">=8.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wellwelwel" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mocha": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.4.0.tgz", + "integrity": "sha512-eqhGB8JKapEYcC4ytX/xrzKforgEc3j1pGlAXVy3eRwrtAy5/nIfT1SvgGzfN0XZZxeLq0aQWkOUAmqIJiv+bA==", + "dev": true, + "dependencies": { + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.4", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "8.1.0", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "5.0.1", + "ms": "2.1.3", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "workerpool": "6.2.1", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/mocha/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/mocha/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/mocha/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/mocha/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/mysql2": { + "version": "3.11.3", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.11.3.tgz", + "integrity": "sha512-Qpu2ADfbKzyLdwC/5d4W7+5Yz7yBzCU05YWt5npWzACST37wJsB23wgOSo00qi043urkiRwXtEvJc9UnuLX/MQ==", + "license": "MIT", + "dependencies": { + "aws-ssl-profiles": "^1.1.1", + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.6.3", + "long": "^5.2.1", + "lru.min": "^1.0.0", + "named-placeholders": "^1.1.3", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/mysql2/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", + "dependencies": { + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/named-placeholders/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/npm-run-all/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/npm-run-all/node_modules/cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/npm-run-all/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/npm-run-all/node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/npm-run-all/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true, + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/prettier": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/seq-queue": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", + "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" + }, + "node_modules/serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.18", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.18.tgz", + "integrity": "sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==", + "dev": true + }, + "node_modules/sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.padend": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.6.tgz", + "integrity": "sha512-XZpspuSB7vJWhvJc9DLSlrXl1mcA2BdoY5jjnS135ydXqLoqhs96JjDtCkjJEQHvfqZIp9hBuBMgI589peyx9Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/test-exclude": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.1.tgz", + "integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^10.4.1", + "minimatch": "^9.0.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", + "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/v8-to-istanbul": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", + "integrity": "sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/workerpool": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", + "dev": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/services/booking/src/schedule-service/package.json b/services/booking/src/schedule-service/package.json index 59d0a911..521921c9 100644 --- a/services/booking/src/schedule-service/package.json +++ b/services/booking/src/schedule-service/package.json @@ -1,13 +1,22 @@ { + "type": "module", "name": "@crosslab/service-schedule-service", "version": "0.0.1", "description": "Part of booking service. Shows schedule of devices - horizontal scaleable.", "main": "app/index.js", + "dockerName": "schedule-service", + "bin": { + "crosslab-schedule-service": "./app/index.js" + }, + "files": [ + "app" + ], "scripts": { - "test": "npm run build && env-cmd -e development nyc --include=\"app/schedule.js\" --include=\"app/timetable.js\" mocha app/*_test.js", + "test": "npm run build && env-cmd -e development c8 --include=\"app/operations/index.js\" --include=\"app/timetable.js\" mocha app/*_test.js app/operations/*_test.js", "build:generate": "openapi-codegen -i dist/openapi.json -p @cross-lab-project/codegen-typescript-addon:preset:service -o src/generated", - "build:compile": "tsc", - "build": "npm run build:generate && npm run build:compile", + "build:compile": "tsc && cp src/generated/basicValidation.cjs app/generated/basicValidation.cjs", + "build:add-shebang": "bash scripts/add-shebang.sh", + "build": "npm-run-all build:*", "start": "npm run build && env-cmd -e development node app/index.js", "format": "prettier . --write", "lint": "eslint ." @@ -16,29 +25,27 @@ "license": "Apache-2.0", "dependencies": { "@cross-lab-project/api-client": "file:../../../../clients/api/js", - "@cross-lab-project/codegen-typescript-addon": "file:../../../../helper/crosslab-typescript-addon", - "@cross-lab-project/openapi-codegen": "file:../../../../helper/openapi-codegeneration", - "@cross-lab-project/service-common": "file:../../../common", + "@crosslab/service-common": "file:../../../common", "@crosslab/booking-service-common": "file:../common", - "@crosslab/booking-service-test-common": "file:../test_common", - "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "@types/express": "^4.17.21", - "@types/lodash": "^4.17.7", - "@eslint/js": "^9.9.0", - "@types/eslint__js": "^8.42.3", - "typescript-eslint": "^8.1.0", "ajv-formats": "^3.0.1", - "dayjs": "^1.11.12", - "express": "^4.19.2", + "dayjs": "^1.11.5", + "express": "^4.18.1", "lodash": "^4.17.21", - "mysql2": "^3.11.0", - "typescript": "^5.5.4" + "mysql2": "^3.11.0" }, "devDependencies": { - "@types/mocha": "^10.0.7", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "typescript": "^5.5.4", + "@types/express": "^4.17.13", + "@types/lodash": "^4.14.198", + "@crosslab/booking-service-test-common": "file:../test_common", + "@cross-lab-project/codegen-typescript-addon": "file:../../../../helper/crosslab-typescript-addon", + "@cross-lab-project/openapi-codegen": "file:../../../../helper/openapi-codegeneration", + "@types/mocha": "^10.0.0", + "c8": "^10.1.0", "env-cmd": "^10.1.0", - "mocha": "^10.7.0", - "nyc": "^17.0.0", - "prettier": "^3.3.3" + "mocha": "^10.0.0", + "prettier": "^3.0.3", + "npm-run-all": "^4.1.5" } } diff --git a/services/booking/src/schedule-service/scripts/add-shebang.sh b/services/booking/src/schedule-service/scripts/add-shebang.sh new file mode 120000 index 00000000..1a5fdd47 --- /dev/null +++ b/services/booking/src/schedule-service/scripts/add-shebang.sh @@ -0,0 +1 @@ +../../../../../common/node/scripts/add-shebang.sh \ No newline at end of file diff --git a/services/booking/src/schedule-service/scripts/build-docker.sh b/services/booking/src/schedule-service/scripts/build-docker.sh new file mode 120000 index 00000000..31019032 --- /dev/null +++ b/services/booking/src/schedule-service/scripts/build-docker.sh @@ -0,0 +1 @@ +../../../../../common/docker/scripts/build-node.sh \ No newline at end of file diff --git a/services/booking/src/schedule-service/scripts/build-spec.sh b/services/booking/src/schedule-service/scripts/build-spec.sh new file mode 100755 index 00000000..e5b66475 --- /dev/null +++ b/services/booking/src/schedule-service/scripts/build-spec.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +mkdir -p dist + +rm -f dist/openapi.yml +echo "# This file was automatically generated - all changes will be lost\n" > dist/openapi.yml + +cat api/openapi_start.yml >> dist/openapi.yml +cat api/component.yml >> dist/openapi.yml +cat ../../api/types.yml >> dist/openapi.yml + +npx @redocly/cli bundle dist/openapi.yml --output dist/openapi.json diff --git a/services/booking/src/schedule-service/scripts/test.sh b/services/booking/src/schedule-service/scripts/test.sh new file mode 100755 index 00000000..3b22f459 --- /dev/null +++ b/services/booking/src/schedule-service/scripts/test.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +sudo service rabbitmq-server start +sudo service mariadb start +sudo mysql -e "DROP DATABASE IF EXISTS unittest;" +sudo mysql -e "CREATE DATABASE unittest DEFAULT CHARSET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;" +sudo mysql -e "DROP USER IF EXISTS 'test'@localhost;" +sudo mysql -e "CREATE USER 'test'@localhost IDENTIFIED BY 'test';" +sudo mysql -e "GRANT ALL PRIVILEGES ON unittest.* to 'test'@localhost;" +sudo mysql -e "FLUSH PRIVILEGES;" + +npm ci +npm test +result=$? + +sudo mysql -e "DROP USER 'test'@localhost;" +sudo mysql -e "DROP DATABASE unittest;" +sudo service mariadb stop +sudo service rabbitmq-server stop + +exit $result \ No newline at end of file diff --git a/services/booking/src/schedule-service/src/config.ts b/services/booking/src/schedule-service/src/config.ts index 0d195d0c..0a070570 100644 --- a/services/booking/src/schedule-service/src/config.ts +++ b/services/booking/src/schedule-service/src/config.ts @@ -1,6 +1,6 @@ -import { baseConfig, die } from '@crosslab/booking-service-common'; +import { baseConfig } from '@crosslab/booking-service-common'; -const PORT = parseInt(process.env.PORT ?? '3000'); +const PORT = parseInt(process.env.PORT ?? '3006'); const DEFAULT_BASE_URL = 'http://localhost:' + PORT; export const config = { @@ -8,12 +8,10 @@ export const config = { PORT, BASE_URL: process.env.BASE_URL ?? DEFAULT_BASE_URL, JWKS_URL: process.env.JWKS_URL ?? 'http://localhost/.well-known/jwks.json', - SECURITY_ISSUER: - process.env.SECURITY_ISSUER ?? - die('the environment variable SECURITY_ISSUER is not defined!'), - SECURITY_AUDIENCE: - process.env.SECURITY_AUDIENCE ?? - die('the environment variable SECURITY_AUDIENCE is not defined!'), - API_TOKEN: - process.env.API_TOKEN ?? die('the environment variable API_TOKEN is not defined!'), + BookingDSN: process.env.BOOKING_DSN ?? baseConfig.BookingDSN, + ReservationDSN: process.env.BOOKING_DSN ?? baseConfig.BookingDSN, + CallbackDSN: process.env.BOOKING_DSN ?? baseConfig.BookingDSN, + OwnURL: process.env.BASE_URL ?? DEFAULT_BASE_URL, + InstitutePrefix: [process.env.BASE_URL ?? DEFAULT_BASE_URL], + AmqpUrl: process.env.AMQP_URL ?? baseConfig.AmqpUrl, }; diff --git a/services/booking/src/schedule-service/src/index.ts b/services/booking/src/schedule-service/src/index.ts index ab78a28e..e40e7bb2 100644 --- a/services/booking/src/schedule-service/src/index.ts +++ b/services/booking/src/schedule-service/src/index.ts @@ -1,27 +1,25 @@ -import { - JWTVerify, - parseJwtFromRequestAuthenticationHeader, -} from '@cross-lab-project/service-common'; +import { authorization, error } from '@crosslab/service-common'; +import express, { ErrorRequestHandler, RequestHandler } from 'express'; -import { config } from './config'; -import { app } from './generated'; -import { isUserTypeJWT } from './generated/types'; +import { config } from './config.js'; +import { app } from './generated/index.js'; -if (require.main === module) { - app.initService({ - security: { - JWT: JWTVerify( - { - JWKS_URL: config.JWKS_URL, - SECURITY_AUDIENCE: config.SECURITY_AUDIENCE, - SECURITY_ISSUER: config.SECURITY_ISSUER, - }, - isUserTypeJWT, - parseJwtFromRequestAuthenticationHeader, - ), +app.initService({ + preHandlers: [ + application => { + application.use(express.json()); + application.use(express.urlencoded({ extended: false })); + application.use(authorization.middleware() as RequestHandler); }, - }); - - console.log('Starting schedule-service'); - app.listen(config.PORT); -} + ], + postHandlers: [ + application => { + application.get('/federation/status', (_req, res) => { + res.send({ status: 'ok' }); + }); + }, + ], + errorHandler: error.middleware as ErrorRequestHandler, +}); +console.log('Starting schedule-service'); +app.listen(config.PORT); diff --git a/services/booking/src/schedule-service/src/operations.ts b/services/booking/src/schedule-service/src/operations/index.ts similarity index 74% rename from services/booking/src/schedule-service/src/operations.ts rename to services/booking/src/schedule-service/src/operations/index.ts index 512e9f36..2563aad6 100644 --- a/services/booking/src/schedule-service/src/operations.ts +++ b/services/booking/src/schedule-service/src/operations/index.ts @@ -1,22 +1,29 @@ -import { APIClient } from '@cross-lab-project/api-client'; -import { DeviceServiceTypes } from '@cross-lab-project/api-client/lib/types/generated/types'; -import { BelongsToUs } from '@crosslab/booking-service-common'; +import { + DeviceServiceTypes, + UnsuccessfulRequestError, +} from '@cross-lab-project/api-client'; +import { BelongsToUs, clients } from '@crosslab/booking-service-common'; import dayjs from 'dayjs'; -import { cloneDeep, map } from 'lodash'; +import lodash from 'lodash'; import * as mysql from 'mysql2/promise'; +import { hackURLWithPort } from '@crosslab/booking-service-common'; -import { config } from './config'; +import { config } from '../config.js'; import { postScheduleRequestBodyType, postScheduleSignature, postScheduleSuccessResponseType, -} from './generated/signatures'; -import { Timeslot } from './generated/types'; -import { timetableAnd, timetableNot } from './timetable'; +} from '../generated/signatures.js'; +import { Timeslot } from '../generated/types.js'; +import { timetableAnd, timetableNot } from '../timetable.js'; + +(BigInt.prototype as any).toJSON = function () { + return this.toString(); +}; // TODO: Missing availability since it is not yet well defined -export const postSchedule: postScheduleSignature = async (body, user) => { - let api: APIClient = new APIClient(config.OwnURL, config.API_TOKEN); +export const postSchedule: postScheduleSignature = async (request, body) => { + await request.authorization.check_authorization_or_fail('create', `booking`); const laterReq = new Map(); // Device in request, device list, request @@ -29,6 +36,8 @@ export const postSchedule: postScheduleSignature = async (body, user) => { >[][] = []; // Device in request, device list let realDevices: string[][] = []; // Device in request, device list + if (!body) body = { Experiment: { Devices: [] }, Time: { Start: '', End: '' } }; + // Collect all timetables for (let device = 0; device < body.Experiment.Devices.length; device++) { // Resolve device @@ -41,10 +50,17 @@ export const postSchedule: postScheduleSignature = async (body, user) => { | DeviceServiceTypes.InstantiableCloudDevice | DeviceServiceTypes.InstantiableBrowserDevice; try { - r = await api.getDevice(body.Experiment.Devices[device].ID, { + r = await clients.device.getDevice(body.Experiment.Devices[device].ID, { flat_group: true, }); - } catch (err) { + } catch (error) { + console.error( + 'Error while getting device ' + + body.Experiment.Devices[device].ID + + ' :', + error, + ); + const err = error as UnsuccessfulRequestError; // Bad status code if (err.response !== undefined && err.response.status !== undefined) { if (err.response.status === 503) { @@ -66,7 +82,6 @@ export const postSchedule: postScheduleSignature = async (body, user) => { }; } - console.log('ANY ERROR device'); // any other error throw err; } @@ -83,14 +98,8 @@ export const postSchedule: postScheduleSignature = async (body, user) => { }; } - if (r.type === 'device') { + if (r.type === 'device'|| r.type === 'cloud instantiable' || r.type === 'edge instantiable') { realDevices[device].push(r.url); - } else if (r.type === 'cloud instantiable' || r.type === 'edge instantiable') { - // TODO - // For now, just add free time - realDevices[device].push(r.url); - timetables[device].push([]); - continue; } else { // group for (let i = 0; i < r.devices.length; i++) { @@ -114,17 +123,17 @@ export const postSchedule: postScheduleSignature = async (body, user) => { }; } if (laterReq.get(d.origin) === undefined) { - let req: postScheduleRequestBodyType = cloneDeep(body); + let req: postScheduleRequestBodyType = lodash.cloneDeep(body); req.onlyOwn = true; req.Experiment.Devices = []; req.Combined = false; laterReq.set(d.origin, [[], [], req]); } - let lr = laterReq.get(d.origin); + let lr = laterReq.get(d.origin)!; lr[0].push(device); lr[1].push(i); - lr[2].Experiment.Devices.push({ ID: realDevices[device][i] }); + lr[2]!.Experiment.Devices.push({ ID: realDevices[device][i] }); laterReq.set(d.origin, lr); t = []; } else { @@ -136,7 +145,7 @@ export const postSchedule: postScheduleSignature = async (body, user) => { // Get availability availability[device].push( - api.getDevice(realDevices[device][i], { flat_group: false }), + clients.device.getDevice(realDevices[device][i], { flat_group: true }), ); } } @@ -151,61 +160,64 @@ export const postSchedule: postScheduleSignature = async (body, user) => { ] >(); // Device in request, device list, request for (let k of laterReq.keys()) { - let lr = laterReq.get(k); - let req = api.schedule(lr[2], { url: k }); + let lr = laterReq.get(k)!; + let req = clients.booking.schedule.schedule(lr[2], { url: k }); lrpromise.set(k, [lr[0], lr[1], lr[2], req]); } for (let k of laterReq.keys()) { - let lr = lrpromise.get(k); + let lr = lrpromise.get(k)!; let req: postScheduleSuccessResponseType['body']; try { req = await lr[3]; - } catch (err) { + } catch (error) { + console.error( + 'Error while getting schedule for ' + k + ' :', error + ); + const err = error as UnsuccessfulRequestError; if (err.response !== undefined && err.response.status !== undefined) { if (err.response.status == 503) { return { status: 503 }; } if (err.response.status == 404) { - return { status: 404, body: err.response.body }; + return { status: 404, body: JSON.stringify(err.response.body) }; } return { status: 500, body: 'Institution ' + k + ' returned status code ' + err.response.status, }; } - console.log('ANY ERROR lr'); throw err; } - if (req.length != lr[2].Experiment.Devices.length) { + if (req.length != lr[2]!.Experiment.Devices.length) { return { status: 500, body: 'Institution ' + k + ' returned bad result (requested ' + - lr[2].Experiment.Devices.length + + lr[2]!.Experiment.Devices.length + ' devices, got ' + req.length + ')', }; } for (let i = 0; i < req.length; i++) { - if (req[i].Device != lr[2].Experiment.Devices[i].ID) { + if (req[i].Device != lr[2]!.Experiment.Devices[i].ID) { return { status: 500, body: 'Institution ' + k + ' returned bad result (requested device' + - lr[2].Experiment.Devices[i].ID + + lr[2]!.Experiment.Devices[i].ID + ', got ' + req[i].Device + ')', }; } - timetables[lr[i][0]][lr[i][1]] = req[i].Booked; + timetables[(lr as any)[i][0]][(lr as any)[i][1]] = req[i].Booked; } } @@ -228,7 +240,16 @@ export const postSchedule: postScheduleSignature = async (body, user) => { | DeviceServiceTypes.InstantiableBrowserDevice; try { a = await availability[device][i]; - } catch (err) { + } catch (error) { + console.error( + 'Error while availability for ' + + device + + ' ' + + i + + ' :', + error, + ); + const err = error as UnsuccessfulRequestError; if (err.response !== undefined && err.response.status !== undefined) { // TODO: Remove later if errors are well specified if (err.response.status === 503) { @@ -246,10 +267,9 @@ export const postSchedule: postScheduleSignature = async (body, user) => { 'Device request ' + realDevices[device][i] + ' returned status code' + - err.status, + err.response.status, }; } - console.log('ANY ERROR availability'); throw err; } if (a.type == 'group') { @@ -263,9 +283,13 @@ export const postSchedule: postScheduleSignature = async (body, user) => { if (a.type == 'cloud instantiable' || a.type == 'edge instantiable') { available = [{ Start: body.Time.Start, End: body.Time.End }]; } else { + const announcedAvailability = await clients.device.getDeviceAvailability(a.url, { // Currently broken in tests + startTime: body.Time.Start, + endTime: body.Time.End, + }); available = timetableAnd( - a.announcedAvailability.map(e => { - return { Start: e.start, End: e.end }; + announcedAvailability!.map(e => { + return { Start: e.start!, End: e.end! }; }), ); } @@ -276,12 +300,17 @@ export const postSchedule: postScheduleSignature = async (body, user) => { ); let notFree: Timeslot[] = timetableAnd(notAvailable, timetables[device][i]); + console.error( + JSON.stringify( + timetableNot(notFree, dayjs(body.Time.Start), dayjs(body.Time.End)), + ), + ); // Now push free free.push(timetableNot(notFree, dayjs(body.Time.Start), dayjs(body.Time.End))); } let freeCombined = timetableAnd(...free); response.push({ - Device: body.Experiment.Devices[device].ID, + Device: hackURLWithPort(body.Experiment.Devices[device].ID), Booked: timetableNot(freeCombined, dayjs(body.Time.Start), dayjs(body.Time.End)), Free: freeCombined, }); @@ -320,7 +349,7 @@ export async function getTimetables( try { await db.connect(); - let [rows, fields]: [any, any] = await db.execute( + let [rows, _fields]: [any, any] = await db.execute( 'SELECT start, end FROM reservation WHERE `device`=? AND ((`start` < ? AND `end` > ?) OR (`start` < ? AND `end` > ?) OR (`start` > ? AND `end` < ?) OR (`start` < ? AND `end` > ?)) ORDER BY `start` ASC', [ device.toString(), diff --git a/services/booking/src/schedule-service/src/operations_test.ts b/services/booking/src/schedule-service/src/operations/operations_test.ts similarity index 59% rename from services/booking/src/schedule-service/src/operations_test.ts rename to services/booking/src/schedule-service/src/operations/operations_test.ts index 2726b095..5f7da6f2 100644 --- a/services/booking/src/schedule-service/src/operations_test.ts +++ b/services/booking/src/schedule-service/src/operations/operations_test.ts @@ -2,6 +2,7 @@ import { fakeServerConfig, getFakeInstitutePrefix, getFakeOwnURL, + getFakeRequest, getSQLDNS, resetFakeServerVars, setupDummySql, @@ -12,8 +13,8 @@ import { import dayjs from 'dayjs'; import * as mocha from 'mocha'; -import { config } from './config'; -import { getTimetables, postSchedule } from './operations'; +import { config } from '../config.js'; +import { getTimetables, postSchedule } from './index.js'; mocha.describe('operations.ts', function () { this.timeout(10000); @@ -56,31 +57,21 @@ mocha.describe('operations.ts', function () { { Start: '2022-06-27T06:00:00Z', End: '2022-06-27T07:00:00Z' }, ]; - let r = await postSchedule( - { - Experiment: { - Devices: [ - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', - }, - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', - }, - ], - }, - Combined: false, - Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, - onlyOwn: undefined, - }, - { - JWT: { - jwt: '', - username: 'test', - url: 'localhost/user/test', - scopes: [''], - }, - }, - ); + let r = await postSchedule(getFakeRequest(), { + Experiment: { + Devices: [ + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', + }, + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', + }, + ], + }, + Combined: false, + Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, + onlyOwn: undefined, + }); if (r.status !== 200) { throw Error('Response error: ' + r.status); } @@ -107,6 +98,7 @@ mocha.describe('operations.ts', function () { if (r.body[i].Booked.length !== correctBooked.length) { console.log(r.body[i].Booked); + console.log(r.body[i].Free); throw Error('Device ' + i + ' Booked has length ' + r.body[i].Booked.length); } @@ -174,31 +166,21 @@ mocha.describe('operations.ts', function () { } } - r = await postSchedule( - { - Experiment: { - Devices: [ - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', - }, - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', - }, - ], - }, - Combined: true, - Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, - onlyOwn: undefined, - }, - { - JWT: { - jwt: '', - username: 'test', - url: 'localhost/user/test', - scopes: [''], - }, - }, - ); + r = await postSchedule(getFakeRequest(), { + Experiment: { + Devices: [ + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', + }, + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', + }, + ], + }, + Combined: true, + Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, + onlyOwn: undefined, + }); if (r.status !== 200) { throw Error('Response error: ' + r.status); } @@ -271,28 +253,18 @@ mocha.describe('operations.ts', function () { } } - r = await postSchedule( - { - Experiment: { - Devices: [ - { - ID: 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', - }, - ], - }, - Combined: false, - Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, - onlyOwn: undefined, - }, - { - JWT: { - jwt: '', - username: 'test', - url: 'localhost/user/test', - scopes: [''], - }, + r = await postSchedule(getFakeRequest(), { + Experiment: { + Devices: [ + { + ID: 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', + }, + ], }, - ); + Combined: false, + Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, + onlyOwn: undefined, + }); if (r.status !== 200) { throw Error('Response error: ' + r.status); } @@ -370,28 +342,18 @@ mocha.describe('operations.ts', function () { }); mocha.it('postBookingSchedule (completely free)', async function () { - let r = await postSchedule( - { - Experiment: { - Devices: [ - { - ID: 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', - }, - ], - }, - Combined: false, - Time: { Start: '1999-06-25T00:00:00Z', End: '1999-06-28T23:59:59Z' }, - onlyOwn: undefined, - }, - { - JWT: { - jwt: '', - username: 'test', - url: 'localhost/user/test', - scopes: [''], - }, - }, - ); + let r = await postSchedule(getFakeRequest(), { + Experiment: { + Devices: [ + { + ID: 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', + }, + ], + }, + Combined: false, + Time: { Start: '1999-06-25T00:00:00Z', End: '1999-06-28T23:59:59Z' }, + onlyOwn: undefined, + }); if (r.status !== 200) { throw Error('Response error: ' + r.status); } @@ -436,28 +398,18 @@ mocha.describe('operations.ts', function () { }); mocha.it('postBookingSchedule (completely free)', async function () { - let r = await postSchedule( - { - Experiment: { - Devices: [ - { - ID: 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', - }, - ], - }, - Combined: false, - Time: { Start: '1999-06-25T00:00:00Z', End: '1999-06-28T23:59:59Z' }, - onlyOwn: undefined, - }, - { - JWT: { - jwt: '', - username: 'test', - url: 'localhost/user/test', - scopes: [''], - }, - }, - ); + let r = await postSchedule(getFakeRequest(), { + Experiment: { + Devices: [ + { + ID: 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', + }, + ], + }, + Combined: false, + Time: { Start: '1999-06-25T00:00:00Z', End: '1999-06-28T23:59:59Z' }, + onlyOwn: undefined, + }); if (r.status !== 200) { throw Error('Response error: ' + r.status); } @@ -501,6 +453,65 @@ mocha.describe('operations.ts', function () { } }); + mocha.it('postBookingSchedule (edge device no availability)', async function () { + let r = await postSchedule(getFakeRequest(), { + Experiment: { + Devices: [ + { + ID: 'http://localhost:10801/devices/00000000-0000-1111-0000-000000000000', + }, + ], + }, + Combined: false, + Time: { Start: '1999-06-25T00:00:00Z', End: '1999-06-28T23:59:59Z' }, + onlyOwn: undefined, + }); + if (r.status !== 200) { + if(r.status === 500){ + throw Error('Response error: ' + r.status + ' Message:' + r.body); + } + throw Error('Response error: ' + r.status); + } + if (r.body.length != 1) { + throw Error('Body has wrong length, should 1, is ' + r.body.length); + } + + if ( + r.body[0].Device !== + 'http://localhost:10801/devices/00000000-0000-1111-0000-000000000000' + ) { + throw Error('Device is ' + r.body[0].Device); + } + + if (r.body[0].Booked.length !== 0) { + console.log(r.body[0].Booked); + throw Error('Device ' + 0 + ' Booked has length ' + r.body[0].Booked.length); + } + + if (r.body[0].Free.length !== 1) { + console.log(r.body[0].Free); + throw Error('Device ' + 0 + ' Free has length ' + r.body[0].Free.length); + } + + if (!dayjs(r.body[0].Free[0].Start).isSame(dayjs('1999-06-25T00:00:00Z'))) { + throw Error( + 'Device ' + + 0 + + ' Free.Start is wrong, should 1999-06-25T00:00:00Z is ' + + r.body[0].Free[0].Start, + ); + } + + if (!dayjs(r.body[0].Free[0].End).isSame(dayjs('1999-06-28T23:59:59Z'))) { + throw Error( + 'Device ' + + 0 + + ' Free.End is wrong, should 1999-06-28T23:59:59Z is ' + + r.body[0].Free[0].End, + ); + } + }); + mocha.it('postBookingSchedule (remote error case)', async function () { this.timeout(10000); @@ -509,7 +520,7 @@ mocha.describe('operations.ts', function () { device_service_status = 503; proxy_server_status = 200; - let r = await postSchedule({ Experiment: { Devices: [{ ID: "http://localhost:10801/devices/00000000-0000-0000-0000-000000000001" }, { ID: "http://localhost:10801/devices/00000000-0000-0000-0000-000000000002" }] }, Combined: false, Time: { Start: "2022-06-25T00:00:00Z", End: "2022-06-28T23:59:59Z" }, onlyOwn: undefined }, {"JWT":{ username: "test", url: "localhost/user/test", scopes: [""] }}); + let r = await postSchedule(getFakeRequest(), { Experiment: { Devices: [{ ID: "http://localhost:10801/devices/00000000-0000-0000-0000-000000000001" }, { ID: "http://localhost:10801/devices/00000000-0000-0000-0000-000000000002" }] }, Combined: false, Time: { Start: "2022-06-25T00:00:00Z", End: "2022-06-28T23:59:59Z" }, onlyOwn: undefined }); if (r.status !== 503) { throw Error("Response error (device overloaded): " + r.status); } @@ -521,7 +532,7 @@ mocha.describe('operations.ts', function () { proxy_server_status = 200; proxy_device_service_status = 503; - r = await postSchedule({ Experiment: { Devices: [{ ID: "http://localhost:10801/devices/00000000-0000-0000-0000-000000000001" }, { ID: "http://localhost:10801/devices/00000000-0000-0000-0000-000000000002" }] }, Combined: false, Time: { Start: "2022-06-25T00:00:00Z", End: "2022-06-28T23:59:59Z" }, onlyOwn: undefined }, {"JWT":{ username: "test", url: "localhost/user/test", scopes: [""] }}); + r = await postSchedule(getFakeRequest(), { Experiment: { Devices: [{ ID: "http://localhost:10801/devices/00000000-0000-0000-0000-000000000001" }, { ID: "http://localhost:10801/devices/00000000-0000-0000-0000-000000000002" }] }, Combined: false, Time: { Start: "2022-06-25T00:00:00Z", End: "2022-06-28T23:59:59Z" }, onlyOwn: undefined }); if (r.status !== 503) { throw Error("Response error (device overloaded): " + r.status); } @@ -533,31 +544,21 @@ mocha.describe('operations.ts', function () { fakeServerConfig.proxy_device_service_status = 200; fakeServerConfig.device_wrong_device = true; - let r = await postSchedule( - { - Experiment: { - Devices: [ - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', - }, - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', - }, - ], - }, - Combined: false, - Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, - onlyOwn: undefined, - }, - { - JWT: { - jwt: '', - username: 'test', - url: 'localhost/user/test', - scopes: [''], - }, - }, - ); + let r = await postSchedule(getFakeRequest(), { + Experiment: { + Devices: [ + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', + }, + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', + }, + ], + }, + Combined: false, + Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, + onlyOwn: undefined, + }); if (r.status !== 500) { throw Error('Response error (device wrong device): ' + r.status); } @@ -569,31 +570,21 @@ mocha.describe('operations.ts', function () { fakeServerConfig.device_wrong_device = false; fakeServerConfig.device_single_is_group = true; - r = await postSchedule( - { - Experiment: { - Devices: [ - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', - }, - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', - }, - ], - }, - Combined: false, - Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, - onlyOwn: undefined, - }, - { - JWT: { - jwt: '', - username: 'test', - url: 'localhost/user/test', - scopes: [''], - }, - }, - ); + r = await postSchedule(getFakeRequest(), { + Experiment: { + Devices: [ + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', + }, + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', + }, + ], + }, + Combined: false, + Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, + onlyOwn: undefined, + }); if (r.status !== 500) { throw Error('Response error (device is group): ' + r.status); } @@ -604,31 +595,21 @@ mocha.describe('operations.ts', function () { fakeServerConfig.proxy_device_service_status = 200; fakeServerConfig.device_single_is_group = false; - r = await postSchedule( - { - Experiment: { - Devices: [ - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', - }, - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', - }, - ], - }, - Combined: false, - Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, - onlyOwn: undefined, - }, - { - JWT: { - jwt: '', - username: 'test', - url: 'localhost/user/test', - scopes: [''], - }, - }, - ); + r = await postSchedule(getFakeRequest(), { + Experiment: { + Devices: [ + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', + }, + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', + }, + ], + }, + Combined: false, + Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, + onlyOwn: undefined, + }); if (r.status !== 503) { throw Error('Response error (proxy overloaded): ' + r.status); } @@ -637,31 +618,21 @@ mocha.describe('operations.ts', function () { fakeServerConfig.device_service_status = 404; fakeServerConfig.proxy_server_status = 200; - r = await postSchedule( - { - Experiment: { - Devices: [ - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', - }, - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', - }, - ], - }, - Combined: false, - Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, - onlyOwn: undefined, - }, - { - JWT: { - jwt: '', - username: 'test', - url: 'localhost/user/test', - scopes: [''], - }, - }, - ); + r = await postSchedule(getFakeRequest(), { + Experiment: { + Devices: [ + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', + }, + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', + }, + ], + }, + Combined: false, + Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, + onlyOwn: undefined, + }); if (r.status !== 404) { throw Error('Response error (proxy 404): ' + r.status); } @@ -670,31 +641,21 @@ mocha.describe('operations.ts', function () { fakeServerConfig.device_service_status = 200; fakeServerConfig.proxy_server_status = 404; - r = await postSchedule( - { - Experiment: { - Devices: [ - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', - }, - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', - }, - ], - }, - Combined: false, - Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, - onlyOwn: undefined, - }, - { - JWT: { - jwt: '', - username: 'test', - url: 'localhost/user/test', - scopes: [''], - }, - }, - ); + r = await postSchedule(getFakeRequest(), { + Experiment: { + Devices: [ + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', + }, + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', + }, + ], + }, + Combined: false, + Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, + onlyOwn: undefined, + }); if (r.status !== 404) { throw Error('Response error (proxy 404): ' + r.status); } @@ -704,31 +665,21 @@ mocha.describe('operations.ts', function () { fakeServerConfig.proxy_server_status = 200; fakeServerConfig.proxy_device_service_status = 500; - r = await postSchedule( - { - Experiment: { - Devices: [ - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', - }, - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', - }, - ], - }, - Combined: false, - Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, - onlyOwn: undefined, - }, - { - JWT: { - jwt: '', - username: 'test', - url: 'localhost/user/test', - scopes: [''], - }, - }, - ); + r = await postSchedule(getFakeRequest(), { + Experiment: { + Devices: [ + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', + }, + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', + }, + ], + }, + Combined: false, + Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, + onlyOwn: undefined, + }); if (r.status !== 500) { throw Error('Response error (device generic error): ' + r.status); } @@ -738,31 +689,21 @@ mocha.describe('operations.ts', function () { fakeServerConfig.proxy_server_status = 200; fakeServerConfig.proxy_device_service_status = 200; - r = await postSchedule( - { - Experiment: { - Devices: [ - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', - }, - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', - }, - ], - }, - Combined: false, - Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, - onlyOwn: undefined, - }, - { - JWT: { - jwt: '', - username: 'test', - url: 'localhost/user/test', - scopes: [''], - }, - }, - ); + r = await postSchedule(getFakeRequest(), { + Experiment: { + Devices: [ + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', + }, + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', + }, + ], + }, + Combined: false, + Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, + onlyOwn: undefined, + }); if (r.status !== 500) { throw Error('Response error (device generic error): ' + r.status); } @@ -772,31 +713,21 @@ mocha.describe('operations.ts', function () { fakeServerConfig.proxy_server_status = 500; fakeServerConfig.proxy_device_service_status = 200; - r = await postSchedule( - { - Experiment: { - Devices: [ - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', - }, - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', - }, - ], - }, - Combined: false, - Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, - onlyOwn: undefined, - }, - { - JWT: { - jwt: '', - username: 'test', - url: 'localhost/user/test', - scopes: [''], - }, - }, - ); + r = await postSchedule(getFakeRequest(), { + Experiment: { + Devices: [ + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', + }, + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', + }, + ], + }, + Combined: false, + Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, + onlyOwn: undefined, + }); if (r.status !== 500) { throw Error('Response error (proxy 500): ' + r.status); } @@ -806,31 +737,21 @@ mocha.describe('operations.ts', function () { fakeServerConfig.proxy_server_status = 200; fakeServerConfig.proxy_schedule_short_body = true; - r = await postSchedule( - { - Experiment: { - Devices: [ - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', - }, - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', - }, - ], - }, - Combined: false, - Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, - onlyOwn: undefined, - }, - { - JWT: { - jwt: '', - username: 'test', - url: 'localhost/user/test', - scopes: [''], - }, - }, - ); + r = await postSchedule(getFakeRequest(), { + Experiment: { + Devices: [ + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', + }, + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', + }, + ], + }, + Combined: false, + Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, + onlyOwn: undefined, + }); if (r.status !== 500) { throw Error('Response error (wrong number of devices): ' + r.status); } @@ -841,31 +762,21 @@ mocha.describe('operations.ts', function () { fakeServerConfig.proxy_schedule_short_body = false; fakeServerConfig.proxy_schedule_wrong_device = true; - r = await postSchedule( - { - Experiment: { - Devices: [ - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', - }, - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', - }, - ], - }, - Combined: false, - Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, - onlyOwn: undefined, - }, - { - JWT: { - jwt: '', - username: 'test', - url: 'localhost/user/test', - scopes: [''], - }, - }, - ); + r = await postSchedule(getFakeRequest(), { + Experiment: { + Devices: [ + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', + }, + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', + }, + ], + }, + Combined: false, + Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, + onlyOwn: undefined, + }); if (r.status !== 500) { throw Error('Response error (wrong devices): ' + r.status); } @@ -874,31 +785,21 @@ mocha.describe('operations.ts', function () { mocha.it('postBookingSchedule (bad requests)', async function () { this.timeout(10000); - let r = await postSchedule( - { - Experiment: { - Devices: [ - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', - }, - { - ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', - }, - ], - }, - Combined: false, - Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, - onlyOwn: true, - }, - { - JWT: { - jwt: '', - username: 'test', - url: 'localhost/user/test', - scopes: [''], - }, - }, - ); + let r = await postSchedule(getFakeRequest(), { + Experiment: { + Devices: [ + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000001', + }, + { + ID: 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000002', + }, + ], + }, + Combined: false, + Time: { Start: '2022-06-25T00:00:00Z', End: '2022-06-28T23:59:59Z' }, + onlyOwn: true, + }); if (r.status !== 400) { throw Error('Response error (onlyOwn wrong usage): ' + r.status); } diff --git a/services/booking/src/schedule-service/src/timetable.ts b/services/booking/src/schedule-service/src/timetable.ts index bd2d8879..403a40b3 100644 --- a/services/booking/src/schedule-service/src/timetable.ts +++ b/services/booking/src/schedule-service/src/timetable.ts @@ -1,7 +1,7 @@ import dayjs from 'dayjs'; -import isSameOrBefore from 'dayjs/plugin/isSameOrBefore'; +import isSameOrBefore from 'dayjs/plugin/isSameOrBefore.js'; -import { Timeslot } from './generated/types'; +import { Timeslot } from './generated/types.js'; dayjs.extend(isSameOrBefore); diff --git a/services/booking/src/schedule-service/src/timetable_test.ts b/services/booking/src/schedule-service/src/timetable_test.ts index e0b9da86..a80c352f 100644 --- a/services/booking/src/schedule-service/src/timetable_test.ts +++ b/services/booking/src/schedule-service/src/timetable_test.ts @@ -1,8 +1,8 @@ import dayjs from 'dayjs'; import * as mocha from 'mocha'; -import { Timeslot } from './generated/types'; -import { timetableAnd, timetableNot, timetableSortInPlace } from './timetable'; +import { Timeslot } from './generated/types.js'; +import { timetableAnd, timetableNot, timetableSortInPlace } from './timetable.js'; mocha.describe('timetable.ts', function () { mocha.it('timetableSortInPlace', function (done) { diff --git a/services/booking/src/schedule-service/tsconfig.json b/services/booking/src/schedule-service/tsconfig.json deleted file mode 100644 index 79b15a31..00000000 --- a/services/booking/src/schedule-service/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "moduleResolution": "Node", - "target": "ES2020", - "outDir": "app", - "rootDir": "src", - "sourceMap": true, - "esModuleInterop": true - }, - "exclude": ["../generated_modified"] -} diff --git a/services/booking/src/schedule-service/tsconfig.json b/services/booking/src/schedule-service/tsconfig.json new file mode 120000 index 00000000..2a9dfaa4 --- /dev/null +++ b/services/booking/src/schedule-service/tsconfig.json @@ -0,0 +1 @@ +../../../../common/node/tsconfig-app.json \ No newline at end of file diff --git a/services/booking/src/test_common/package-lock.json b/services/booking/src/test_common/package-lock.json new file mode 100644 index 00000000..9d0cc006 --- /dev/null +++ b/services/booking/src/test_common/package-lock.json @@ -0,0 +1,1669 @@ +{ + "name": "@crosslab/booking-service-test-common", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@crosslab/booking-service-test-common", + "version": "0.0.1", + "license": "Apache-2.0", + "dependencies": { + "@crosslab/booking-service-common": "file:../common", + "@crosslab/service-device-reservation": "file:../device-reservation", + "amqplib": "^0.10.3", + "dayjs": "^1.11.5", + "express": "^4.18.1", + "mysql2": "^3.6.0", + "typescript": "^5.5.4" + }, + "devDependencies": { + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/amqplib": "^0.10.1", + "@types/express": "^4.17.13", + "node-mocks-http": "^1.14.1", + "prettier": "^3.0.3" + } + }, + "../common": { + "name": "@crosslab/booking-service-common", + "version": "0.0.1", + "license": "Apache-2.0", + "dependencies": { + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/express": "^4.17.13", + "ajv-formats": "^3.0.1", + "express": "^4.18.1", + "node-fetch": "^3.3.2" + }, + "devDependencies": { + "@cross-lab-project/codegen-typescript-addon": "file:../../../../helper/crosslab-typescript-addon", + "@cross-lab-project/openapi-codegen": "file:../../../../helper/openapi-codegeneration", + "@types/express": "^4.17.13", + "@types/node": "^20.5.9", + "@types/node-fetch": "^2.6.4", + "npm-run-all": "^4.1.5", + "prettier": "^3.0.3", + "typescript": "^5.2.2" + } + }, + "../device-reservation": { + "name": "@crosslab/service-device-reservation", + "version": "0.1.0", + "license": "Apache-2.0", + "dependencies": { + "@crosslab/booking-service-common": "file:../common", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/amqplib": "^0.10.1", + "amqplib": "^0.10.0", + "async-mutex": "^0.5.0", + "dayjs": "^1.11.5", + "mysql2": "^3.6.0", + "typescript": "^5.5.4" + }, + "bin": { + "crosslab-device-reservation": "app/index.js" + }, + "devDependencies": { + "@types/mocha": "^10.0.0", + "c8": "^10.1.0", + "mocha": "^10.0.0", + "mocha-suppress-logs": "^0.5.1", + "npm-run-all": "^4.1.5", + "prettier": "^3.0.3" + } + }, + "node_modules/@acuminous/bitsyntax": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@acuminous/bitsyntax/-/bitsyntax-0.1.2.tgz", + "integrity": "sha512-29lUK80d1muEQqiUsSo+3A0yP6CdspgC95EnKBMi22Xlwt79i/En4Vr67+cXhU+cZjbti3TgGGC5wy1stIywVQ==", + "dependencies": { + "buffer-more-ints": "~1.0.0", + "debug": "^4.3.4", + "safe-buffer": "~5.1.2" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/generator": { + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", + "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "dev": true, + "dependencies": { + "@babel/types": "^7.17.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", + "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-environment-visitor/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", + "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", + "dev": true, + "dependencies": { + "@babel/template": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", + "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", + "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", + "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", + "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", + "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/generator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", + "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.24.7", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", + "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@crosslab/booking-service-common": { + "resolved": "../common", + "link": true + }, + "node_modules/@crosslab/service-device-reservation": { + "resolved": "../device-reservation", + "link": true + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.3.0.tgz", + "integrity": "sha512-r3n0onD3BTOVUNPhR4lhVK4/pABGpbA7bW3eumZnYdKaHkf1qEC+Mag6DPbGNuuh0eG8AaYj+YqmVHSiGslaTQ==", + "dev": true, + "dependencies": { + "@babel/generator": "7.17.7", + "@babel/parser": "^7.20.5", + "@babel/traverse": "7.23.2", + "@babel/types": "7.17.0", + "javascript-natural-sort": "0.7.1", + "lodash": "^4.17.21" + }, + "peerDependencies": { + "@vue/compiler-sfc": "3.x", + "prettier": "2.x - 3.x" + }, + "peerDependenciesMeta": { + "@vue/compiler-sfc": { + "optional": true + } + } + }, + "node_modules/@types/amqplib": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@types/amqplib/-/amqplib-0.10.5.tgz", + "integrity": "sha512-/cSykxROY7BWwDoi4Y4/jLAuZTshZxd8Ey1QYa/VaXriMotBDoou7V/twJiOSHzU6t1Kp1AHAUXGCgqq+6DNeg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/body-parser": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "dev": true, + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", + "dev": true, + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.19.3", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.3.tgz", + "integrity": "sha512-KOzM7MhcBFlmnlr/fzISFF5vGWVSvN6fTd4T+ExOt08bA/dA5kpSzY52nMsI1KDFmUREpJelPYyuslLRSjjgCg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", + "dev": true + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.14.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", + "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/qs": { + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", + "dev": true + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true + }, + "node_modules/@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", + "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", + "dev": true, + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/amqplib": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/amqplib/-/amqplib-0.10.4.tgz", + "integrity": "sha512-DMZ4eCEjAVdX1II2TfIUpJhfKAuoCeDIo/YyETbfAqehHTXxxs7WOOd+N1Xxr4cKhx12y23zk8/os98FxlZHrw==", + "dependencies": { + "@acuminous/bitsyntax": "^0.1.2", + "buffer-more-ints": "~1.0.0", + "readable-stream": "1.x >=1.1.9", + "url-parse": "~1.5.10" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/buffer-more-ints": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-more-ints/-/buffer-more-ints-1.0.0.tgz", + "integrity": "sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg==" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-disposition/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "node_modules/dayjs": { + "version": "1.11.11", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.11.tgz", + "integrity": "sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==" + }, + "node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/express/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "dependencies": { + "is-property": "^1.0.2" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" + }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + }, + "node_modules/javascript-natural-sort": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "node_modules/lru-cache": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz", + "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==", + "engines": { + "node": ">=16.14" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/mysql2": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.10.1.tgz", + "integrity": "sha512-6zo1T3GILsXMCex3YEu7hCz2OXLUarxFsxvFcUHWMpkPtmZLeTTWgRdc1gWyNJiYt6AxITmIf9bZDRy/jAfWew==", + "dependencies": { + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.6.3", + "long": "^5.2.1", + "lru-cache": "^8.0.0", + "named-placeholders": "^1.1.3", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/mysql2/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", + "dependencies": { + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/named-placeholders/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-mocks-http": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/node-mocks-http/-/node-mocks-http-1.14.1.tgz", + "integrity": "sha512-mfXuCGonz0A7uG1FEjnypjm34xegeN5+HI6xeGhYKecfgaZhjsmYoLE9LEFmT+53G1n8IuagPZmVnEL/xNsFaA==", + "dev": true, + "dependencies": { + "@types/express": "^4.17.21", + "@types/node": "^20.10.6", + "accepts": "^1.3.7", + "content-disposition": "^0.5.3", + "depd": "^1.1.0", + "fresh": "^0.5.2", + "merge-descriptors": "^1.0.1", + "methods": "^1.1.2", + "mime": "^1.3.4", + "parseurl": "^1.3.3", + "range-parser": "^1.2.0", + "type-is": "^1.6.18" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/node-mocks-http/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "dev": true + }, + "node_modules/prettier": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/seq-queue": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", + "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typescript": { + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + } + } +} diff --git a/services/booking/src/test_common/package.json b/services/booking/src/test_common/package.json index 9c93a553..d2bce44e 100644 --- a/services/booking/src/test_common/package.json +++ b/services/booking/src/test_common/package.json @@ -1,10 +1,14 @@ { + "type": "module", "name": "@crosslab/booking-service-test-common", "version": "0.0.1", "description": "Part of booking service.", "main": "lib/index.js", + "files": [ + "lib" + ], "scripts": { - "build": "npx tsc", + "build": "tsc", "format": "prettier . --write", "lint": "eslint ." }, @@ -13,16 +17,17 @@ "dependencies": { "@crosslab/booking-service-common": "file:../common", "@crosslab/service-device-reservation": "file:../device-reservation", - "@trivago/prettier-plugin-sort-imports": "^4.2.0", - "@types/amqplib": "^0.10.5", - "@types/express": "^4.17.21", - "amqplib": "^0.10.4", - "dayjs": "^1.11.12", + "amqplib": "^0.10.3", + "dayjs": "^1.11.5", "express": "^4.18.1", "mysql2": "^3.6.0", "typescript": "^5.5.4" }, "devDependencies": { - "prettier": "^3.3.3" + "node-mocks-http": "^1.14.1", + "prettier": "^3.0.3", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@types/amqplib": "^0.10.1", + "@types/express": "^4.17.13" } } diff --git a/services/booking/src/test_common/scripts/set-scene.sh b/services/booking/src/test_common/scripts/set-scene.sh new file mode 120000 index 00000000..d41e06af --- /dev/null +++ b/services/booking/src/test_common/scripts/set-scene.sh @@ -0,0 +1 @@ +../../../../../common/node/scripts/set-scene.sh \ No newline at end of file diff --git a/services/booking/src/test_common/src/devicereservationhelper.ts b/services/booking/src/test_common/src/devicereservationhelper.ts index cfeb90cb..c8fef9eb 100644 --- a/services/booking/src/test_common/src/devicereservationhelper.ts +++ b/services/booking/src/test_common/src/devicereservationhelper.ts @@ -2,23 +2,35 @@ import { baseConfig, sleep } from '@crosslab/booking-service-common'; import { ReservationMessage, ReservationRequest, + config, mainLoop, } from '@crosslab/service-device-reservation'; import * as amqplib from 'amqplib'; +import { getSQLDNS } from './setup.js'; + var running: boolean = false; export async function startDeviceReservation() { + config.BookingDSN = getSQLDNS(); + config.ReservationDSN = getSQLDNS(); + config.CallbackDSN = getSQLDNS(); if (running) { throw Error('reservation already started'); } let connection: amqplib.Connection = await amqplib.connect(baseConfig.AmqpUrl); let channel: amqplib.Channel = await connection.createChannel(); + // Ensure queue exists + await channel.assertQueue('device-reservation', { + durable: true, + }); + // Drain queue for tests while (await channel.get('device-reservation', { noAck: true })) {} await channel.close(); + await sleep(250); await connection.close(); mainLoop(); @@ -46,9 +58,14 @@ export async function stopDeviceReservation() { while (await channel.get('TEST_ANSWER_STOP_SERVER', { noAck: true })) {} await channel.deleteQueue('TEST_ANSWER_STOP_SERVER'); + + // Drain queue + while (await channel.get('device-reservation', { noAck: true })) {} + await channel.deleteQueue('device-reservation'); await channel.close(); + await sleep(250); await connection.close(); running = false; diff --git a/services/booking/src/test_common/src/fakerequest.ts b/services/booking/src/test_common/src/fakerequest.ts new file mode 100644 index 00000000..84e72732 --- /dev/null +++ b/services/booking/src/test_common/src/fakerequest.ts @@ -0,0 +1,54 @@ +import express from 'express'; +import * as nodeMocksHttp from 'node-mocks-http'; + +type FakeRequestOptions = { + user: string; + isAuthorized: boolean; +}; + +export function getFakeRequest(options?: FakeRequestOptions): express.Request { + if (options === undefined) { + options = fakeRequestDefaultConfig(); + } + let request = nodeMocksHttp.createRequest(); + request.authorization = {}; + request.authorization.user = options.user; + + request.related = []; + request.unrelated = []; + + request.authorization.check_authorization_or_fail = async function ( + _action: string, + _id: string, + ): Promise { + if (!options?.isAuthorized) { + throw Error('test authorization failed'); + } + }; + + request.authorization.relate = async function ( + user: string, + action: string, + id: string, + ): Promise { + request.related.push([user, action, id]); + return true; + }; + + request.authorization.unrelate = async function ( + user: string, + action: string, + id: string, + ): Promise { + request.unrelated.push([user, action, id]); + return true; + }; + return request; +} + +export function fakeRequestDefaultConfig(): FakeRequestOptions { + return { + user: 'testuser', + isAuthorized: true, + }; +} diff --git a/services/booking/src/test_common/src/fakeserver.ts b/services/booking/src/test_common/src/fakeserver.ts index 5ef8366c..86ee4401 100644 --- a/services/booking/src/test_common/src/fakeserver.ts +++ b/services/booking/src/test_common/src/fakeserver.ts @@ -1,8 +1,8 @@ import express from 'express'; import * as http from 'http'; -var device_server: http.Server; -var proxy_warning_server: http.Server; +var device_server: http.Server | undefined; +var proxy_warning_server: http.Server | undefined; var running: boolean = false; @@ -23,6 +23,8 @@ export var fakeServerConfig = { callback_test_local_two_second_was_called: false, callback_test_local_group_was_called: false, callback_test_remote_single_was_called: false, + callback_test_new_was_called: false, + device_patch_list: [] as any[], booking_status: 'booked', }; @@ -36,12 +38,12 @@ export async function startFakeServer() { // Proxy warning let app: express.Application = express(); - app.get('*', (req, res) => { + app.get('*', (_req, res) => { console.log('Proxy access wrong'); res.status(405).send(); }); - app.post('*', (req, res) => { + app.post('*', (_req, res) => { console.log('Proxy access wrong'); res.status(405).send(); }); @@ -52,18 +54,19 @@ export async function startFakeServer() { app.use(express.json()); - app.get('/devices/00000000-0000-0000-0000-000000000001', (req, res) => { + app.get('/devices/00000000-0000-0000-0000-000000000001', (_req, res) => { switch (fakeServerConfig.device_service_status) { case 200: if (fakeServerConfig.device_wrong_device) { res.send( - '{"url": "http://localhost:10801/devices/00000000-0000-0000-0000-111111111110", "name": "Test Group", "description": "Test group for unit tests", "type": "group", "owner": "http://localhost", "devices": [{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000"}, {"url": "http://127.0.0.1:10802/devices/a0000000-0000-0000-0000-000000000000"}], "isPublic": true}', + '{"url": "http://localhost:10801/devices/00000000-0000-0000-0000-111111111110", "name": "Test Group", "description": "Test group for unit tests", "isPublic": true, "type": "group", "devices": [{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000"}, {"url": "http://127.0.0.1:10802/devices/a0000000-0000-0000-0000-000000000000"}], "isPublic": true}', ); return; } res.send( - '{"url": "http://localhost:10801/devices/00000000-0000-0000-0000-000000000001", "name": "Test Group", "description": "Test group for unit tests", "type": "group", "owner": "http://localhost", "devices": [{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000"}, {"url": "http://127.0.0.1:10802/devices/a0000000-0000-0000-0000-000000000000"}], "isPublic": true}', + '{"url": "http://localhost:10801/devices/00000000-0000-0000-0000-000000000001", "name": "Test Group", "description": "Test group for unit tests", "isPublic": true, "type": "group", "devices": [{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000"}, {"url": "http://127.0.0.1:10802/devices/a0000000-0000-0000-0000-000000000000"}], "isPublic": true}', ); + return; case 404: res.status(404).send(); return; @@ -75,17 +78,22 @@ export async function startFakeServer() { return; default: res - .status(fakeServerConfig.proxy_server_status) - .send('Undefined error' + fakeServerConfig.proxy_server_status); + .status(fakeServerConfig.device_service_status) + .send('Undefined error' + fakeServerConfig.device_service_status); return; } }); - app.get('/devices/00000000-0000-0000-0000-000000000002', (req, res) => { + app.get('/devices/*/availability', (_req, res) => { + res.send('[{"start": "1990-01-01T01:00:00Z", "end": "2200-01-01T01:00:00Z"}]'); + return; + }); + + app.get('/devices/00000000-0000-0000-0000-000000000002', (_req, res) => { switch (fakeServerConfig.device_service_status) { case 200: res.send( - '{"url": "http://localhost:10801/devices/00000000-0000-0000-0000-000000000002", "name": "Test Group 2", "description": "Test group two for unit tests", "type": "group", "owner": "http://localhost", "devices": [{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000"}, {"url": "http://127.0.0.1:10802/devices/a0000000-0000-0000-0000-000000000000"}], "isPublic": true}', + '{"url": "http://localhost:10801/devices/00000000-0000-0000-0000-000000000002", "name": "Test Group 2", "description": "Test group two for unit tests", "isPublic": true, "type": "group", "devices": [{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000"}, {"url": "http://127.0.0.1:10802/devices/a0000000-0000-0000-0000-000000000000"}], "isPublic": true}', ); return; case 404: @@ -99,17 +107,17 @@ export async function startFakeServer() { return; default: res - .status(fakeServerConfig.proxy_server_status) - .send('Undefined error' + fakeServerConfig.proxy_server_status); + .status(fakeServerConfig.device_service_status) + .send('Undefined error' + fakeServerConfig.device_service_status); return; } }); - app.get('/devices/00000000-0000-0000-0000-000000000010', (req, res) => { + app.get('/devices/00000000-0000-0000-0000-000000000010', (_req, res) => { switch (fakeServerConfig.device_service_status) { case 200: res.send( - '{"url": "http://localhost:10801/devices/00000000-0000-0000-0000-000000000010", "name": "Test Group Booking", "description": "Test group containing two local devices. Used in booking-backend/bookng-frontend tests.", "type": "group", "owner": "http://localhost", "devices": [{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000"}, {"url": "http://localhost:10801/devices/20000000-0000-0000-0000-000000000000"}], "isPublic": true}', + '{"url": "http://localhost:10801/devices/00000000-0000-0000-0000-000000000010", "name": "Test Group Booking", "description": "Test group containing two local devices. Used in booking-backend/bookng-frontend tests.", "isPublic": true, "type": "group", "devices": [{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000"}, {"url": "http://localhost:10801/devices/20000000-0000-0000-0000-000000000000"}], "isPublic": true}', ); return; case 404: @@ -123,29 +131,29 @@ export async function startFakeServer() { return; default: res - .status(fakeServerConfig.proxy_server_status) - .send('Undefined error' + fakeServerConfig.proxy_server_status); + .status(fakeServerConfig.device_service_status) + .send('Undefined error' + fakeServerConfig.device_service_status); return; } }); - app.get('/devices/10000000-0000-0000-0000-000000000000', (req, res) => { + app.get('/devices/10000000-0000-0000-0000-000000000000', (_req, res) => { switch (fakeServerConfig.device_service_status) { case 200: if (fakeServerConfig.device_single_is_group) { res.send( - '{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000", "name": "Test Group 2", "description": "Test group two for unit tests", "type": "group", "owner": "http://localhost", "devices": [{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000"}, {"url": "http://127.0.0.1:10802/devices/a0000000-0000-0000-0000-000000000000"}], "isPublic": true}', + '{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000", "name": "Test Group 2", "description": "Test group two for unit tests", "isPublic": true, "type": "group", "devices": [{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000"}, {"url": "http://127.0.0.1:10802/devices/a0000000-0000-0000-0000-000000000000"}], "isPublic": true}', ); return; } if (fakeServerConfig.device_not_available) { res.send( - '{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000", "name": "Test Device", "description": "Test device for unit tests", "type": "device", "owner": "http://localhost", "connected": true, "announcedAvailability": [], "isPublic": true}', + '{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000", "name": "Test Device", "description": "Test device for unit tests", "isPublic": true, "type": "device", "connected": true, "announcedAvailability": [], "isPublic": true}', ); return; } res.send( - '{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000", "name": "Test Device", "description": "Test device for unit tests", "type": "device", "owner": "http://localhost", "connected": true, "announcedAvailability": [{"start":"1999-01-01T00:00:00Z", "end": "1999-12-31T23:59:59Z"},{"start": "2022-06-20T00:00:00Z", "end": "2022-06-27T06:00:00Z"}, {"start": "2022-06-27T07:00:00Z", "end": "2022-07-01T23:59:59Z"}], "isPublic": true}', + '{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000", "name": "Test Device", "description": "Test device for unit tests", "isPublic": true, "type": "device", "connected": true, "announcedAvailability": [{"start":"1999-01-01T00:00:00Z", "end": "1999-12-31T23:59:59Z"},{"start": "2022-06-20T00:00:00Z", "end": "2022-06-27T06:00:00Z"}, {"start": "2022-06-27T07:00:00Z", "end": "2022-07-01T23:59:59Z"}], "isPublic": true}', ); return; case 404: @@ -159,29 +167,29 @@ export async function startFakeServer() { return; default: res - .status(fakeServerConfig.proxy_server_status) - .send('Undefined error' + fakeServerConfig.proxy_server_status); + .status(fakeServerConfig.device_service_status) + .send('Undefined error' + fakeServerConfig.device_service_status); return; } }); - app.get('/devices/20000000-0000-0000-0000-000000000000', (req, res) => { + app.get('/devices/20000000-0000-0000-0000-000000000000', (_req, res) => { switch (fakeServerConfig.device_service_status) { case 200: if (fakeServerConfig.device_single_is_group) { res.send( - '{"url": "http://localhost:10801/devices/20000000-0000-0000-0000-000000000000", "name": "Test Group 3", "description": "Test group two for unit tests", "type": "group", "owner": "http://localhost", "devices": [{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000"}, {"url": "http://127.0.0.1:10802/devices/a0000000-0000-0000-0000-000000000000"}], "isPublic": true}', + '{"url": "http://localhost:10801/devices/20000000-0000-0000-0000-000000000000", "name": "Test Group 3", "description": "Test group two for unit tests", "isPublic": true, "type": "group", "devices": [{"url": "http://localhost:10801/devices/10000000-0000-0000-0000-000000000000"}, {"url": "http://127.0.0.1:10802/devices/a0000000-0000-0000-0000-000000000000"}], "isPublic": true}', ); return; } if (fakeServerConfig.device_not_available) { res.send( - '{"url": "http://localhost:10801/devices/20000000-0000-0000-0000-000000000000", "name": "Test Device 2", "description": "Test device for unit tests", "type": "device", "owner": "http://localhost", "connected": true, "announcedAvailability": [], "isPublic": true}', + '{"url": "http://localhost:10801/devices/20000000-0000-0000-0000-000000000000", "name": "Test Device 2", "description": "Test device for unit tests", "isPublic": true, "type": "device", "connected": true, "announcedAvailability": [], "isPublic": true}', ); return; } res.send( - '{"url": "http://localhost:10801/devices/20000000-0000-0000-0000-000000000000", "name": "Test Device 2", "description": "Test device for unit tests", "type": "device", "owner": "http://localhost", "connected": true, "announcedAvailability": [{"start":"1999-01-01T00:00:00Z", "end": "1999-12-31T23:59:59Z"},{"start": "2022-06-20T00:00:00Z", "end": "2022-06-27T06:00:00Z"}, {"start": "2022-06-27T07:00:00Z", "end": "2022-07-01T23:59:59Z"}], "isPublic": true}', + '{"url": "http://localhost:10801/devices/20000000-0000-0000-0000-000000000000", "name": "Test Device 2", "description": "Test device for unit tests", "isPublic": true, "type": "device", "connected": true, "announcedAvailability": [{"start":"1999-01-01T00:00:00Z", "end": "1999-12-31T23:59:59Z"},{"start": "2022-06-20T00:00:00Z", "end": "2022-06-27T06:00:00Z"}, {"start": "2022-06-27T07:00:00Z", "end": "2022-07-01T23:59:59Z"}], "isPublic": true}', ); return; case 404: @@ -195,37 +203,67 @@ export async function startFakeServer() { return; default: res - .status(fakeServerConfig.proxy_server_status) - .send('Undefined error' + fakeServerConfig.proxy_server_status); + .status(fakeServerConfig.device_service_status) + .send('Undefined error' + fakeServerConfig.device_service_status); return; } }); - app.get('/test_callbacks/test-local-single', (req, res) => { + app.get('/devices/00000000-0000-1111-0000-000000000000', (_req, res) => { + switch (fakeServerConfig.device_service_status) { + case 200: + res.send( + '{"url": "http://localhost:10801/devices/00000000-0000-1111-0000-000000000000", "type": "edge instantiable", "name": "JS Device 1", "description": "A test device", "isPublic": true, "codeUrl": "http://localhost/cloud_instantiable_device", "owner": [{"url": "http://localhost:80/users/69d03aff-1a7f-41de-8b66-0902bdc0886f"}], "viewer": []}' + ); + return; + case 404: + res.status(404).send(); + return; + case 500: + res.status(500).send(); + return; + case 503: + res.status(503).send(); + return; + default: + res + .status(fakeServerConfig.device_service_status) + .send('Undefined error' + fakeServerConfig.device_service_status); + return; + } + }); + + app.post('/test_callbacks/test-local-single', (_req, res) => { fakeServerConfig.callback_test_local_single_was_called = true; res.status(200).send(); }); - app.get('/test_callbacks/test-local-two-first', (req, res) => { + app.post('/test_callbacks/test-local-two-first', (_req, res) => { fakeServerConfig.callback_test_local_two_first_was_called = true; res.status(200).send(); }); - app.get('/test_callbacks/test-local-two-second', (req, res) => { + app.post('/test_callbacks/test-local-two-second', (_req, res) => { fakeServerConfig.callback_test_local_two_second_was_called = true; res.status(200).send(); }); - app.get('/test_callbacks/test-local-group', (req, res) => { + app.post('/test_callbacks/test-local-group', (_req, res) => { fakeServerConfig.callback_test_local_group_was_called = true; res.status(200).send(); }); - app.get('/test_callbacks/test-remote-single', (req, res) => { + app.post('/test_callbacks/test-remote-single', (_req, res) => { fakeServerConfig.callback_test_remote_single_was_called = true; res.status(200).send(); }); + // to add in tests: http://localhost:10801/test_callbacks/callback-test-new + app.post('/test_callbacks/callback-test-new', (_req, res) => { + fakeServerConfig.callback_test_new_was_called = true; + res.status(200).send(); + }); + app.post('/schedule', (req, res) => { switch (fakeServerConfig.schedule_service_status) { case 200: @@ -249,8 +287,10 @@ export async function startFakeServer() { return; case 400: res.status(400).send(); + return; case 401: res.status(401).send(); + return; case 404: res.status(404).send('FAKE404'); return; @@ -357,7 +397,7 @@ export async function startFakeServer() { switch (fakeServerConfig.proxy_device_service_status) { case 200: res.send( - '{"url": "http://localhost:10801/devices/a0000000-0000-0000-0000-000000000000", "name": "Remote Fake", "description": "Remote Fake test device for unit tests", "type": "device", "owner": "http://127.0.0.1:10802/", "connected": true, "announcedAvailability": [{"start": "2022-06-20T00:00:00Z", "end": "2022-06-27T06:00:00Z"}, {"start": "2022-06-27T07:00:00Z", "end": "2022-07-01T23:59:59Z"}], "isPublic": true}', + '{"url": "http://localhost:10801/devices/a0000000-0000-0000-0000-000000000000", "name": "Remote Fake", "description": "Remote Fake test device for unit tests", "isPublic": true, "type": "device", "connected": true, "announcedAvailability": [{"start": "2022-06-20T00:00:00Z", "end": "2022-06-27T06:00:00Z"}, {"start": "2022-06-27T07:00:00Z", "end": "2022-07-01T23:59:59Z"}], "isPublic": true}', ); return; case 404: @@ -388,6 +428,11 @@ export async function startFakeServer() { } }); + app.patch('/devices/*', (req, res) => { + fakeServerConfig.device_patch_list.push([req.path, req.query.changedUrl]); + res.status(200).send(); + }); + app.all('*', (req, res) => { console.log('Fake server got unknown request:', req.path, req.method); res @@ -401,9 +446,9 @@ export async function stopFakeServer() { if (!running) { throw Error('can not stop fakeserver that is not running.'); } - device_server.close(); + device_server?.close(); device_server = undefined; - proxy_warning_server.close(); + proxy_warning_server?.close(); proxy_warning_server = undefined; running = false; } @@ -425,6 +470,8 @@ export function resetFakeServerVars() { fakeServerConfig.callback_test_local_two_second_was_called = false; fakeServerConfig.callback_test_local_group_was_called = false; fakeServerConfig.callback_test_remote_single_was_called = false; + fakeServerConfig.callback_test_new_was_called = false; + fakeServerConfig.device_patch_list = []; fakeServerConfig.booking_status = 'booked'; } diff --git a/services/booking/src/test_common/src/index.ts b/services/booking/src/test_common/src/index.ts index 1b76a674..296afc9f 100644 --- a/services/booking/src/test_common/src/index.ts +++ b/services/booking/src/test_common/src/index.ts @@ -1,3 +1,4 @@ -export * from './devicereservationhelper'; -export * from './fakeserver'; -export * from './setup'; +export * from './devicereservationhelper.js'; +export * from './fakeserver.js'; +export * from './setup.js'; +export * from './fakerequest.js'; diff --git a/services/booking/src/test_common/src/setup.ts b/services/booking/src/test_common/src/setup.ts index 8e4df311..712209d9 100644 --- a/services/booking/src/test_common/src/setup.ts +++ b/services/booking/src/test_common/src/setup.ts @@ -9,7 +9,7 @@ export enum callbackType { export async function setupDummySql() { let sqlDNS: string = getSQLDNS(); - let db: mysql.Connection; + let db: mysql.Connection | undefined; try { db = await mysql.createConnection(sqlDNS); @@ -55,7 +55,7 @@ export async function setupDummySql() { // Booking await db.execute( - "CREATE TABLE booking (`id` BIGINT UNSIGNED AUTO_INCREMENT, `start` DATETIME NOT NULL, `end` DATETIME NOT NULL, `type` ENUM('normal'), `status` ENUM('pending', 'booked', 'rejected', 'cancelled', 'active', 'active-pending', 'active-rejected') NOT NULL, `user` TEXT NOT NULL, `message` LONGTEXT, PRIMARY KEY (`id`))", + "CREATE TABLE booking (`id` BIGINT UNSIGNED AUTO_INCREMENT, `start` DATETIME(3) NOT NULL, `end` DATETIME(3) NOT NULL, `type` ENUM('normal'), `status` ENUM('pending', 'booked', 'rejected', 'cancelled', 'active', 'active-pending', 'active-rejected') NOT NULL, `user` TEXT NOT NULL, `message` LONGTEXT, PRIMARY KEY (`id`))", ); await db.execute( 'CREATE TABLE bookeddevices (`id` BIGINT UNSIGNED AUTO_INCREMENT, `booking` BIGINT UNSIGNED NOT NULL, `originaldevice` TEXT NOT NULL, `originalposition` INT NOT NULL, `bookeddevice` TEXT, `remotereference` TEXT, `local` BOOLEAN, PRIMARY KEY (`id`), `reservation` BIGINT UNSIGNED, FOREIGN KEY(`booking`) REFERENCES booking (`id`) ON DELETE CASCADE ON UPDATE RESTRICT)', @@ -67,6 +67,8 @@ export async function setupDummySql() { 'CREATE TABLE callback (`id` VARCHAR(600), `type` INTEGER, `targetbooking` BIGINT UNSIGNED NOT NULL, `parameters` JSON NOT NULL DEFAULT "{}", PRIMARY KEY(`id`))', ); + // Booking already booked + // // Fake booking local single device await db.execute( 'INSERT INTO booking (`id`,`start`,`end`,`type`,`status`,`user`,`message`) VALUES (?,?,?,?,?,?,?)', @@ -276,19 +278,130 @@ export async function setupDummySql() { [BigInt(5), callbackType.BookingUpdate, BigInt(4), JSON.stringify({ Position: 0 })], ); + // Booking new + // // Fake booking local single device (5) + await db.execute( + 'INSERT INTO booking (`id`,`start`,`end`,`type`,`status`,`user`,`message`) VALUES (?,?,?,?,?,?,?)', + [ + BigInt(5), + dayjs('1999-01-10T08:00:00Z').toDate(), + dayjs('1999-01-10T09:00:00Z').toDate(), + 'normal', + 'pending', + 'test', + '', + ], + ); + await db.execute( + 'INSERT INTO bookeddevices (`id`,`booking`,`originaldevice`, `originalposition`,`bookeddevice`,`remotereference`,`local`,`reservation`) VALUES (?,?,?,?,?,?,?,?)', + [ + BigInt(6), + BigInt(5), + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', + 0, + null, + null, + true, + null, + ], + ); + await db.execute( + 'INSERT INTO callback(`id`,`type`,`targetbooking`,`parameters`) VALUES (?,?,?,?)', + [BigInt(6), callbackType.DeviceUpdate, BigInt(5), JSON.stringify({ Position: 0 })], + ); + + // // Fake booking local two devices (6) + await db.execute( + 'INSERT INTO booking (`id`,`start`,`end`,`type`,`status`,`user`,`message`) VALUES (?,?,?,?,?,?,?)', + [ + BigInt(6), + dayjs('1999-02-10T08:00:00Z').toDate(), + dayjs('1999-02-10T09:00:00Z').toDate(), + 'normal', + 'pending', + 'test', + '', + ], + ); + await db.execute( + 'INSERT INTO bookeddevices (`id`,`booking`,`originaldevice`, `originalposition`,`bookeddevice`,`remotereference`,`local`,`reservation`) VALUES (?,?,?,?,?,?,?,?)', + [ + BigInt(7), + BigInt(6), + 'http://localhost:10801/devices/10000000-0000-0000-0000-000000000000', + 0, + null, + null, + true, + null, + ], + ); + await db.execute( + 'INSERT INTO bookeddevices (`id`,`booking`,`originaldevice`, `originalposition`,`bookeddevice`,`remotereference`,`local`,`reservation`) VALUES (?,?,?,?,?,?,?,?)', + [ + BigInt(8), + BigInt(6), + 'http://localhost:10801/devices/20000000-0000-0000-0000-000000000000', + 1, + null, + null, + true, + null, + ], + ); + await db.execute( + 'INSERT INTO callback(`id`,`type`,`targetbooking`,`parameters`) VALUES (?,?,?,?)', + [BigInt(7), callbackType.DeviceUpdate, BigInt(6), JSON.stringify({ Position: 0 })], + ); + await db.execute( + 'INSERT INTO callback(`id`,`type`,`targetbooking`,`parameters`) VALUES (?,?,?,?)', + [BigInt(8), callbackType.DeviceUpdate, BigInt(6), JSON.stringify({ Position: 1 })], + ); + + // // Fake booking group (7) + await db.execute( + 'INSERT INTO booking (`id`,`start`,`end`,`type`,`status`,`user`,`message`) VALUES (?,?,?,?,?,?,?)', + [ + BigInt(7), + dayjs('1999-03-10T08:00:00Z').toDate(), + dayjs('1999-03-10T09:00:00Z').toDate(), + 'normal', + 'pending', + 'test', + '', + ], + ); + await db.execute( + 'INSERT INTO bookeddevices (`id`,`booking`,`originaldevice`, `originalposition`,`bookeddevice`,`remotereference`,`local`,`reservation`) VALUES (?,?,?,?,?,?,?,?)', + [ + BigInt(9), + BigInt(7), + 'http://localhost:10801/devices/00000000-0000-0000-0000-000000000010', + 0, + null, + null, + true, + null, + ], + ); + await db.execute( + 'INSERT INTO callback(`id`,`type`,`targetbooking`,`parameters`) VALUES (?,?,?,?)', + [BigInt(9), callbackType.DeviceUpdate, BigInt(7), JSON.stringify({ Position: 0 })], + ); + // finish await db.commit(); db.end(); } catch (err) { console.log('error in test setup:', err); - await db.rollback(); - db.end(); + await db?.rollback(); + db?.end(); throw err; } } export async function tearDownDummySql() { - let db: mysql.Connection; + let db: mysql.Connection | undefined; try { db = await mysql.createConnection(getSQLDNS()); await db.connect(); @@ -300,7 +413,7 @@ export async function tearDownDummySql() { db.end(); } catch (err) { console.log('error in test tear down:', err); - db.end(); + db?.end(); throw err; } } diff --git a/services/booking/src/test_common/tsconfig.json b/services/booking/src/test_common/tsconfig.json index e807d467..13bcd3bf 100644 --- a/services/booking/src/test_common/tsconfig.json +++ b/services/booking/src/test_common/tsconfig.json @@ -1,13 +1,25 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "Node", - "target": "ES2020", + "module": "Node16", + "moduleResolution": "Node16", + "allowSyntheticDefaultImports": true, + "target": "ES2022", + "lib": ["ES2022"], + "esModuleInterop": true, "outDir": "lib", "rootDir": "src", - "declaration": true, - "declarationMap": true, + "strict": true, + "noImplicitAny": true, + // "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + // "noFallthroughCasesInSwitch": true, "sourceMap": true, - "esModuleInterop": true - } + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "skipLibCheck": true, + "declaration": true, + "declarationMap": true + }, + "include": ["src"] } diff --git a/services/device/api/resources/device.yml b/services/device/api/resources/device.yml index 9d423068..25af05cb 100644 --- a/services/device/api/resources/device.yml +++ b/services/device/api/resources/device.yml @@ -43,6 +43,7 @@ patch: - $ref: '../parameters/device_changed_url.yml' requestBody: description: Updated device. + required: false content: application/json: $ref: '../content/device_update.yml' diff --git a/services/device/src/clients/authentication/client.ts b/services/device/src/clients/authentication/client.ts index 6bba092f..71677b02 100644 --- a/services/device/src/clients/authentication/client.ts +++ b/services/device/src/clients/authentication/client.ts @@ -127,23 +127,10 @@ function parsePathParameters(url: string, endpoint: string): string[] { * // returns ["username", "role_name"] * validateUrl("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") */ -function validateUrl(url: string, baseUrl: string, endpoint: string): string[] { +function validateUrl(url: string, endpoint: string): string[] { if (!isValidHttpUrl(url)) throw new InvalidUrlError('Provided url is not a valid http url'); - if (!url.startsWith(baseUrl)) - throw new InvalidUrlError('Provided url does not start with the provided base url'); - const pathParameters = parsePathParameters(url, endpoint); - - let extendedBaseUrl = baseUrl + endpoint; - - pathParameters.forEach(pathParameter => { - extendedBaseUrl = extendedBaseUrl.replace('{}', pathParameter); - }); - - if (url !== extendedBaseUrl) - throw new InvalidUrlError('Provided url does not match extended base url'); - - return pathParameters; + return parsePathParameters(url, endpoint); } /** @@ -173,10 +160,11 @@ export class Client { private fixedHeaders: [string, string][]; private fetch = async (url: RequestInfo | URL, init: RequestInit) => { let raw_response; + const parsedUrl = new URL(url.toString()); try { if ( - url.toString().startsWith(this.baseUrl) || - url.toString().startsWith(this.serviceUrl) + parsedUrl.toString().startsWith(this.baseUrl) || + parsedUrl.toString().startsWith(this.serviceUrl) ) { raw_response = await fetch(url, init); } else { @@ -211,12 +199,8 @@ export class Client { fixedHeaders?: [string, string][]; }, ) { - this.baseUrl = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl; - this.serviceUrl = options.serviceUrl - ? options.serviceUrl.endsWith('/') - ? options.serviceUrl.slice(0, -1) - : options.serviceUrl - : this.baseUrl; + this.baseUrl = new URL(baseUrl).toString().slice(0, -1); + this.serviceUrl = new URL(options.serviceUrl ?? this.baseUrl).toString().slice(0, -1); this.accessToken = options.accessToken ?? ''; this.fixedHeaders = options.fixedHeaders ?? []; } @@ -252,6 +236,7 @@ export class Client { }, ): Promise { const url = appendToUrl(this.baseUrl, '/login'); + console.log('trying to fetch url:', url); const body: Signatures.LoginBody = { username: username, @@ -265,15 +250,22 @@ export class Client { (RequestValidation.validateLoginInput as Types.FunctionWithErrors).errors, ); - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'POST', - headers: [ - ['Content-Type', 'application/json'], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - body: JSON.stringify(body), - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); if (!RequestValidation.validateLoginOutput(response)) throw new ValidationError( @@ -307,6 +299,7 @@ export class Client { */ public async logout(options?: { headers?: [string, string][] }): Promise { const url = appendToUrl(this.baseUrl, '/logout'); + console.log('trying to fetch url:', url); const body: Signatures.LogoutBody = { token: this.accessToken }; @@ -318,16 +311,23 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'POST', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - body: JSON.stringify(body), - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); if (!RequestValidation.validateLogoutOutput(response)) throw new ValidationError( @@ -370,6 +370,7 @@ export class Client { url?: string; }): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, '/users'); + console.log('trying to fetch url:', url); const parameters = { username: options?.username, @@ -388,8 +389,16 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); const response = await this.fetch( - url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), { method: 'GET', headers: [ @@ -444,6 +453,7 @@ export class Client { }, ): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, '/users'); + console.log('trying to fetch url:', url); const body = user; @@ -455,16 +465,23 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'POST', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - body: JSON.stringify(body), - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); if (!RequestValidation.validateCreateUserOutput(response)) throw new ValidationError( @@ -507,7 +524,8 @@ export class Client { ): Promise { const urlSuffix = '/users/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [user_id] = validateUrl(url, this.baseUrl, '/users/{}'); + const [user_id] = validateUrl(new URL(url).toString(), '/users/{}'); + console.log('trying to fetch url:', url); const parameters = { user_id: user_id, @@ -521,15 +539,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'GET', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'GET', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateGetUserOutput(response)) throw new ValidationError( @@ -575,7 +600,8 @@ export class Client { ): Promise { const urlSuffix = '/users/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [user_id] = validateUrl(url, this.baseUrl, '/users/{}'); + const [user_id] = validateUrl(new URL(url).toString(), '/users/{}'); + console.log('trying to fetch url:', url); const body = user; @@ -591,16 +617,23 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'PATCH', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - body: JSON.stringify(body), - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'PATCH', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); if (!RequestValidation.validateUpdateUserOutput(response)) throw new ValidationError( @@ -643,7 +676,8 @@ export class Client { ): Promise { const urlSuffix = '/users/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [user_id] = validateUrl(url, this.baseUrl, '/users/{}'); + const [user_id] = validateUrl(new URL(url).toString(), '/users/{}'); + console.log('trying to fetch url:', url); const parameters = { user_id: user_id, @@ -657,15 +691,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'DELETE', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'DELETE', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateDeleteUserOutput(response)) throw new ValidationError( @@ -699,6 +740,7 @@ export class Client { headers?: [string, string][]; }): Promise { const url = appendToUrl(this.baseUrl, '/identity'); + console.log('trying to fetch url:', url); if (!RequestValidation.validateGetIdentityInput()) throw new ValidationError( @@ -708,15 +750,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'GET', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'GET', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateGetIdentityOutput(response)) throw new ValidationError( @@ -752,12 +801,13 @@ export class Client { * The JSON representation of the updated user. */ public async updateIdentity( - user: Types.User<'request'>, + user: Types.User<'request'> | undefined, options?: { headers?: [string, string][]; }, ): Promise { const url = appendToUrl(this.baseUrl, '/identity'); + console.log('trying to fetch url:', url); const body = user; @@ -771,16 +821,23 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'PATCH', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - body: JSON.stringify(body), - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'PATCH', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); if (!RequestValidation.validateUpdateIdentityOutput(response)) throw new ValidationError( @@ -851,6 +908,7 @@ export class Client { }, ): Promise { const url = appendToUrl(this.baseUrl, '/token'); + console.log('trying to fetch url:', url); if (!RequestValidation.validateCreateTokenInput(body)) throw new ValidationError( @@ -858,15 +916,22 @@ export class Client { (RequestValidation.validateCreateTokenInput as Types.FunctionWithErrors).errors, ); - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'POST', - headers: [ - ['Content-Type', 'application/json'], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - body: JSON.stringify(body), - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); if (!RequestValidation.validateCreateTokenOutput(response)) throw new ValidationError( diff --git a/services/device/src/clients/device/client.ts b/services/device/src/clients/device/client.ts index 3d97e543..46a0ace9 100644 --- a/services/device/src/clients/device/client.ts +++ b/services/device/src/clients/device/client.ts @@ -127,23 +127,10 @@ function parsePathParameters(url: string, endpoint: string): string[] { * // returns ["username", "role_name"] * validateUrl("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") */ -function validateUrl(url: string, baseUrl: string, endpoint: string): string[] { +function validateUrl(url: string, endpoint: string): string[] { if (!isValidHttpUrl(url)) throw new InvalidUrlError('Provided url is not a valid http url'); - if (!url.startsWith(baseUrl)) - throw new InvalidUrlError('Provided url does not start with the provided base url'); - const pathParameters = parsePathParameters(url, endpoint); - - let extendedBaseUrl = baseUrl + endpoint; - - pathParameters.forEach(pathParameter => { - extendedBaseUrl = extendedBaseUrl.replace('{}', pathParameter); - }); - - if (url !== extendedBaseUrl) - throw new InvalidUrlError('Provided url does not match extended base url'); - - return pathParameters; + return parsePathParameters(url, endpoint); } /** @@ -173,10 +160,11 @@ export class Client { private fixedHeaders: [string, string][]; private fetch = async (url: RequestInfo | URL, init: RequestInit) => { let raw_response; + const parsedUrl = new URL(url.toString()); try { if ( - url.toString().startsWith(this.baseUrl) || - url.toString().startsWith(this.serviceUrl) + parsedUrl.toString().startsWith(this.baseUrl) || + parsedUrl.toString().startsWith(this.serviceUrl) ) { raw_response = await fetch(url, init); } else { @@ -211,12 +199,8 @@ export class Client { fixedHeaders?: [string, string][]; }, ) { - this.baseUrl = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl; - this.serviceUrl = options.serviceUrl - ? options.serviceUrl.endsWith('/') - ? options.serviceUrl.slice(0, -1) - : options.serviceUrl - : this.baseUrl; + this.baseUrl = new URL(baseUrl).toString().slice(0, -1); + this.serviceUrl = new URL(options.serviceUrl ?? this.baseUrl).toString().slice(0, -1); this.accessToken = options.accessToken ?? ''; this.fixedHeaders = options.fixedHeaders ?? []; } @@ -244,6 +228,7 @@ export class Client { url?: string; }): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, '/devices'); + console.log('trying to fetch url:', url); if (!RequestValidation.validateListDevicesInput()) throw new ValidationError( @@ -253,15 +238,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'GET', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'GET', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateListDevicesOutput(response)) throw new ValidationError( @@ -316,6 +308,7 @@ export class Client { }, ): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, '/devices'); + console.log('trying to fetch url:', url); const body = device; @@ -336,8 +329,16 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); const response = await this.fetch( - url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), { method: 'POST', headers: [ @@ -394,7 +395,8 @@ export class Client { ): Promise { const urlSuffix = '/devices/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}'); + console.log('trying to fetch url:', url); const parameters = { device_id: device_id, @@ -414,8 +416,16 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); const response = await this.fetch( - url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), { method: 'GET', headers: [ @@ -473,7 +483,7 @@ export class Client { */ public async updateDevice( url: string, - deviceUpdate: Types.DeviceUpdate<'request'>, + deviceUpdate: Types.DeviceUpdate<'request'> | undefined, options?: { headers?: [string, string][]; changedUrl?: string; @@ -481,7 +491,8 @@ export class Client { ): Promise { const urlSuffix = '/devices/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}'); + console.log('trying to fetch url:', url); const body = deviceUpdate; @@ -503,8 +514,16 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); const response = await this.fetch( - url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), { method: 'PATCH', headers: [ @@ -558,7 +577,8 @@ export class Client { ): Promise { const urlSuffix = '/devices/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}'); + console.log('trying to fetch url:', url); const parameters = { device_id: device_id, @@ -572,15 +592,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'DELETE', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'DELETE', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateDeleteDeviceOutput(response)) throw new ValidationError( @@ -631,7 +658,8 @@ export class Client { ): Promise { const urlSuffix = '/devices/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}'); + console.log('trying to fetch url:', url); const parameters = { device_id: device_id, @@ -653,8 +681,16 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); const response = await this.fetch( - url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), { method: 'POST', headers: [ @@ -715,7 +751,8 @@ export class Client { ): Promise { const urlSuffix = '/devices/{}/availability'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}/availability'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}/availability'); + console.log('trying to fetch url:', url); const parameters = { device_id: device_id, @@ -740,8 +777,16 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); const response = await this.fetch( - url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), { method: 'GET', headers: [ @@ -796,7 +841,8 @@ export class Client { ): Promise { const urlSuffix = '/devices/{}/availability'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}/availability'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}/availability'); + console.log('trying to fetch url:', url); const parameters = { device_id: device_id, @@ -812,15 +858,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'DELETE', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'DELETE', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateDeleteDeviceAvailabilityRulesOutput(response)) throw new ValidationError( @@ -859,14 +912,15 @@ export class Client { */ public async addDeviceAvailabilityRules( url: string, - availabilityRules: Types.AvailabilityRule<'request'>[], + availabilityRules: Types.AvailabilityRule<'request'>[] | undefined, options?: { headers?: [string, string][]; }, ): Promise { const urlSuffix = '/devices/{}/availability'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}/availability'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}/availability'); + console.log('trying to fetch url:', url); const body = availabilityRules; @@ -884,16 +938,23 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'POST', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - body: JSON.stringify(body), - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); if (!RequestValidation.validateAddDeviceAvailabilityRulesOutput(response)) throw new ValidationError( @@ -938,7 +999,8 @@ export class Client { ): Promise { const urlSuffix = '/devices/{}/websocket'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}/websocket'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}/websocket'); + console.log('trying to fetch url:', url); const parameters = { device_id: device_id, @@ -954,15 +1016,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'POST', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateCreateWebsocketTokenOutput(response)) throw new ValidationError( @@ -1016,7 +1085,8 @@ export class Client { ): Promise { const urlSuffix = '/devices/{}/signaling'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}/signaling'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}/signaling'); + console.log('trying to fetch url:', url); const body = sigMessage; @@ -1034,16 +1104,23 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'POST', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - body: JSON.stringify(body), - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); if (!RequestValidation.validateSendSignalingMessageOutput(response)) throw new ValidationError( @@ -1083,6 +1160,7 @@ export class Client { url?: string; }): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, '/peerconnections'); + console.log('trying to fetch url:', url); if (!RequestValidation.validateListPeerconnectionsInput()) throw new ValidationError( @@ -1094,15 +1172,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'GET', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'GET', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateListPeerconnectionsOutput(response)) throw new ValidationError( @@ -1156,6 +1241,7 @@ export class Client { }, ): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, '/peerconnections'); + console.log('trying to fetch url:', url); const body = peerconnection; @@ -1182,8 +1268,16 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); const response = await this.fetch( - url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), { method: 'POST', headers: [ @@ -1239,7 +1333,11 @@ export class Client { ): Promise { const urlSuffix = '/peerconnections/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [peerconnection_id] = validateUrl(url, this.baseUrl, '/peerconnections/{}'); + const [peerconnection_id] = validateUrl( + new URL(url).toString(), + '/peerconnections/{}', + ); + console.log('trying to fetch url:', url); const parameters = { peerconnection_id: peerconnection_id, @@ -1255,15 +1353,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'GET', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'GET', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateGetPeerconnectionOutput(response)) throw new ValidationError( @@ -1309,7 +1414,11 @@ export class Client { ): Promise { const urlSuffix = '/peerconnections/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [peerconnection_id] = validateUrl(url, this.baseUrl, '/peerconnections/{}'); + const [peerconnection_id] = validateUrl( + new URL(url).toString(), + '/peerconnections/{}', + ); + console.log('trying to fetch url:', url); const parameters = { peerconnection_id: peerconnection_id, @@ -1325,15 +1434,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'DELETE', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'DELETE', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateDeletePeerconnectionOutput(response)) throw new ValidationError( @@ -1389,10 +1505,10 @@ export class Client { const urlSuffix = '/peerconnections/{}/device_status'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); const [peerconnection_id] = validateUrl( - url, - this.baseUrl, + new URL(url).toString(), '/peerconnections/{}/device_status', ); + console.log('trying to fetch url:', url); const parameters = { peerconnection_id: peerconnection_id, @@ -1414,8 +1530,16 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); const response = await this.fetch( - url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), { method: 'PATCH', headers: [ diff --git a/services/device/src/clients/federation/client.ts b/services/device/src/clients/federation/client.ts index c1ff9b57..dc5d4fdf 100644 --- a/services/device/src/clients/federation/client.ts +++ b/services/device/src/clients/federation/client.ts @@ -127,23 +127,10 @@ function parsePathParameters(url: string, endpoint: string): string[] { * // returns ["username", "role_name"] * validateUrl("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") */ -function validateUrl(url: string, baseUrl: string, endpoint: string): string[] { +function validateUrl(url: string, endpoint: string): string[] { if (!isValidHttpUrl(url)) throw new InvalidUrlError('Provided url is not a valid http url'); - if (!url.startsWith(baseUrl)) - throw new InvalidUrlError('Provided url does not start with the provided base url'); - const pathParameters = parsePathParameters(url, endpoint); - - let extendedBaseUrl = baseUrl + endpoint; - - pathParameters.forEach(pathParameter => { - extendedBaseUrl = extendedBaseUrl.replace('{}', pathParameter); - }); - - if (url !== extendedBaseUrl) - throw new InvalidUrlError('Provided url does not match extended base url'); - - return pathParameters; + return parsePathParameters(url, endpoint); } /** @@ -173,10 +160,11 @@ export class Client { private fixedHeaders: [string, string][]; private fetch = async (url: RequestInfo | URL, init: RequestInit) => { let raw_response; + const parsedUrl = new URL(url.toString()); try { if ( - url.toString().startsWith(this.baseUrl) || - url.toString().startsWith(this.serviceUrl) + parsedUrl.toString().startsWith(this.baseUrl) || + parsedUrl.toString().startsWith(this.serviceUrl) ) { raw_response = await fetch(url, init); } else { @@ -211,12 +199,8 @@ export class Client { fixedHeaders?: [string, string][]; }, ) { - this.baseUrl = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl; - this.serviceUrl = options.serviceUrl - ? options.serviceUrl.endsWith('/') - ? options.serviceUrl.slice(0, -1) - : options.serviceUrl - : this.baseUrl; + this.baseUrl = new URL(baseUrl).toString().slice(0, -1); + this.serviceUrl = new URL(options.serviceUrl ?? this.baseUrl).toString().slice(0, -1); this.accessToken = options.accessToken ?? ''; this.fixedHeaders = options.fixedHeaders ?? []; } @@ -244,6 +228,7 @@ export class Client { url?: string; }): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, '/institutions'); + console.log('trying to fetch url:', url); if (!RequestValidation.validateListInstitutionsInput()) throw new ValidationError( @@ -255,15 +240,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'GET', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'GET', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateListInstitutionsOutput(response)) throw new ValidationError( @@ -310,6 +302,7 @@ export class Client { }, ): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, '/institutions'); + console.log('trying to fetch url:', url); const body = institution; @@ -323,16 +316,23 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'POST', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - body: JSON.stringify(body), - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); if (!RequestValidation.validateCreateInstitutionOutput(response)) throw new ValidationError( @@ -377,7 +377,8 @@ export class Client { ): Promise { const urlSuffix = '/institutions/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [institution_id] = validateUrl(url, this.baseUrl, '/institutions/{}'); + const [institution_id] = validateUrl(new URL(url).toString(), '/institutions/{}'); + console.log('trying to fetch url:', url); const parameters = { institution_id: institution_id, @@ -393,15 +394,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'GET', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'GET', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateGetInstitutionOutput(response)) throw new ValidationError( @@ -442,14 +450,15 @@ export class Client { */ public async updateInstitution( url: string, - institution: Types.Institution<'request'>, + institution: Types.Institution<'request'> | undefined, options?: { headers?: [string, string][]; }, ): Promise { const urlSuffix = '/institutions/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [institution_id] = validateUrl(url, this.baseUrl, '/institutions/{}'); + const [institution_id] = validateUrl(new URL(url).toString(), '/institutions/{}'); + console.log('trying to fetch url:', url); const body = institution; @@ -467,16 +476,23 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'PATCH', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - body: JSON.stringify(body), - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'PATCH', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); if (!RequestValidation.validateUpdateInstitutionOutput(response)) throw new ValidationError( @@ -521,7 +537,8 @@ export class Client { ): Promise { const urlSuffix = '/institutions/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [institution_id] = validateUrl(url, this.baseUrl, '/institutions/{}'); + const [institution_id] = validateUrl(new URL(url).toString(), '/institutions/{}'); + console.log('trying to fetch url:', url); const parameters = { institution_id: institution_id, @@ -537,15 +554,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'DELETE', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'DELETE', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateDeleteInstitutionOutput(response)) throw new ValidationError( diff --git a/services/device/src/database/migrations/mariadb/1721035482365-RemoveAnnouncedAvailability.ts b/services/device/src/database/migrations/mariadb/1721035482365-RemoveAnnouncedAvailability.ts new file mode 100644 index 00000000..c3bb8104 --- /dev/null +++ b/services/device/src/database/migrations/mariadb/1721035482365-RemoveAnnouncedAvailability.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class RemoveAnnouncedAvailability1721035482365 implements MigrationInterface { + name = 'RemoveAnnouncedAvailability1721035482365' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`Device\` DROP COLUMN \`announcedAvailability\``); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`Device\` ADD \`announcedAvailability\` text NULL`); + } + +} diff --git a/services/device/src/database/migrations/mariadb/index.ts b/services/device/src/database/migrations/mariadb/index.ts index 44468015..cc394e52 100644 --- a/services/device/src/database/migrations/mariadb/index.ts +++ b/services/device/src/database/migrations/mariadb/index.ts @@ -1,4 +1,9 @@ import { Setup1690370717132 } from './1690370717132-Setup.js'; import { RemoveOwnerProperty1701781258758 } from './1701781258758-RemoveOwnerProperty.js'; +import { RemoveAnnouncedAvailability1721035482365 } from './1721035482365-RemoveAnnouncedAvailability.js'; -export const Migrations = [Setup1690370717132, RemoveOwnerProperty1701781258758]; +export const Migrations = [ + Setup1690370717132, + RemoveOwnerProperty1701781258758, + RemoveAnnouncedAvailability1721035482365, +]; diff --git a/services/device/src/database/migrations/sqlite/1721035468806-RemoveAnnouncedAvailability.ts b/services/device/src/database/migrations/sqlite/1721035468806-RemoveAnnouncedAvailability.ts new file mode 100644 index 00000000..b3f62ba9 --- /dev/null +++ b/services/device/src/database/migrations/sqlite/1721035468806-RemoveAnnouncedAvailability.ts @@ -0,0 +1,24 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class RemoveAnnouncedAvailability1721035468806 implements MigrationInterface { + name = 'RemoveAnnouncedAvailability1721035468806' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`DROP INDEX "IDX_41fd67cfa14290cc8dc11f12df"`); + await queryRunner.query(`CREATE TABLE "temporary_Device" ("uuid" varchar PRIMARY KEY NOT NULL, "name" varchar NOT NULL, "description" varchar, "type" varchar NOT NULL, "isPublic" boolean NOT NULL DEFAULT (0), "deletedAt" datetime, "connected" boolean, "availabilityRules" text, "experiment" varchar, "token" varchar, "services" text, "devices" text, "instantiateUrl" varchar, "codeUrl" varchar, "instanceOfUuid" varchar, CONSTRAINT "FK_2f318c27d7d5c9441431f910fd4" FOREIGN KEY ("instanceOfUuid") REFERENCES "Device" ("uuid") ON DELETE NO ACTION ON UPDATE NO ACTION)`); + await queryRunner.query(`INSERT INTO "temporary_Device"("uuid", "name", "description", "type", "isPublic", "deletedAt", "connected", "availabilityRules", "experiment", "token", "services", "devices", "instantiateUrl", "codeUrl", "instanceOfUuid") SELECT "uuid", "name", "description", "type", "isPublic", "deletedAt", "connected", "availabilityRules", "experiment", "token", "services", "devices", "instantiateUrl", "codeUrl", "instanceOfUuid" FROM "Device"`); + await queryRunner.query(`DROP TABLE "Device"`); + await queryRunner.query(`ALTER TABLE "temporary_Device" RENAME TO "Device"`); + await queryRunner.query(`CREATE INDEX "IDX_41fd67cfa14290cc8dc11f12df" ON "Device" ("type") `); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`DROP INDEX "IDX_41fd67cfa14290cc8dc11f12df"`); + await queryRunner.query(`ALTER TABLE "Device" RENAME TO "temporary_Device"`); + await queryRunner.query(`CREATE TABLE "Device" ("uuid" varchar PRIMARY KEY NOT NULL, "name" varchar NOT NULL, "description" varchar, "type" varchar NOT NULL, "isPublic" boolean NOT NULL DEFAULT (0), "deletedAt" datetime, "connected" boolean, "announcedAvailability" text, "availabilityRules" text, "experiment" varchar, "token" varchar, "services" text, "devices" text, "instantiateUrl" varchar, "codeUrl" varchar, "instanceOfUuid" varchar, CONSTRAINT "FK_2f318c27d7d5c9441431f910fd4" FOREIGN KEY ("instanceOfUuid") REFERENCES "Device" ("uuid") ON DELETE NO ACTION ON UPDATE NO ACTION)`); + await queryRunner.query(`INSERT INTO "Device"("uuid", "name", "description", "type", "isPublic", "deletedAt", "connected", "availabilityRules", "experiment", "token", "services", "devices", "instantiateUrl", "codeUrl", "instanceOfUuid") SELECT "uuid", "name", "description", "type", "isPublic", "deletedAt", "connected", "availabilityRules", "experiment", "token", "services", "devices", "instantiateUrl", "codeUrl", "instanceOfUuid" FROM "temporary_Device"`); + await queryRunner.query(`DROP TABLE "temporary_Device"`); + await queryRunner.query(`CREATE INDEX "IDX_41fd67cfa14290cc8dc11f12df" ON "Device" ("type") `); + } + +} diff --git a/services/device/src/database/migrations/sqlite/index.ts b/services/device/src/database/migrations/sqlite/index.ts index 138bad95..e9e85bbc 100644 --- a/services/device/src/database/migrations/sqlite/index.ts +++ b/services/device/src/database/migrations/sqlite/index.ts @@ -1,5 +1,9 @@ import { Setup1692095173359 } from './1692095173359-Setup.js'; import { RemoveOwnerProperty1701781240608 } from './1701781240608-RemoveOwnerProperty.js'; +import { RemoveAnnouncedAvailability1721035468806 } from './1721035468806-RemoveAnnouncedAvailability.js'; -export const Migrations = [Setup1692095173359, RemoveOwnerProperty1701781240608]; -// typeorm-ts-node-commonjs migration:generate -d src/database/dataSource.ts src/database/migrations/sqlite/Setup +export const Migrations = [ + Setup1692095173359, + RemoveOwnerProperty1701781240608, + RemoveAnnouncedAvailability1721035468806, +]; diff --git a/services/device/src/database/model.ts b/services/device/src/database/model.ts index 4dbc1bb6..e98c2ad0 100644 --- a/services/device/src/database/model.ts +++ b/services/device/src/database/model.ts @@ -15,7 +15,6 @@ import { ConnectionStatus, DeviceReference, ServiceDescription, - TimeSlot, } from '../generated/types.js'; export type DeviceModel = @@ -68,9 +67,6 @@ export class ConcreteDeviceModel extends DeviceOverviewModel { @Column() connected!: boolean; - @Column('simple-json') - announcedAvailability!: Required[]; - @Column('simple-json') availabilityRules!: AvailabilityRule[]; diff --git a/services/device/src/database/repositories/device/concreteDevice.ts b/services/device/src/database/repositories/device/concreteDevice.ts index 74622b2a..893d316c 100644 --- a/services/device/src/database/repositories/device/concreteDevice.ts +++ b/services/device/src/database/repositories/device/concreteDevice.ts @@ -2,6 +2,8 @@ import { AbstractRepository } from '@crosslab/service-common'; import { EntityManager } from 'typeorm'; import { ConcreteDevice, ConcreteDeviceUpdate } from '../../../generated/types.js'; +import { WEEK } from '../../../globals.js'; +import { calculateAvailability } from '../../../methods/availability.js'; import { ConcreteDeviceModel } from '../../model.js'; import { DeviceOverviewRepository } from './deviceOverview.js'; @@ -30,7 +32,6 @@ export class ConcreteDeviceRepository extends AbstractRepository< async create(data?: ConcreteDevice<'request'>): Promise { const model = await super.create(data); model.type = 'device'; - model.announcedAvailability = []; model.availabilityRules = []; model.connected = false; model.services = []; @@ -54,7 +55,11 @@ export class ConcreteDeviceRepository extends AbstractRepository< return { ...(await this.dependencies.deviceOverview.format(model)), type: 'device', - announcedAvailability: model.announcedAvailability, + announcedAvailability: calculateAvailability( + model.availabilityRules, + Date.now(), + Date.now() + WEEK, + ), connected: model.connected, experiment: model.experiment ?? undefined, services: model.services, diff --git a/services/device/src/globals.ts b/services/device/src/globals.ts index a27e1d37..f4032f31 100644 --- a/services/device/src/globals.ts +++ b/services/device/src/globals.ts @@ -1,2 +1,6 @@ export const timeoutMap: Map = new Map(); -export const WEEK = 1000 * 60 * 60 * 24 * 7; + +/** + * Time of a week in milliseconds + */ +export const WEEK = 604800000; diff --git a/services/device/src/operations/devices/device/availability/post.ts b/services/device/src/operations/devices/device/availability/post.ts index d1506f72..8017297f 100644 --- a/services/device/src/operations/devices/device/availability/post.ts +++ b/services/device/src/operations/devices/device/availability/post.ts @@ -40,11 +40,6 @@ export const postDevicesByDeviceIdAvailability: postDevicesByDeviceIdAvailabilit const start = Date.now(); const end = start + WEEK; - deviceModel.announcedAvailability = calculateAvailability( - deviceModel.availabilityRules, - start, - end, - ); await repositories.device.save(deviceModel); sendChangedCallback(deviceModel); @@ -53,6 +48,6 @@ export const postDevicesByDeviceIdAvailability: postDevicesByDeviceIdAvailabilit return { status: 200, - body: deviceModel.announcedAvailability, + body: calculateAvailability(deviceModel.availabilityRules, start, end), }; }; diff --git a/services/device/src/operations/devices/device/post.ts b/services/device/src/operations/devices/device/post.ts index b88827e4..f69d6da2 100644 --- a/services/device/src/operations/devices/device/post.ts +++ b/services/device/src/operations/devices/device/post.ts @@ -46,9 +46,10 @@ export const postDevicesByDeviceId: postDevicesByDeviceIdSignature = async ( type: 'device', }); - concreteDeviceModel = (await repositories.device.save( - concreteDeviceModel, - )) as ConcreteDeviceModel; + concreteDeviceModel = (await repositories.device.save({ + ...concreteDeviceModel, + availabilityRules: [{ available: true }], + })) as ConcreteDeviceModel; await req.authorization.relate( `user:${req.authorization.user}`, diff --git a/services/device/src/operations/devices/websocket/handling/disconnect.ts b/services/device/src/operations/devices/websocket/handling/disconnect.ts index 8e320e47..0c6c94af 100644 --- a/services/device/src/operations/devices/websocket/handling/disconnect.ts +++ b/services/device/src/operations/devices/websocket/handling/disconnect.ts @@ -1,6 +1,11 @@ +import { logger } from '@crosslab/service-common'; + import { repositories } from '../../../../database/dataSource.js'; import { signalingQueueManager } from '../../../../methods/signaling/signalingQueueManager.js'; -import { deviceUrlFromId } from '../../../../methods/urlFromId.js'; +import { + deviceUrlFromId, + peerconnectionUrlFromId, +} from '../../../../methods/urlFromId.js'; import { sendStatusChangedCallback } from '../../../callbacks/index.js'; export const disconnectTimeouts = new Map(); @@ -19,11 +24,19 @@ export function addDisconnectTimeout(deviceId: string) { for (const peerconnection of peerconnections) { peerconnection.status = 'closed'; - try { - signalingQueueManager.closeSignalingQueues(peerconnection.uuid); - } catch { - // empty - } + signalingQueueManager.closeSignalingQueues(peerconnection.uuid).catch(error => + logger.log( + 'error', + `Something went wrong while trying to close the signaling queues of peerconnection "${peerconnectionUrlFromId( + peerconnection.uuid, + )}"`, + { + data: { + error, + }, + }, + ), + ); await repositories.peerconnection.save(peerconnection); sendStatusChangedCallback(peerconnection); } diff --git a/services/experiment/api/parameters/experiment_status.yml b/services/experiment/api/parameters/experiment_status.yml new file mode 100644 index 00000000..9568fa77 --- /dev/null +++ b/services/experiment/api/parameters/experiment_status.yml @@ -0,0 +1,7 @@ +# yaml-language-server: $schema=https://cross-lab-project.github.io/crosslab/meta-schemas/openapi-parameter.json +in: query +name: experimentStatus +description: Only retrieve experiments with this status. +required: false +schema: + type: string diff --git a/services/experiment/api/resources/experiments.yml b/services/experiment/api/resources/experiments.yml index 59879534..974c3326 100644 --- a/services/experiment/api/resources/experiments.yml +++ b/services/experiment/api/resources/experiments.yml @@ -9,6 +9,8 @@ get: - experiment - experiment:read - experiment:read:owned + parameters: + - $ref: '../parameters/experiment_status.yml' responses: 200: description: The list of all experiments. diff --git a/services/experiment/package.json b/services/experiment/package.json index 79a6464a..f0a0ff16 100644 --- a/services/experiment/package.json +++ b/services/experiment/package.json @@ -18,7 +18,10 @@ "build:generate:code": "npx openapi-codegen -i dist/openapi.json -p @cross-lab-project/codegen-typescript-addon:preset:service -o src/generated", "build:generate:test": "npx openapi-codegen -i dist/openapi.json -p @cross-lab-project/codegen-typescript-addon:preset:service:test -o test/generated", "build:generate:device": "npx openapi-codegen -i ../device/dist/openapi.json -p @cross-lab-project/codegen-typescript-addon:preset:service-client -o ./src/clients/device && prettier ./src/clients/device --write", - "build:compile": "tsc && cp src/generated/*.cjs app/generated && cp src/clients/device/basicValidation.cjs app/clients/device/", + "build:generate:booking-backend": "npx openapi-codegen -i ../booking/src/booking-backend/dist/openapi.json -p @cross-lab-project/codegen-typescript-addon:preset:service-client -o ./src/clients/booking-backend && prettier ./src/clients/booking-backend --write", + "build:generate:booking-frontend": "npx openapi-codegen -i ../booking/src/booking-frontend/dist/openapi.json -p @cross-lab-project/codegen-typescript-addon:preset:service-client -o ./src/clients/booking-frontend && prettier ./src/clients/booking-frontend --write", + "build:generate:schedule-service": "npx openapi-codegen -i ../booking/src/schedule-service/dist/openapi.json -p @cross-lab-project/codegen-typescript-addon:preset:service-client -o ./src/clients/schedule-service && prettier ./src/clients/schedule-service --write", + "build:compile": "tsc && cp src/generated/*.cjs app/generated && cp src/clients/device/basicValidation.cjs app/clients/device/ && cp src/clients/booking-backend/basicValidation.cjs app/clients/booking-backend/ && cp src/clients/booking-frontend/basicValidation.cjs app/clients/booking-frontend/ && cp src/clients/schedule-service/basicValidation.cjs app/clients/schedule-service/", "build:add-shebang": "bash scripts/add-shebang.sh", "build": "npm-run-all build:*", "start": "node app/index.js", diff --git a/services/experiment/src/clients/booking-backend/basicValidation.cjs b/services/experiment/src/clients/booking-backend/basicValidation.cjs new file mode 100644 index 00000000..83d82620 --- /dev/null +++ b/services/experiment/src/clients/booking-backend/basicValidation.cjs @@ -0,0 +1,3937 @@ +/* eslint-disable */ +//@ts-nocheck +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +'use strict'; +exports.validateBooking = validate21; +const schema6 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'Booking', + 'x-location': '#/components/schemas/Booking', + 'x-schema-type': 'all', +}; +const formats0 = require('ajv-formats/dist/formats').fullFormats.uri; +const formats2 = require('ajv-formats/dist/formats').fullFormats['date-time']; +function validate21( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate21.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema6.required, + parentSchema: schema6, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate21.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema6.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.ID.type, + parentSchema: schema6.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate21.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema6.properties.Time.required, + parentSchema: schema6.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate21.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema6.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Time.properties.Start.type, + parentSchema: schema6.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate21.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema6.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Time.properties.End.type, + parentSchema: schema6.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema6.properties.Time.type, + parentSchema: schema6.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate21.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema6.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Devices.items.type, + parentSchema: schema6.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema6.properties.Devices.type, + parentSchema: schema6.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Type.type, + parentSchema: schema6.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate21.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema6.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema6.properties.Type.enum, + parentSchema: schema6.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Status.type, + parentSchema: schema6.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate21.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema6.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema6.properties.Status.enum, + parentSchema: schema6.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate21.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema6.properties.You.type, + parentSchema: schema6.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate21.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema6.properties.External.type, + parentSchema: schema6.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Message.type, + parentSchema: schema6.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate21.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema6.type, + parentSchema: schema6, + data, + }, + ]; + return false; + } + } + validate21.errors = vErrors; + return errors === 0; +} +exports.validateDevice = validate22; +const schema7 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'Device', + 'x-location': '#/components/schemas/Device', + 'x-schema-type': 'all', +}; +function validate22( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate22.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema7.required, + parentSchema: schema7, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate22.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema7.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate22.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema7.properties.ID.type, + parentSchema: schema7.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate22.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema7.type, + parentSchema: schema7, + data, + }, + ]; + return false; + } + } + validate22.errors = vErrors; + return errors === 0; +} +exports.validateExperiment = validate23; +const schema8 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'Experiment', + 'x-location': '#/components/schemas/Experiment', + 'x-schema-type': 'all', +}; +function validate23( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate23.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema8.required, + parentSchema: schema8, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema8.properties.Devices.items.required, + parentSchema: schema8.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema8.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema8.properties.Devices.items.properties.ID.type, + parentSchema: + schema8.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema8.properties.Devices.items.type, + parentSchema: schema8.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema8.properties.Devices.type, + parentSchema: schema8.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate23.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema8.properties.Description.type, + parentSchema: schema8.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate23.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema8.type, + parentSchema: schema8, + data, + }, + ]; + return false; + } + } + validate23.errors = vErrors; + return errors === 0; +} +exports.validateTimeslot = validate24; +const schema9 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'Timeslot', + 'x-location': '#/components/schemas/Timeslot', + 'x-schema-type': 'all', +}; +function validate24( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate24.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema9.required, + parentSchema: schema9, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate24.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema9.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate24.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema9.properties.Start.type, + parentSchema: schema9.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate24.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema9.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate24.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema9.properties.End.type, + parentSchema: schema9.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate24.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema9.type, + parentSchema: schema9, + data, + }, + ]; + return false; + } + } + validate24.errors = vErrors; + return errors === 0; +} +exports.validateID = validate25; +const schema10 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'ID', + 'x-location': '#/components/parameters/ID/schema', + 'x-schema-type': 'all', +}; +function validate25( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate25.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema10.type, + parentSchema: schema10, + data, + }, + ]; + return false; + } + validate25.errors = vErrors; + return errors === 0; +} +exports.validateLockBookingResponse200 = validate26; +const schema11 = { + type: 'array', + description: + 'The list of booked devices and selected real devices. Order is guaranteed to be the same as in the booking.', + items: { + type: 'object', + required: ['Requested', 'Selected'], + properties: { + Requested: { type: 'string', format: 'uri' }, + Selected: { type: 'string', format: 'uri' }, + }, + }, + 'x-standalone': false, + 'x-name': 'lockBookingResponse200', + 'x-location': + '#/paths//booking/{ID}/lock/put/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate26( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if ( + (data0.Requested === undefined && (missing0 = 'Requested')) || + (data0.Selected === undefined && (missing0 = 'Selected')) + ) { + validate26.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema11.items.required, + parentSchema: schema11.items, + data: data0, + }, + ]; + return false; + } else { + if (data0.Requested !== undefined) { + let data1 = data0.Requested; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate26.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Requested', + schemaPath: '#/items/properties/Requested/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema11.items.properties.Requested, + data: data1, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Requested', + schemaPath: '#/items/properties/Requested/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.items.properties.Requested.type, + parentSchema: schema11.items.properties.Requested, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Selected !== undefined) { + let data2 = data0.Selected; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate26.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Selected', + schemaPath: '#/items/properties/Selected/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema11.items.properties.Selected, + data: data2, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Selected', + schemaPath: '#/items/properties/Selected/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.items.properties.Selected.type, + parentSchema: schema11.items.properties.Selected, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.items.type, + parentSchema: schema11.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate26.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema11.type, + parentSchema: schema11, + data, + }, + ]; + return false; + } + } + validate26.errors = vErrors; + return errors === 0; +} +exports.validateLockBookingResponse500 = validate27; +const schema12 = { + type: 'string', + description: 'Error string', + 'x-standalone': false, + 'x-name': 'lockBookingResponse500', + 'x-location': + '#/paths//booking/{ID}/lock/put/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate27( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate27.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema12.type, + parentSchema: schema12, + data, + }, + ]; + return false; + } + validate27.errors = vErrors; + return errors === 0; +} +exports.validateUnlockBookingResponse500 = validate28; +const schema13 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'unlockBookingResponse500', + 'x-location': + '#/paths//booking/{ID}/lock/delete/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate28( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate28.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema13.type, + parentSchema: schema13, + data, + }, + ]; + return false; + } + validate28.errors = vErrors; + return errors === 0; +} +exports.validateBookingCallbackResponse500 = validate29; +const schema14 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'bookingCallbackResponse500', + 'x-location': + '#/paths//booking_callback/{ID}/post/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate29( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate29.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema14.type, + parentSchema: schema14, + data, + }, + ]; + return false; + } + validate29.errors = vErrors; + return errors === 0; +} +exports.validateBookingRequest = validate30; +const schema15 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'BookingRequest', + 'x-location': '#/components/schemas/Booking_request', + 'x-schema-type': 'request', +}; +function validate30( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate30.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema15.required, + parentSchema: schema15, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate30.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema15.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.properties.ID.type, + parentSchema: schema15.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate30.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema15.properties.Time.required, + parentSchema: schema15.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate30.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema15.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.properties.Time.properties.Start.type, + parentSchema: schema15.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate30.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema15.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.properties.Time.properties.End.type, + parentSchema: schema15.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema15.properties.Time.type, + parentSchema: schema15.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate30.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema15.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.properties.Devices.items.type, + parentSchema: schema15.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema15.properties.Devices.type, + parentSchema: schema15.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate30.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.properties.Type.type, + parentSchema: schema15.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate30.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema15.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema15.properties.Type.enum, + parentSchema: schema15.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate30.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.properties.Status.type, + parentSchema: schema15.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate30.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema15.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema15.properties.Status.enum, + parentSchema: schema15.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate30.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema15.properties.You.type, + parentSchema: schema15.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate30.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema15.properties.External.type, + parentSchema: schema15.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate30.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.properties.Message.type, + parentSchema: schema15.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate30.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema15.type, + parentSchema: schema15, + data, + }, + ]; + return false; + } + } + validate30.errors = vErrors; + return errors === 0; +} +exports.validateBookingResponse = validate31; +const schema16 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'BookingResponse', + 'x-location': '#/components/schemas/Booking_response', + 'x-schema-type': 'response', +}; +function validate31( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate31.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema16.required, + parentSchema: schema16, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate31.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema16.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.ID.type, + parentSchema: schema16.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate31.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema16.properties.Time.required, + parentSchema: schema16.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate31.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema16.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Time.properties.Start.type, + parentSchema: schema16.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate31.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema16.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Time.properties.End.type, + parentSchema: schema16.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema16.properties.Time.type, + parentSchema: schema16.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate31.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema16.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Devices.items.type, + parentSchema: schema16.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema16.properties.Devices.type, + parentSchema: schema16.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate31.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Type.type, + parentSchema: schema16.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate31.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema16.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema16.properties.Type.enum, + parentSchema: schema16.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate31.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Status.type, + parentSchema: schema16.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate31.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema16.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema16.properties.Status.enum, + parentSchema: schema16.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate31.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema16.properties.You.type, + parentSchema: schema16.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate31.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema16.properties.External.type, + parentSchema: schema16.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate31.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Message.type, + parentSchema: schema16.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate31.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema16.type, + parentSchema: schema16, + data, + }, + ]; + return false; + } + } + validate31.errors = vErrors; + return errors === 0; +} +exports.validateDeviceRequest = validate32; +const schema17 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'DeviceRequest', + 'x-location': '#/components/schemas/Device_request', + 'x-schema-type': 'request', +}; +function validate32( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate32.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema17.required, + parentSchema: schema17, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate32.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema17.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.properties.ID.type, + parentSchema: schema17.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate32.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema17.type, + parentSchema: schema17, + data, + }, + ]; + return false; + } + } + validate32.errors = vErrors; + return errors === 0; +} +exports.validateDeviceResponse = validate33; +const schema18 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'DeviceResponse', + 'x-location': '#/components/schemas/Device_response', + 'x-schema-type': 'response', +}; +function validate33( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate33.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema18.required, + parentSchema: schema18, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate33.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema18.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate33.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.properties.ID.type, + parentSchema: schema18.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate33.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema18.type, + parentSchema: schema18, + data, + }, + ]; + return false; + } + } + validate33.errors = vErrors; + return errors === 0; +} +exports.validateExperimentRequest = validate34; +const schema19 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'ExperimentRequest', + 'x-location': '#/components/schemas/Experiment_request', + 'x-schema-type': 'request', +}; +function validate34( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate34.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema19.required, + parentSchema: schema19, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate34.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema19.properties.Devices.items.required, + parentSchema: schema19.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate34.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema19.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema19.properties.Devices.items.properties.ID.type, + parentSchema: + schema19.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema19.properties.Devices.items.type, + parentSchema: schema19.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema19.properties.Devices.type, + parentSchema: schema19.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate34.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema19.properties.Description.type, + parentSchema: schema19.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate34.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema19.type, + parentSchema: schema19, + data, + }, + ]; + return false; + } + } + validate34.errors = vErrors; + return errors === 0; +} +exports.validateExperimentResponse = validate35; +const schema20 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'ExperimentResponse', + 'x-location': '#/components/schemas/Experiment_response', + 'x-schema-type': 'response', +}; +function validate35( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate35.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema20.required, + parentSchema: schema20, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate35.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema20.properties.Devices.items.required, + parentSchema: schema20.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate35.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema20.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate35.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema20.properties.Devices.items.properties.ID.type, + parentSchema: + schema20.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate35.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema20.properties.Devices.items.type, + parentSchema: schema20.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate35.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema20.properties.Devices.type, + parentSchema: schema20.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate35.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema20.properties.Description.type, + parentSchema: schema20.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate35.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema20.type, + parentSchema: schema20, + data, + }, + ]; + return false; + } + } + validate35.errors = vErrors; + return errors === 0; +} +exports.validateTimeslotRequest = validate36; +const schema21 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'TimeslotRequest', + 'x-location': '#/components/schemas/Timeslot_request', + 'x-schema-type': 'request', +}; +function validate36( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate36.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema21.required, + parentSchema: schema21, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate36.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema21.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate36.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema21.properties.Start.type, + parentSchema: schema21.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate36.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema21.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate36.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema21.properties.End.type, + parentSchema: schema21.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate36.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema21.type, + parentSchema: schema21, + data, + }, + ]; + return false; + } + } + validate36.errors = vErrors; + return errors === 0; +} +exports.validateTimeslotResponse = validate37; +const schema22 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'TimeslotResponse', + 'x-location': '#/components/schemas/Timeslot_response', + 'x-schema-type': 'response', +}; +function validate37( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate37.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema22.required, + parentSchema: schema22, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate37.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema22.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.Start.type, + parentSchema: schema22.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate37.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema22.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.End.type, + parentSchema: schema22.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate37.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema22.type, + parentSchema: schema22, + data, + }, + ]; + return false; + } + } + validate37.errors = vErrors; + return errors === 0; +} +exports.validateIDRequest = validate38; +const schema23 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'IDRequest', + 'x-location': '#/components/parameters/ID/schema_request', + 'x-schema-type': 'request', +}; +function validate38( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate38.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.type, + parentSchema: schema23, + data, + }, + ]; + return false; + } + validate38.errors = vErrors; + return errors === 0; +} +exports.validateIDResponse = validate39; +const schema24 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'IDResponse', + 'x-location': '#/components/parameters/ID/schema_response', + 'x-schema-type': 'response', +}; +function validate39( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate39.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema24.type, + parentSchema: schema24, + data, + }, + ]; + return false; + } + validate39.errors = vErrors; + return errors === 0; +} +exports.validateLockBookingResponse200Request = validate40; +const schema25 = { + type: 'array', + description: + 'The list of booked devices and selected real devices. Order is guaranteed to be the same as in the booking.', + items: { + type: 'object', + required: ['Requested', 'Selected'], + properties: { + Requested: { type: 'string', format: 'uri' }, + Selected: { type: 'string', format: 'uri' }, + }, + }, + 'x-standalone': false, + 'x-name': 'lockBookingResponse200Request', + 'x-location': + '#/paths//booking/{ID}/lock/put/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate40( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if ( + (data0.Requested === undefined && (missing0 = 'Requested')) || + (data0.Selected === undefined && (missing0 = 'Selected')) + ) { + validate40.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema25.items.required, + parentSchema: schema25.items, + data: data0, + }, + ]; + return false; + } else { + if (data0.Requested !== undefined) { + let data1 = data0.Requested; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate40.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Requested', + schemaPath: '#/items/properties/Requested/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema25.items.properties.Requested, + data: data1, + }, + ]; + return false; + } + } else { + validate40.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Requested', + schemaPath: '#/items/properties/Requested/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema25.items.properties.Requested.type, + parentSchema: schema25.items.properties.Requested, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Selected !== undefined) { + let data2 = data0.Selected; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate40.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Selected', + schemaPath: '#/items/properties/Selected/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema25.items.properties.Selected, + data: data2, + }, + ]; + return false; + } + } else { + validate40.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Selected', + schemaPath: '#/items/properties/Selected/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema25.items.properties.Selected.type, + parentSchema: schema25.items.properties.Selected, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate40.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema25.items.type, + parentSchema: schema25.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate40.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema25.type, + parentSchema: schema25, + data, + }, + ]; + return false; + } + } + validate40.errors = vErrors; + return errors === 0; +} +exports.validateLockBookingResponse200Response = validate41; +const schema26 = { + type: 'array', + description: + 'The list of booked devices and selected real devices. Order is guaranteed to be the same as in the booking.', + items: { + type: 'object', + required: ['Requested', 'Selected'], + properties: { + Requested: { type: 'string', format: 'uri' }, + Selected: { type: 'string', format: 'uri' }, + }, + }, + 'x-standalone': false, + 'x-name': 'lockBookingResponse200Response', + 'x-location': + '#/paths//booking/{ID}/lock/put/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate41( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if ( + (data0.Requested === undefined && (missing0 = 'Requested')) || + (data0.Selected === undefined && (missing0 = 'Selected')) + ) { + validate41.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema26.items.required, + parentSchema: schema26.items, + data: data0, + }, + ]; + return false; + } else { + if (data0.Requested !== undefined) { + let data1 = data0.Requested; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate41.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Requested', + schemaPath: '#/items/properties/Requested/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema26.items.properties.Requested, + data: data1, + }, + ]; + return false; + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Requested', + schemaPath: '#/items/properties/Requested/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema26.items.properties.Requested.type, + parentSchema: schema26.items.properties.Requested, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Selected !== undefined) { + let data2 = data0.Selected; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate41.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Selected', + schemaPath: '#/items/properties/Selected/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema26.items.properties.Selected, + data: data2, + }, + ]; + return false; + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Selected', + schemaPath: '#/items/properties/Selected/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema26.items.properties.Selected.type, + parentSchema: schema26.items.properties.Selected, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema26.items.type, + parentSchema: schema26.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate41.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema26.type, + parentSchema: schema26, + data, + }, + ]; + return false; + } + } + validate41.errors = vErrors; + return errors === 0; +} +exports.validateLockBookingResponse500Request = validate42; +const schema27 = { + type: 'string', + description: 'Error string', + 'x-standalone': false, + 'x-name': 'lockBookingResponse500Request', + 'x-location': + '#/paths//booking/{ID}/lock/put/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate42( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate42.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.type, + parentSchema: schema27, + data, + }, + ]; + return false; + } + validate42.errors = vErrors; + return errors === 0; +} +exports.validateLockBookingResponse500Response = validate43; +const schema28 = { + type: 'string', + description: 'Error string', + 'x-standalone': false, + 'x-name': 'lockBookingResponse500Response', + 'x-location': + '#/paths//booking/{ID}/lock/put/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate43( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate43.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema28.type, + parentSchema: schema28, + data, + }, + ]; + return false; + } + validate43.errors = vErrors; + return errors === 0; +} +exports.validateUnlockBookingResponse500Request = validate44; +const schema29 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'unlockBookingResponse500Request', + 'x-location': + '#/paths//booking/{ID}/lock/delete/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate44( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate44.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema29.type, + parentSchema: schema29, + data, + }, + ]; + return false; + } + validate44.errors = vErrors; + return errors === 0; +} +exports.validateUnlockBookingResponse500Response = validate45; +const schema30 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'unlockBookingResponse500Response', + 'x-location': + '#/paths//booking/{ID}/lock/delete/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate45( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate45.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema30.type, + parentSchema: schema30, + data, + }, + ]; + return false; + } + validate45.errors = vErrors; + return errors === 0; +} +exports.validateBookingCallbackResponse500Request = validate46; +const schema31 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'bookingCallbackResponse500Request', + 'x-location': + '#/paths//booking_callback/{ID}/post/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate46( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate46.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema31.type, + parentSchema: schema31, + data, + }, + ]; + return false; + } + validate46.errors = vErrors; + return errors === 0; +} +exports.validateBookingCallbackResponse500Response = validate47; +const schema32 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'bookingCallbackResponse500Response', + 'x-location': + '#/paths//booking_callback/{ID}/post/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate47( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate47.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema32.type, + parentSchema: schema32, + data, + }, + ]; + return false; + } + validate47.errors = vErrors; + return errors === 0; +} diff --git a/services/experiment/src/clients/booking-backend/basicValidation.d.cts b/services/experiment/src/clients/booking-backend/basicValidation.d.cts new file mode 100644 index 00000000..51a62d7e --- /dev/null +++ b/services/experiment/src/clients/booking-backend/basicValidation.d.cts @@ -0,0 +1,107 @@ +export declare function validateBooking( + object: unknown, +): Booking; + +export declare function validateDevice( + object: unknown, +): Device; + +export declare function validateExperiment( + object: unknown, +): Experiment; + +export declare function validateTimeslot( + object: unknown, +): Timeslot; + +export declare function validateID( + object: unknown, +): ID; + +export declare function validateLockBookingResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): lockBookingResponse200; + +export declare function validateLockBookingResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): lockBookingResponse500; + +export declare function validateUnlockBookingResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): unlockBookingResponse500; + +export declare function validateBookingCallbackResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): bookingCallbackResponse500; + +export declare function validateBookingRequest( + object: unknown, +): BookingRequest; + +export declare function validateBookingResponse( + object: unknown, +): BookingResponse; + +export declare function validateDeviceRequest( + object: unknown, +): DeviceRequest; + +export declare function validateDeviceResponse( + object: unknown, +): DeviceResponse; + +export declare function validateExperimentRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ExperimentRequest; + +export declare function validateExperimentResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ExperimentResponse; + +export declare function validateTimeslotRequest( + object: unknown, +): TimeslotRequest; + +export declare function validateTimeslotResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): TimeslotResponse; + +export declare function validateIDRequest( + object: unknown, +): IDRequest; + +export declare function validateIDResponse( + object: unknown, +): IDResponse; + +export declare function validateLockBookingResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): lockBookingResponse200Request; + +export declare function validateLockBookingResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): lockBookingResponse200Response; + +export declare function validateLockBookingResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): lockBookingResponse500Request; + +export declare function validateLockBookingResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): lockBookingResponse500Response; + +export declare function validateUnlockBookingResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): unlockBookingResponse500Request; + +export declare function validateUnlockBookingResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): unlockBookingResponse500Response; + +export declare function validateBookingCallbackResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): bookingCallbackResponse500Request; + +export declare function validateBookingCallbackResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): bookingCallbackResponse500Response; diff --git a/services/experiment/src/clients/booking-backend/client.ts b/services/experiment/src/clients/booking-backend/client.ts new file mode 100644 index 00000000..a7d1aee1 --- /dev/null +++ b/services/experiment/src/clients/booking-backend/client.ts @@ -0,0 +1,428 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import fetch, { RequestInfo, RequestInit, Response } from 'node-fetch'; + +import * as RequestValidation from './requestValidation.js'; +import * as Signatures from './signatures.js'; +import * as Types from './types.js'; +// @ts-ignore +import { type Require } from './types.js'; + +/** + * This error class should be used if an error occurs during validation of a request/response. + * @category Errors + */ +export class ValidationError extends Error { + public errors: unknown; + + constructor(message: string, errors: unknown) { + super(message); + this.name = 'ValidationError'; + this.errors = errors; + } +} + +/** + * This error class should be used if an error occurs while fetching a request. + * @category Errors + */ +export class FetchError extends Error { + constructor(message: string) { + super(message); + this.name = 'FetchError'; + } +} + +/** + * This error class should be used if the response of the server has a status + * greater than or equal to 400. This error should contain the validated response. + * @category Errors + */ +export class UnsuccessfulRequestError extends Error { + public response: Types.ResponseData; + + constructor(message: string, response: Types.ResponseData) { + super(message); + this.response = response; + this.name = 'UnsuccessfulRequestError'; + } +} + +/** + * This error class should be used if the validation of an url fails. + * @category Errors + */ +export class InvalidUrlError extends Error { + constructor(message: string) { + super(message); + this.name = 'InvalidUrlError'; + } +} + +/** + * This function attempts to parse a Response as ResponseData. + */ +async function parseResponse(response: Response): Promise { + let text = null; + try { + text = await response.text(); + const json = JSON.parse(text); + return { status: response.status, body: json }; + } catch { + return { status: response.status, body: text }; + } +} + +/** + * This function checks if a string is a valid http url. + * @param string The string to be checked. + * @returns True if the string is a valid http url. + */ +function isValidHttpUrl(string: string) { + let url; + + try { + url = new URL(string); + } catch (_) { + return false; + } + + return url.protocol === 'http:' || url.protocol === 'https:'; +} + +/** + * This function takes an url and a pattern for the requested endpoint and parses the contained path parameters. + * @param url The url to be parsed. + * @param endpoint Pattern of the requested endpoint. + * @throws {InvalidUrlError} Thrown if the provided url does not end with the provided endpoint. + * @returns An array containing all parsed path parameters in order of appearance. + * @example + * // returns ["username", "role_name"] + * parsePathParameters("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") + */ +function parsePathParameters(url: string, endpoint: string): string[] { + const parameterRegex = '([^/]+)'; + const regex = new RegExp(endpoint.replaceAll('{}', parameterRegex) + '(?:.(?!\\\\))?$'); + const matches = url.match(regex); + + if (!matches) throw new InvalidUrlError('Url does not end with the provided endpoint'); + + return matches.slice(1); +} + +/** + * This function validates a given http url and parses its path parameters. + * @param url The url to be validated. + * @param endpoint Pattern of the requested endpoint. + * @throws {InvalidUrlError} Thrown if the validation of the provided url fails. + * @returns An array containing all parsed path parameters in order of appearance (see {@link parsePathParameters}). + * @example + * // returns ["username", "role_name"] + * validateUrl("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") + */ +function validateUrl(url: string, endpoint: string): string[] { + if (!isValidHttpUrl(url)) + throw new InvalidUrlError('Provided url is not a valid http url'); + return parsePathParameters(url, endpoint); +} + +/** + * This function appends a given endpoint to an url. + * @param url The url to append the endpoint to. + * @param endpoint The endpoint to be appended. + * @example + * // returns "https://api.example.com/devices/device_id/token" + * appendToUrl("https://api.example.com/devices/device_id", "/token") + * @example + * // returns "https://api.example.com/devices/device_id/token" + * appendToUrl("https://api.example.com/devices/device_id/", "/token") + * @returns The url with the appended endpoint. + */ +function appendToUrl(url: string, endpoint: string) { + return url.endsWith('/') ? `${url.slice(0, -1)}${endpoint}` : `${url}${endpoint}`; +} + +/** + * Client for the use of the Crosslab API + * @category Client + */ +export class Client { + public readonly baseUrl: string; + public readonly serviceUrl: string; + public accessToken: string; + private fixedHeaders: [string, string][]; + private fetch = async (url: RequestInfo | URL, init: RequestInit) => { + let raw_response; + const parsedUrl = new URL(url.toString()); + try { + if ( + parsedUrl.toString().startsWith(this.baseUrl) || + parsedUrl.toString().startsWith(this.serviceUrl) + ) { + raw_response = await fetch(url, init); + } else { + raw_response = await fetch( + appendToUrl( + this.baseUrl, + '/proxy?' + new URLSearchParams([['URL', url.toString()]]).toString(), + ), + init, + ); + } + } catch (error) { + if (error instanceof Error) { + throw new FetchError(error.message); + } else if (typeof error === 'string') { + throw new FetchError(error); + } else { + throw new FetchError('Something went wrong while trying to fetch the request'); + } + } + return await parseResponse(raw_response); + }; + + /** + * @category Constructors + */ + constructor( + baseUrl: string, + options: { + serviceUrl?: string; + accessToken?: string; + fixedHeaders?: [string, string][]; + }, + ) { + this.baseUrl = new URL(baseUrl).toString().slice(0, -1); + this.serviceUrl = new URL(options.serviceUrl ?? this.baseUrl).toString().slice(0, -1); + this.accessToken = options.accessToken ?? ''; + this.fixedHeaders = options.fixedHeaders ?? []; + } + + /** + * Locks the current booking so the devices can be used. This sets the status to "active" This means that the booking can not be cancelled or (currently not implemented) the end time can not be set to a prior time. If called multiple times, the booking will be locked only once. + * + * @param url + * Url of the resource to be accessed. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * All devices were booked by user. + */ + public async lockBooking( + url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/booking/{}/lock'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [ID] = validateUrl(new URL(url).toString(), '/booking/{}/lock'); + console.log('trying to fetch url:', url); + + const parameters = { + ID: ID, + }; + + if (!RequestValidation.validateLockBookingInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateLockBookingInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'PUT', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateLockBookingOutput(response)) + throw new ValidationError( + 'Response validation failed!', + (RequestValidation.validateLockBookingOutput as Types.FunctionWithErrors).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * Unlocks all devices belonging to a booking, status will be set to 'booked'. + * + * @param url + * Url of the resource to be accessed. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * Unlocking was successful. + */ + public async unlockBooking( + url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/booking/{}/lock'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [ID] = validateUrl(new URL(url).toString(), '/booking/{}/lock'); + console.log('trying to fetch url:', url); + + const parameters = { + ID: ID, + }; + + if (!RequestValidation.validateUnlockBookingInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateUnlockBookingInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'DELETE', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateUnlockBookingOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateUnlockBookingOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + } + + /** + * Callback used for updating device info / booking info. + * + * @param url + * Url of the resource to be accessed. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * Update was processed. + */ + public async bookingCallback( + url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/booking_callback/{}'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [ID] = validateUrl(new URL(url).toString(), '/booking_callback/{}'); + console.log('trying to fetch url:', url); + + const parameters = { + ID: ID, + }; + + if (!RequestValidation.validateBookingCallbackInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + ( + RequestValidation.validateBookingCallbackInput as Types.FunctionWithErrors + ).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateBookingCallbackOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateBookingCallbackOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + } +} diff --git a/services/experiment/src/clients/booking-backend/requestValidation.ts b/services/experiment/src/clients/booking-backend/requestValidation.ts new file mode 100644 index 00000000..b5921790 --- /dev/null +++ b/services/experiment/src/clients/booking-backend/requestValidation.ts @@ -0,0 +1,208 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +import * as BasicValidation from './basicValidation.cjs'; +import * as Signatures from './signatures.js'; +import { FunctionWithErrors, ResponseData } from './types.js'; + +/** + * This function validates the inputs to lockBooking() + */ +export function validateLockBookingInput(parameters: Signatures.LockBookingParameters) { + if (parameters) { + if (!BasicValidation.validateIDRequest(parameters['ID'])) { + (validateLockBookingInput as FunctionWithErrors).errors = ( + BasicValidation.validateIDRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of lockBooking() + */ +export function validateLockBookingOutput( + response: ResponseData, +): response is Signatures.LockBookingResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if (!BasicValidation.validateLockBookingResponse200Response(response.body)) { + (validateLockBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateLockBookingResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 412) { + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateLockBookingResponse500Response(response.body)) { + (validateLockBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateLockBookingResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateLockBookingOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to unlockBooking() + */ +export function validateUnlockBookingInput( + parameters: Signatures.UnlockBookingParameters, +) { + if (parameters) { + if (!BasicValidation.validateIDRequest(parameters['ID'])) { + (validateUnlockBookingInput as FunctionWithErrors).errors = ( + BasicValidation.validateIDRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of unlockBooking() + */ +export function validateUnlockBookingOutput( + response: ResponseData, +): response is Signatures.UnlockBookingResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 412) { + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateUnlockBookingResponse500Response(response.body)) { + (validateUnlockBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateUnlockBookingResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateUnlockBookingOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to bookingCallback() + */ +export function validateBookingCallbackInput( + parameters: Signatures.BookingCallbackParameters, +) { + if (parameters) { + if (!BasicValidation.validateIDRequest(parameters['ID'])) { + (validateBookingCallbackInput as FunctionWithErrors).errors = ( + BasicValidation.validateIDRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of bookingCallback() + */ +export function validateBookingCallbackOutput( + response: ResponseData, +): response is Signatures.BookingCallbackResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateBookingCallbackResponse500Response(response.body)) { + (validateBookingCallbackOutput as FunctionWithErrors).errors = ( + BasicValidation.validateBookingCallbackResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateBookingCallbackOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} diff --git a/services/experiment/src/clients/booking-backend/signatures.ts b/services/experiment/src/clients/booking-backend/signatures.ts new file mode 100644 index 00000000..3569d504 --- /dev/null +++ b/services/experiment/src/clients/booking-backend/signatures.ts @@ -0,0 +1,329 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import * as Types from './types.js'; +// @ts-ignore +import { type Require } from './types.js'; + +/** + * Typing for the parameters of the request made by lockBooking() + * @category lockBooking() + */ +export type LockBookingParameters = { + ID: string; +}; + +/** + * Typing for all possible responses to the request made by lockBooking() + * @category lockBooking() + */ +export type LockBookingResponse = LockBookingSuccessResponse | LockBookingErrorResponse; + +/** + * Typing for all successful responses to the request made by lockBooking() + * @category lockBooking() + */ +export type LockBookingSuccessResponse = LockBookingResponse200; + +/** + * Typing for all error responses to the request made by lockBooking() + * @category lockBooking() + */ +export type LockBookingErrorResponse = + | LockBookingResponse401 + | LockBookingResponse403 + | LockBookingResponse404 + | LockBookingResponse412 + | LockBookingResponse500 + | LockBookingResponse503; + +/** + * Typing for a response with status 200 to the request made by lockBooking() + * @category lockBooking() + */ +export interface LockBookingResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: { + Requested: string; + Selected: string; + [k: string]: unknown; + }[]; +} + +/** + * Typing for a response with status 401 to the request made by lockBooking() + * @category lockBooking() + */ +export interface LockBookingResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by lockBooking() + * @category lockBooking() + */ +export interface LockBookingResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by lockBooking() + * @category lockBooking() + */ +export interface LockBookingResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 412 to the request made by lockBooking() + * @category lockBooking() + */ +export interface LockBookingResponse412 extends Types.ErrorResponse { + status: 412; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by lockBooking() + * @category lockBooking() + */ +export interface LockBookingResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by lockBooking() + * @category lockBooking() + */ +export interface LockBookingResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by unlockBooking() + * @category unlockBooking() + */ +export type UnlockBookingParameters = { + ID: string; +}; + +/** + * Typing for all possible responses to the request made by unlockBooking() + * @category unlockBooking() + */ +export type UnlockBookingResponse = + | UnlockBookingSuccessResponse + | UnlockBookingErrorResponse; + +/** + * Typing for all successful responses to the request made by unlockBooking() + * @category unlockBooking() + */ +export type UnlockBookingSuccessResponse = UnlockBookingResponse200; + +/** + * Typing for all error responses to the request made by unlockBooking() + * @category unlockBooking() + */ +export type UnlockBookingErrorResponse = + | UnlockBookingResponse401 + | UnlockBookingResponse403 + | UnlockBookingResponse404 + | UnlockBookingResponse412 + | UnlockBookingResponse500 + | UnlockBookingResponse503; + +/** + * Typing for a response with status 200 to the request made by unlockBooking() + * @category unlockBooking() + */ +export interface UnlockBookingResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by unlockBooking() + * @category unlockBooking() + */ +export interface UnlockBookingResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by unlockBooking() + * @category unlockBooking() + */ +export interface UnlockBookingResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by unlockBooking() + * @category unlockBooking() + */ +export interface UnlockBookingResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 412 to the request made by unlockBooking() + * @category unlockBooking() + */ +export interface UnlockBookingResponse412 extends Types.ErrorResponse { + status: 412; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by unlockBooking() + * @category unlockBooking() + */ +export interface UnlockBookingResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by unlockBooking() + * @category unlockBooking() + */ +export interface UnlockBookingResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by bookingCallback() + * @category bookingCallback() + */ +export type BookingCallbackParameters = { + ID: string; +}; + +/** + * Typing for all possible responses to the request made by bookingCallback() + * @category bookingCallback() + */ +export type BookingCallbackResponse = + | BookingCallbackSuccessResponse + | BookingCallbackErrorResponse; + +/** + * Typing for all successful responses to the request made by bookingCallback() + * @category bookingCallback() + */ +export type BookingCallbackSuccessResponse = BookingCallbackResponse200; + +/** + * Typing for all error responses to the request made by bookingCallback() + * @category bookingCallback() + */ +export type BookingCallbackErrorResponse = + | BookingCallbackResponse404 + | BookingCallbackResponse500 + | BookingCallbackResponse503; + +/** + * Typing for a response with status 200 to the request made by bookingCallback() + * @category bookingCallback() + */ +export interface BookingCallbackResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by bookingCallback() + * @category bookingCallback() + */ +export interface BookingCallbackResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by bookingCallback() + * @category bookingCallback() + */ +export interface BookingCallbackResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by bookingCallback() + * @category bookingCallback() + */ +export interface BookingCallbackResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} diff --git a/services/experiment/src/clients/booking-backend/types.ts b/services/experiment/src/clients/booking-backend/types.ts new file mode 100644 index 00000000..8d0b0be8 --- /dev/null +++ b/services/experiment/src/clients/booking-backend/types.ts @@ -0,0 +1,410 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +import * as _BasicValidation from './basicValidation.cjs'; + +/** + * @internal + */ +export interface FunctionWithErrors { + (...args: unknown[]): unknown; + errors?: unknown; +} + +/** + * @internal + */ +export interface RequestInfo { + method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'TRACE' | 'OPTIONS' | 'PATCH' | 'HEAD'; + body?: string; + headers?: [string, string][]; +} + +/** + * @internal + */ +export type FetchFunction = ( + url: string, + info?: RequestInfo, +) => Promise | ResponseData; + +export interface ResponseData { + status: number; + headers?: { + [key: string]: string | undefined; + }; + body?: unknown; +} + +export interface SuccessResponse extends ResponseData { + success?: true; +} + +export interface ErrorResponse extends ResponseData { + success?: false; +} + +/** + * @internal + */ +export function isSuccessResponse(response: ResponseData): response is SuccessResponse { + return response.status < 400; +} + +/** + * @internal + */ +export function isErrorResponse(response: ResponseData): response is ErrorResponse { + return response.status >= 400; +} + +/** + * This type allows to pick the required properties of another type. + */ +export type Require = Partial & { + [Property in Key]-?: Type[Property]; +}; + +export type SizedTuple< + T, + MIN extends number | undefined = undefined, + MAX extends number | undefined = undefined, +> = MIN extends number + ? MAX extends number + ? _SizedTuple> + : TupleObject> & T[] + : MAX extends number + ? _SizedTuple, true> + : T[]; + +type _SizedTuple = ARR extends [ + infer HEAD extends number, + ...infer TAIL extends number[], +] + ? Tuple | _SizedTuple + : never; + +type Tuple = _Tuple< + T, + NumericRangeTuple +>; + +type _Tuple = N extends [ + infer HEAD, + ...infer TAIL extends number[], +] + ? HEAD extends 0 + ? [] | _Tuple + : [T, ..._Tuple] + : []; + +type TupleObject = N extends [ + infer HEAD extends number, + ...infer TAIL extends number[], +] + ? TAIL extends [] + ? Record + : { [P in HEAD]: T } & TupleObject + : Record; + +export type NumericRange< + START extends number, + END extends number, + ARR extends unknown[] = [], + ACC extends number = never, +> = ARR['length'] extends END + ? ACC | START | END + : NumericRange< + START, + END, + [...ARR, 1], + ARR[START] extends undefined ? ACC : ACC | ARR['length'] + >; + +type NumericRangeTuple< + START extends number, + END extends number, + ARR extends unknown[] = [], + ACC extends number[] = [], +> = ARR['length'] extends END + ? [START, ...ACC, END] + : NumericRangeTuple< + START, + END, + [...ARR, 1], + ARR[START] extends undefined ? ACC : [...ACC, ARR['length']] + >; + +/** + * A booking in the booking system. + */ +export type Booking = T extends 'all' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : never; + +/** + * A device might either be a physical/virtual device or a group of device. + */ +export type Device = T extends 'all' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : never; + +/** + * An experiment describes a set of devices and how they should be connected (potentially among other metadata). + */ +export type Experiment = T extends 'all' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device<'request'>[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device<'response'>[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : never; + +/** + * A time slot represents a slice of time used for bookings. + */ +export type Timeslot = T extends 'all' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : never; diff --git a/services/experiment/src/clients/booking-frontend/basicValidation.cjs b/services/experiment/src/clients/booking-frontend/basicValidation.cjs new file mode 100644 index 00000000..25c648d5 --- /dev/null +++ b/services/experiment/src/clients/booking-frontend/basicValidation.cjs @@ -0,0 +1,8434 @@ +/* eslint-disable */ +//@ts-nocheck +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +'use strict'; +exports.validateBooking = validate21; +const schema6 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'Booking', + 'x-location': '#/components/schemas/Booking', + 'x-schema-type': 'all', +}; +const formats0 = require('ajv-formats/dist/formats').fullFormats.uri; +const formats2 = require('ajv-formats/dist/formats').fullFormats['date-time']; +function validate21( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate21.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema6.required, + parentSchema: schema6, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate21.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema6.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.ID.type, + parentSchema: schema6.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate21.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema6.properties.Time.required, + parentSchema: schema6.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate21.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema6.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Time.properties.Start.type, + parentSchema: schema6.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate21.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema6.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Time.properties.End.type, + parentSchema: schema6.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema6.properties.Time.type, + parentSchema: schema6.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate21.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema6.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Devices.items.type, + parentSchema: schema6.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema6.properties.Devices.type, + parentSchema: schema6.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Type.type, + parentSchema: schema6.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate21.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema6.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema6.properties.Type.enum, + parentSchema: schema6.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Status.type, + parentSchema: schema6.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate21.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema6.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema6.properties.Status.enum, + parentSchema: schema6.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate21.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema6.properties.You.type, + parentSchema: schema6.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate21.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema6.properties.External.type, + parentSchema: schema6.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Message.type, + parentSchema: schema6.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate21.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema6.type, + parentSchema: schema6, + data, + }, + ]; + return false; + } + } + validate21.errors = vErrors; + return errors === 0; +} +exports.validateDevice = validate22; +const schema7 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'Device', + 'x-location': '#/components/schemas/Device', + 'x-schema-type': 'all', +}; +function validate22( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate22.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema7.required, + parentSchema: schema7, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate22.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema7.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate22.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema7.properties.ID.type, + parentSchema: schema7.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate22.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema7.type, + parentSchema: schema7, + data, + }, + ]; + return false; + } + } + validate22.errors = vErrors; + return errors === 0; +} +exports.validateExperiment = validate23; +const schema8 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'Experiment', + 'x-location': '#/components/schemas/Experiment', + 'x-schema-type': 'all', +}; +function validate23( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate23.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema8.required, + parentSchema: schema8, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema8.properties.Devices.items.required, + parentSchema: schema8.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema8.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema8.properties.Devices.items.properties.ID.type, + parentSchema: + schema8.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema8.properties.Devices.items.type, + parentSchema: schema8.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema8.properties.Devices.type, + parentSchema: schema8.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate23.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema8.properties.Description.type, + parentSchema: schema8.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate23.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema8.type, + parentSchema: schema8, + data, + }, + ]; + return false; + } + } + validate23.errors = vErrors; + return errors === 0; +} +exports.validateTimeslot = validate24; +const schema9 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'Timeslot', + 'x-location': '#/components/schemas/Timeslot', + 'x-schema-type': 'all', +}; +function validate24( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate24.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema9.required, + parentSchema: schema9, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate24.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema9.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate24.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema9.properties.Start.type, + parentSchema: schema9.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate24.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema9.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate24.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema9.properties.End.type, + parentSchema: schema9.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate24.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema9.type, + parentSchema: schema9, + data, + }, + ]; + return false; + } + } + validate24.errors = vErrors; + return errors === 0; +} +exports.validateID = validate25; +const schema10 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'ID', + 'x-location': '#/components/parameters/ID/schema', + 'x-schema-type': 'all', +}; +function validate25( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate25.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema10.type, + parentSchema: schema10, + data, + }, + ]; + return false; + } + validate25.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingBody = validate26; +const schema11 = { + type: 'object', + required: ['Devices', 'Time'], + properties: { + Devices: { + type: 'array', + description: 'List of devices which should be added.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + }, + 'x-standalone': false, + 'x-name': 'newBookingBody', + 'x-location': '#/paths//booking/post/requestBody/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate26( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Time === undefined && (missing0 = 'Time')) + ) { + validate26.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema11.required, + parentSchema: schema11, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate26.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema11.properties.Devices.items.required, + parentSchema: schema11.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate26.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema11.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema11.properties.Devices.items.properties.ID.type, + parentSchema: + schema11.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.properties.Devices.items.type, + parentSchema: schema11.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema11.properties.Devices.type, + parentSchema: schema11.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data3 = data.Time; + const _errs7 = errors; + if (errors === _errs7) { + if (data3 && typeof data3 == 'object' && !Array.isArray(data3)) { + let missing2; + if ( + (data3.Start === undefined && (missing2 = 'Start')) || + (data3.End === undefined && (missing2 = 'End')) + ) { + validate26.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema11.properties.Time.required, + parentSchema: schema11.properties.Time, + data: data3, + }, + ]; + return false; + } else { + if (data3.Start !== undefined) { + let data4 = data3.Start; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate26.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema11.properties.Time.properties.Start, + data: data4, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.properties.Time.properties.Start.type, + parentSchema: schema11.properties.Time.properties.Start, + data: data4, + }, + ]; + return false; + } + } + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.End !== undefined) { + let data5 = data3.End; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats2.validate(data5)) { + validate26.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema11.properties.Time.properties.End, + data: data5, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.properties.Time.properties.End.type, + parentSchema: schema11.properties.Time.properties.End, + data: data5, + }, + ]; + return false; + } + } + } + var valid3 = _errs11 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.properties.Time.type, + parentSchema: schema11.properties.Time, + data: data3, + }, + ]; + return false; + } + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate26.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.properties.Type.type, + parentSchema: schema11.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate26.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema11.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema11.properties.Type.enum, + parentSchema: schema11.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + } + } + } + } else { + validate26.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.type, + parentSchema: schema11, + data, + }, + ]; + return false; + } + } + validate26.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingResponse200 = validate27; +const schema12 = { + type: 'object', + required: ['BookingID'], + properties: { + BookingID: { + type: 'string', + format: 'uri', + description: 'ID at which the booking can be managed.', + }, + }, + 'x-standalone': false, + 'x-name': 'newBookingResponse200', + 'x-location': '#/paths//booking/post/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate27( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.BookingID === undefined && (missing0 = 'BookingID')) { + validate27.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema12.required, + parentSchema: schema12, + data, + }, + ]; + return false; + } else { + if (data.BookingID !== undefined) { + let data0 = data.BookingID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate27.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema12.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } else { + validate27.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema12.properties.BookingID.type, + parentSchema: schema12.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate27.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema12.type, + parentSchema: schema12, + data, + }, + ]; + return false; + } + } + validate27.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingResponse500 = validate28; +const schema13 = { + description: 'Error description', + type: 'string', + 'x-standalone': false, + 'x-name': 'newBookingResponse500', + 'x-location': '#/paths//booking/post/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate28( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate28.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema13.type, + parentSchema: schema13, + data, + }, + ]; + return false; + } + validate28.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingBody = validate29; +const schema14 = { + anyOf: [ + { + type: 'object', + description: 'Use this request for adding devices.', + properties: { + Locked: { + type: 'boolean', + description: + 'Expresses whether the devices should be locked. Must match current status of booking. Is assumed to be false if not set.', + }, + Devices: { + type: 'array', + description: 'List of devices which should be added.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + }, + }, + { + type: 'object', + description: 'Use this request for adding callbacks.', + properties: { + Callback: { + type: 'string', + format: 'uri', + description: 'Callback which should be called at changes.', + }, + }, + }, + ], + 'x-standalone': false, + 'x-name': 'updateBookingBody', + 'x-location': '#/paths//booking/{ID}/patch/requestBody/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate29( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.Locked !== undefined) { + let data0 = data.Locked; + const _errs3 = errors; + if (typeof data0 !== 'boolean') { + const err0 = { + instancePath: instancePath + '/Locked', + schemaPath: '#/anyOf/0/properties/Locked/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema14.anyOf[0].properties.Locked.type, + parentSchema: schema14.anyOf[0].properties.Locked, + data: data0, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.Devices !== undefined) { + let data1 = data.Devices; + const _errs5 = errors; + if (errors === _errs5) { + if (Array.isArray(data1)) { + var valid2 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs7 = errors; + if (errors === _errs7) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing0; + if (data2.ID === undefined && (missing0 = 'ID')) { + const err1 = { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/anyOf/0/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema14.anyOf[0].properties.Devices.items.required, + parentSchema: schema14.anyOf[0].properties.Devices.items, + data: data2, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } else { + if (data2.ID !== undefined) { + let data3 = data2.ID; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + const err2 = { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/anyOf/0/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema14.anyOf[0].properties.Devices.items.properties + .ID, + data: data3, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } else { + const err3 = { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/anyOf/0/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema14.anyOf[0].properties.Devices.items.properties.ID + .type, + parentSchema: + schema14.anyOf[0].properties.Devices.items.properties + .ID, + data: data3, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + } + } + } + } + } else { + const err4 = { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/anyOf/0/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema14.anyOf[0].properties.Devices.items.type, + parentSchema: schema14.anyOf[0].properties.Devices.items, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + } + var valid2 = _errs7 === errors; + if (!valid2) { + break; + } + } + } else { + const err5 = { + instancePath: instancePath + '/Devices', + schemaPath: '#/anyOf/0/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema14.anyOf[0].properties.Devices.type, + parentSchema: schema14.anyOf[0].properties.Devices, + data: data1, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + const err6 = { + instancePath, + schemaPath: '#/anyOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema14.anyOf[0].type, + parentSchema: schema14.anyOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.Callback !== undefined) { + let data4 = data.Callback; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data4 === 'string') { + if (!formats0(data4)) { + const err7 = { + instancePath: instancePath + '/Callback', + schemaPath: '#/anyOf/1/properties/Callback/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema14.anyOf[1].properties.Callback, + data: data4, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: instancePath + '/Callback', + schemaPath: '#/anyOf/1/properties/Callback/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema14.anyOf[1].properties.Callback.type, + parentSchema: schema14.anyOf[1].properties.Callback, + data: data4, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } else { + const err9 = { + instancePath, + schemaPath: '#/anyOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema14.anyOf[1].type, + parentSchema: schema14.anyOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var _valid0 = _errs11 === errors; + valid0 = valid0 || _valid0; + } + if (!valid0) { + const err10 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema14.anyOf, + parentSchema: schema14, + data, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + validate29.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate29.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse200 = validate30; +const schema15 = { + type: 'object', + required: ['BookingID'], + properties: { BookingID: { type: 'string', format: 'uri' } }, + 'x-standalone': false, + 'x-name': 'updateBookingResponse200', + 'x-location': + '#/paths//booking/{ID}/patch/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate30( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.BookingID === undefined && (missing0 = 'BookingID')) { + validate30.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema15.required, + parentSchema: schema15, + data, + }, + ]; + return false; + } else { + if (data.BookingID !== undefined) { + let data0 = data.BookingID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate30.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema15.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } else { + validate30.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.properties.BookingID.type, + parentSchema: schema15.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate30.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema15.type, + parentSchema: schema15, + data, + }, + ]; + return false; + } + } + validate30.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse400 = validate31; +const schema16 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'updateBookingResponse400', + 'x-location': + '#/paths//booking/{ID}/patch/responses/400/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate31( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate31.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.type, + parentSchema: schema16, + data, + }, + ]; + return false; + } + validate31.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse500 = validate32; +const schema17 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'updateBookingResponse500', + 'x-location': + '#/paths//booking/{ID}/patch/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate32( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate32.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.type, + parentSchema: schema17, + data, + }, + ]; + return false; + } + validate32.errors = vErrors; + return errors === 0; +} +exports.validateDeleteBookingResponse500 = validate33; +const schema18 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'deleteBookingResponse500', + 'x-location': + '#/paths//booking/{ID}/delete/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate33( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate33.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.type, + parentSchema: schema18, + data, + }, + ]; + return false; + } + validate33.errors = vErrors; + return errors === 0; +} +exports.validateGetBookingResponse200 = validate34; +const schema19 = { + type: 'object', + required: ['Booking', 'Locked'], + properties: { + Booking: { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + }, + Locked: { + type: 'boolean', + description: 'Shows if the booking is in a locked status.', + }, + }, + 'x-standalone': false, + 'x-name': 'getBookingResponse200', + 'x-location': '#/paths//booking/{ID}/get/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate34( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Booking === undefined && (missing0 = 'Booking')) || + (data.Locked === undefined && (missing0 = 'Locked')) + ) { + validate34.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema19.required, + parentSchema: schema19, + data, + }, + ]; + return false; + } else { + if (data.Booking !== undefined) { + let data0 = data.Booking; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if ( + (data0.ID === undefined && (missing1 = 'ID')) || + (data0.Time === undefined && (missing1 = 'Time')) || + (data0.Devices === undefined && (missing1 = 'Devices')) || + (data0.Status === undefined && (missing1 = 'Status')) || + (data0.You === undefined && (missing1 = 'You')) || + (data0.External === undefined && (missing1 = 'External')) + ) { + validate34.errors = [ + { + instancePath: instancePath + '/Booking', + schemaPath: '#/properties/Booking/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema19.properties.Booking.required, + parentSchema: schema19.properties.Booking, + data: data0, + }, + ]; + return false; + } else { + if (data0.ID !== undefined) { + let data1 = data0.ID; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/ID', + schemaPath: '#/properties/Booking/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema19.properties.Booking.properties.ID, + data: data1, + }, + ]; + return false; + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/ID', + schemaPath: '#/properties/Booking/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema19.properties.Booking.properties.ID.type, + parentSchema: schema19.properties.Booking.properties.ID, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Time !== undefined) { + let data2 = data0.Time; + const _errs5 = errors; + if (errors === _errs5) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing2; + if ( + (data2.Start === undefined && (missing2 = 'Start')) || + (data2.End === undefined && (missing2 = 'End')) + ) { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Time', + schemaPath: '#/properties/Booking/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema19.properties.Booking.properties.Time.required, + parentSchema: schema19.properties.Booking.properties.Time, + data: data2, + }, + ]; + return false; + } else { + if (data2.Start !== undefined) { + let data3 = data2.Start; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate34.errors = [ + { + instancePath: + instancePath + '/Booking/Time/Start', + schemaPath: + '#/properties/Booking/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema19.properties.Booking.properties.Time + .properties.Start, + data: data3, + }, + ]; + return false; + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Time/Start', + schemaPath: + '#/properties/Booking/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema19.properties.Booking.properties.Time + .properties.Start.type, + parentSchema: + schema19.properties.Booking.properties.Time + .properties.Start, + data: data3, + }, + ]; + return false; + } + } + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data2.End !== undefined) { + let data4 = data2.End; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate34.errors = [ + { + instancePath: + instancePath + '/Booking/Time/End', + schemaPath: + '#/properties/Booking/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema19.properties.Booking.properties.Time + .properties.End, + data: data4, + }, + ]; + return false; + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Time/End', + schemaPath: + '#/properties/Booking/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema19.properties.Booking.properties.Time + .properties.End.type, + parentSchema: + schema19.properties.Booking.properties.Time + .properties.End, + data: data4, + }, + ]; + return false; + } + } + } + var valid2 = _errs9 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Time', + schemaPath: '#/properties/Booking/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema19.properties.Booking.properties.Time.type, + parentSchema: schema19.properties.Booking.properties.Time, + data: data2, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Devices !== undefined) { + let data5 = data0.Devices; + const _errs11 = errors; + if (errors === _errs11) { + if (Array.isArray(data5)) { + var valid3 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate34.errors = [ + { + instancePath: + instancePath + '/Booking/Devices/' + i0, + schemaPath: + '#/properties/Booking/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema19.properties.Booking.properties.Devices + .items, + data: data6, + }, + ]; + return false; + } + } else { + validate34.errors = [ + { + instancePath: + instancePath + '/Booking/Devices/' + i0, + schemaPath: + '#/properties/Booking/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema19.properties.Booking.properties.Devices + .items.type, + parentSchema: + schema19.properties.Booking.properties.Devices + .items, + data: data6, + }, + ]; + return false; + } + } + } + var valid3 = _errs13 === errors; + if (!valid3) { + break; + } + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Devices', + schemaPath: '#/properties/Booking/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema19.properties.Booking.properties.Devices.type, + parentSchema: + schema19.properties.Booking.properties.Devices, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs11 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Type !== undefined) { + let data7 = data0.Type; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Type', + schemaPath: '#/properties/Booking/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema19.properties.Booking.properties.Type.type, + parentSchema: schema19.properties.Booking.properties.Type, + data: data7, + }, + ]; + return false; + } + if (!(data7 === 'normal')) { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Type', + schemaPath: '#/properties/Booking/properties/Type/enum', + keyword: 'enum', + params: { + allowedValues: + schema19.properties.Booking.properties.Type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema19.properties.Booking.properties.Type.enum, + parentSchema: schema19.properties.Booking.properties.Type, + data: data7, + }, + ]; + return false; + } + var valid1 = _errs15 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Status !== undefined) { + let data8 = data0.Status; + const _errs17 = errors; + if (typeof data8 !== 'string') { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Status', + schemaPath: '#/properties/Booking/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema19.properties.Booking.properties.Status.type, + parentSchema: + schema19.properties.Booking.properties.Status, + data: data8, + }, + ]; + return false; + } + if ( + !( + data8 === 'pending' || + data8 === 'booked' || + data8 === 'rejected' || + data8 === 'cancelled' || + data8 === 'active' || + data8 === 'active-pending' || + data8 === 'active-rejected' + ) + ) { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Status', + schemaPath: '#/properties/Booking/properties/Status/enum', + keyword: 'enum', + params: { + allowedValues: + schema19.properties.Booking.properties.Status.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema19.properties.Booking.properties.Status.enum, + parentSchema: + schema19.properties.Booking.properties.Status, + data: data8, + }, + ]; + return false; + } + var valid1 = _errs17 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.You !== undefined) { + let data9 = data0.You; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/You', + schemaPath: '#/properties/Booking/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema19.properties.Booking.properties.You.type, + parentSchema: + schema19.properties.Booking.properties.You, + data: data9, + }, + ]; + return false; + } + var valid1 = _errs19 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.External !== undefined) { + let data10 = data0.External; + const _errs21 = errors; + if (typeof data10 !== 'boolean') { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/External', + schemaPath: + '#/properties/Booking/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema19.properties.Booking.properties.External + .type, + parentSchema: + schema19.properties.Booking.properties.External, + data: data10, + }, + ]; + return false; + } + var valid1 = _errs21 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Message !== undefined) { + let data11 = data0.Message; + const _errs23 = errors; + if (typeof data11 !== 'string') { + validate34.errors = [ + { + instancePath: instancePath + '/Booking/Message', + schemaPath: + '#/properties/Booking/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema19.properties.Booking.properties.Message + .type, + parentSchema: + schema19.properties.Booking.properties.Message, + data: data11, + }, + ]; + return false; + } + var valid1 = _errs23 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/Booking', + schemaPath: '#/properties/Booking/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema19.properties.Booking.type, + parentSchema: schema19.properties.Booking, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Locked !== undefined) { + let data12 = data.Locked; + const _errs25 = errors; + if (typeof data12 !== 'boolean') { + validate34.errors = [ + { + instancePath: instancePath + '/Locked', + schemaPath: '#/properties/Locked/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema19.properties.Locked.type, + parentSchema: schema19.properties.Locked, + data: data12, + }, + ]; + return false; + } + var valid0 = _errs25 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate34.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema19.type, + parentSchema: schema19, + data, + }, + ]; + return false; + } + } + validate34.errors = vErrors; + return errors === 0; +} +exports.validateGetBookingResponse500 = validate35; +const schema20 = { + type: 'string', + description: 'Error code', + 'x-standalone': false, + 'x-name': 'getBookingResponse500', + 'x-location': '#/paths//booking/{ID}/get/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate35( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate35.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema20.type, + parentSchema: schema20, + data, + }, + ]; + return false; + } + validate35.errors = vErrors; + return errors === 0; +} +exports.validateDestroyBookingResponse500 = validate36; +const schema21 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'destroyBookingResponse500', + 'x-location': + '#/paths//booking/{ID}/destroy/delete/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate36( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate36.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema21.type, + parentSchema: schema21, + data, + }, + ]; + return false; + } + validate36.errors = vErrors; + return errors === 0; +} +exports.validateBookingRequest = validate37; +const schema22 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'BookingRequest', + 'x-location': '#/components/schemas/Booking_request', + 'x-schema-type': 'request', +}; +function validate37( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate37.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema22.required, + parentSchema: schema22, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate37.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema22.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.ID.type, + parentSchema: schema22.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate37.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema22.properties.Time.required, + parentSchema: schema22.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate37.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema22.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.Time.properties.Start.type, + parentSchema: schema22.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate37.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema22.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.Time.properties.End.type, + parentSchema: schema22.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema22.properties.Time.type, + parentSchema: schema22.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate37.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema22.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.Devices.items.type, + parentSchema: schema22.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema22.properties.Devices.type, + parentSchema: schema22.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate37.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.Type.type, + parentSchema: schema22.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate37.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema22.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema22.properties.Type.enum, + parentSchema: schema22.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate37.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.Status.type, + parentSchema: schema22.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate37.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema22.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema22.properties.Status.enum, + parentSchema: schema22.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate37.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema22.properties.You.type, + parentSchema: schema22.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate37.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema22.properties.External.type, + parentSchema: schema22.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate37.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.Message.type, + parentSchema: schema22.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate37.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema22.type, + parentSchema: schema22, + data, + }, + ]; + return false; + } + } + validate37.errors = vErrors; + return errors === 0; +} +exports.validateBookingResponse = validate38; +const schema23 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'BookingResponse', + 'x-location': '#/components/schemas/Booking_response', + 'x-schema-type': 'response', +}; +function validate38( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate38.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema23.required, + parentSchema: schema23, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate38.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema23.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.ID.type, + parentSchema: schema23.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate38.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema23.properties.Time.required, + parentSchema: schema23.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate38.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema23.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.Time.properties.Start.type, + parentSchema: schema23.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate38.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema23.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.Time.properties.End.type, + parentSchema: schema23.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema23.properties.Time.type, + parentSchema: schema23.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate38.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema23.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.Devices.items.type, + parentSchema: schema23.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema23.properties.Devices.type, + parentSchema: schema23.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate38.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.Type.type, + parentSchema: schema23.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate38.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema23.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema23.properties.Type.enum, + parentSchema: schema23.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate38.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.Status.type, + parentSchema: schema23.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate38.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema23.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema23.properties.Status.enum, + parentSchema: schema23.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate38.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema23.properties.You.type, + parentSchema: schema23.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate38.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema23.properties.External.type, + parentSchema: schema23.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate38.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.Message.type, + parentSchema: schema23.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate38.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema23.type, + parentSchema: schema23, + data, + }, + ]; + return false; + } + } + validate38.errors = vErrors; + return errors === 0; +} +exports.validateDeviceRequest = validate39; +const schema24 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'DeviceRequest', + 'x-location': '#/components/schemas/Device_request', + 'x-schema-type': 'request', +}; +function validate39( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate39.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema24.required, + parentSchema: schema24, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate39.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema24.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate39.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema24.properties.ID.type, + parentSchema: schema24.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate39.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema24.type, + parentSchema: schema24, + data, + }, + ]; + return false; + } + } + validate39.errors = vErrors; + return errors === 0; +} +exports.validateDeviceResponse = validate40; +const schema25 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'DeviceResponse', + 'x-location': '#/components/schemas/Device_response', + 'x-schema-type': 'response', +}; +function validate40( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate40.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema25.required, + parentSchema: schema25, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate40.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema25.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate40.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema25.properties.ID.type, + parentSchema: schema25.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate40.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema25.type, + parentSchema: schema25, + data, + }, + ]; + return false; + } + } + validate40.errors = vErrors; + return errors === 0; +} +exports.validateExperimentRequest = validate41; +const schema26 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'ExperimentRequest', + 'x-location': '#/components/schemas/Experiment_request', + 'x-schema-type': 'request', +}; +function validate41( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate41.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema26.required, + parentSchema: schema26, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate41.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema26.properties.Devices.items.required, + parentSchema: schema26.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate41.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema26.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema26.properties.Devices.items.properties.ID.type, + parentSchema: + schema26.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema26.properties.Devices.items.type, + parentSchema: schema26.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema26.properties.Devices.type, + parentSchema: schema26.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate41.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema26.properties.Description.type, + parentSchema: schema26.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate41.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema26.type, + parentSchema: schema26, + data, + }, + ]; + return false; + } + } + validate41.errors = vErrors; + return errors === 0; +} +exports.validateExperimentResponse = validate42; +const schema27 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'ExperimentResponse', + 'x-location': '#/components/schemas/Experiment_response', + 'x-schema-type': 'response', +}; +function validate42( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate42.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema27.required, + parentSchema: schema27, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate42.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema27.properties.Devices.items.required, + parentSchema: schema27.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate42.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema27.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.properties.Devices.items.properties.ID.type, + parentSchema: + schema27.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.properties.Devices.items.type, + parentSchema: schema27.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema27.properties.Devices.type, + parentSchema: schema27.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate42.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.properties.Description.type, + parentSchema: schema27.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate42.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.type, + parentSchema: schema27, + data, + }, + ]; + return false; + } + } + validate42.errors = vErrors; + return errors === 0; +} +exports.validateTimeslotRequest = validate43; +const schema28 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'TimeslotRequest', + 'x-location': '#/components/schemas/Timeslot_request', + 'x-schema-type': 'request', +}; +function validate43( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate43.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema28.required, + parentSchema: schema28, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate43.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema28.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema28.properties.Start.type, + parentSchema: schema28.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate43.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema28.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema28.properties.End.type, + parentSchema: schema28.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate43.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema28.type, + parentSchema: schema28, + data, + }, + ]; + return false; + } + } + validate43.errors = vErrors; + return errors === 0; +} +exports.validateTimeslotResponse = validate44; +const schema29 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'TimeslotResponse', + 'x-location': '#/components/schemas/Timeslot_response', + 'x-schema-type': 'response', +}; +function validate44( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate44.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema29.required, + parentSchema: schema29, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate44.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema29.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate44.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema29.properties.Start.type, + parentSchema: schema29.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate44.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema29.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate44.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema29.properties.End.type, + parentSchema: schema29.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate44.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema29.type, + parentSchema: schema29, + data, + }, + ]; + return false; + } + } + validate44.errors = vErrors; + return errors === 0; +} +exports.validateIDRequest = validate45; +const schema30 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'IDRequest', + 'x-location': '#/components/parameters/ID/schema_request', + 'x-schema-type': 'request', +}; +function validate45( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate45.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema30.type, + parentSchema: schema30, + data, + }, + ]; + return false; + } + validate45.errors = vErrors; + return errors === 0; +} +exports.validateIDResponse = validate46; +const schema31 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'IDResponse', + 'x-location': '#/components/parameters/ID/schema_response', + 'x-schema-type': 'response', +}; +function validate46( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate46.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema31.type, + parentSchema: schema31, + data, + }, + ]; + return false; + } + validate46.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingBodyRequest = validate47; +const schema32 = { + type: 'object', + required: ['Devices', 'Time'], + properties: { + Devices: { + type: 'array', + description: 'List of devices which should be added.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + }, + 'x-standalone': false, + 'x-name': 'newBookingBodyRequest', + 'x-location': + '#/paths//booking/post/requestBody/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate47( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Time === undefined && (missing0 = 'Time')) + ) { + validate47.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema32.required, + parentSchema: schema32, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate47.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema32.properties.Devices.items.required, + parentSchema: schema32.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate47.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema32.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate47.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema32.properties.Devices.items.properties.ID.type, + parentSchema: + schema32.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate47.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema32.properties.Devices.items.type, + parentSchema: schema32.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate47.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema32.properties.Devices.type, + parentSchema: schema32.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data3 = data.Time; + const _errs7 = errors; + if (errors === _errs7) { + if (data3 && typeof data3 == 'object' && !Array.isArray(data3)) { + let missing2; + if ( + (data3.Start === undefined && (missing2 = 'Start')) || + (data3.End === undefined && (missing2 = 'End')) + ) { + validate47.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema32.properties.Time.required, + parentSchema: schema32.properties.Time, + data: data3, + }, + ]; + return false; + } else { + if (data3.Start !== undefined) { + let data4 = data3.Start; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate47.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema32.properties.Time.properties.Start, + data: data4, + }, + ]; + return false; + } + } else { + validate47.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema32.properties.Time.properties.Start.type, + parentSchema: schema32.properties.Time.properties.Start, + data: data4, + }, + ]; + return false; + } + } + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.End !== undefined) { + let data5 = data3.End; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats2.validate(data5)) { + validate47.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema32.properties.Time.properties.End, + data: data5, + }, + ]; + return false; + } + } else { + validate47.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema32.properties.Time.properties.End.type, + parentSchema: schema32.properties.Time.properties.End, + data: data5, + }, + ]; + return false; + } + } + } + var valid3 = _errs11 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate47.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema32.properties.Time.type, + parentSchema: schema32.properties.Time, + data: data3, + }, + ]; + return false; + } + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate47.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema32.properties.Type.type, + parentSchema: schema32.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate47.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema32.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema32.properties.Type.enum, + parentSchema: schema32.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + } + } + } + } else { + validate47.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema32.type, + parentSchema: schema32, + data, + }, + ]; + return false; + } + } + validate47.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingBodyResponse = validate48; +const schema33 = { + type: 'object', + required: ['Devices', 'Time'], + properties: { + Devices: { + type: 'array', + description: 'List of devices which should be added.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + }, + 'x-standalone': false, + 'x-name': 'newBookingBodyResponse', + 'x-location': + '#/paths//booking/post/requestBody/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate48( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Time === undefined && (missing0 = 'Time')) + ) { + validate48.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema33.required, + parentSchema: schema33, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate48.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema33.properties.Devices.items.required, + parentSchema: schema33.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate48.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema33.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate48.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema33.properties.Devices.items.properties.ID.type, + parentSchema: + schema33.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate48.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema33.properties.Devices.items.type, + parentSchema: schema33.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate48.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema33.properties.Devices.type, + parentSchema: schema33.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data3 = data.Time; + const _errs7 = errors; + if (errors === _errs7) { + if (data3 && typeof data3 == 'object' && !Array.isArray(data3)) { + let missing2; + if ( + (data3.Start === undefined && (missing2 = 'Start')) || + (data3.End === undefined && (missing2 = 'End')) + ) { + validate48.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: schema33.properties.Time.required, + parentSchema: schema33.properties.Time, + data: data3, + }, + ]; + return false; + } else { + if (data3.Start !== undefined) { + let data4 = data3.Start; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate48.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema33.properties.Time.properties.Start, + data: data4, + }, + ]; + return false; + } + } else { + validate48.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema33.properties.Time.properties.Start.type, + parentSchema: schema33.properties.Time.properties.Start, + data: data4, + }, + ]; + return false; + } + } + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.End !== undefined) { + let data5 = data3.End; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats2.validate(data5)) { + validate48.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema33.properties.Time.properties.End, + data: data5, + }, + ]; + return false; + } + } else { + validate48.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema33.properties.Time.properties.End.type, + parentSchema: schema33.properties.Time.properties.End, + data: data5, + }, + ]; + return false; + } + } + } + var valid3 = _errs11 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate48.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema33.properties.Time.type, + parentSchema: schema33.properties.Time, + data: data3, + }, + ]; + return false; + } + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate48.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema33.properties.Type.type, + parentSchema: schema33.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate48.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema33.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema33.properties.Type.enum, + parentSchema: schema33.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + } + } + } + } else { + validate48.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema33.type, + parentSchema: schema33, + data, + }, + ]; + return false; + } + } + validate48.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingResponse200Request = validate49; +const schema34 = { + type: 'object', + required: ['BookingID'], + properties: { + BookingID: { + type: 'string', + format: 'uri', + description: 'ID at which the booking can be managed.', + }, + }, + 'x-standalone': false, + 'x-name': 'newBookingResponse200Request', + 'x-location': + '#/paths//booking/post/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate49( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.BookingID === undefined && (missing0 = 'BookingID')) { + validate49.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema34.required, + parentSchema: schema34, + data, + }, + ]; + return false; + } else { + if (data.BookingID !== undefined) { + let data0 = data.BookingID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate49.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema34.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } else { + validate49.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema34.properties.BookingID.type, + parentSchema: schema34.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate49.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema34.type, + parentSchema: schema34, + data, + }, + ]; + return false; + } + } + validate49.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingResponse200Response = validate50; +const schema35 = { + type: 'object', + required: ['BookingID'], + properties: { + BookingID: { + type: 'string', + format: 'uri', + description: 'ID at which the booking can be managed.', + }, + }, + 'x-standalone': false, + 'x-name': 'newBookingResponse200Response', + 'x-location': + '#/paths//booking/post/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate50( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.BookingID === undefined && (missing0 = 'BookingID')) { + validate50.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema35.required, + parentSchema: schema35, + data, + }, + ]; + return false; + } else { + if (data.BookingID !== undefined) { + let data0 = data.BookingID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate50.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema35.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } else { + validate50.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema35.properties.BookingID.type, + parentSchema: schema35.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate50.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema35.type, + parentSchema: schema35, + data, + }, + ]; + return false; + } + } + validate50.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingResponse500Request = validate51; +const schema36 = { + description: 'Error description', + type: 'string', + 'x-standalone': false, + 'x-name': 'newBookingResponse500Request', + 'x-location': + '#/paths//booking/post/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate51( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate51.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema36.type, + parentSchema: schema36, + data, + }, + ]; + return false; + } + validate51.errors = vErrors; + return errors === 0; +} +exports.validateNewBookingResponse500Response = validate52; +const schema37 = { + description: 'Error description', + type: 'string', + 'x-standalone': false, + 'x-name': 'newBookingResponse500Response', + 'x-location': + '#/paths//booking/post/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate52( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate52.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema37.type, + parentSchema: schema37, + data, + }, + ]; + return false; + } + validate52.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingBodyRequest = validate53; +const schema38 = { + anyOf: [ + { + type: 'object', + description: 'Use this request for adding devices.', + properties: { + Locked: { + type: 'boolean', + description: + 'Expresses whether the devices should be locked. Must match current status of booking. Is assumed to be false if not set.', + }, + Devices: { + type: 'array', + description: 'List of devices which should be added.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + }, + }, + { + type: 'object', + description: 'Use this request for adding callbacks.', + properties: { + Callback: { + type: 'string', + format: 'uri', + description: 'Callback which should be called at changes.', + }, + }, + }, + ], + 'x-standalone': false, + 'x-name': 'updateBookingBodyRequest', + 'x-location': + '#/paths//booking/{ID}/patch/requestBody/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate53( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.Locked !== undefined) { + let data0 = data.Locked; + const _errs3 = errors; + if (typeof data0 !== 'boolean') { + const err0 = { + instancePath: instancePath + '/Locked', + schemaPath: '#/anyOf/0/properties/Locked/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema38.anyOf[0].properties.Locked.type, + parentSchema: schema38.anyOf[0].properties.Locked, + data: data0, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.Devices !== undefined) { + let data1 = data.Devices; + const _errs5 = errors; + if (errors === _errs5) { + if (Array.isArray(data1)) { + var valid2 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs7 = errors; + if (errors === _errs7) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing0; + if (data2.ID === undefined && (missing0 = 'ID')) { + const err1 = { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/anyOf/0/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema38.anyOf[0].properties.Devices.items.required, + parentSchema: schema38.anyOf[0].properties.Devices.items, + data: data2, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } else { + if (data2.ID !== undefined) { + let data3 = data2.ID; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + const err2 = { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/anyOf/0/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema38.anyOf[0].properties.Devices.items.properties + .ID, + data: data3, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } else { + const err3 = { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/anyOf/0/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema38.anyOf[0].properties.Devices.items.properties.ID + .type, + parentSchema: + schema38.anyOf[0].properties.Devices.items.properties + .ID, + data: data3, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + } + } + } + } + } else { + const err4 = { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/anyOf/0/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema38.anyOf[0].properties.Devices.items.type, + parentSchema: schema38.anyOf[0].properties.Devices.items, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + } + var valid2 = _errs7 === errors; + if (!valid2) { + break; + } + } + } else { + const err5 = { + instancePath: instancePath + '/Devices', + schemaPath: '#/anyOf/0/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema38.anyOf[0].properties.Devices.type, + parentSchema: schema38.anyOf[0].properties.Devices, + data: data1, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + const err6 = { + instancePath, + schemaPath: '#/anyOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema38.anyOf[0].type, + parentSchema: schema38.anyOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.Callback !== undefined) { + let data4 = data.Callback; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data4 === 'string') { + if (!formats0(data4)) { + const err7 = { + instancePath: instancePath + '/Callback', + schemaPath: '#/anyOf/1/properties/Callback/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema38.anyOf[1].properties.Callback, + data: data4, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: instancePath + '/Callback', + schemaPath: '#/anyOf/1/properties/Callback/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema38.anyOf[1].properties.Callback.type, + parentSchema: schema38.anyOf[1].properties.Callback, + data: data4, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } else { + const err9 = { + instancePath, + schemaPath: '#/anyOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema38.anyOf[1].type, + parentSchema: schema38.anyOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var _valid0 = _errs11 === errors; + valid0 = valid0 || _valid0; + } + if (!valid0) { + const err10 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema38.anyOf, + parentSchema: schema38, + data, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + validate53.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate53.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingBodyResponse = validate54; +const schema39 = { + anyOf: [ + { + type: 'object', + description: 'Use this request for adding devices.', + properties: { + Locked: { + type: 'boolean', + description: + 'Expresses whether the devices should be locked. Must match current status of booking. Is assumed to be false if not set.', + }, + Devices: { + type: 'array', + description: 'List of devices which should be added.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + }, + }, + { + type: 'object', + description: 'Use this request for adding callbacks.', + properties: { + Callback: { + type: 'string', + format: 'uri', + description: 'Callback which should be called at changes.', + }, + }, + }, + ], + 'x-standalone': false, + 'x-name': 'updateBookingBodyResponse', + 'x-location': + '#/paths//booking/{ID}/patch/requestBody/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate54( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + const _errs1 = errors; + if (errors === _errs1) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.Locked !== undefined) { + let data0 = data.Locked; + const _errs3 = errors; + if (typeof data0 !== 'boolean') { + const err0 = { + instancePath: instancePath + '/Locked', + schemaPath: '#/anyOf/0/properties/Locked/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema39.anyOf[0].properties.Locked.type, + parentSchema: schema39.anyOf[0].properties.Locked, + data: data0, + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data.Devices !== undefined) { + let data1 = data.Devices; + const _errs5 = errors; + if (errors === _errs5) { + if (Array.isArray(data1)) { + var valid2 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs7 = errors; + if (errors === _errs7) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing0; + if (data2.ID === undefined && (missing0 = 'ID')) { + const err1 = { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/anyOf/0/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema39.anyOf[0].properties.Devices.items.required, + parentSchema: schema39.anyOf[0].properties.Devices.items, + data: data2, + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } else { + if (data2.ID !== undefined) { + let data3 = data2.ID; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + const err2 = { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/anyOf/0/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema39.anyOf[0].properties.Devices.items.properties + .ID, + data: data3, + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } else { + const err3 = { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/anyOf/0/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema39.anyOf[0].properties.Devices.items.properties.ID + .type, + parentSchema: + schema39.anyOf[0].properties.Devices.items.properties + .ID, + data: data3, + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + } + } + } + } + } else { + const err4 = { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/anyOf/0/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema39.anyOf[0].properties.Devices.items.type, + parentSchema: schema39.anyOf[0].properties.Devices.items, + data: data2, + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + } + var valid2 = _errs7 === errors; + if (!valid2) { + break; + } + } + } else { + const err5 = { + instancePath: instancePath + '/Devices', + schemaPath: '#/anyOf/0/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema39.anyOf[0].properties.Devices.type, + parentSchema: schema39.anyOf[0].properties.Devices, + data: data1, + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + } + } else { + const err6 = { + instancePath, + schemaPath: '#/anyOf/0/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema39.anyOf[0].type, + parentSchema: schema39.anyOf[0], + data, + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + var _valid0 = _errs1 === errors; + valid0 = valid0 || _valid0; + if (!valid0) { + const _errs11 = errors; + if (errors === _errs11) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.Callback !== undefined) { + let data4 = data.Callback; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data4 === 'string') { + if (!formats0(data4)) { + const err7 = { + instancePath: instancePath + '/Callback', + schemaPath: '#/anyOf/1/properties/Callback/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema39.anyOf[1].properties.Callback, + data: data4, + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } else { + const err8 = { + instancePath: instancePath + '/Callback', + schemaPath: '#/anyOf/1/properties/Callback/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema39.anyOf[1].properties.Callback.type, + parentSchema: schema39.anyOf[1].properties.Callback, + data: data4, + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + } + } + } else { + const err9 = { + instancePath, + schemaPath: '#/anyOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema39.anyOf[1].type, + parentSchema: schema39.anyOf[1], + data, + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + var _valid0 = _errs11 === errors; + valid0 = valid0 || _valid0; + } + if (!valid0) { + const err10 = { + instancePath, + schemaPath: '#/anyOf', + keyword: 'anyOf', + params: {}, + message: 'must match a schema in anyOf', + schema: schema39.anyOf, + parentSchema: schema39, + data, + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + validate54.errors = vErrors; + return false; + } else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } else { + vErrors = null; + } + } + } + validate54.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse200Request = validate55; +const schema40 = { + type: 'object', + required: ['BookingID'], + properties: { BookingID: { type: 'string', format: 'uri' } }, + 'x-standalone': false, + 'x-name': 'updateBookingResponse200Request', + 'x-location': + '#/paths//booking/{ID}/patch/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate55( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.BookingID === undefined && (missing0 = 'BookingID')) { + validate55.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema40.required, + parentSchema: schema40, + data, + }, + ]; + return false; + } else { + if (data.BookingID !== undefined) { + let data0 = data.BookingID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate55.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema40.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } else { + validate55.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema40.properties.BookingID.type, + parentSchema: schema40.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate55.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema40.type, + parentSchema: schema40, + data, + }, + ]; + return false; + } + } + validate55.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse200Response = validate56; +const schema41 = { + type: 'object', + required: ['BookingID'], + properties: { BookingID: { type: 'string', format: 'uri' } }, + 'x-standalone': false, + 'x-name': 'updateBookingResponse200Response', + 'x-location': + '#/paths//booking/{ID}/patch/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate56( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.BookingID === undefined && (missing0 = 'BookingID')) { + validate56.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema41.required, + parentSchema: schema41, + data, + }, + ]; + return false; + } else { + if (data.BookingID !== undefined) { + let data0 = data.BookingID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate56.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema41.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } else { + validate56.errors = [ + { + instancePath: instancePath + '/BookingID', + schemaPath: '#/properties/BookingID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema41.properties.BookingID.type, + parentSchema: schema41.properties.BookingID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate56.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema41.type, + parentSchema: schema41, + data, + }, + ]; + return false; + } + } + validate56.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse400Request = validate57; +const schema42 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'updateBookingResponse400Request', + 'x-location': + '#/paths//booking/{ID}/patch/responses/400/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate57( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate57.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema42.type, + parentSchema: schema42, + data, + }, + ]; + return false; + } + validate57.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse400Response = validate58; +const schema43 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'updateBookingResponse400Response', + 'x-location': + '#/paths//booking/{ID}/patch/responses/400/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate58( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate58.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema43.type, + parentSchema: schema43, + data, + }, + ]; + return false; + } + validate58.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse500Request = validate59; +const schema44 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'updateBookingResponse500Request', + 'x-location': + '#/paths//booking/{ID}/patch/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate59( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate59.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema44.type, + parentSchema: schema44, + data, + }, + ]; + return false; + } + validate59.errors = vErrors; + return errors === 0; +} +exports.validateUpdateBookingResponse500Response = validate60; +const schema45 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'updateBookingResponse500Response', + 'x-location': + '#/paths//booking/{ID}/patch/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate60( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate60.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema45.type, + parentSchema: schema45, + data, + }, + ]; + return false; + } + validate60.errors = vErrors; + return errors === 0; +} +exports.validateDeleteBookingResponse500Request = validate61; +const schema46 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'deleteBookingResponse500Request', + 'x-location': + '#/paths//booking/{ID}/delete/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate61( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate61.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema46.type, + parentSchema: schema46, + data, + }, + ]; + return false; + } + validate61.errors = vErrors; + return errors === 0; +} +exports.validateDeleteBookingResponse500Response = validate62; +const schema47 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'deleteBookingResponse500Response', + 'x-location': + '#/paths//booking/{ID}/delete/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate62( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate62.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema47.type, + parentSchema: schema47, + data, + }, + ]; + return false; + } + validate62.errors = vErrors; + return errors === 0; +} +exports.validateGetBookingResponse200Request = validate63; +const schema48 = { + type: 'object', + required: ['Booking', 'Locked'], + properties: { + Booking: { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + }, + Locked: { + type: 'boolean', + description: 'Shows if the booking is in a locked status.', + }, + }, + 'x-standalone': false, + 'x-name': 'getBookingResponse200Request', + 'x-location': + '#/paths//booking/{ID}/get/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate63( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Booking === undefined && (missing0 = 'Booking')) || + (data.Locked === undefined && (missing0 = 'Locked')) + ) { + validate63.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema48.required, + parentSchema: schema48, + data, + }, + ]; + return false; + } else { + if (data.Booking !== undefined) { + let data0 = data.Booking; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if ( + (data0.ID === undefined && (missing1 = 'ID')) || + (data0.Time === undefined && (missing1 = 'Time')) || + (data0.Devices === undefined && (missing1 = 'Devices')) || + (data0.Status === undefined && (missing1 = 'Status')) || + (data0.You === undefined && (missing1 = 'You')) || + (data0.External === undefined && (missing1 = 'External')) + ) { + validate63.errors = [ + { + instancePath: instancePath + '/Booking', + schemaPath: '#/properties/Booking/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema48.properties.Booking.required, + parentSchema: schema48.properties.Booking, + data: data0, + }, + ]; + return false; + } else { + if (data0.ID !== undefined) { + let data1 = data0.ID; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/ID', + schemaPath: '#/properties/Booking/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema48.properties.Booking.properties.ID, + data: data1, + }, + ]; + return false; + } + } else { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/ID', + schemaPath: '#/properties/Booking/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema48.properties.Booking.properties.ID.type, + parentSchema: schema48.properties.Booking.properties.ID, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Time !== undefined) { + let data2 = data0.Time; + const _errs5 = errors; + if (errors === _errs5) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing2; + if ( + (data2.Start === undefined && (missing2 = 'Start')) || + (data2.End === undefined && (missing2 = 'End')) + ) { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Time', + schemaPath: '#/properties/Booking/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema48.properties.Booking.properties.Time.required, + parentSchema: schema48.properties.Booking.properties.Time, + data: data2, + }, + ]; + return false; + } else { + if (data2.Start !== undefined) { + let data3 = data2.Start; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate63.errors = [ + { + instancePath: + instancePath + '/Booking/Time/Start', + schemaPath: + '#/properties/Booking/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema48.properties.Booking.properties.Time + .properties.Start, + data: data3, + }, + ]; + return false; + } + } else { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Time/Start', + schemaPath: + '#/properties/Booking/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema48.properties.Booking.properties.Time + .properties.Start.type, + parentSchema: + schema48.properties.Booking.properties.Time + .properties.Start, + data: data3, + }, + ]; + return false; + } + } + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data2.End !== undefined) { + let data4 = data2.End; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate63.errors = [ + { + instancePath: + instancePath + '/Booking/Time/End', + schemaPath: + '#/properties/Booking/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema48.properties.Booking.properties.Time + .properties.End, + data: data4, + }, + ]; + return false; + } + } else { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Time/End', + schemaPath: + '#/properties/Booking/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema48.properties.Booking.properties.Time + .properties.End.type, + parentSchema: + schema48.properties.Booking.properties.Time + .properties.End, + data: data4, + }, + ]; + return false; + } + } + } + var valid2 = _errs9 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Time', + schemaPath: '#/properties/Booking/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema48.properties.Booking.properties.Time.type, + parentSchema: schema48.properties.Booking.properties.Time, + data: data2, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Devices !== undefined) { + let data5 = data0.Devices; + const _errs11 = errors; + if (errors === _errs11) { + if (Array.isArray(data5)) { + var valid3 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate63.errors = [ + { + instancePath: + instancePath + '/Booking/Devices/' + i0, + schemaPath: + '#/properties/Booking/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema48.properties.Booking.properties.Devices + .items, + data: data6, + }, + ]; + return false; + } + } else { + validate63.errors = [ + { + instancePath: + instancePath + '/Booking/Devices/' + i0, + schemaPath: + '#/properties/Booking/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema48.properties.Booking.properties.Devices + .items.type, + parentSchema: + schema48.properties.Booking.properties.Devices + .items, + data: data6, + }, + ]; + return false; + } + } + } + var valid3 = _errs13 === errors; + if (!valid3) { + break; + } + } + } else { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Devices', + schemaPath: '#/properties/Booking/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema48.properties.Booking.properties.Devices.type, + parentSchema: + schema48.properties.Booking.properties.Devices, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs11 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Type !== undefined) { + let data7 = data0.Type; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Type', + schemaPath: '#/properties/Booking/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema48.properties.Booking.properties.Type.type, + parentSchema: schema48.properties.Booking.properties.Type, + data: data7, + }, + ]; + return false; + } + if (!(data7 === 'normal')) { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Type', + schemaPath: '#/properties/Booking/properties/Type/enum', + keyword: 'enum', + params: { + allowedValues: + schema48.properties.Booking.properties.Type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema48.properties.Booking.properties.Type.enum, + parentSchema: schema48.properties.Booking.properties.Type, + data: data7, + }, + ]; + return false; + } + var valid1 = _errs15 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Status !== undefined) { + let data8 = data0.Status; + const _errs17 = errors; + if (typeof data8 !== 'string') { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Status', + schemaPath: '#/properties/Booking/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema48.properties.Booking.properties.Status.type, + parentSchema: + schema48.properties.Booking.properties.Status, + data: data8, + }, + ]; + return false; + } + if ( + !( + data8 === 'pending' || + data8 === 'booked' || + data8 === 'rejected' || + data8 === 'cancelled' || + data8 === 'active' || + data8 === 'active-pending' || + data8 === 'active-rejected' + ) + ) { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Status', + schemaPath: '#/properties/Booking/properties/Status/enum', + keyword: 'enum', + params: { + allowedValues: + schema48.properties.Booking.properties.Status.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema48.properties.Booking.properties.Status.enum, + parentSchema: + schema48.properties.Booking.properties.Status, + data: data8, + }, + ]; + return false; + } + var valid1 = _errs17 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.You !== undefined) { + let data9 = data0.You; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/You', + schemaPath: '#/properties/Booking/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema48.properties.Booking.properties.You.type, + parentSchema: + schema48.properties.Booking.properties.You, + data: data9, + }, + ]; + return false; + } + var valid1 = _errs19 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.External !== undefined) { + let data10 = data0.External; + const _errs21 = errors; + if (typeof data10 !== 'boolean') { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/External', + schemaPath: + '#/properties/Booking/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema48.properties.Booking.properties.External + .type, + parentSchema: + schema48.properties.Booking.properties.External, + data: data10, + }, + ]; + return false; + } + var valid1 = _errs21 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Message !== undefined) { + let data11 = data0.Message; + const _errs23 = errors; + if (typeof data11 !== 'string') { + validate63.errors = [ + { + instancePath: instancePath + '/Booking/Message', + schemaPath: + '#/properties/Booking/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema48.properties.Booking.properties.Message + .type, + parentSchema: + schema48.properties.Booking.properties.Message, + data: data11, + }, + ]; + return false; + } + var valid1 = _errs23 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } + } + } else { + validate63.errors = [ + { + instancePath: instancePath + '/Booking', + schemaPath: '#/properties/Booking/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema48.properties.Booking.type, + parentSchema: schema48.properties.Booking, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Locked !== undefined) { + let data12 = data.Locked; + const _errs25 = errors; + if (typeof data12 !== 'boolean') { + validate63.errors = [ + { + instancePath: instancePath + '/Locked', + schemaPath: '#/properties/Locked/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema48.properties.Locked.type, + parentSchema: schema48.properties.Locked, + data: data12, + }, + ]; + return false; + } + var valid0 = _errs25 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate63.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema48.type, + parentSchema: schema48, + data, + }, + ]; + return false; + } + } + validate63.errors = vErrors; + return errors === 0; +} +exports.validateGetBookingResponse200Response = validate64; +const schema49 = { + type: 'object', + required: ['Booking', 'Locked'], + properties: { + Booking: { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + }, + Locked: { + type: 'boolean', + description: 'Shows if the booking is in a locked status.', + }, + }, + 'x-standalone': false, + 'x-name': 'getBookingResponse200Response', + 'x-location': + '#/paths//booking/{ID}/get/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate64( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Booking === undefined && (missing0 = 'Booking')) || + (data.Locked === undefined && (missing0 = 'Locked')) + ) { + validate64.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema49.required, + parentSchema: schema49, + data, + }, + ]; + return false; + } else { + if (data.Booking !== undefined) { + let data0 = data.Booking; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if ( + (data0.ID === undefined && (missing1 = 'ID')) || + (data0.Time === undefined && (missing1 = 'Time')) || + (data0.Devices === undefined && (missing1 = 'Devices')) || + (data0.Status === undefined && (missing1 = 'Status')) || + (data0.You === undefined && (missing1 = 'You')) || + (data0.External === undefined && (missing1 = 'External')) + ) { + validate64.errors = [ + { + instancePath: instancePath + '/Booking', + schemaPath: '#/properties/Booking/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema49.properties.Booking.required, + parentSchema: schema49.properties.Booking, + data: data0, + }, + ]; + return false; + } else { + if (data0.ID !== undefined) { + let data1 = data0.ID; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats0(data1)) { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/ID', + schemaPath: '#/properties/Booking/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema49.properties.Booking.properties.ID, + data: data1, + }, + ]; + return false; + } + } else { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/ID', + schemaPath: '#/properties/Booking/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema49.properties.Booking.properties.ID.type, + parentSchema: schema49.properties.Booking.properties.ID, + data: data1, + }, + ]; + return false; + } + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Time !== undefined) { + let data2 = data0.Time; + const _errs5 = errors; + if (errors === _errs5) { + if (data2 && typeof data2 == 'object' && !Array.isArray(data2)) { + let missing2; + if ( + (data2.Start === undefined && (missing2 = 'Start')) || + (data2.End === undefined && (missing2 = 'End')) + ) { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Time', + schemaPath: '#/properties/Booking/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: "must have required property '" + missing2 + "'", + schema: + schema49.properties.Booking.properties.Time.required, + parentSchema: schema49.properties.Booking.properties.Time, + data: data2, + }, + ]; + return false; + } else { + if (data2.Start !== undefined) { + let data3 = data2.Start; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate64.errors = [ + { + instancePath: + instancePath + '/Booking/Time/Start', + schemaPath: + '#/properties/Booking/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema49.properties.Booking.properties.Time + .properties.Start, + data: data3, + }, + ]; + return false; + } + } else { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Time/Start', + schemaPath: + '#/properties/Booking/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema49.properties.Booking.properties.Time + .properties.Start.type, + parentSchema: + schema49.properties.Booking.properties.Time + .properties.Start, + data: data3, + }, + ]; + return false; + } + } + } + var valid2 = _errs7 === errors; + } else { + var valid2 = true; + } + if (valid2) { + if (data2.End !== undefined) { + let data4 = data2.End; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate64.errors = [ + { + instancePath: + instancePath + '/Booking/Time/End', + schemaPath: + '#/properties/Booking/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema49.properties.Booking.properties.Time + .properties.End, + data: data4, + }, + ]; + return false; + } + } else { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Time/End', + schemaPath: + '#/properties/Booking/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema49.properties.Booking.properties.Time + .properties.End.type, + parentSchema: + schema49.properties.Booking.properties.Time + .properties.End, + data: data4, + }, + ]; + return false; + } + } + } + var valid2 = _errs9 === errors; + } else { + var valid2 = true; + } + } + } + } else { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Time', + schemaPath: '#/properties/Booking/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema49.properties.Booking.properties.Time.type, + parentSchema: schema49.properties.Booking.properties.Time, + data: data2, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Devices !== undefined) { + let data5 = data0.Devices; + const _errs11 = errors; + if (errors === _errs11) { + if (Array.isArray(data5)) { + var valid3 = true; + const len0 = data5.length; + for (let i0 = 0; i0 < len0; i0++) { + let data6 = data5[i0]; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data6 === 'string') { + if (!formats0(data6)) { + validate64.errors = [ + { + instancePath: + instancePath + '/Booking/Devices/' + i0, + schemaPath: + '#/properties/Booking/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema49.properties.Booking.properties.Devices + .items, + data: data6, + }, + ]; + return false; + } + } else { + validate64.errors = [ + { + instancePath: + instancePath + '/Booking/Devices/' + i0, + schemaPath: + '#/properties/Booking/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema49.properties.Booking.properties.Devices + .items.type, + parentSchema: + schema49.properties.Booking.properties.Devices + .items, + data: data6, + }, + ]; + return false; + } + } + } + var valid3 = _errs13 === errors; + if (!valid3) { + break; + } + } + } else { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Devices', + schemaPath: '#/properties/Booking/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema49.properties.Booking.properties.Devices.type, + parentSchema: + schema49.properties.Booking.properties.Devices, + data: data5, + }, + ]; + return false; + } + } + var valid1 = _errs11 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Type !== undefined) { + let data7 = data0.Type; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Type', + schemaPath: '#/properties/Booking/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema49.properties.Booking.properties.Type.type, + parentSchema: schema49.properties.Booking.properties.Type, + data: data7, + }, + ]; + return false; + } + if (!(data7 === 'normal')) { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Type', + schemaPath: '#/properties/Booking/properties/Type/enum', + keyword: 'enum', + params: { + allowedValues: + schema49.properties.Booking.properties.Type.enum, + }, + message: 'must be equal to one of the allowed values', + schema: schema49.properties.Booking.properties.Type.enum, + parentSchema: schema49.properties.Booking.properties.Type, + data: data7, + }, + ]; + return false; + } + var valid1 = _errs15 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Status !== undefined) { + let data8 = data0.Status; + const _errs17 = errors; + if (typeof data8 !== 'string') { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Status', + schemaPath: '#/properties/Booking/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema49.properties.Booking.properties.Status.type, + parentSchema: + schema49.properties.Booking.properties.Status, + data: data8, + }, + ]; + return false; + } + if ( + !( + data8 === 'pending' || + data8 === 'booked' || + data8 === 'rejected' || + data8 === 'cancelled' || + data8 === 'active' || + data8 === 'active-pending' || + data8 === 'active-rejected' + ) + ) { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Status', + schemaPath: '#/properties/Booking/properties/Status/enum', + keyword: 'enum', + params: { + allowedValues: + schema49.properties.Booking.properties.Status.enum, + }, + message: 'must be equal to one of the allowed values', + schema: + schema49.properties.Booking.properties.Status.enum, + parentSchema: + schema49.properties.Booking.properties.Status, + data: data8, + }, + ]; + return false; + } + var valid1 = _errs17 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.You !== undefined) { + let data9 = data0.You; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/You', + schemaPath: '#/properties/Booking/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema49.properties.Booking.properties.You.type, + parentSchema: + schema49.properties.Booking.properties.You, + data: data9, + }, + ]; + return false; + } + var valid1 = _errs19 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.External !== undefined) { + let data10 = data0.External; + const _errs21 = errors; + if (typeof data10 !== 'boolean') { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/External', + schemaPath: + '#/properties/Booking/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: + schema49.properties.Booking.properties.External + .type, + parentSchema: + schema49.properties.Booking.properties.External, + data: data10, + }, + ]; + return false; + } + var valid1 = _errs21 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Message !== undefined) { + let data11 = data0.Message; + const _errs23 = errors; + if (typeof data11 !== 'string') { + validate64.errors = [ + { + instancePath: instancePath + '/Booking/Message', + schemaPath: + '#/properties/Booking/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema49.properties.Booking.properties.Message + .type, + parentSchema: + schema49.properties.Booking.properties.Message, + data: data11, + }, + ]; + return false; + } + var valid1 = _errs23 === errors; + } else { + var valid1 = true; + } + } + } + } + } + } + } + } + } + } else { + validate64.errors = [ + { + instancePath: instancePath + '/Booking', + schemaPath: '#/properties/Booking/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema49.properties.Booking.type, + parentSchema: schema49.properties.Booking, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Locked !== undefined) { + let data12 = data.Locked; + const _errs25 = errors; + if (typeof data12 !== 'boolean') { + validate64.errors = [ + { + instancePath: instancePath + '/Locked', + schemaPath: '#/properties/Locked/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema49.properties.Locked.type, + parentSchema: schema49.properties.Locked, + data: data12, + }, + ]; + return false; + } + var valid0 = _errs25 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate64.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema49.type, + parentSchema: schema49, + data, + }, + ]; + return false; + } + } + validate64.errors = vErrors; + return errors === 0; +} +exports.validateGetBookingResponse500Request = validate65; +const schema50 = { + type: 'string', + description: 'Error code', + 'x-standalone': false, + 'x-name': 'getBookingResponse500Request', + 'x-location': + '#/paths//booking/{ID}/get/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate65( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate65.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema50.type, + parentSchema: schema50, + data, + }, + ]; + return false; + } + validate65.errors = vErrors; + return errors === 0; +} +exports.validateGetBookingResponse500Response = validate66; +const schema51 = { + type: 'string', + description: 'Error code', + 'x-standalone': false, + 'x-name': 'getBookingResponse500Response', + 'x-location': + '#/paths//booking/{ID}/get/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate66( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate66.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema51.type, + parentSchema: schema51, + data, + }, + ]; + return false; + } + validate66.errors = vErrors; + return errors === 0; +} +exports.validateDestroyBookingResponse500Request = validate67; +const schema52 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'destroyBookingResponse500Request', + 'x-location': + '#/paths//booking/{ID}/destroy/delete/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate67( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate67.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema52.type, + parentSchema: schema52, + data, + }, + ]; + return false; + } + validate67.errors = vErrors; + return errors === 0; +} +exports.validateDestroyBookingResponse500Response = validate68; +const schema53 = { + type: 'string', + description: 'Error description', + 'x-standalone': false, + 'x-name': 'destroyBookingResponse500Response', + 'x-location': + '#/paths//booking/{ID}/destroy/delete/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate68( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate68.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema53.type, + parentSchema: schema53, + data, + }, + ]; + return false; + } + validate68.errors = vErrors; + return errors === 0; +} diff --git a/services/experiment/src/clients/booking-frontend/basicValidation.d.cts b/services/experiment/src/clients/booking-frontend/basicValidation.d.cts new file mode 100644 index 00000000..986e0dcc --- /dev/null +++ b/services/experiment/src/clients/booking-frontend/basicValidation.d.cts @@ -0,0 +1,191 @@ +export declare function validateBooking( + object: unknown, +): Booking; + +export declare function validateDevice( + object: unknown, +): Device; + +export declare function validateExperiment( + object: unknown, +): Experiment; + +export declare function validateTimeslot( + object: unknown, +): Timeslot; + +export declare function validateID( + object: unknown, +): ID; + +export declare function validateNewBookingBody( + object: unknown, +): newBookingBody; + +export declare function validateNewBookingResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): newBookingResponse200; + +export declare function validateNewBookingResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): newBookingResponse500; + +export declare function validateUpdateBookingBody< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingBody; + +export declare function validateUpdateBookingResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse200; + +export declare function validateUpdateBookingResponse400< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse400; + +export declare function validateUpdateBookingResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse500; + +export declare function validateDeleteBookingResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): deleteBookingResponse500; + +export declare function validateGetBookingResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): getBookingResponse200; + +export declare function validateGetBookingResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): getBookingResponse500; + +export declare function validateDestroyBookingResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): destroyBookingResponse500; + +export declare function validateBookingRequest( + object: unknown, +): BookingRequest; + +export declare function validateBookingResponse( + object: unknown, +): BookingResponse; + +export declare function validateDeviceRequest( + object: unknown, +): DeviceRequest; + +export declare function validateDeviceResponse( + object: unknown, +): DeviceResponse; + +export declare function validateExperimentRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ExperimentRequest; + +export declare function validateExperimentResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ExperimentResponse; + +export declare function validateTimeslotRequest( + object: unknown, +): TimeslotRequest; + +export declare function validateTimeslotResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): TimeslotResponse; + +export declare function validateIDRequest( + object: unknown, +): IDRequest; + +export declare function validateIDResponse( + object: unknown, +): IDResponse; + +export declare function validateNewBookingBodyRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): newBookingBodyRequest; + +export declare function validateNewBookingBodyResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): newBookingBodyResponse; + +export declare function validateNewBookingResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): newBookingResponse200Request; + +export declare function validateNewBookingResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): newBookingResponse200Response; + +export declare function validateNewBookingResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): newBookingResponse500Request; + +export declare function validateNewBookingResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): newBookingResponse500Response; + +export declare function validateUpdateBookingBodyRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingBodyRequest; + +export declare function validateUpdateBookingBodyResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingBodyResponse; + +export declare function validateUpdateBookingResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse200Request; + +export declare function validateUpdateBookingResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse200Response; + +export declare function validateUpdateBookingResponse400Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse400Request; + +export declare function validateUpdateBookingResponse400Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse400Response; + +export declare function validateUpdateBookingResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse500Request; + +export declare function validateUpdateBookingResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): updateBookingResponse500Response; + +export declare function validateDeleteBookingResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): deleteBookingResponse500Request; + +export declare function validateDeleteBookingResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): deleteBookingResponse500Response; + +export declare function validateGetBookingResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): getBookingResponse200Request; + +export declare function validateGetBookingResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): getBookingResponse200Response; + +export declare function validateGetBookingResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): getBookingResponse500Request; + +export declare function validateGetBookingResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): getBookingResponse500Response; + +export declare function validateDestroyBookingResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): destroyBookingResponse500Request; + +export declare function validateDestroyBookingResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): destroyBookingResponse500Response; diff --git a/services/experiment/src/clients/booking-frontend/client.ts b/services/experiment/src/clients/booking-frontend/client.ts new file mode 100644 index 00000000..719ff403 --- /dev/null +++ b/services/experiment/src/clients/booking-frontend/client.ts @@ -0,0 +1,609 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import fetch, { RequestInfo, RequestInit, Response } from 'node-fetch'; + +import * as RequestValidation from './requestValidation.js'; +import * as Signatures from './signatures.js'; +import * as Types from './types.js'; +// @ts-ignore +import { type Require } from './types.js'; + +/** + * This error class should be used if an error occurs during validation of a request/response. + * @category Errors + */ +export class ValidationError extends Error { + public errors: unknown; + + constructor(message: string, errors: unknown) { + super(message); + this.name = 'ValidationError'; + this.errors = errors; + } +} + +/** + * This error class should be used if an error occurs while fetching a request. + * @category Errors + */ +export class FetchError extends Error { + constructor(message: string) { + super(message); + this.name = 'FetchError'; + } +} + +/** + * This error class should be used if the response of the server has a status + * greater than or equal to 400. This error should contain the validated response. + * @category Errors + */ +export class UnsuccessfulRequestError extends Error { + public response: Types.ResponseData; + + constructor(message: string, response: Types.ResponseData) { + super(message); + this.response = response; + this.name = 'UnsuccessfulRequestError'; + } +} + +/** + * This error class should be used if the validation of an url fails. + * @category Errors + */ +export class InvalidUrlError extends Error { + constructor(message: string) { + super(message); + this.name = 'InvalidUrlError'; + } +} + +/** + * This function attempts to parse a Response as ResponseData. + */ +async function parseResponse(response: Response): Promise { + let text = null; + try { + text = await response.text(); + const json = JSON.parse(text); + return { status: response.status, body: json }; + } catch { + return { status: response.status, body: text }; + } +} + +/** + * This function checks if a string is a valid http url. + * @param string The string to be checked. + * @returns True if the string is a valid http url. + */ +function isValidHttpUrl(string: string) { + let url; + + try { + url = new URL(string); + } catch (_) { + return false; + } + + return url.protocol === 'http:' || url.protocol === 'https:'; +} + +/** + * This function takes an url and a pattern for the requested endpoint and parses the contained path parameters. + * @param url The url to be parsed. + * @param endpoint Pattern of the requested endpoint. + * @throws {InvalidUrlError} Thrown if the provided url does not end with the provided endpoint. + * @returns An array containing all parsed path parameters in order of appearance. + * @example + * // returns ["username", "role_name"] + * parsePathParameters("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") + */ +function parsePathParameters(url: string, endpoint: string): string[] { + const parameterRegex = '([^/]+)'; + const regex = new RegExp(endpoint.replaceAll('{}', parameterRegex) + '(?:.(?!\\\\))?$'); + const matches = url.match(regex); + + if (!matches) throw new InvalidUrlError('Url does not end with the provided endpoint'); + + return matches.slice(1); +} + +/** + * This function validates a given http url and parses its path parameters. + * @param url The url to be validated. + * @param endpoint Pattern of the requested endpoint. + * @throws {InvalidUrlError} Thrown if the validation of the provided url fails. + * @returns An array containing all parsed path parameters in order of appearance (see {@link parsePathParameters}). + * @example + * // returns ["username", "role_name"] + * validateUrl("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") + */ +function validateUrl(url: string, endpoint: string): string[] { + if (!isValidHttpUrl(url)) + throw new InvalidUrlError('Provided url is not a valid http url'); + return parsePathParameters(url, endpoint); +} + +/** + * This function appends a given endpoint to an url. + * @param url The url to append the endpoint to. + * @param endpoint The endpoint to be appended. + * @example + * // returns "https://api.example.com/devices/device_id/token" + * appendToUrl("https://api.example.com/devices/device_id", "/token") + * @example + * // returns "https://api.example.com/devices/device_id/token" + * appendToUrl("https://api.example.com/devices/device_id/", "/token") + * @returns The url with the appended endpoint. + */ +function appendToUrl(url: string, endpoint: string) { + return url.endsWith('/') ? `${url.slice(0, -1)}${endpoint}` : `${url}${endpoint}`; +} + +/** + * Client for the use of the Crosslab API + * @category Client + */ +export class Client { + public readonly baseUrl: string; + public readonly serviceUrl: string; + public accessToken: string; + private fixedHeaders: [string, string][]; + private fetch = async (url: RequestInfo | URL, init: RequestInit) => { + let raw_response; + const parsedUrl = new URL(url.toString()); + try { + if ( + parsedUrl.toString().startsWith(this.baseUrl) || + parsedUrl.toString().startsWith(this.serviceUrl) + ) { + raw_response = await fetch(url, init); + } else { + raw_response = await fetch( + appendToUrl( + this.baseUrl, + '/proxy?' + new URLSearchParams([['URL', url.toString()]]).toString(), + ), + init, + ); + } + } catch (error) { + if (error instanceof Error) { + throw new FetchError(error.message); + } else if (typeof error === 'string') { + throw new FetchError(error); + } else { + throw new FetchError('Something went wrong while trying to fetch the request'); + } + } + return await parseResponse(raw_response); + }; + + /** + * @category Constructors + */ + constructor( + baseUrl: string, + options: { + serviceUrl?: string; + accessToken?: string; + fixedHeaders?: [string, string][]; + }, + ) { + this.baseUrl = new URL(baseUrl).toString().slice(0, -1); + this.serviceUrl = new URL(options.serviceUrl ?? this.baseUrl).toString().slice(0, -1); + this.accessToken = options.accessToken ?? ''; + this.fixedHeaders = options.fixedHeaders ?? []; + } + + /** + * Books an experiment. + * + * @param body + * @param options.url + * Url of the to be used. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The booking was accepted. The booking status will display whether the booking of all devices was successful. + */ + public async newBooking( + body: { + /** + * List of devices which should be added. + */ + Devices: Types.Device<'request'>[]; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: Types.Timeslot<'request'>; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + [k: string]: unknown; + }, + options?: { + headers?: [string, string][]; + url?: string; + }, + ): Promise { + const url = appendToUrl(options?.url ?? this.baseUrl, '/booking'); + console.log('trying to fetch url:', url); + + if (!RequestValidation.validateNewBookingInput(body)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateNewBookingInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); + + if (!RequestValidation.validateNewBookingOutput(response)) + throw new ValidationError( + 'Response validation failed!', + (RequestValidation.validateNewBookingOutput as Types.FunctionWithErrors).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * Allows the addition of devices to a booking (removing of devices is not supportet) or the registration of callbacks. For adding devices, the scope 'booking:use' is required. + + * + * @param url + * Url of the resource to be accessed. + * @param body + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The booking change was accepted. The booking status will display whether the booking of all devices was successful. + */ + public async updateBooking( + url: string, + body: + | { + /** + * Expresses whether the devices should be locked. Must match current status of booking. Is assumed to be false if not set. + */ + Locked?: boolean; + /** + * List of devices which should be added. + */ + Devices?: Types.Device<'request'>[]; + [k: string]: unknown; + } + | { + /** + * Callback which should be called at changes. + */ + Callback?: string; + [k: string]: unknown; + }, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/booking/{}'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [ID] = validateUrl(new URL(url).toString(), '/booking/{}'); + console.log('trying to fetch url:', url); + + const parameters = { + ID: ID, + }; + + if (!RequestValidation.validateUpdateBookingInput(parameters, body)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateUpdateBookingInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'PATCH', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); + + if (!RequestValidation.validateUpdateBookingOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateUpdateBookingOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * Cancels a booking, as long as the booking was originally done by you. + * + * @param url + * Url of the resource to be accessed. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The booking was cancelled. All associated devices were released. + */ + public async deleteBooking( + url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/booking/{}'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [ID] = validateUrl(new URL(url).toString(), '/booking/{}'); + console.log('trying to fetch url:', url); + + const parameters = { + ID: ID, + }; + + if (!RequestValidation.validateDeleteBookingInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateDeleteBookingInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'DELETE', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateDeleteBookingOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateDeleteBookingOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + } + + /** + * Returns whether a list of devices is currently booked for a user. + * + * @param url + * Url of the resource to be accessed. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * Returns the current booking. + */ + public async getBooking( + url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/booking/{}'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [ID] = validateUrl(new URL(url).toString(), '/booking/{}'); + console.log('trying to fetch url:', url); + + const parameters = { + ID: ID, + }; + + if (!RequestValidation.validateGetBookingInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateGetBookingInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'GET', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateGetBookingOutput(response)) + throw new ValidationError( + 'Response validation failed!', + (RequestValidation.validateGetBookingOutput as Types.FunctionWithErrors).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } + + /** + * Allows selected persons (like lab manager) to remove a user booking. To avoid mistakes, this is a different path than normal delete. + * + * @param url + * Url of the resource to be accessed. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * The booking was cancelled. All associated devices were released. + */ + public async destroyBooking( + url: string, + options?: { + headers?: [string, string][]; + }, + ): Promise { + const urlSuffix = '/booking/{}/destroy'.split('{}').at(-1) ?? ''; + if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); + const [ID] = validateUrl(new URL(url).toString(), '/booking/{}/destroy'); + console.log('trying to fetch url:', url); + + const parameters = { + ID: ID, + }; + + if (!RequestValidation.validateDestroyBookingInput(parameters)) + throw new ValidationError( + 'Request validation failed!', + ( + RequestValidation.validateDestroyBookingInput as Types.FunctionWithErrors + ).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'DELETE', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); + + if (!RequestValidation.validateDestroyBookingOutput(response)) + throw new ValidationError( + 'Response validation failed!', + ( + RequestValidation.validateDestroyBookingOutput as Types.FunctionWithErrors + ).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + } +} diff --git a/services/experiment/src/clients/booking-frontend/requestValidation.ts b/services/experiment/src/clients/booking-frontend/requestValidation.ts new file mode 100644 index 00000000..bf388f61 --- /dev/null +++ b/services/experiment/src/clients/booking-frontend/requestValidation.ts @@ -0,0 +1,373 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +import * as BasicValidation from './basicValidation.cjs'; +import * as Signatures from './signatures.js'; +import { FunctionWithErrors, ResponseData } from './types.js'; + +/** + * This function validates the inputs to newBooking() + */ +export function validateNewBookingInput(body: Signatures.NewBookingBody) { + if (!BasicValidation.validateNewBookingBodyRequest(body)) { + (validateNewBookingInput as FunctionWithErrors).errors = ( + BasicValidation.validateNewBookingBodyRequest as FunctionWithErrors + ).errors; + return false; + } + + return true; +} + +/** + * This function validates the outputs of newBooking() + */ +export function validateNewBookingOutput( + response: ResponseData, +): response is Signatures.NewBookingResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if (!BasicValidation.validateNewBookingResponse200Response(response.body)) { + (validateNewBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateNewBookingResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateNewBookingResponse500Response(response.body)) { + (validateNewBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateNewBookingResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateNewBookingOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to updateBooking() + */ +export function validateUpdateBookingInput( + parameters: Signatures.UpdateBookingParameters, + body: Signatures.UpdateBookingBody, +) { + if (parameters) { + if (!BasicValidation.validateIDRequest(parameters['ID'])) { + (validateUpdateBookingInput as FunctionWithErrors).errors = ( + BasicValidation.validateIDRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + if (!BasicValidation.validateUpdateBookingBodyRequest(body)) { + (validateUpdateBookingInput as FunctionWithErrors).errors = ( + BasicValidation.validateUpdateBookingBodyRequest as FunctionWithErrors + ).errors; + return false; + } + + return true; +} + +/** + * This function validates the outputs of updateBooking() + */ +export function validateUpdateBookingOutput( + response: ResponseData, +): response is Signatures.UpdateBookingResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if (!BasicValidation.validateUpdateBookingResponse200Response(response.body)) { + (validateUpdateBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateUpdateBookingResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 400) { + if (!BasicValidation.validateUpdateBookingResponse400Response(response.body)) { + (validateUpdateBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateUpdateBookingResponse400Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 423) { + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateUpdateBookingResponse500Response(response.body)) { + (validateUpdateBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateUpdateBookingResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateUpdateBookingOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to deleteBooking() + */ +export function validateDeleteBookingInput( + parameters: Signatures.DeleteBookingParameters, +) { + if (parameters) { + if (!BasicValidation.validateIDRequest(parameters['ID'])) { + (validateDeleteBookingInput as FunctionWithErrors).errors = ( + BasicValidation.validateIDRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of deleteBooking() + */ +export function validateDeleteBookingOutput( + response: ResponseData, +): response is Signatures.DeleteBookingResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 423) { + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateDeleteBookingResponse500Response(response.body)) { + (validateDeleteBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateDeleteBookingResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateDeleteBookingOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to getBooking() + */ +export function validateGetBookingInput(parameters: Signatures.GetBookingParameters) { + if (parameters) { + if (!BasicValidation.validateIDRequest(parameters['ID'])) { + (validateGetBookingInput as FunctionWithErrors).errors = ( + BasicValidation.validateIDRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of getBooking() + */ +export function validateGetBookingOutput( + response: ResponseData, +): response is Signatures.GetBookingResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if (!BasicValidation.validateGetBookingResponse200Response(response.body)) { + (validateGetBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateGetBookingResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateGetBookingResponse500Response(response.body)) { + (validateGetBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateGetBookingResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateGetBookingOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} + +/** + * This function validates the inputs to destroyBooking() + */ +export function validateDestroyBookingInput( + parameters: Signatures.DestroyBookingParameters, +) { + if (parameters) { + if (!BasicValidation.validateIDRequest(parameters['ID'])) { + (validateDestroyBookingInput as FunctionWithErrors).errors = ( + BasicValidation.validateIDRequest as FunctionWithErrors + ).errors; + return false; + } + } else { + return false; + } + + return true; +} + +/** + * This function validates the outputs of destroyBooking() + */ +export function validateDestroyBookingOutput( + response: ResponseData, +): response is Signatures.DestroyBookingResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + return true; + } + + if (response.status === 423) { + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateDestroyBookingResponse500Response(response.body)) { + (validateDestroyBookingOutput as FunctionWithErrors).errors = ( + BasicValidation.validateDestroyBookingResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateDestroyBookingOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} diff --git a/services/experiment/src/clients/booking-frontend/signatures.ts b/services/experiment/src/clients/booking-frontend/signatures.ts new file mode 100644 index 00000000..09577589 --- /dev/null +++ b/services/experiment/src/clients/booking-frontend/signatures.ts @@ -0,0 +1,627 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import * as Types from './types.js'; +// @ts-ignore +import { type Require } from './types.js'; + +/** + * Typing for the body of the request made by newBooking() + * @category newBooking() + */ +export type NewBookingBody = { + /** + * List of devices which should be added. + */ + Devices: Types.Device<'request'>[]; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: Types.Timeslot<'request'>; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + [k: string]: unknown; +}; + +/** + * Typing for all possible responses to the request made by newBooking() + * @category newBooking() + */ +export type NewBookingResponse = NewBookingSuccessResponse | NewBookingErrorResponse; + +/** + * Typing for all successful responses to the request made by newBooking() + * @category newBooking() + */ +export type NewBookingSuccessResponse = NewBookingResponse200; + +/** + * Typing for all error responses to the request made by newBooking() + * @category newBooking() + */ +export type NewBookingErrorResponse = + | NewBookingResponse401 + | NewBookingResponse403 + | NewBookingResponse500 + | NewBookingResponse503; + +/** + * Typing for a response with status 200 to the request made by newBooking() + * @category newBooking() + */ +export interface NewBookingResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: { + /** + * ID at which the booking can be managed. + */ + BookingID: string; + [k: string]: unknown; + }; +} + +/** + * Typing for a response with status 401 to the request made by newBooking() + * @category newBooking() + */ +export interface NewBookingResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by newBooking() + * @category newBooking() + */ +export interface NewBookingResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by newBooking() + * @category newBooking() + */ +export interface NewBookingResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by newBooking() + * @category newBooking() + */ +export interface NewBookingResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by updateBooking() + * @category updateBooking() + */ +export type UpdateBookingParameters = { + ID: string; +}; + +/** + * Typing for the body of the request made by updateBooking() + * @category updateBooking() + */ +export type UpdateBookingBody = + | { + /** + * Expresses whether the devices should be locked. Must match current status of booking. Is assumed to be false if not set. + */ + Locked?: boolean; + /** + * List of devices which should be added. + */ + Devices?: Types.Device<'request'>[]; + [k: string]: unknown; + } + | { + /** + * Callback which should be called at changes. + */ + Callback?: string; + [k: string]: unknown; + }; + +/** + * Typing for all possible responses to the request made by updateBooking() + * @category updateBooking() + */ +export type UpdateBookingResponse = + | UpdateBookingSuccessResponse + | UpdateBookingErrorResponse; + +/** + * Typing for all successful responses to the request made by updateBooking() + * @category updateBooking() + */ +export type UpdateBookingSuccessResponse = UpdateBookingResponse200; + +/** + * Typing for all error responses to the request made by updateBooking() + * @category updateBooking() + */ +export type UpdateBookingErrorResponse = + | UpdateBookingResponse400 + | UpdateBookingResponse401 + | UpdateBookingResponse403 + | UpdateBookingResponse404 + | UpdateBookingResponse423 + | UpdateBookingResponse500 + | UpdateBookingResponse503; + +/** + * Typing for a response with status 200 to the request made by updateBooking() + * @category updateBooking() + */ +export interface UpdateBookingResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: { + BookingID: string; + [k: string]: unknown; + }; +} + +/** + * Typing for a response with status 400 to the request made by updateBooking() + * @category updateBooking() + */ +export interface UpdateBookingResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 401 to the request made by updateBooking() + * @category updateBooking() + */ +export interface UpdateBookingResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by updateBooking() + * @category updateBooking() + */ +export interface UpdateBookingResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by updateBooking() + * @category updateBooking() + */ +export interface UpdateBookingResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 423 to the request made by updateBooking() + * @category updateBooking() + */ +export interface UpdateBookingResponse423 extends Types.ErrorResponse { + status: 423; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by updateBooking() + * @category updateBooking() + */ +export interface UpdateBookingResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by updateBooking() + * @category updateBooking() + */ +export interface UpdateBookingResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by deleteBooking() + * @category deleteBooking() + */ +export type DeleteBookingParameters = { + ID: string; +}; + +/** + * Typing for all possible responses to the request made by deleteBooking() + * @category deleteBooking() + */ +export type DeleteBookingResponse = + | DeleteBookingSuccessResponse + | DeleteBookingErrorResponse; + +/** + * Typing for all successful responses to the request made by deleteBooking() + * @category deleteBooking() + */ +export type DeleteBookingSuccessResponse = DeleteBookingResponse200; + +/** + * Typing for all error responses to the request made by deleteBooking() + * @category deleteBooking() + */ +export type DeleteBookingErrorResponse = + | DeleteBookingResponse401 + | DeleteBookingResponse403 + | DeleteBookingResponse404 + | DeleteBookingResponse423 + | DeleteBookingResponse500 + | DeleteBookingResponse503; + +/** + * Typing for a response with status 200 to the request made by deleteBooking() + * @category deleteBooking() + */ +export interface DeleteBookingResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by deleteBooking() + * @category deleteBooking() + */ +export interface DeleteBookingResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by deleteBooking() + * @category deleteBooking() + */ +export interface DeleteBookingResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by deleteBooking() + * @category deleteBooking() + */ +export interface DeleteBookingResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 423 to the request made by deleteBooking() + * @category deleteBooking() + */ +export interface DeleteBookingResponse423 extends Types.ErrorResponse { + status: 423; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by deleteBooking() + * @category deleteBooking() + */ +export interface DeleteBookingResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by deleteBooking() + * @category deleteBooking() + */ +export interface DeleteBookingResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by getBooking() + * @category getBooking() + */ +export type GetBookingParameters = { + ID: string; +}; + +/** + * Typing for all possible responses to the request made by getBooking() + * @category getBooking() + */ +export type GetBookingResponse = GetBookingSuccessResponse | GetBookingErrorResponse; + +/** + * Typing for all successful responses to the request made by getBooking() + * @category getBooking() + */ +export type GetBookingSuccessResponse = GetBookingResponse200; + +/** + * Typing for all error responses to the request made by getBooking() + * @category getBooking() + */ +export type GetBookingErrorResponse = + | GetBookingResponse401 + | GetBookingResponse403 + | GetBookingResponse404 + | GetBookingResponse500 + | GetBookingResponse503; + +/** + * Typing for a response with status 200 to the request made by getBooking() + * @category getBooking() + */ +export interface GetBookingResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: { + /** + * A booking in the booking system. + */ + Booking: Types.Booking<'response'>; + /** + * Shows if the booking is in a locked status. + */ + Locked: boolean; + [k: string]: unknown; + }; +} + +/** + * Typing for a response with status 401 to the request made by getBooking() + * @category getBooking() + */ +export interface GetBookingResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by getBooking() + * @category getBooking() + */ +export interface GetBookingResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by getBooking() + * @category getBooking() + */ +export interface GetBookingResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by getBooking() + * @category getBooking() + */ +export interface GetBookingResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by getBooking() + * @category getBooking() + */ +export interface GetBookingResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for the parameters of the request made by destroyBooking() + * @category destroyBooking() + */ +export type DestroyBookingParameters = { + ID: string; +}; + +/** + * Typing for all possible responses to the request made by destroyBooking() + * @category destroyBooking() + */ +export type DestroyBookingResponse = + | DestroyBookingSuccessResponse + | DestroyBookingErrorResponse; + +/** + * Typing for all successful responses to the request made by destroyBooking() + * @category destroyBooking() + */ +export type DestroyBookingSuccessResponse = DestroyBookingResponse200; + +/** + * Typing for all error responses to the request made by destroyBooking() + * @category destroyBooking() + */ +export type DestroyBookingErrorResponse = + | DestroyBookingResponse401 + | DestroyBookingResponse403 + | DestroyBookingResponse404 + | DestroyBookingResponse423 + | DestroyBookingResponse500 + | DestroyBookingResponse503; + +/** + * Typing for a response with status 200 to the request made by destroyBooking() + * @category destroyBooking() + */ +export interface DestroyBookingResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by destroyBooking() + * @category destroyBooking() + */ +export interface DestroyBookingResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by destroyBooking() + * @category destroyBooking() + */ +export interface DestroyBookingResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by destroyBooking() + * @category destroyBooking() + */ +export interface DestroyBookingResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 423 to the request made by destroyBooking() + * @category destroyBooking() + */ +export interface DestroyBookingResponse423 extends Types.ErrorResponse { + status: 423; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 500 to the request made by destroyBooking() + * @category destroyBooking() + */ +export interface DestroyBookingResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by destroyBooking() + * @category destroyBooking() + */ +export interface DestroyBookingResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} diff --git a/services/experiment/src/clients/booking-frontend/types.ts b/services/experiment/src/clients/booking-frontend/types.ts new file mode 100644 index 00000000..8d0b0be8 --- /dev/null +++ b/services/experiment/src/clients/booking-frontend/types.ts @@ -0,0 +1,410 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +import * as _BasicValidation from './basicValidation.cjs'; + +/** + * @internal + */ +export interface FunctionWithErrors { + (...args: unknown[]): unknown; + errors?: unknown; +} + +/** + * @internal + */ +export interface RequestInfo { + method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'TRACE' | 'OPTIONS' | 'PATCH' | 'HEAD'; + body?: string; + headers?: [string, string][]; +} + +/** + * @internal + */ +export type FetchFunction = ( + url: string, + info?: RequestInfo, +) => Promise | ResponseData; + +export interface ResponseData { + status: number; + headers?: { + [key: string]: string | undefined; + }; + body?: unknown; +} + +export interface SuccessResponse extends ResponseData { + success?: true; +} + +export interface ErrorResponse extends ResponseData { + success?: false; +} + +/** + * @internal + */ +export function isSuccessResponse(response: ResponseData): response is SuccessResponse { + return response.status < 400; +} + +/** + * @internal + */ +export function isErrorResponse(response: ResponseData): response is ErrorResponse { + return response.status >= 400; +} + +/** + * This type allows to pick the required properties of another type. + */ +export type Require = Partial & { + [Property in Key]-?: Type[Property]; +}; + +export type SizedTuple< + T, + MIN extends number | undefined = undefined, + MAX extends number | undefined = undefined, +> = MIN extends number + ? MAX extends number + ? _SizedTuple> + : TupleObject> & T[] + : MAX extends number + ? _SizedTuple, true> + : T[]; + +type _SizedTuple = ARR extends [ + infer HEAD extends number, + ...infer TAIL extends number[], +] + ? Tuple | _SizedTuple + : never; + +type Tuple = _Tuple< + T, + NumericRangeTuple +>; + +type _Tuple = N extends [ + infer HEAD, + ...infer TAIL extends number[], +] + ? HEAD extends 0 + ? [] | _Tuple + : [T, ..._Tuple] + : []; + +type TupleObject = N extends [ + infer HEAD extends number, + ...infer TAIL extends number[], +] + ? TAIL extends [] + ? Record + : { [P in HEAD]: T } & TupleObject + : Record; + +export type NumericRange< + START extends number, + END extends number, + ARR extends unknown[] = [], + ACC extends number = never, +> = ARR['length'] extends END + ? ACC | START | END + : NumericRange< + START, + END, + [...ARR, 1], + ARR[START] extends undefined ? ACC : ACC | ARR['length'] + >; + +type NumericRangeTuple< + START extends number, + END extends number, + ARR extends unknown[] = [], + ACC extends number[] = [], +> = ARR['length'] extends END + ? [START, ...ACC, END] + : NumericRangeTuple< + START, + END, + [...ARR, 1], + ARR[START] extends undefined ? ACC : [...ACC, ARR['length']] + >; + +/** + * A booking in the booking system. + */ +export type Booking = T extends 'all' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : never; + +/** + * A device might either be a physical/virtual device or a group of device. + */ +export type Device = T extends 'all' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : never; + +/** + * An experiment describes a set of devices and how they should be connected (potentially among other metadata). + */ +export type Experiment = T extends 'all' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device<'request'>[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device<'response'>[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : never; + +/** + * A time slot represents a slice of time used for bookings. + */ +export type Timeslot = T extends 'all' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : never; diff --git a/services/experiment/src/clients/device/client.ts b/services/experiment/src/clients/device/client.ts index 3d97e543..46a0ace9 100644 --- a/services/experiment/src/clients/device/client.ts +++ b/services/experiment/src/clients/device/client.ts @@ -127,23 +127,10 @@ function parsePathParameters(url: string, endpoint: string): string[] { * // returns ["username", "role_name"] * validateUrl("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") */ -function validateUrl(url: string, baseUrl: string, endpoint: string): string[] { +function validateUrl(url: string, endpoint: string): string[] { if (!isValidHttpUrl(url)) throw new InvalidUrlError('Provided url is not a valid http url'); - if (!url.startsWith(baseUrl)) - throw new InvalidUrlError('Provided url does not start with the provided base url'); - const pathParameters = parsePathParameters(url, endpoint); - - let extendedBaseUrl = baseUrl + endpoint; - - pathParameters.forEach(pathParameter => { - extendedBaseUrl = extendedBaseUrl.replace('{}', pathParameter); - }); - - if (url !== extendedBaseUrl) - throw new InvalidUrlError('Provided url does not match extended base url'); - - return pathParameters; + return parsePathParameters(url, endpoint); } /** @@ -173,10 +160,11 @@ export class Client { private fixedHeaders: [string, string][]; private fetch = async (url: RequestInfo | URL, init: RequestInit) => { let raw_response; + const parsedUrl = new URL(url.toString()); try { if ( - url.toString().startsWith(this.baseUrl) || - url.toString().startsWith(this.serviceUrl) + parsedUrl.toString().startsWith(this.baseUrl) || + parsedUrl.toString().startsWith(this.serviceUrl) ) { raw_response = await fetch(url, init); } else { @@ -211,12 +199,8 @@ export class Client { fixedHeaders?: [string, string][]; }, ) { - this.baseUrl = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl; - this.serviceUrl = options.serviceUrl - ? options.serviceUrl.endsWith('/') - ? options.serviceUrl.slice(0, -1) - : options.serviceUrl - : this.baseUrl; + this.baseUrl = new URL(baseUrl).toString().slice(0, -1); + this.serviceUrl = new URL(options.serviceUrl ?? this.baseUrl).toString().slice(0, -1); this.accessToken = options.accessToken ?? ''; this.fixedHeaders = options.fixedHeaders ?? []; } @@ -244,6 +228,7 @@ export class Client { url?: string; }): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, '/devices'); + console.log('trying to fetch url:', url); if (!RequestValidation.validateListDevicesInput()) throw new ValidationError( @@ -253,15 +238,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'GET', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'GET', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateListDevicesOutput(response)) throw new ValidationError( @@ -316,6 +308,7 @@ export class Client { }, ): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, '/devices'); + console.log('trying to fetch url:', url); const body = device; @@ -336,8 +329,16 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); const response = await this.fetch( - url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), { method: 'POST', headers: [ @@ -394,7 +395,8 @@ export class Client { ): Promise { const urlSuffix = '/devices/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}'); + console.log('trying to fetch url:', url); const parameters = { device_id: device_id, @@ -414,8 +416,16 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); const response = await this.fetch( - url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), { method: 'GET', headers: [ @@ -473,7 +483,7 @@ export class Client { */ public async updateDevice( url: string, - deviceUpdate: Types.DeviceUpdate<'request'>, + deviceUpdate: Types.DeviceUpdate<'request'> | undefined, options?: { headers?: [string, string][]; changedUrl?: string; @@ -481,7 +491,8 @@ export class Client { ): Promise { const urlSuffix = '/devices/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}'); + console.log('trying to fetch url:', url); const body = deviceUpdate; @@ -503,8 +514,16 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); const response = await this.fetch( - url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), { method: 'PATCH', headers: [ @@ -558,7 +577,8 @@ export class Client { ): Promise { const urlSuffix = '/devices/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}'); + console.log('trying to fetch url:', url); const parameters = { device_id: device_id, @@ -572,15 +592,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'DELETE', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'DELETE', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateDeleteDeviceOutput(response)) throw new ValidationError( @@ -631,7 +658,8 @@ export class Client { ): Promise { const urlSuffix = '/devices/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}'); + console.log('trying to fetch url:', url); const parameters = { device_id: device_id, @@ -653,8 +681,16 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); const response = await this.fetch( - url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), { method: 'POST', headers: [ @@ -715,7 +751,8 @@ export class Client { ): Promise { const urlSuffix = '/devices/{}/availability'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}/availability'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}/availability'); + console.log('trying to fetch url:', url); const parameters = { device_id: device_id, @@ -740,8 +777,16 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); const response = await this.fetch( - url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), { method: 'GET', headers: [ @@ -796,7 +841,8 @@ export class Client { ): Promise { const urlSuffix = '/devices/{}/availability'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}/availability'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}/availability'); + console.log('trying to fetch url:', url); const parameters = { device_id: device_id, @@ -812,15 +858,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'DELETE', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'DELETE', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateDeleteDeviceAvailabilityRulesOutput(response)) throw new ValidationError( @@ -859,14 +912,15 @@ export class Client { */ public async addDeviceAvailabilityRules( url: string, - availabilityRules: Types.AvailabilityRule<'request'>[], + availabilityRules: Types.AvailabilityRule<'request'>[] | undefined, options?: { headers?: [string, string][]; }, ): Promise { const urlSuffix = '/devices/{}/availability'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}/availability'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}/availability'); + console.log('trying to fetch url:', url); const body = availabilityRules; @@ -884,16 +938,23 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'POST', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - body: JSON.stringify(body), - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); if (!RequestValidation.validateAddDeviceAvailabilityRulesOutput(response)) throw new ValidationError( @@ -938,7 +999,8 @@ export class Client { ): Promise { const urlSuffix = '/devices/{}/websocket'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}/websocket'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}/websocket'); + console.log('trying to fetch url:', url); const parameters = { device_id: device_id, @@ -954,15 +1016,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'POST', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateCreateWebsocketTokenOutput(response)) throw new ValidationError( @@ -1016,7 +1085,8 @@ export class Client { ): Promise { const urlSuffix = '/devices/{}/signaling'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [device_id] = validateUrl(url, this.baseUrl, '/devices/{}/signaling'); + const [device_id] = validateUrl(new URL(url).toString(), '/devices/{}/signaling'); + console.log('trying to fetch url:', url); const body = sigMessage; @@ -1034,16 +1104,23 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'POST', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - body: JSON.stringify(body), - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); if (!RequestValidation.validateSendSignalingMessageOutput(response)) throw new ValidationError( @@ -1083,6 +1160,7 @@ export class Client { url?: string; }): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, '/peerconnections'); + console.log('trying to fetch url:', url); if (!RequestValidation.validateListPeerconnectionsInput()) throw new ValidationError( @@ -1094,15 +1172,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'GET', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'GET', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateListPeerconnectionsOutput(response)) throw new ValidationError( @@ -1156,6 +1241,7 @@ export class Client { }, ): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, '/peerconnections'); + console.log('trying to fetch url:', url); const body = peerconnection; @@ -1182,8 +1268,16 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); const response = await this.fetch( - url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), { method: 'POST', headers: [ @@ -1239,7 +1333,11 @@ export class Client { ): Promise { const urlSuffix = '/peerconnections/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [peerconnection_id] = validateUrl(url, this.baseUrl, '/peerconnections/{}'); + const [peerconnection_id] = validateUrl( + new URL(url).toString(), + '/peerconnections/{}', + ); + console.log('trying to fetch url:', url); const parameters = { peerconnection_id: peerconnection_id, @@ -1255,15 +1353,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'GET', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'GET', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateGetPeerconnectionOutput(response)) throw new ValidationError( @@ -1309,7 +1414,11 @@ export class Client { ): Promise { const urlSuffix = '/peerconnections/{}'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); - const [peerconnection_id] = validateUrl(url, this.baseUrl, '/peerconnections/{}'); + const [peerconnection_id] = validateUrl( + new URL(url).toString(), + '/peerconnections/{}', + ); + console.log('trying to fetch url:', url); const parameters = { peerconnection_id: peerconnection_id, @@ -1325,15 +1434,22 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl), { - method: 'DELETE', - headers: [ - ['Content-Type', 'application/json'], - ['Authorization', authorization], - ...this.fixedHeaders, - ...(options?.headers ?? []), - ], - }); + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'DELETE', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + }, + ); if (!RequestValidation.validateDeletePeerconnectionOutput(response)) throw new ValidationError( @@ -1389,10 +1505,10 @@ export class Client { const urlSuffix = '/peerconnections/{}/device_status'.split('{}').at(-1) ?? ''; if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix); const [peerconnection_id] = validateUrl( - url, - this.baseUrl, + new URL(url).toString(), '/peerconnections/{}/device_status', ); + console.log('trying to fetch url:', url); const parameters = { peerconnection_id: peerconnection_id, @@ -1414,8 +1530,16 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}`; + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), + ); const response = await this.fetch( - url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), + new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + + '?' + + new URLSearchParams(query), { method: 'PATCH', headers: [ diff --git a/services/experiment/src/clients/index.ts b/services/experiment/src/clients/index.ts index 51776c7f..7ba5fe04 100644 --- a/services/experiment/src/clients/index.ts +++ b/services/experiment/src/clients/index.ts @@ -1,13 +1,30 @@ import { RequestHandler } from 'express'; import { config } from '../config.js'; +import { Client as BookingBackendClient } from './booking-backend/client.js'; +import { Client as BookingFrontendClient } from './booking-frontend/client.js'; import { Client as DeviceClient } from './device/client.js'; +import { Client as ScheduleServiceClient } from './schedule-service/client.js'; export const device = new DeviceClient(config.BASE_URL, { serviceUrl: config.DEVICE_SERVICE_URL, fixedHeaders: [['x-request-authentication', 'experiment-service']], }); -export const clients = { device }; +export const booking = { + backend: new BookingBackendClient(config.BASE_URL, { + serviceUrl: config.BOOKING_BACKEND_URL, + fixedHeaders: [['x-request-authentication', 'experiment-service']], + }), + frontend: new BookingFrontendClient(config.BASE_URL, { + serviceUrl: config.BOOKING_FRONTEND_URL, + fixedHeaders: [['x-request-authentication', 'experiment-service']], + }), + schedule: new ScheduleServiceClient(config.BASE_URL, { + serviceUrl: config.SCHEDULE_SERVICE_URL, + fixedHeaders: [['x-request-authentication', 'experiment-service']], + }), +}; +export const clients = { device, booking }; export type Clients = typeof clients; declare global { @@ -33,7 +50,23 @@ export const middleware: RequestHandler = (req, _res, next) => { serviceUrl: config.DEVICE_SERVICE_URL, fixedHeaders: fixed_headers, }); - req.clients = { device: bound_device }; + + const bound_booking = { + backend: new BookingBackendClient(config.BASE_URL, { + serviceUrl: config.BOOKING_BACKEND_URL, + fixedHeaders: fixed_headers, + }), + frontend: new BookingFrontendClient(config.BASE_URL, { + serviceUrl: config.BOOKING_FRONTEND_URL, + fixedHeaders: fixed_headers, + }), + schedule: new ScheduleServiceClient(config.BASE_URL, { + serviceUrl: config.SCHEDULE_SERVICE_URL, + fixedHeaders: fixed_headers, + }), + }; + + req.clients = { device: bound_device, booking: bound_booking }; next(); }; diff --git a/services/experiment/src/clients/schedule-service/basicValidation.cjs b/services/experiment/src/clients/schedule-service/basicValidation.cjs new file mode 100644 index 00000000..ff4febf8 --- /dev/null +++ b/services/experiment/src/clients/schedule-service/basicValidation.cjs @@ -0,0 +1,6650 @@ +/* eslint-disable */ +//@ts-nocheck +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +'use strict'; +exports.validateBooking = validate21; +const schema6 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'Booking', + 'x-location': '#/components/schemas/Booking', + 'x-schema-type': 'all', +}; +const formats0 = require('ajv-formats/dist/formats').fullFormats.uri; +const formats2 = require('ajv-formats/dist/formats').fullFormats['date-time']; +function validate21( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate21.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema6.required, + parentSchema: schema6, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate21.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema6.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.ID.type, + parentSchema: schema6.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate21.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema6.properties.Time.required, + parentSchema: schema6.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate21.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema6.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Time.properties.Start.type, + parentSchema: schema6.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate21.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema6.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Time.properties.End.type, + parentSchema: schema6.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema6.properties.Time.type, + parentSchema: schema6.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate21.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema6.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Devices.items.type, + parentSchema: schema6.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate21.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema6.properties.Devices.type, + parentSchema: schema6.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Type.type, + parentSchema: schema6.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate21.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema6.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema6.properties.Type.enum, + parentSchema: schema6.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Status.type, + parentSchema: schema6.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate21.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema6.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema6.properties.Status.enum, + parentSchema: schema6.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate21.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema6.properties.You.type, + parentSchema: schema6.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate21.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema6.properties.External.type, + parentSchema: schema6.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate21.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema6.properties.Message.type, + parentSchema: schema6.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate21.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema6.type, + parentSchema: schema6, + data, + }, + ]; + return false; + } + } + validate21.errors = vErrors; + return errors === 0; +} +exports.validateDevice = validate22; +const schema7 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'Device', + 'x-location': '#/components/schemas/Device', + 'x-schema-type': 'all', +}; +function validate22( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate22.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema7.required, + parentSchema: schema7, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate22.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema7.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate22.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema7.properties.ID.type, + parentSchema: schema7.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate22.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema7.type, + parentSchema: schema7, + data, + }, + ]; + return false; + } + } + validate22.errors = vErrors; + return errors === 0; +} +exports.validateExperiment = validate23; +const schema8 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'Experiment', + 'x-location': '#/components/schemas/Experiment', + 'x-schema-type': 'all', +}; +function validate23( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate23.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema8.required, + parentSchema: schema8, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema8.properties.Devices.items.required, + parentSchema: schema8.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema8.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema8.properties.Devices.items.properties.ID.type, + parentSchema: + schema8.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema8.properties.Devices.items.type, + parentSchema: schema8.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate23.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema8.properties.Devices.type, + parentSchema: schema8.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate23.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema8.properties.Description.type, + parentSchema: schema8.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate23.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema8.type, + parentSchema: schema8, + data, + }, + ]; + return false; + } + } + validate23.errors = vErrors; + return errors === 0; +} +exports.validateTimeslot = validate24; +const schema9 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'Timeslot', + 'x-location': '#/components/schemas/Timeslot', + 'x-schema-type': 'all', +}; +function validate24( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate24.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema9.required, + parentSchema: schema9, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate24.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema9.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate24.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema9.properties.Start.type, + parentSchema: schema9.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate24.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema9.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate24.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema9.properties.End.type, + parentSchema: schema9.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate24.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema9.type, + parentSchema: schema9, + data, + }, + ]; + return false; + } + } + validate24.errors = vErrors; + return errors === 0; +} +exports.validateID = validate25; +const schema10 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'ID', + 'x-location': '#/components/parameters/ID/schema', + 'x-schema-type': 'all', +}; +function validate25( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate25.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema10.type, + parentSchema: schema10, + data, + }, + ]; + return false; + } + validate25.errors = vErrors; + return errors === 0; +} +exports.validateScheduleBody = validate26; +const schema11 = { + type: 'object', + required: ['Experiment', 'Time'], + properties: { + Experiment: { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Combined: { + type: 'boolean', + description: + 'If true, show only one timetable per device instead of one for all available physical devices.', + }, + onlyOwn: { + type: 'boolean', + description: + '(private) Show only devices of this institution. Give an error if a device of an other institution is requested.', + }, + }, + 'x-standalone': false, + 'x-name': 'scheduleBody', + 'x-location': '#/paths//schedule/post/requestBody/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate26( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Experiment === undefined && (missing0 = 'Experiment')) || + (data.Time === undefined && (missing0 = 'Time')) + ) { + validate26.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema11.required, + parentSchema: schema11, + data, + }, + ]; + return false; + } else { + if (data.Experiment !== undefined) { + let data0 = data.Experiment; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if (data0.Devices === undefined && (missing1 = 'Devices')) { + validate26.errors = [ + { + instancePath: instancePath + '/Experiment', + schemaPath: '#/properties/Experiment/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema11.properties.Experiment.required, + parentSchema: schema11.properties.Experiment, + data: data0, + }, + ]; + return false; + } else { + if (data0.Devices !== undefined) { + let data1 = data0.Devices; + const _errs3 = errors; + if (errors === _errs3) { + if (Array.isArray(data1)) { + var valid2 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs5 = errors; + if (errors === _errs5) { + if ( + data2 && + typeof data2 == 'object' && + !Array.isArray(data2) + ) { + let missing2; + if (data2.ID === undefined && (missing2 = 'ID')) { + validate26.errors = [ + { + instancePath: + instancePath + '/Experiment/Devices/' + i0, + schemaPath: + '#/properties/Experiment/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema11.properties.Experiment.properties.Devices + .items.required, + parentSchema: + schema11.properties.Experiment.properties.Devices + .items, + data: data2, + }, + ]; + return false; + } else { + if (data2.ID !== undefined) { + let data3 = data2.ID; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + validate26.errors = [ + { + instancePath: + instancePath + + '/Experiment/Devices/' + + i0 + + '/ID', + schemaPath: + '#/properties/Experiment/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema11.properties.Experiment.properties + .Devices.items.properties.ID, + data: data3, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: + instancePath + + '/Experiment/Devices/' + + i0 + + '/ID', + schemaPath: + '#/properties/Experiment/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema11.properties.Experiment.properties + .Devices.items.properties.ID.type, + parentSchema: + schema11.properties.Experiment.properties + .Devices.items.properties.ID, + data: data3, + }, + ]; + return false; + } + } + } + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Experiment/Devices/' + i0, + schemaPath: + '#/properties/Experiment/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema11.properties.Experiment.properties.Devices.items + .type, + parentSchema: + schema11.properties.Experiment.properties.Devices.items, + data: data2, + }, + ]; + return false; + } + } + var valid2 = _errs5 === errors; + if (!valid2) { + break; + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Experiment/Devices', + schemaPath: '#/properties/Experiment/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema11.properties.Experiment.properties.Devices.type, + parentSchema: schema11.properties.Experiment.properties.Devices, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Description !== undefined) { + let data4 = data0.Description; + const _errs9 = errors; + if (typeof data4 !== 'string') { + validate26.errors = [ + { + instancePath: instancePath + '/Experiment/Description', + schemaPath: + '#/properties/Experiment/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema11.properties.Experiment.properties.Description.type, + parentSchema: + schema11.properties.Experiment.properties.Description, + data: data4, + }, + ]; + return false; + } + var valid1 = _errs9 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Experiment', + schemaPath: '#/properties/Experiment/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.properties.Experiment.type, + parentSchema: schema11.properties.Experiment, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data5 = data.Time; + const _errs11 = errors; + if (errors === _errs11) { + if (data5 && typeof data5 == 'object' && !Array.isArray(data5)) { + let missing3; + if ( + (data5.Start === undefined && (missing3 = 'Start')) || + (data5.End === undefined && (missing3 = 'End')) + ) { + validate26.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema11.properties.Time.required, + parentSchema: schema11.properties.Time, + data: data5, + }, + ]; + return false; + } else { + if (data5.Start !== undefined) { + let data6 = data5.Start; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data6 === 'string') { + if (!formats2.validate(data6)) { + validate26.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema11.properties.Time.properties.Start, + data: data6, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.properties.Time.properties.Start.type, + parentSchema: schema11.properties.Time.properties.Start, + data: data6, + }, + ]; + return false; + } + } + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data5.End !== undefined) { + let data7 = data5.End; + const _errs15 = errors; + if (errors === _errs15) { + if (errors === _errs15) { + if (typeof data7 === 'string') { + if (!formats2.validate(data7)) { + validate26.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema11.properties.Time.properties.End, + data: data7, + }, + ]; + return false; + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema11.properties.Time.properties.End.type, + parentSchema: schema11.properties.Time.properties.End, + data: data7, + }, + ]; + return false; + } + } + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate26.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.properties.Time.type, + parentSchema: schema11.properties.Time, + data: data5, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Combined !== undefined) { + let data8 = data.Combined; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate26.errors = [ + { + instancePath: instancePath + '/Combined', + schemaPath: '#/properties/Combined/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema11.properties.Combined.type, + parentSchema: schema11.properties.Combined, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.onlyOwn !== undefined) { + let data9 = data.onlyOwn; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate26.errors = [ + { + instancePath: instancePath + '/onlyOwn', + schemaPath: '#/properties/onlyOwn/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema11.properties.onlyOwn.type, + parentSchema: schema11.properties.onlyOwn, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } else { + validate26.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema11.type, + parentSchema: schema11, + data, + }, + ]; + return false; + } + } + validate26.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse200 = validate27; +const schema12 = { + type: 'array', + items: { + type: 'object', + required: ['Device', 'Booked', 'Free'], + properties: { + Device: { type: 'string', description: 'ID of the device (or * if combined).' }, + Booked: { + type: 'array', + description: 'Array of booked times.', + items: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + }, + Free: { + type: 'array', + description: 'Array of free times.', + items: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + }, + }, + }, + 'x-standalone': false, + 'x-name': 'scheduleResponse200', + 'x-location': '#/paths//schedule/post/responses/200/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate27( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if ( + (data0.Device === undefined && (missing0 = 'Device')) || + (data0.Booked === undefined && (missing0 = 'Booked')) || + (data0.Free === undefined && (missing0 = 'Free')) + ) { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema12.items.required, + parentSchema: schema12.items, + data: data0, + }, + ]; + return false; + } else { + if (data0.Device !== undefined) { + let data1 = data0.Device; + const _errs3 = errors; + if (typeof data1 !== 'string') { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Device', + schemaPath: '#/items/properties/Device/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema12.items.properties.Device.type, + parentSchema: schema12.items.properties.Device, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Booked !== undefined) { + let data2 = data0.Booked; + const _errs5 = errors; + if (errors === _errs5) { + if (Array.isArray(data2)) { + var valid2 = true; + const len1 = data2.length; + for (let i1 = 0; i1 < len1; i1++) { + let data3 = data2[i1]; + const _errs7 = errors; + if (errors === _errs7) { + if ( + data3 && + typeof data3 == 'object' && + !Array.isArray(data3) + ) { + let missing1; + if ( + (data3.Start === undefined && (missing1 = 'Start')) || + (data3.End === undefined && (missing1 = 'End')) + ) { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked/' + i1, + schemaPath: '#/items/properties/Booked/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: schema12.items.properties.Booked.items.required, + parentSchema: schema12.items.properties.Booked.items, + data: data3, + }, + ]; + return false; + } else { + if (data3.Start !== undefined) { + let data4 = data3.Start; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate27.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/Start', + schemaPath: + '#/items/properties/Booked/items/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema12.items.properties.Booked.items + .properties.Start, + data: data4, + }, + ]; + return false; + } + } else { + validate27.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/Start', + schemaPath: + '#/items/properties/Booked/items/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema12.items.properties.Booked.items + .properties.Start.type, + parentSchema: + schema12.items.properties.Booked.items + .properties.Start, + data: data4, + }, + ]; + return false; + } + } + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.End !== undefined) { + let data5 = data3.End; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats2.validate(data5)) { + validate27.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/End', + schemaPath: + '#/items/properties/Booked/items/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema12.items.properties.Booked.items + .properties.End, + data: data5, + }, + ]; + return false; + } + } else { + validate27.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/End', + schemaPath: + '#/items/properties/Booked/items/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema12.items.properties.Booked.items + .properties.End.type, + parentSchema: + schema12.items.properties.Booked.items + .properties.End, + data: data5, + }, + ]; + return false; + } + } + } + var valid3 = _errs11 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked/' + i1, + schemaPath: '#/items/properties/Booked/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema12.items.properties.Booked.items.type, + parentSchema: schema12.items.properties.Booked.items, + data: data3, + }, + ]; + return false; + } + } + var valid2 = _errs7 === errors; + if (!valid2) { + break; + } + } + } else { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked', + schemaPath: '#/items/properties/Booked/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema12.items.properties.Booked.type, + parentSchema: schema12.items.properties.Booked, + data: data2, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Free !== undefined) { + let data6 = data0.Free; + const _errs13 = errors; + if (errors === _errs13) { + if (Array.isArray(data6)) { + var valid4 = true; + const len2 = data6.length; + for (let i2 = 0; i2 < len2; i2++) { + let data7 = data6[i2]; + const _errs15 = errors; + if (errors === _errs15) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing2; + if ( + (data7.Start === undefined && (missing2 = 'Start')) || + (data7.End === undefined && (missing2 = 'End')) + ) { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free/' + i2, + schemaPath: '#/items/properties/Free/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: schema12.items.properties.Free.items.required, + parentSchema: schema12.items.properties.Free.items, + data: data7, + }, + ]; + return false; + } else { + if (data7.Start !== undefined) { + let data8 = data7.Start; + const _errs17 = errors; + if (errors === _errs17) { + if (errors === _errs17) { + if (typeof data8 === 'string') { + if (!formats2.validate(data8)) { + validate27.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/Start', + schemaPath: + '#/items/properties/Free/items/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema12.items.properties.Free.items + .properties.Start, + data: data8, + }, + ]; + return false; + } + } else { + validate27.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/Start', + schemaPath: + '#/items/properties/Free/items/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema12.items.properties.Free.items + .properties.Start.type, + parentSchema: + schema12.items.properties.Free.items + .properties.Start, + data: data8, + }, + ]; + return false; + } + } + } + var valid5 = _errs17 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data7.End !== undefined) { + let data9 = data7.End; + const _errs19 = errors; + if (errors === _errs19) { + if (errors === _errs19) { + if (typeof data9 === 'string') { + if (!formats2.validate(data9)) { + validate27.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/End', + schemaPath: + '#/items/properties/Free/items/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + + 'date-time' + + '"', + schema: 'date-time', + parentSchema: + schema12.items.properties.Free.items + .properties.End, + data: data9, + }, + ]; + return false; + } + } else { + validate27.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/End', + schemaPath: + '#/items/properties/Free/items/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema12.items.properties.Free.items + .properties.End.type, + parentSchema: + schema12.items.properties.Free.items + .properties.End, + data: data9, + }, + ]; + return false; + } + } + } + var valid5 = _errs19 === errors; + } else { + var valid5 = true; + } + } + } + } else { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free/' + i2, + schemaPath: '#/items/properties/Free/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema12.items.properties.Free.items.type, + parentSchema: schema12.items.properties.Free.items, + data: data7, + }, + ]; + return false; + } + } + var valid4 = _errs15 === errors; + if (!valid4) { + break; + } + } + } else { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free', + schemaPath: '#/items/properties/Free/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema12.items.properties.Free.type, + parentSchema: schema12.items.properties.Free, + data: data6, + }, + ]; + return false; + } + } + var valid1 = _errs13 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate27.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema12.items.type, + parentSchema: schema12.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate27.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema12.type, + parentSchema: schema12, + data, + }, + ]; + return false; + } + } + validate27.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse404 = validate28; +const schema13 = { + type: 'string', + description: 'First unknown device ID.', + 'x-standalone': false, + 'x-name': 'scheduleResponse404', + 'x-location': '#/paths//schedule/post/responses/404/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate28( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate28.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema13.type, + parentSchema: schema13, + data, + }, + ]; + return false; + } + validate28.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse422 = validate29; +const schema14 = { + type: 'string', + description: 'First virtual device ID.', + 'x-standalone': false, + 'x-name': 'scheduleResponse422', + 'x-location': '#/paths//schedule/post/responses/422/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate29( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate29.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema14.type, + parentSchema: schema14, + data, + }, + ]; + return false; + } + validate29.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse500 = validate30; +const schema15 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'scheduleResponse500', + 'x-location': '#/paths//schedule/post/responses/500/content/application/json/schema', + 'x-schema-type': 'all', +}; +function validate30( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate30.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema15.type, + parentSchema: schema15, + data, + }, + ]; + return false; + } + validate30.errors = vErrors; + return errors === 0; +} +exports.validateBookingRequest = validate31; +const schema16 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'BookingRequest', + 'x-location': '#/components/schemas/Booking_request', + 'x-schema-type': 'request', +}; +function validate31( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate31.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema16.required, + parentSchema: schema16, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate31.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema16.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.ID.type, + parentSchema: schema16.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate31.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema16.properties.Time.required, + parentSchema: schema16.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate31.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema16.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Time.properties.Start.type, + parentSchema: schema16.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate31.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema16.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Time.properties.End.type, + parentSchema: schema16.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema16.properties.Time.type, + parentSchema: schema16.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate31.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema16.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Devices.items.type, + parentSchema: schema16.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate31.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema16.properties.Devices.type, + parentSchema: schema16.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate31.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Type.type, + parentSchema: schema16.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate31.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema16.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema16.properties.Type.enum, + parentSchema: schema16.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate31.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Status.type, + parentSchema: schema16.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate31.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema16.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema16.properties.Status.enum, + parentSchema: schema16.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate31.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema16.properties.You.type, + parentSchema: schema16.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate31.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema16.properties.External.type, + parentSchema: schema16.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate31.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema16.properties.Message.type, + parentSchema: schema16.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate31.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema16.type, + parentSchema: schema16, + data, + }, + ]; + return false; + } + } + validate31.errors = vErrors; + return errors === 0; +} +exports.validateBookingResponse = validate32; +const schema17 = { + title: 'Booking', + description: 'A booking in the booking system.', + type: 'object', + required: ['ID', 'Time', 'Devices', 'Status', 'You', 'External'], + properties: { + ID: { type: 'string', format: 'uri', description: 'Unique ID of the booking.' }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Devices: { type: 'array', items: { type: 'string', format: 'uri' } }, + Type: { + description: + "Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed.", + type: 'string', + enum: ['normal'], + }, + Status: { + description: + "Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked.\n", + type: 'string', + enum: [ + 'pending', + 'booked', + 'rejected', + 'cancelled', + 'active', + 'active-pending', + 'active-rejected', + ], + }, + You: { type: 'boolean', description: 'If true, this booking was done by you.' }, + External: { + type: 'boolean', + description: 'Shows whether the booking was done by an external institution.', + }, + Message: { + type: 'string', + description: + 'User readable notes about the status of the booking (e.g. if devices are unknown).', + }, + }, + 'x-standalone': true, + 'x-name': 'BookingResponse', + 'x-location': '#/components/schemas/Booking_response', + 'x-schema-type': 'response', +}; +function validate32( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.ID === undefined && (missing0 = 'ID')) || + (data.Time === undefined && (missing0 = 'Time')) || + (data.Devices === undefined && (missing0 = 'Devices')) || + (data.Status === undefined && (missing0 = 'Status')) || + (data.You === undefined && (missing0 = 'You')) || + (data.External === undefined && (missing0 = 'External')) + ) { + validate32.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema17.required, + parentSchema: schema17, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate32.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema17.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.properties.ID.type, + parentSchema: schema17.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data1 = data.Time; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if ( + (data1.Start === undefined && (missing1 = 'Start')) || + (data1.End === undefined && (missing1 = 'End')) + ) { + validate32.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema17.properties.Time.required, + parentSchema: schema17.properties.Time, + data: data1, + }, + ]; + return false; + } else { + if (data1.Start !== undefined) { + let data2 = data1.Start; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats2.validate(data2)) { + validate32.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema17.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.properties.Time.properties.Start.type, + parentSchema: schema17.properties.Time.properties.Start, + data: data2, + }, + ]; + return false; + } + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data1.End !== undefined) { + let data3 = data1.End; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats2.validate(data3)) { + validate32.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema17.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.properties.Time.properties.End.type, + parentSchema: schema17.properties.Time.properties.End, + data: data3, + }, + ]; + return false; + } + } + } + var valid1 = _errs7 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema17.properties.Time.type, + parentSchema: schema17.properties.Time, + data: data1, + }, + ]; + return false; + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Devices !== undefined) { + let data4 = data.Devices; + const _errs9 = errors; + if (errors === _errs9) { + if (Array.isArray(data4)) { + var valid2 = true; + const len0 = data4.length; + for (let i0 = 0; i0 < len0; i0++) { + let data5 = data4[i0]; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats0(data5)) { + validate32.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema17.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.properties.Devices.items.type, + parentSchema: schema17.properties.Devices.items, + data: data5, + }, + ]; + return false; + } + } + } + var valid2 = _errs11 === errors; + if (!valid2) { + break; + } + } + } else { + validate32.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema17.properties.Devices.type, + parentSchema: schema17.properties.Devices, + data: data4, + }, + ]; + return false; + } + } + var valid0 = _errs9 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Type !== undefined) { + let data6 = data.Type; + const _errs13 = errors; + if (typeof data6 !== 'string') { + validate32.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.properties.Type.type, + parentSchema: schema17.properties.Type, + data: data6, + }, + ]; + return false; + } + if (!(data6 === 'normal')) { + validate32.errors = [ + { + instancePath: instancePath + '/Type', + schemaPath: '#/properties/Type/enum', + keyword: 'enum', + params: { allowedValues: schema17.properties.Type.enum }, + message: 'must be equal to one of the allowed values', + schema: schema17.properties.Type.enum, + parentSchema: schema17.properties.Type, + data: data6, + }, + ]; + return false; + } + var valid0 = _errs13 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Status !== undefined) { + let data7 = data.Status; + const _errs15 = errors; + if (typeof data7 !== 'string') { + validate32.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.properties.Status.type, + parentSchema: schema17.properties.Status, + data: data7, + }, + ]; + return false; + } + if ( + !( + data7 === 'pending' || + data7 === 'booked' || + data7 === 'rejected' || + data7 === 'cancelled' || + data7 === 'active' || + data7 === 'active-pending' || + data7 === 'active-rejected' + ) + ) { + validate32.errors = [ + { + instancePath: instancePath + '/Status', + schemaPath: '#/properties/Status/enum', + keyword: 'enum', + params: { allowedValues: schema17.properties.Status.enum }, + message: 'must be equal to one of the allowed values', + schema: schema17.properties.Status.enum, + parentSchema: schema17.properties.Status, + data: data7, + }, + ]; + return false; + } + var valid0 = _errs15 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.You !== undefined) { + let data8 = data.You; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate32.errors = [ + { + instancePath: instancePath + '/You', + schemaPath: '#/properties/You/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema17.properties.You.type, + parentSchema: schema17.properties.You, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.External !== undefined) { + let data9 = data.External; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate32.errors = [ + { + instancePath: instancePath + '/External', + schemaPath: '#/properties/External/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema17.properties.External.type, + parentSchema: schema17.properties.External, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Message !== undefined) { + let data10 = data.Message; + const _errs21 = errors; + if (typeof data10 !== 'string') { + validate32.errors = [ + { + instancePath: instancePath + '/Message', + schemaPath: '#/properties/Message/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema17.properties.Message.type, + parentSchema: schema17.properties.Message, + data: data10, + }, + ]; + return false; + } + var valid0 = _errs21 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } + } + } + } + } else { + validate32.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema17.type, + parentSchema: schema17, + data, + }, + ]; + return false; + } + } + validate32.errors = vErrors; + return errors === 0; +} +exports.validateDeviceRequest = validate33; +const schema18 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'DeviceRequest', + 'x-location': '#/components/schemas/Device_request', + 'x-schema-type': 'request', +}; +function validate33( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate33.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema18.required, + parentSchema: schema18, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate33.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema18.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate33.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema18.properties.ID.type, + parentSchema: schema18.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate33.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema18.type, + parentSchema: schema18, + data, + }, + ]; + return false; + } + } + validate33.errors = vErrors; + return errors === 0; +} +exports.validateDeviceResponse = validate34; +const schema19 = { + title: 'Device', + description: 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + 'x-standalone': true, + 'x-name': 'DeviceResponse', + 'x-location': '#/components/schemas/Device_response', + 'x-schema-type': 'response', +}; +function validate34( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.ID === undefined && (missing0 = 'ID')) { + validate34.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema19.required, + parentSchema: schema19, + data, + }, + ]; + return false; + } else { + if (data.ID !== undefined) { + let data0 = data.ID; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats0(data0)) { + validate34.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: schema19.properties.ID, + data: data0, + }, + ]; + return false; + } + } else { + validate34.errors = [ + { + instancePath: instancePath + '/ID', + schemaPath: '#/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema19.properties.ID.type, + parentSchema: schema19.properties.ID, + data: data0, + }, + ]; + return false; + } + } + } + } + } + } else { + validate34.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema19.type, + parentSchema: schema19, + data, + }, + ]; + return false; + } + } + validate34.errors = vErrors; + return errors === 0; +} +exports.validateExperimentRequest = validate35; +const schema20 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'ExperimentRequest', + 'x-location': '#/components/schemas/Experiment_request', + 'x-schema-type': 'request', +}; +function validate35( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate35.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema20.required, + parentSchema: schema20, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate35.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema20.properties.Devices.items.required, + parentSchema: schema20.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate35.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema20.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate35.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema20.properties.Devices.items.properties.ID.type, + parentSchema: + schema20.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate35.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema20.properties.Devices.items.type, + parentSchema: schema20.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate35.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema20.properties.Devices.type, + parentSchema: schema20.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate35.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema20.properties.Description.type, + parentSchema: schema20.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate35.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema20.type, + parentSchema: schema20, + data, + }, + ]; + return false; + } + } + validate35.errors = vErrors; + return errors === 0; +} +exports.validateExperimentResponse = validate36; +const schema21 = { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + 'x-standalone': true, + 'x-name': 'ExperimentResponse', + 'x-location': '#/components/schemas/Experiment_response', + 'x-schema-type': 'response', +}; +function validate36( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if (data.Devices === undefined && (missing0 = 'Devices')) { + validate36.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema21.required, + parentSchema: schema21, + data, + }, + ]; + return false; + } else { + if (data.Devices !== undefined) { + let data0 = data.Devices; + const _errs1 = errors; + if (errors === _errs1) { + if (Array.isArray(data0)) { + var valid1 = true; + const len0 = data0.length; + for (let i0 = 0; i0 < len0; i0++) { + let data1 = data0[i0]; + const _errs3 = errors; + if (errors === _errs3) { + if (data1 && typeof data1 == 'object' && !Array.isArray(data1)) { + let missing1; + if (data1.ID === undefined && (missing1 = 'ID')) { + validate36.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema21.properties.Devices.items.required, + parentSchema: schema21.properties.Devices.items, + data: data1, + }, + ]; + return false; + } else { + if (data1.ID !== undefined) { + let data2 = data1.ID; + const _errs5 = errors; + if (errors === _errs5) { + if (errors === _errs5) { + if (typeof data2 === 'string') { + if (!formats0(data2)) { + validate36.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema21.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } else { + validate36.errors = [ + { + instancePath: instancePath + '/Devices/' + i0 + '/ID', + schemaPath: + '#/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema21.properties.Devices.items.properties.ID.type, + parentSchema: + schema21.properties.Devices.items.properties.ID, + data: data2, + }, + ]; + return false; + } + } + } + } + } + } else { + validate36.errors = [ + { + instancePath: instancePath + '/Devices/' + i0, + schemaPath: '#/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema21.properties.Devices.items.type, + parentSchema: schema21.properties.Devices.items, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + if (!valid1) { + break; + } + } + } else { + validate36.errors = [ + { + instancePath: instancePath + '/Devices', + schemaPath: '#/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema21.properties.Devices.type, + parentSchema: schema21.properties.Devices, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Description !== undefined) { + let data3 = data.Description; + const _errs7 = errors; + if (typeof data3 !== 'string') { + validate36.errors = [ + { + instancePath: instancePath + '/Description', + schemaPath: '#/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema21.properties.Description.type, + parentSchema: schema21.properties.Description, + data: data3, + }, + ]; + return false; + } + var valid0 = _errs7 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate36.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema21.type, + parentSchema: schema21, + data, + }, + ]; + return false; + } + } + validate36.errors = vErrors; + return errors === 0; +} +exports.validateTimeslotRequest = validate37; +const schema22 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'TimeslotRequest', + 'x-location': '#/components/schemas/Timeslot_request', + 'x-schema-type': 'request', +}; +function validate37( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate37.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema22.required, + parentSchema: schema22, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate37.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema22.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.Start.type, + parentSchema: schema22.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate37.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema22.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate37.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema22.properties.End.type, + parentSchema: schema22.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate37.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema22.type, + parentSchema: schema22, + data, + }, + ]; + return false; + } + } + validate37.errors = vErrors; + return errors === 0; +} +exports.validateTimeslotResponse = validate38; +const schema23 = { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { type: 'string', description: 'End time of the booking.', format: 'date-time' }, + }, + 'x-standalone': true, + 'x-name': 'TimeslotResponse', + 'x-location': '#/components/schemas/Timeslot_response', + 'x-schema-type': 'response', +}; +function validate38( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Start === undefined && (missing0 = 'Start')) || + (data.End === undefined && (missing0 = 'End')) + ) { + validate38.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema23.required, + parentSchema: schema23, + data, + }, + ]; + return false; + } else { + if (data.Start !== undefined) { + let data0 = data.Start; + const _errs1 = errors; + if (errors === _errs1) { + if (errors === _errs1) { + if (typeof data0 === 'string') { + if (!formats2.validate(data0)) { + validate38.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema23.properties.Start, + data: data0, + }, + ]; + return false; + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/Start', + schemaPath: '#/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.Start.type, + parentSchema: schema23.properties.Start, + data: data0, + }, + ]; + return false; + } + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.End !== undefined) { + let data1 = data.End; + const _errs3 = errors; + if (errors === _errs3) { + if (errors === _errs3) { + if (typeof data1 === 'string') { + if (!formats2.validate(data1)) { + validate38.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema23.properties.End, + data: data1, + }, + ]; + return false; + } + } else { + validate38.errors = [ + { + instancePath: instancePath + '/End', + schemaPath: '#/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema23.properties.End.type, + parentSchema: schema23.properties.End, + data: data1, + }, + ]; + return false; + } + } + } + var valid0 = _errs3 === errors; + } else { + var valid0 = true; + } + } + } + } else { + validate38.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema23.type, + parentSchema: schema23, + data, + }, + ]; + return false; + } + } + validate38.errors = vErrors; + return errors === 0; +} +exports.validateIDRequest = validate39; +const schema24 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'IDRequest', + 'x-location': '#/components/parameters/ID/schema_request', + 'x-schema-type': 'request', +}; +function validate39( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate39.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema24.type, + parentSchema: schema24, + data, + }, + ]; + return false; + } + validate39.errors = vErrors; + return errors === 0; +} +exports.validateIDResponse = validate40; +const schema25 = { + type: 'string', + 'x-standalone': false, + 'x-name': 'IDResponse', + 'x-location': '#/components/parameters/ID/schema_response', + 'x-schema-type': 'response', +}; +function validate40( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate40.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema25.type, + parentSchema: schema25, + data, + }, + ]; + return false; + } + validate40.errors = vErrors; + return errors === 0; +} +exports.validateScheduleBodyRequest = validate41; +const schema26 = { + type: 'object', + required: ['Experiment', 'Time'], + properties: { + Experiment: { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Combined: { + type: 'boolean', + description: + 'If true, show only one timetable per device instead of one for all available physical devices.', + }, + onlyOwn: { + type: 'boolean', + description: + '(private) Show only devices of this institution. Give an error if a device of an other institution is requested.', + }, + }, + 'x-standalone': false, + 'x-name': 'scheduleBodyRequest', + 'x-location': + '#/paths//schedule/post/requestBody/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate41( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Experiment === undefined && (missing0 = 'Experiment')) || + (data.Time === undefined && (missing0 = 'Time')) + ) { + validate41.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema26.required, + parentSchema: schema26, + data, + }, + ]; + return false; + } else { + if (data.Experiment !== undefined) { + let data0 = data.Experiment; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if (data0.Devices === undefined && (missing1 = 'Devices')) { + validate41.errors = [ + { + instancePath: instancePath + '/Experiment', + schemaPath: '#/properties/Experiment/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema26.properties.Experiment.required, + parentSchema: schema26.properties.Experiment, + data: data0, + }, + ]; + return false; + } else { + if (data0.Devices !== undefined) { + let data1 = data0.Devices; + const _errs3 = errors; + if (errors === _errs3) { + if (Array.isArray(data1)) { + var valid2 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs5 = errors; + if (errors === _errs5) { + if ( + data2 && + typeof data2 == 'object' && + !Array.isArray(data2) + ) { + let missing2; + if (data2.ID === undefined && (missing2 = 'ID')) { + validate41.errors = [ + { + instancePath: + instancePath + '/Experiment/Devices/' + i0, + schemaPath: + '#/properties/Experiment/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema26.properties.Experiment.properties.Devices + .items.required, + parentSchema: + schema26.properties.Experiment.properties.Devices + .items, + data: data2, + }, + ]; + return false; + } else { + if (data2.ID !== undefined) { + let data3 = data2.ID; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + validate41.errors = [ + { + instancePath: + instancePath + + '/Experiment/Devices/' + + i0 + + '/ID', + schemaPath: + '#/properties/Experiment/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema26.properties.Experiment.properties + .Devices.items.properties.ID, + data: data3, + }, + ]; + return false; + } + } else { + validate41.errors = [ + { + instancePath: + instancePath + + '/Experiment/Devices/' + + i0 + + '/ID', + schemaPath: + '#/properties/Experiment/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema26.properties.Experiment.properties + .Devices.items.properties.ID.type, + parentSchema: + schema26.properties.Experiment.properties + .Devices.items.properties.ID, + data: data3, + }, + ]; + return false; + } + } + } + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Experiment/Devices/' + i0, + schemaPath: + '#/properties/Experiment/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema26.properties.Experiment.properties.Devices.items + .type, + parentSchema: + schema26.properties.Experiment.properties.Devices.items, + data: data2, + }, + ]; + return false; + } + } + var valid2 = _errs5 === errors; + if (!valid2) { + break; + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Experiment/Devices', + schemaPath: '#/properties/Experiment/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema26.properties.Experiment.properties.Devices.type, + parentSchema: schema26.properties.Experiment.properties.Devices, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Description !== undefined) { + let data4 = data0.Description; + const _errs9 = errors; + if (typeof data4 !== 'string') { + validate41.errors = [ + { + instancePath: instancePath + '/Experiment/Description', + schemaPath: + '#/properties/Experiment/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema26.properties.Experiment.properties.Description.type, + parentSchema: + schema26.properties.Experiment.properties.Description, + data: data4, + }, + ]; + return false; + } + var valid1 = _errs9 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Experiment', + schemaPath: '#/properties/Experiment/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema26.properties.Experiment.type, + parentSchema: schema26.properties.Experiment, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data5 = data.Time; + const _errs11 = errors; + if (errors === _errs11) { + if (data5 && typeof data5 == 'object' && !Array.isArray(data5)) { + let missing3; + if ( + (data5.Start === undefined && (missing3 = 'Start')) || + (data5.End === undefined && (missing3 = 'End')) + ) { + validate41.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema26.properties.Time.required, + parentSchema: schema26.properties.Time, + data: data5, + }, + ]; + return false; + } else { + if (data5.Start !== undefined) { + let data6 = data5.Start; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data6 === 'string') { + if (!formats2.validate(data6)) { + validate41.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema26.properties.Time.properties.Start, + data: data6, + }, + ]; + return false; + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema26.properties.Time.properties.Start.type, + parentSchema: schema26.properties.Time.properties.Start, + data: data6, + }, + ]; + return false; + } + } + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data5.End !== undefined) { + let data7 = data5.End; + const _errs15 = errors; + if (errors === _errs15) { + if (errors === _errs15) { + if (typeof data7 === 'string') { + if (!formats2.validate(data7)) { + validate41.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema26.properties.Time.properties.End, + data: data7, + }, + ]; + return false; + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema26.properties.Time.properties.End.type, + parentSchema: schema26.properties.Time.properties.End, + data: data7, + }, + ]; + return false; + } + } + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate41.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema26.properties.Time.type, + parentSchema: schema26.properties.Time, + data: data5, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Combined !== undefined) { + let data8 = data.Combined; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate41.errors = [ + { + instancePath: instancePath + '/Combined', + schemaPath: '#/properties/Combined/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema26.properties.Combined.type, + parentSchema: schema26.properties.Combined, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.onlyOwn !== undefined) { + let data9 = data.onlyOwn; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate41.errors = [ + { + instancePath: instancePath + '/onlyOwn', + schemaPath: '#/properties/onlyOwn/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema26.properties.onlyOwn.type, + parentSchema: schema26.properties.onlyOwn, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } else { + validate41.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema26.type, + parentSchema: schema26, + data, + }, + ]; + return false; + } + } + validate41.errors = vErrors; + return errors === 0; +} +exports.validateScheduleBodyResponse = validate42; +const schema27 = { + type: 'object', + required: ['Experiment', 'Time'], + properties: { + Experiment: { + title: 'Experiment', + description: + 'An experiment describes a set of devices and how they should be connected (potentially among other metadata).', + type: 'object', + required: ['Devices'], + properties: { + Devices: { + type: 'array', + description: 'List of devices used in experiment.', + items: { + title: 'Device', + description: + 'A device might either be a physical/virtual device or a group of device.', + type: 'object', + required: ['ID'], + properties: { + ID: { + type: 'string', + description: + 'Unique ID of the device. Contains the institution (by having an end point at that institution)', + format: 'uri', + }, + }, + }, + }, + Description: { + type: 'string', + description: + 'User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing.\n', + }, + }, + }, + Time: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + Combined: { + type: 'boolean', + description: + 'If true, show only one timetable per device instead of one for all available physical devices.', + }, + onlyOwn: { + type: 'boolean', + description: + '(private) Show only devices of this institution. Give an error if a device of an other institution is requested.', + }, + }, + 'x-standalone': false, + 'x-name': 'scheduleBodyResponse', + 'x-location': + '#/paths//schedule/post/requestBody/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate42( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (data && typeof data == 'object' && !Array.isArray(data)) { + let missing0; + if ( + (data.Experiment === undefined && (missing0 = 'Experiment')) || + (data.Time === undefined && (missing0 = 'Time')) + ) { + validate42.errors = [ + { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema27.required, + parentSchema: schema27, + data, + }, + ]; + return false; + } else { + if (data.Experiment !== undefined) { + let data0 = data.Experiment; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing1; + if (data0.Devices === undefined && (missing1 = 'Devices')) { + validate42.errors = [ + { + instancePath: instancePath + '/Experiment', + schemaPath: '#/properties/Experiment/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: "must have required property '" + missing1 + "'", + schema: schema27.properties.Experiment.required, + parentSchema: schema27.properties.Experiment, + data: data0, + }, + ]; + return false; + } else { + if (data0.Devices !== undefined) { + let data1 = data0.Devices; + const _errs3 = errors; + if (errors === _errs3) { + if (Array.isArray(data1)) { + var valid2 = true; + const len0 = data1.length; + for (let i0 = 0; i0 < len0; i0++) { + let data2 = data1[i0]; + const _errs5 = errors; + if (errors === _errs5) { + if ( + data2 && + typeof data2 == 'object' && + !Array.isArray(data2) + ) { + let missing2; + if (data2.ID === undefined && (missing2 = 'ID')) { + validate42.errors = [ + { + instancePath: + instancePath + '/Experiment/Devices/' + i0, + schemaPath: + '#/properties/Experiment/properties/Devices/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: + schema27.properties.Experiment.properties.Devices + .items.required, + parentSchema: + schema27.properties.Experiment.properties.Devices + .items, + data: data2, + }, + ]; + return false; + } else { + if (data2.ID !== undefined) { + let data3 = data2.ID; + const _errs7 = errors; + if (errors === _errs7) { + if (errors === _errs7) { + if (typeof data3 === 'string') { + if (!formats0(data3)) { + validate42.errors = [ + { + instancePath: + instancePath + + '/Experiment/Devices/' + + i0 + + '/ID', + schemaPath: + '#/properties/Experiment/properties/Devices/items/properties/ID/format', + keyword: 'format', + params: { format: 'uri' }, + message: 'must match format "' + 'uri' + '"', + schema: 'uri', + parentSchema: + schema27.properties.Experiment.properties + .Devices.items.properties.ID, + data: data3, + }, + ]; + return false; + } + } else { + validate42.errors = [ + { + instancePath: + instancePath + + '/Experiment/Devices/' + + i0 + + '/ID', + schemaPath: + '#/properties/Experiment/properties/Devices/items/properties/ID/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.properties.Experiment.properties + .Devices.items.properties.ID.type, + parentSchema: + schema27.properties.Experiment.properties + .Devices.items.properties.ID, + data: data3, + }, + ]; + return false; + } + } + } + } + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Experiment/Devices/' + i0, + schemaPath: + '#/properties/Experiment/properties/Devices/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: + schema27.properties.Experiment.properties.Devices.items + .type, + parentSchema: + schema27.properties.Experiment.properties.Devices.items, + data: data2, + }, + ]; + return false; + } + } + var valid2 = _errs5 === errors; + if (!valid2) { + break; + } + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Experiment/Devices', + schemaPath: '#/properties/Experiment/properties/Devices/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema27.properties.Experiment.properties.Devices.type, + parentSchema: schema27.properties.Experiment.properties.Devices, + data: data1, + }, + ]; + return false; + } + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Description !== undefined) { + let data4 = data0.Description; + const _errs9 = errors; + if (typeof data4 !== 'string') { + validate42.errors = [ + { + instancePath: instancePath + '/Experiment/Description', + schemaPath: + '#/properties/Experiment/properties/Description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema27.properties.Experiment.properties.Description.type, + parentSchema: + schema27.properties.Experiment.properties.Description, + data: data4, + }, + ]; + return false; + } + var valid1 = _errs9 === errors; + } else { + var valid1 = true; + } + } + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Experiment', + schemaPath: '#/properties/Experiment/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.properties.Experiment.type, + parentSchema: schema27.properties.Experiment, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Time !== undefined) { + let data5 = data.Time; + const _errs11 = errors; + if (errors === _errs11) { + if (data5 && typeof data5 == 'object' && !Array.isArray(data5)) { + let missing3; + if ( + (data5.Start === undefined && (missing3 = 'Start')) || + (data5.End === undefined && (missing3 = 'End')) + ) { + validate42.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/required', + keyword: 'required', + params: { missingProperty: missing3 }, + message: "must have required property '" + missing3 + "'", + schema: schema27.properties.Time.required, + parentSchema: schema27.properties.Time, + data: data5, + }, + ]; + return false; + } else { + if (data5.Start !== undefined) { + let data6 = data5.Start; + const _errs13 = errors; + if (errors === _errs13) { + if (errors === _errs13) { + if (typeof data6 === 'string') { + if (!formats2.validate(data6)) { + validate42.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema27.properties.Time.properties.Start, + data: data6, + }, + ]; + return false; + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Time/Start', + schemaPath: '#/properties/Time/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.properties.Time.properties.Start.type, + parentSchema: schema27.properties.Time.properties.Start, + data: data6, + }, + ]; + return false; + } + } + } + var valid4 = _errs13 === errors; + } else { + var valid4 = true; + } + if (valid4) { + if (data5.End !== undefined) { + let data7 = data5.End; + const _errs15 = errors; + if (errors === _errs15) { + if (errors === _errs15) { + if (typeof data7 === 'string') { + if (!formats2.validate(data7)) { + validate42.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: schema27.properties.Time.properties.End, + data: data7, + }, + ]; + return false; + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Time/End', + schemaPath: '#/properties/Time/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema27.properties.Time.properties.End.type, + parentSchema: schema27.properties.Time.properties.End, + data: data7, + }, + ]; + return false; + } + } + } + var valid4 = _errs15 === errors; + } else { + var valid4 = true; + } + } + } + } else { + validate42.errors = [ + { + instancePath: instancePath + '/Time', + schemaPath: '#/properties/Time/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.properties.Time.type, + parentSchema: schema27.properties.Time, + data: data5, + }, + ]; + return false; + } + } + var valid0 = _errs11 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.Combined !== undefined) { + let data8 = data.Combined; + const _errs17 = errors; + if (typeof data8 !== 'boolean') { + validate42.errors = [ + { + instancePath: instancePath + '/Combined', + schemaPath: '#/properties/Combined/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema27.properties.Combined.type, + parentSchema: schema27.properties.Combined, + data: data8, + }, + ]; + return false; + } + var valid0 = _errs17 === errors; + } else { + var valid0 = true; + } + if (valid0) { + if (data.onlyOwn !== undefined) { + let data9 = data.onlyOwn; + const _errs19 = errors; + if (typeof data9 !== 'boolean') { + validate42.errors = [ + { + instancePath: instancePath + '/onlyOwn', + schemaPath: '#/properties/onlyOwn/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + schema: schema27.properties.onlyOwn.type, + parentSchema: schema27.properties.onlyOwn, + data: data9, + }, + ]; + return false; + } + var valid0 = _errs19 === errors; + } else { + var valid0 = true; + } + } + } + } + } + } else { + validate42.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema27.type, + parentSchema: schema27, + data, + }, + ]; + return false; + } + } + validate42.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse200Request = validate43; +const schema28 = { + type: 'array', + items: { + type: 'object', + required: ['Device', 'Booked', 'Free'], + properties: { + Device: { type: 'string', description: 'ID of the device (or * if combined).' }, + Booked: { + type: 'array', + description: 'Array of booked times.', + items: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + }, + Free: { + type: 'array', + description: 'Array of free times.', + items: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + }, + }, + }, + 'x-standalone': false, + 'x-name': 'scheduleResponse200Request', + 'x-location': + '#/paths//schedule/post/responses/200/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate43( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if ( + (data0.Device === undefined && (missing0 = 'Device')) || + (data0.Booked === undefined && (missing0 = 'Booked')) || + (data0.Free === undefined && (missing0 = 'Free')) + ) { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema28.items.required, + parentSchema: schema28.items, + data: data0, + }, + ]; + return false; + } else { + if (data0.Device !== undefined) { + let data1 = data0.Device; + const _errs3 = errors; + if (typeof data1 !== 'string') { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Device', + schemaPath: '#/items/properties/Device/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema28.items.properties.Device.type, + parentSchema: schema28.items.properties.Device, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Booked !== undefined) { + let data2 = data0.Booked; + const _errs5 = errors; + if (errors === _errs5) { + if (Array.isArray(data2)) { + var valid2 = true; + const len1 = data2.length; + for (let i1 = 0; i1 < len1; i1++) { + let data3 = data2[i1]; + const _errs7 = errors; + if (errors === _errs7) { + if ( + data3 && + typeof data3 == 'object' && + !Array.isArray(data3) + ) { + let missing1; + if ( + (data3.Start === undefined && (missing1 = 'Start')) || + (data3.End === undefined && (missing1 = 'End')) + ) { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked/' + i1, + schemaPath: '#/items/properties/Booked/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: schema28.items.properties.Booked.items.required, + parentSchema: schema28.items.properties.Booked.items, + data: data3, + }, + ]; + return false; + } else { + if (data3.Start !== undefined) { + let data4 = data3.Start; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate43.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/Start', + schemaPath: + '#/items/properties/Booked/items/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema28.items.properties.Booked.items + .properties.Start, + data: data4, + }, + ]; + return false; + } + } else { + validate43.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/Start', + schemaPath: + '#/items/properties/Booked/items/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema28.items.properties.Booked.items + .properties.Start.type, + parentSchema: + schema28.items.properties.Booked.items + .properties.Start, + data: data4, + }, + ]; + return false; + } + } + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.End !== undefined) { + let data5 = data3.End; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats2.validate(data5)) { + validate43.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/End', + schemaPath: + '#/items/properties/Booked/items/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema28.items.properties.Booked.items + .properties.End, + data: data5, + }, + ]; + return false; + } + } else { + validate43.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/End', + schemaPath: + '#/items/properties/Booked/items/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema28.items.properties.Booked.items + .properties.End.type, + parentSchema: + schema28.items.properties.Booked.items + .properties.End, + data: data5, + }, + ]; + return false; + } + } + } + var valid3 = _errs11 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked/' + i1, + schemaPath: '#/items/properties/Booked/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema28.items.properties.Booked.items.type, + parentSchema: schema28.items.properties.Booked.items, + data: data3, + }, + ]; + return false; + } + } + var valid2 = _errs7 === errors; + if (!valid2) { + break; + } + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked', + schemaPath: '#/items/properties/Booked/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema28.items.properties.Booked.type, + parentSchema: schema28.items.properties.Booked, + data: data2, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Free !== undefined) { + let data6 = data0.Free; + const _errs13 = errors; + if (errors === _errs13) { + if (Array.isArray(data6)) { + var valid4 = true; + const len2 = data6.length; + for (let i2 = 0; i2 < len2; i2++) { + let data7 = data6[i2]; + const _errs15 = errors; + if (errors === _errs15) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing2; + if ( + (data7.Start === undefined && (missing2 = 'Start')) || + (data7.End === undefined && (missing2 = 'End')) + ) { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free/' + i2, + schemaPath: '#/items/properties/Free/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: schema28.items.properties.Free.items.required, + parentSchema: schema28.items.properties.Free.items, + data: data7, + }, + ]; + return false; + } else { + if (data7.Start !== undefined) { + let data8 = data7.Start; + const _errs17 = errors; + if (errors === _errs17) { + if (errors === _errs17) { + if (typeof data8 === 'string') { + if (!formats2.validate(data8)) { + validate43.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/Start', + schemaPath: + '#/items/properties/Free/items/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema28.items.properties.Free.items + .properties.Start, + data: data8, + }, + ]; + return false; + } + } else { + validate43.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/Start', + schemaPath: + '#/items/properties/Free/items/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema28.items.properties.Free.items + .properties.Start.type, + parentSchema: + schema28.items.properties.Free.items + .properties.Start, + data: data8, + }, + ]; + return false; + } + } + } + var valid5 = _errs17 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data7.End !== undefined) { + let data9 = data7.End; + const _errs19 = errors; + if (errors === _errs19) { + if (errors === _errs19) { + if (typeof data9 === 'string') { + if (!formats2.validate(data9)) { + validate43.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/End', + schemaPath: + '#/items/properties/Free/items/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + + 'date-time' + + '"', + schema: 'date-time', + parentSchema: + schema28.items.properties.Free.items + .properties.End, + data: data9, + }, + ]; + return false; + } + } else { + validate43.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/End', + schemaPath: + '#/items/properties/Free/items/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema28.items.properties.Free.items + .properties.End.type, + parentSchema: + schema28.items.properties.Free.items + .properties.End, + data: data9, + }, + ]; + return false; + } + } + } + var valid5 = _errs19 === errors; + } else { + var valid5 = true; + } + } + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free/' + i2, + schemaPath: '#/items/properties/Free/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema28.items.properties.Free.items.type, + parentSchema: schema28.items.properties.Free.items, + data: data7, + }, + ]; + return false; + } + } + var valid4 = _errs15 === errors; + if (!valid4) { + break; + } + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free', + schemaPath: '#/items/properties/Free/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema28.items.properties.Free.type, + parentSchema: schema28.items.properties.Free, + data: data6, + }, + ]; + return false; + } + } + var valid1 = _errs13 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate43.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema28.items.type, + parentSchema: schema28.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate43.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema28.type, + parentSchema: schema28, + data, + }, + ]; + return false; + } + } + validate43.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse200Response = validate44; +const schema29 = { + type: 'array', + items: { + type: 'object', + required: ['Device', 'Booked', 'Free'], + properties: { + Device: { type: 'string', description: 'ID of the device (or * if combined).' }, + Booked: { + type: 'array', + description: 'Array of booked times.', + items: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + }, + Free: { + type: 'array', + description: 'Array of free times.', + items: { + title: 'Timeslot', + description: 'A time slot represents a slice of time used for bookings.', + type: 'object', + required: ['Start', 'End'], + properties: { + Start: { + type: 'string', + description: 'Start time of the booking.', + format: 'date-time', + }, + End: { + type: 'string', + description: 'End time of the booking.', + format: 'date-time', + }, + }, + }, + }, + }, + }, + 'x-standalone': false, + 'x-name': 'scheduleResponse200Response', + 'x-location': + '#/paths//schedule/post/responses/200/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate44( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (errors === 0) { + if (Array.isArray(data)) { + var valid0 = true; + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + let data0 = data[i0]; + const _errs1 = errors; + if (errors === _errs1) { + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + let missing0; + if ( + (data0.Device === undefined && (missing0 = 'Device')) || + (data0.Booked === undefined && (missing0 = 'Booked')) || + (data0.Free === undefined && (missing0 = 'Free')) + ) { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: missing0 }, + message: "must have required property '" + missing0 + "'", + schema: schema29.items.required, + parentSchema: schema29.items, + data: data0, + }, + ]; + return false; + } else { + if (data0.Device !== undefined) { + let data1 = data0.Device; + const _errs3 = errors; + if (typeof data1 !== 'string') { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Device', + schemaPath: '#/items/properties/Device/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema29.items.properties.Device.type, + parentSchema: schema29.items.properties.Device, + data: data1, + }, + ]; + return false; + } + var valid1 = _errs3 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Booked !== undefined) { + let data2 = data0.Booked; + const _errs5 = errors; + if (errors === _errs5) { + if (Array.isArray(data2)) { + var valid2 = true; + const len1 = data2.length; + for (let i1 = 0; i1 < len1; i1++) { + let data3 = data2[i1]; + const _errs7 = errors; + if (errors === _errs7) { + if ( + data3 && + typeof data3 == 'object' && + !Array.isArray(data3) + ) { + let missing1; + if ( + (data3.Start === undefined && (missing1 = 'Start')) || + (data3.End === undefined && (missing1 = 'End')) + ) { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked/' + i1, + schemaPath: '#/items/properties/Booked/items/required', + keyword: 'required', + params: { missingProperty: missing1 }, + message: + "must have required property '" + missing1 + "'", + schema: schema29.items.properties.Booked.items.required, + parentSchema: schema29.items.properties.Booked.items, + data: data3, + }, + ]; + return false; + } else { + if (data3.Start !== undefined) { + let data4 = data3.Start; + const _errs9 = errors; + if (errors === _errs9) { + if (errors === _errs9) { + if (typeof data4 === 'string') { + if (!formats2.validate(data4)) { + validate44.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/Start', + schemaPath: + '#/items/properties/Booked/items/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema29.items.properties.Booked.items + .properties.Start, + data: data4, + }, + ]; + return false; + } + } else { + validate44.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/Start', + schemaPath: + '#/items/properties/Booked/items/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema29.items.properties.Booked.items + .properties.Start.type, + parentSchema: + schema29.items.properties.Booked.items + .properties.Start, + data: data4, + }, + ]; + return false; + } + } + } + var valid3 = _errs9 === errors; + } else { + var valid3 = true; + } + if (valid3) { + if (data3.End !== undefined) { + let data5 = data3.End; + const _errs11 = errors; + if (errors === _errs11) { + if (errors === _errs11) { + if (typeof data5 === 'string') { + if (!formats2.validate(data5)) { + validate44.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/End', + schemaPath: + '#/items/properties/Booked/items/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema29.items.properties.Booked.items + .properties.End, + data: data5, + }, + ]; + return false; + } + } else { + validate44.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Booked/' + + i1 + + '/End', + schemaPath: + '#/items/properties/Booked/items/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema29.items.properties.Booked.items + .properties.End.type, + parentSchema: + schema29.items.properties.Booked.items + .properties.End, + data: data5, + }, + ]; + return false; + } + } + } + var valid3 = _errs11 === errors; + } else { + var valid3 = true; + } + } + } + } else { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked/' + i1, + schemaPath: '#/items/properties/Booked/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema29.items.properties.Booked.items.type, + parentSchema: schema29.items.properties.Booked.items, + data: data3, + }, + ]; + return false; + } + } + var valid2 = _errs7 === errors; + if (!valid2) { + break; + } + } + } else { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Booked', + schemaPath: '#/items/properties/Booked/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema29.items.properties.Booked.type, + parentSchema: schema29.items.properties.Booked, + data: data2, + }, + ]; + return false; + } + } + var valid1 = _errs5 === errors; + } else { + var valid1 = true; + } + if (valid1) { + if (data0.Free !== undefined) { + let data6 = data0.Free; + const _errs13 = errors; + if (errors === _errs13) { + if (Array.isArray(data6)) { + var valid4 = true; + const len2 = data6.length; + for (let i2 = 0; i2 < len2; i2++) { + let data7 = data6[i2]; + const _errs15 = errors; + if (errors === _errs15) { + if ( + data7 && + typeof data7 == 'object' && + !Array.isArray(data7) + ) { + let missing2; + if ( + (data7.Start === undefined && (missing2 = 'Start')) || + (data7.End === undefined && (missing2 = 'End')) + ) { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free/' + i2, + schemaPath: '#/items/properties/Free/items/required', + keyword: 'required', + params: { missingProperty: missing2 }, + message: + "must have required property '" + missing2 + "'", + schema: schema29.items.properties.Free.items.required, + parentSchema: schema29.items.properties.Free.items, + data: data7, + }, + ]; + return false; + } else { + if (data7.Start !== undefined) { + let data8 = data7.Start; + const _errs17 = errors; + if (errors === _errs17) { + if (errors === _errs17) { + if (typeof data8 === 'string') { + if (!formats2.validate(data8)) { + validate44.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/Start', + schemaPath: + '#/items/properties/Free/items/properties/Start/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + 'date-time' + '"', + schema: 'date-time', + parentSchema: + schema29.items.properties.Free.items + .properties.Start, + data: data8, + }, + ]; + return false; + } + } else { + validate44.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/Start', + schemaPath: + '#/items/properties/Free/items/properties/Start/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema29.items.properties.Free.items + .properties.Start.type, + parentSchema: + schema29.items.properties.Free.items + .properties.Start, + data: data8, + }, + ]; + return false; + } + } + } + var valid5 = _errs17 === errors; + } else { + var valid5 = true; + } + if (valid5) { + if (data7.End !== undefined) { + let data9 = data7.End; + const _errs19 = errors; + if (errors === _errs19) { + if (errors === _errs19) { + if (typeof data9 === 'string') { + if (!formats2.validate(data9)) { + validate44.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/End', + schemaPath: + '#/items/properties/Free/items/properties/End/format', + keyword: 'format', + params: { format: 'date-time' }, + message: + 'must match format "' + + 'date-time' + + '"', + schema: 'date-time', + parentSchema: + schema29.items.properties.Free.items + .properties.End, + data: data9, + }, + ]; + return false; + } + } else { + validate44.errors = [ + { + instancePath: + instancePath + + '/' + + i0 + + '/Free/' + + i2 + + '/End', + schemaPath: + '#/items/properties/Free/items/properties/End/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: + schema29.items.properties.Free.items + .properties.End.type, + parentSchema: + schema29.items.properties.Free.items + .properties.End, + data: data9, + }, + ]; + return false; + } + } + } + var valid5 = _errs19 === errors; + } else { + var valid5 = true; + } + } + } + } else { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free/' + i2, + schemaPath: '#/items/properties/Free/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema29.items.properties.Free.items.type, + parentSchema: schema29.items.properties.Free.items, + data: data7, + }, + ]; + return false; + } + } + var valid4 = _errs15 === errors; + if (!valid4) { + break; + } + } + } else { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0 + '/Free', + schemaPath: '#/items/properties/Free/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema29.items.properties.Free.type, + parentSchema: schema29.items.properties.Free, + data: data6, + }, + ]; + return false; + } + } + var valid1 = _errs13 === errors; + } else { + var valid1 = true; + } + } + } + } + } else { + validate44.errors = [ + { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + schema: schema29.items.type, + parentSchema: schema29.items, + data: data0, + }, + ]; + return false; + } + } + var valid0 = _errs1 === errors; + if (!valid0) { + break; + } + } + } else { + validate44.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + schema: schema29.type, + parentSchema: schema29, + data, + }, + ]; + return false; + } + } + validate44.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse404Request = validate45; +const schema30 = { + type: 'string', + description: 'First unknown device ID.', + 'x-standalone': false, + 'x-name': 'scheduleResponse404Request', + 'x-location': + '#/paths//schedule/post/responses/404/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate45( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate45.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema30.type, + parentSchema: schema30, + data, + }, + ]; + return false; + } + validate45.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse404Response = validate46; +const schema31 = { + type: 'string', + description: 'First unknown device ID.', + 'x-standalone': false, + 'x-name': 'scheduleResponse404Response', + 'x-location': + '#/paths//schedule/post/responses/404/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate46( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate46.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema31.type, + parentSchema: schema31, + data, + }, + ]; + return false; + } + validate46.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse422Request = validate47; +const schema32 = { + type: 'string', + description: 'First virtual device ID.', + 'x-standalone': false, + 'x-name': 'scheduleResponse422Request', + 'x-location': + '#/paths//schedule/post/responses/422/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate47( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate47.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema32.type, + parentSchema: schema32, + data, + }, + ]; + return false; + } + validate47.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse422Response = validate48; +const schema33 = { + type: 'string', + description: 'First virtual device ID.', + 'x-standalone': false, + 'x-name': 'scheduleResponse422Response', + 'x-location': + '#/paths//schedule/post/responses/422/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate48( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate48.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema33.type, + parentSchema: schema33, + data, + }, + ]; + return false; + } + validate48.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse500Request = validate49; +const schema34 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'scheduleResponse500Request', + 'x-location': + '#/paths//schedule/post/responses/500/content/application/json/schema_request', + 'x-schema-type': 'request', +}; +function validate49( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate49.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema34.type, + parentSchema: schema34, + data, + }, + ]; + return false; + } + validate49.errors = vErrors; + return errors === 0; +} +exports.validateScheduleResponse500Response = validate50; +const schema35 = { + type: 'string', + description: 'Error description.', + 'x-standalone': false, + 'x-name': 'scheduleResponse500Response', + 'x-location': + '#/paths//schedule/post/responses/500/content/application/json/schema_response', + 'x-schema-type': 'response', +}; +function validate50( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + let vErrors = null; + let errors = 0; + if (typeof data !== 'string') { + validate50.errors = [ + { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + schema: schema35.type, + parentSchema: schema35, + data, + }, + ]; + return false; + } + validate50.errors = vErrors; + return errors === 0; +} diff --git a/services/experiment/src/clients/schedule-service/basicValidation.d.cts b/services/experiment/src/clients/schedule-service/basicValidation.d.cts new file mode 100644 index 00000000..2a3299fc --- /dev/null +++ b/services/experiment/src/clients/schedule-service/basicValidation.d.cts @@ -0,0 +1,119 @@ +export declare function validateBooking( + object: unknown, +): Booking; + +export declare function validateDevice( + object: unknown, +): Device; + +export declare function validateExperiment( + object: unknown, +): Experiment; + +export declare function validateTimeslot( + object: unknown, +): Timeslot; + +export declare function validateID( + object: unknown, +): ID; + +export declare function validateScheduleBody( + object: unknown, +): scheduleBody; + +export declare function validateScheduleResponse200< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse200; + +export declare function validateScheduleResponse404< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse404; + +export declare function validateScheduleResponse422< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse422; + +export declare function validateScheduleResponse500< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse500; + +export declare function validateBookingRequest( + object: unknown, +): BookingRequest; + +export declare function validateBookingResponse( + object: unknown, +): BookingResponse; + +export declare function validateDeviceRequest( + object: unknown, +): DeviceRequest; + +export declare function validateDeviceResponse( + object: unknown, +): DeviceResponse; + +export declare function validateExperimentRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): ExperimentRequest; + +export declare function validateExperimentResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): ExperimentResponse; + +export declare function validateTimeslotRequest( + object: unknown, +): TimeslotRequest; + +export declare function validateTimeslotResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): TimeslotResponse; + +export declare function validateIDRequest( + object: unknown, +): IDRequest; + +export declare function validateIDResponse( + object: unknown, +): IDResponse; + +export declare function validateScheduleBodyRequest< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleBodyRequest; + +export declare function validateScheduleBodyResponse< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleBodyResponse; + +export declare function validateScheduleResponse200Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse200Request; + +export declare function validateScheduleResponse200Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse200Response; + +export declare function validateScheduleResponse404Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse404Request; + +export declare function validateScheduleResponse404Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse404Response; + +export declare function validateScheduleResponse422Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse422Request; + +export declare function validateScheduleResponse422Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse422Response; + +export declare function validateScheduleResponse500Request< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse500Request; + +export declare function validateScheduleResponse500Response< + T extends 'request' | 'response' | 'all', +>(object: unknown): scheduleResponse500Response; diff --git a/services/experiment/src/clients/schedule-service/client.ts b/services/experiment/src/clients/schedule-service/client.ts new file mode 100644 index 00000000..f88d6c98 --- /dev/null +++ b/services/experiment/src/clients/schedule-service/client.ts @@ -0,0 +1,244 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import fetch, { RequestInfo, RequestInit, Response } from 'node-fetch'; + +import * as RequestValidation from './requestValidation.js'; +import * as Signatures from './signatures.js'; +import * as Types from './types.js'; +// @ts-ignore +import { type Require } from './types.js'; + +/** + * This error class should be used if an error occurs during validation of a request/response. + * @category Errors + */ +export class ValidationError extends Error { + public errors: unknown; + + constructor(message: string, errors: unknown) { + super(message); + this.name = 'ValidationError'; + this.errors = errors; + } +} + +/** + * This error class should be used if an error occurs while fetching a request. + * @category Errors + */ +export class FetchError extends Error { + constructor(message: string) { + super(message); + this.name = 'FetchError'; + } +} + +/** + * This error class should be used if the response of the server has a status + * greater than or equal to 400. This error should contain the validated response. + * @category Errors + */ +export class UnsuccessfulRequestError extends Error { + public response: Types.ResponseData; + + constructor(message: string, response: Types.ResponseData) { + super(message); + this.response = response; + this.name = 'UnsuccessfulRequestError'; + } +} + +/** + * This error class should be used if the validation of an url fails. + * @category Errors + */ +export class InvalidUrlError extends Error { + constructor(message: string) { + super(message); + this.name = 'InvalidUrlError'; + } +} + +/** + * This function attempts to parse a Response as ResponseData. + */ +async function parseResponse(response: Response): Promise { + let text = null; + try { + text = await response.text(); + const json = JSON.parse(text); + return { status: response.status, body: json }; + } catch { + return { status: response.status, body: text }; + } +} + +/** + * This function appends a given endpoint to an url. + * @param url The url to append the endpoint to. + * @param endpoint The endpoint to be appended. + * @example + * // returns "https://api.example.com/devices/device_id/token" + * appendToUrl("https://api.example.com/devices/device_id", "/token") + * @example + * // returns "https://api.example.com/devices/device_id/token" + * appendToUrl("https://api.example.com/devices/device_id/", "/token") + * @returns The url with the appended endpoint. + */ +function appendToUrl(url: string, endpoint: string) { + return url.endsWith('/') ? `${url.slice(0, -1)}${endpoint}` : `${url}${endpoint}`; +} + +/** + * Client for the use of the Crosslab API + * @category Client + */ +export class Client { + public readonly baseUrl: string; + public readonly serviceUrl: string; + public accessToken: string; + private fixedHeaders: [string, string][]; + private fetch = async (url: RequestInfo | URL, init: RequestInit) => { + let raw_response; + const parsedUrl = new URL(url.toString()); + try { + if ( + parsedUrl.toString().startsWith(this.baseUrl) || + parsedUrl.toString().startsWith(this.serviceUrl) + ) { + raw_response = await fetch(url, init); + } else { + raw_response = await fetch( + appendToUrl( + this.baseUrl, + '/proxy?' + new URLSearchParams([['URL', url.toString()]]).toString(), + ), + init, + ); + } + } catch (error) { + if (error instanceof Error) { + throw new FetchError(error.message); + } else if (typeof error === 'string') { + throw new FetchError(error); + } else { + throw new FetchError('Something went wrong while trying to fetch the request'); + } + } + return await parseResponse(raw_response); + }; + + /** + * @category Constructors + */ + constructor( + baseUrl: string, + options: { + serviceUrl?: string; + accessToken?: string; + fixedHeaders?: [string, string][]; + }, + ) { + this.baseUrl = new URL(baseUrl).toString().slice(0, -1); + this.serviceUrl = new URL(options.serviceUrl ?? this.baseUrl).toString().slice(0, -1); + this.accessToken = options.accessToken ?? ''; + this.fixedHeaders = options.fixedHeaders ?? []; + } + + /** + * Returns the free / booked times for given experiment. + * + * @param body + * @param options.url + * Url of the to be used. + * + * @throws {@link FetchError | FetchError } + * Thrown if fetch fails. + * @throws {@link ValidationError | ValidationError } + * Thrown if the request/response validation fails. + * @throws {@link InvalidUrlError | InvalidUrlError } + * Thrown if the provided url is not valid for this request. + * @throws {@link UnsuccessfulRequestError | UnsuccessfulRequestError } + * Thrown if response is validated but has status greater than or equal to 400. + * + * @returns + * Timetable of free/booked time. If 'Combined' is set to true, an array with only one entry is returned containing the combined timetable. + */ + public async schedule( + body: + | { + /** + * An experiment describes a set of devices and how they should be connected (potentially among other metadata). + */ + Experiment: Types.Experiment<'request'>; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: Types.Timeslot<'request'>; + /** + * If true, show only one timetable per device instead of one for all available physical devices. + */ + Combined?: boolean; + /** + * (private) Show only devices of this institution. Give an error if a device of an other institution is requested. + */ + onlyOwn?: boolean; + [k: string]: unknown; + } + | undefined, + options?: { + headers?: [string, string][]; + url?: string; + }, + ): Promise { + const url = appendToUrl(options?.url ?? this.baseUrl, '/schedule'); + console.log('trying to fetch url:', url); + + if (!RequestValidation.validateScheduleInput(body)) + throw new ValidationError( + 'Request validation failed!', + (RequestValidation.validateScheduleInput as Types.FunctionWithErrors).errors, + ); + + const authorization: string = `Bearer ${this.accessToken}`; + + console.log( + 'trying to fetch url:', + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + ); + const response = await this.fetch( + new URL(url).toString().replace(this.baseUrl, this.serviceUrl), + { + method: 'POST', + headers: [ + ['Content-Type', 'application/json'], + ['Authorization', authorization], + ...this.fixedHeaders, + ...(options?.headers ?? []), + ], + body: JSON.stringify(body), + }, + ); + + if (!RequestValidation.validateScheduleOutput(response)) + throw new ValidationError( + 'Response validation failed!', + (RequestValidation.validateScheduleOutput as Types.FunctionWithErrors).errors, + ); + + if (Types.isErrorResponse(response)) + throw new UnsuccessfulRequestError( + `Server returned response with status ${response.status}`, + response, + ); + + return response.body; + } +} diff --git a/services/experiment/src/clients/schedule-service/requestValidation.ts b/services/experiment/src/clients/schedule-service/requestValidation.ts new file mode 100644 index 00000000..8803e553 --- /dev/null +++ b/services/experiment/src/clients/schedule-service/requestValidation.ts @@ -0,0 +1,100 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +import * as BasicValidation from './basicValidation.cjs'; +import * as Signatures from './signatures.js'; +import { FunctionWithErrors, ResponseData } from './types.js'; + +/** + * This function validates the inputs to schedule() + */ +export function validateScheduleInput(body: Signatures.ScheduleBody) { + if (body === undefined) { + return true; + } + + if (!BasicValidation.validateScheduleBodyRequest(body)) { + (validateScheduleInput as FunctionWithErrors).errors = ( + BasicValidation.validateScheduleBodyRequest as FunctionWithErrors + ).errors; + return false; + } + + return true; +} + +/** + * This function validates the outputs of schedule() + */ +export function validateScheduleOutput( + response: ResponseData, +): response is Signatures.ScheduleResponse { + if (response.status < 100 || response.status >= 600) return false; + + if (response.status === 200) { + if (!BasicValidation.validateScheduleResponse200Response(response.body)) { + (validateScheduleOutput as FunctionWithErrors).errors = ( + BasicValidation.validateScheduleResponse200Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 400) { + return true; + } + + if (response.status === 401) { + return true; + } + + if (response.status === 403) { + return true; + } + + if (response.status === 404) { + if (!BasicValidation.validateScheduleResponse404Response(response.body)) { + (validateScheduleOutput as FunctionWithErrors).errors = ( + BasicValidation.validateScheduleResponse404Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 422) { + if (!BasicValidation.validateScheduleResponse422Response(response.body)) { + (validateScheduleOutput as FunctionWithErrors).errors = ( + BasicValidation.validateScheduleResponse422Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 500) { + if (!BasicValidation.validateScheduleResponse500Response(response.body)) { + (validateScheduleOutput as FunctionWithErrors).errors = ( + BasicValidation.validateScheduleResponse500Response as FunctionWithErrors + ).errors; + return false; + } + + return true; + } + + if (response.status === 503) { + return true; + } + + (validateScheduleOutput as FunctionWithErrors).errors = + `Response status ${response.status} is unexpected`; + + return false; +} diff --git a/services/experiment/src/clients/schedule-service/signatures.ts b/services/experiment/src/clients/schedule-service/signatures.ts new file mode 100644 index 00000000..32de25f3 --- /dev/null +++ b/services/experiment/src/clients/schedule-service/signatures.ts @@ -0,0 +1,173 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import * as Types from './types.js'; +// @ts-ignore +import { type Require } from './types.js'; + +/** + * Typing for the body of the request made by schedule() + * @category schedule() + */ +export type ScheduleBody = + | { + /** + * An experiment describes a set of devices and how they should be connected (potentially among other metadata). + */ + Experiment: Types.Experiment<'request'>; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: Types.Timeslot<'request'>; + /** + * If true, show only one timetable per device instead of one for all available physical devices. + */ + Combined?: boolean; + /** + * (private) Show only devices of this institution. Give an error if a device of an other institution is requested. + */ + onlyOwn?: boolean; + [k: string]: unknown; + } + | undefined; + +/** + * Typing for all possible responses to the request made by schedule() + * @category schedule() + */ +export type ScheduleResponse = ScheduleSuccessResponse | ScheduleErrorResponse; + +/** + * Typing for all successful responses to the request made by schedule() + * @category schedule() + */ +export type ScheduleSuccessResponse = ScheduleResponse200; + +/** + * Typing for all error responses to the request made by schedule() + * @category schedule() + */ +export type ScheduleErrorResponse = + | ScheduleResponse400 + | ScheduleResponse401 + | ScheduleResponse403 + | ScheduleResponse404 + | ScheduleResponse422 + | ScheduleResponse500 + | ScheduleResponse503; + +/** + * Typing for a response with status 200 to the request made by schedule() + * @category schedule() + */ +export interface ScheduleResponse200 extends Types.SuccessResponse { + status: 200; + headers?: { + [k: string]: string | undefined; + }; + body: { + /** + * ID of the device (or * if combined). + */ + Device: string; + /** + * Array of booked times. + */ + Booked: Types.Timeslot<'response'>[]; + /** + * Array of free times. + */ + Free: Types.Timeslot<'response'>[]; + [k: string]: unknown; + }[]; +} + +/** + * Typing for a response with status 400 to the request made by schedule() + * @category schedule() + */ +export interface ScheduleResponse400 extends Types.ErrorResponse { + status: 400; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 401 to the request made by schedule() + * @category schedule() + */ +export interface ScheduleResponse401 extends Types.ErrorResponse { + status: 401; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 403 to the request made by schedule() + * @category schedule() + */ +export interface ScheduleResponse403 extends Types.ErrorResponse { + status: 403; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} + +/** + * Typing for a response with status 404 to the request made by schedule() + * @category schedule() + */ +export interface ScheduleResponse404 extends Types.ErrorResponse { + status: 404; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 422 to the request made by schedule() + * @category schedule() + */ +export interface ScheduleResponse422 extends Types.ErrorResponse { + status: 422; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 500 to the request made by schedule() + * @category schedule() + */ +export interface ScheduleResponse500 extends Types.ErrorResponse { + status: 500; + headers?: { + [k: string]: string | undefined; + }; + body: string; +} + +/** + * Typing for a response with status 503 to the request made by schedule() + * @category schedule() + */ +export interface ScheduleResponse503 extends Types.ErrorResponse { + status: 503; + headers?: { + [k: string]: string | undefined; + }; + body?: undefined; +} diff --git a/services/experiment/src/clients/schedule-service/types.ts b/services/experiment/src/clients/schedule-service/types.ts new file mode 100644 index 00000000..8d0b0be8 --- /dev/null +++ b/services/experiment/src/clients/schedule-service/types.ts @@ -0,0 +1,410 @@ +/** + * This file was automatically generated by openapi-codegeneration. + * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, + * and run openapi-codegeneration to regenerate this file. + */ +import * as _BasicValidation from './basicValidation.cjs'; + +/** + * @internal + */ +export interface FunctionWithErrors { + (...args: unknown[]): unknown; + errors?: unknown; +} + +/** + * @internal + */ +export interface RequestInfo { + method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'TRACE' | 'OPTIONS' | 'PATCH' | 'HEAD'; + body?: string; + headers?: [string, string][]; +} + +/** + * @internal + */ +export type FetchFunction = ( + url: string, + info?: RequestInfo, +) => Promise | ResponseData; + +export interface ResponseData { + status: number; + headers?: { + [key: string]: string | undefined; + }; + body?: unknown; +} + +export interface SuccessResponse extends ResponseData { + success?: true; +} + +export interface ErrorResponse extends ResponseData { + success?: false; +} + +/** + * @internal + */ +export function isSuccessResponse(response: ResponseData): response is SuccessResponse { + return response.status < 400; +} + +/** + * @internal + */ +export function isErrorResponse(response: ResponseData): response is ErrorResponse { + return response.status >= 400; +} + +/** + * This type allows to pick the required properties of another type. + */ +export type Require = Partial & { + [Property in Key]-?: Type[Property]; +}; + +export type SizedTuple< + T, + MIN extends number | undefined = undefined, + MAX extends number | undefined = undefined, +> = MIN extends number + ? MAX extends number + ? _SizedTuple> + : TupleObject> & T[] + : MAX extends number + ? _SizedTuple, true> + : T[]; + +type _SizedTuple = ARR extends [ + infer HEAD extends number, + ...infer TAIL extends number[], +] + ? Tuple | _SizedTuple + : never; + +type Tuple = _Tuple< + T, + NumericRangeTuple +>; + +type _Tuple = N extends [ + infer HEAD, + ...infer TAIL extends number[], +] + ? HEAD extends 0 + ? [] | _Tuple + : [T, ..._Tuple] + : []; + +type TupleObject = N extends [ + infer HEAD extends number, + ...infer TAIL extends number[], +] + ? TAIL extends [] + ? Record + : { [P in HEAD]: T } & TupleObject + : Record; + +export type NumericRange< + START extends number, + END extends number, + ARR extends unknown[] = [], + ACC extends number = never, +> = ARR['length'] extends END + ? ACC | START | END + : NumericRange< + START, + END, + [...ARR, 1], + ARR[START] extends undefined ? ACC : ACC | ARR['length'] + >; + +type NumericRangeTuple< + START extends number, + END extends number, + ARR extends unknown[] = [], + ACC extends number[] = [], +> = ARR['length'] extends END + ? [START, ...ACC, END] + : NumericRangeTuple< + START, + END, + [...ARR, 1], + ARR[START] extends undefined ? ACC : [...ACC, ARR['length']] + >; + +/** + * A booking in the booking system. + */ +export type Booking = T extends 'all' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Unique ID of the booking. + */ + ID: string; + /** + * A time slot represents a slice of time used for bookings. + */ + Time: { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + }; + Devices: string[]; + /** + * Type of booking. Currently, only one type is defined, but others might follow (e.g. priority booking). If empty, 'normal' is assumed. + */ + Type?: 'normal'; + /** + * Current status of the booking. While the booking is pending, it can not be used. Will change automatically and can not be set by user. 'rejected' is set when the initial booking failed, 'cancelled' when the booking was deleted / cancelled after it was once active. The 'active-*' will be used when a device was added after the booking was locked. + * + */ + Status: + | 'pending' + | 'booked' + | 'rejected' + | 'cancelled' + | 'active' + | 'active-pending' + | 'active-rejected'; + /** + * If true, this booking was done by you. + */ + You: boolean; + /** + * Shows whether the booking was done by an external institution. + */ + External: boolean; + /** + * User readable notes about the status of the booking (e.g. if devices are unknown). + */ + Message?: string; + [k: string]: unknown; + } + : never; + +/** + * A device might either be a physical/virtual device or a group of device. + */ +export type Device = T extends 'all' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Unique ID of the device. Contains the institution (by having an end point at that institution) + */ + ID: string; + [k: string]: unknown; + } + : never; + +/** + * An experiment describes a set of devices and how they should be connected (potentially among other metadata). + */ +export type Experiment = T extends 'all' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device<'request'>[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * List of devices used in experiment. + */ + Devices: Device<'response'>[]; + /** + * User provided description, for example might be a reason for the booking (e.g. maintenance) or a link to the experiment. Might be empty or missing. + * + */ + Description?: string; + [k: string]: unknown; + } + : never; + +/** + * A time slot represents a slice of time used for bookings. + */ +export type Timeslot = T extends 'all' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : T extends 'request' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : T extends 'response' + ? { + /** + * Start time of the booking. + */ + Start: string; + /** + * End time of the booking. + */ + End: string; + [k: string]: unknown; + } + : never; diff --git a/services/experiment/src/config.ts b/services/experiment/src/config.ts index 12b696e0..e6d09193 100644 --- a/services/experiment/src/config.ts +++ b/services/experiment/src/config.ts @@ -13,6 +13,9 @@ export const config = { NODE_ENV: process.env.NODE_ENV ?? 'development', BASE_URL: process.env.BASE_URL ?? 'http://localhost', DEVICE_SERVICE_URL: process.env.DEVICE_SERVICE_URL ?? 'http://localhost:3001', + BOOKING_FRONTEND_URL: process.env.BOOKING_FRONTEND_URL ?? 'http://localhost:3004', + BOOKING_BACKEND_URL: process.env.BOOKING_BACKEND_URL ?? 'http://localhost:3005', + SCHEDULE_SERVICE_URL: process.env.SCHEDULE_SERVICE_URL ?? 'http://localhost:3006', JWT_SECRET: 'secret', orm: { ...basicOrmConfig, diff --git a/services/experiment/src/methods/callbacks.ts b/services/experiment/src/methods/callbacks.ts index 8df8b310..dccb6486 100644 --- a/services/experiment/src/methods/callbacks.ts +++ b/services/experiment/src/methods/callbacks.ts @@ -53,10 +53,10 @@ export async function sendChangedCallback(experiment: ExperimentModel) { if (res.status === 410) { const changedCallbackURLs = changedCallbacks.get(experiment.uuid); - changedCallbacks.set( - experiment.uuid, - changedCallbackURLs?.filter(cbUrl => cbUrl != url), - ); + const newCallbackURLs = changedCallbackURLs?.filter(cbUrl => cbUrl != url) ?? []; + if (newCallbackURLs.length > 0) + changedCallbacks.set(experiment.uuid, newCallbackURLs); + else changedCallbacks.delete(experiment.uuid); } } catch (error) { logger.log('error', 'An error occurred while sending a changed-callback', { diff --git a/services/experiment/src/methods/experimentStatus/book.ts b/services/experiment/src/methods/experimentStatus/book.ts index 6122d6ac..0b4e7cc0 100644 --- a/services/experiment/src/methods/experimentStatus/book.ts +++ b/services/experiment/src/methods/experimentStatus/book.ts @@ -1,9 +1,11 @@ -import { MissingPropertyError } from '@crosslab/service-common'; +import { InvalidChangeError, MissingPropertyError } from '@crosslab/service-common'; import { logger } from '@crosslab/service-common'; +import { clients } from '../../clients/index.js'; import { repositories } from '../../database/dataSource.js'; import { ExperimentModel } from '../../database/model.js'; -// import { apiClient } from '../api.js' +import { callbackHandler } from '../../operations/callbacks/callbackHandler.js'; +import { callbackUrl } from '../../operations/callbacks/index.js'; import { experimentUrlFromId } from '../url.js'; /** @@ -17,29 +19,68 @@ export async function bookExperiment(experimentModel: ExperimentModel) { if (!experimentModel.devices || experimentModel.devices.length === 0) throw new MissingPropertyError(`Experiment ${experimentUrl} has no devices`, 400); - // const currentTime = new Date() - // const startTime = new Date(experimentModel.bookingStart ?? currentTime) - // const endTime = new Date( - // experimentModel.bookingEnd ?? startTime.getTime() + 60 * 60 * 1000 - // ) - - // // TODO: error handling - // const { BookingID } = await apiClient.bookExperiment({ - // Experiment: { - // Devices: experimentModel.devices.map((device) => { - // return { ID: device.url } - // }), - // }, - // Time: { - // Start: startTime.toISOString(), - // End: endTime.toISOString(), - // }, - // Type: 'normal', - // }) - - // experimentModel.bookingStart = startTime.toISOString() - // experimentModel.bookingEnd = endTime.toISOString() - // experimentModel.bookingID = BookingID + if ( + experimentModel.bookingID && + experimentModel.bookingStart && + experimentModel.bookingEnd + ) { + const booking = await clients.booking.frontend.getBooking(experimentModel.bookingID); + if ( + Date.parse(booking.Booking.Time.Start) !== + Date.parse(experimentModel.bookingStart) || + Date.parse(booking.Booking.Time.End) !== Date.parse(experimentModel.bookingEnd) + ) { + throw new InvalidChangeError( + `The start and end of a booking cannot be changed!`, + 400, + ); + } + } + + const currentTime = new Date(); + const startTime = new Date(experimentModel.bookingStart ?? currentTime); + const endTime = new Date( + experimentModel.bookingEnd ?? startTime.getTime() + 60 * 60 * 1000, + ); + + // TODO: error handling + const booking = await clients.booking.frontend.newBooking({ + Devices: experimentModel.devices.map(device => { + return { ID: device.url }; + }), + Time: { + Start: startTime.toISOString(), + End: endTime.toISOString(), + }, + Type: 'normal', + }); + console.log( + 'BOOKING DATA:', + startTime, + endTime, + JSON.stringify(await clients.booking.frontend.getBooking(booking.BookingID)), + ); + + await clients.booking.frontend.updateBooking(booking.BookingID, { + Callback: callbackUrl, + }); + + // TEMPORARY HOTFIX: wait for booking to have status "booked" + for (let i = 0; i < 10; i++) { + const updatedBooking = await clients.booking.frontend.getBooking(booking.BookingID); + + if (updatedBooking.Booking.Status === 'booked') { + break; + } + + await new Promise(resolve => setTimeout(resolve, 1000)); + } + + callbackHandler.addListener('booking', booking.BookingID, experimentModel.uuid); + + experimentModel.bookingStart = startTime.toISOString(); + experimentModel.bookingEnd = endTime.toISOString(); + experimentModel.bookingID = booking.BookingID; experimentModel.status = 'booked'; await repositories.experiment.save(experimentModel); diff --git a/services/experiment/src/methods/experimentStatus/finish.ts b/services/experiment/src/methods/experimentStatus/finish.ts index 6ff945ae..b2acaefc 100644 --- a/services/experiment/src/methods/experimentStatus/finish.ts +++ b/services/experiment/src/methods/experimentStatus/finish.ts @@ -27,23 +27,23 @@ export async function finishExperiment( case 'booked': { assert(validateExperimentStatus(experimentModel, 'booked')); - // await apiClient.deleteBooking(experimentModel.bookingID) + await deleteBooking(experimentModel, clients); break; } case 'booking-locked': { assert(validateExperimentStatus(experimentModel, 'booking-locked')); - // await apiClient.unlockBooking(experimentModel.bookingID) - // await apiClient.deleteBooking(experimentModel.bookingID) + await unlockBooking(experimentModel, clients); + await deleteBooking(experimentModel, clients); break; } case 'devices-instantiated': { assert(validateExperimentStatus(experimentModel, 'devices-instantiated')); - // await apiClient.unlockBooking(experimentModel.bookingID) - // await apiClient.deleteBooking(experimentModel.bookingID) + await unlockBooking(experimentModel, clients); + await deleteBooking(experimentModel, clients); await deleteInstances(experimentModel, clients); break; @@ -51,8 +51,8 @@ export async function finishExperiment( case 'booking-updated': { assert(validateExperimentStatus(experimentModel, 'booking-updated')); - // await apiClient.unlockBooking(experimentModel.bookingID) - // await apiClient.deleteBooking(experimentModel.bookingID) + await unlockBooking(experimentModel, clients); + await deleteBooking(experimentModel, clients); await deleteInstances(experimentModel, clients); break; @@ -60,8 +60,8 @@ export async function finishExperiment( case 'peerconnections-created': { assert(validateExperimentStatus(experimentModel, 'peerconnections-created')); - // await apiClient.unlockBooking(experimentModel.bookingID) - // await apiClient.deleteBooking(experimentModel.bookingID) + await unlockBooking(experimentModel, clients); + await deleteBooking(experimentModel, clients); await deletePeerconnections(experimentModel, clients); await deleteInstances(experimentModel, clients); @@ -70,8 +70,8 @@ export async function finishExperiment( case 'running': { assert(validateExperimentStatus(experimentModel, 'running')); - // await apiClient.unlockBooking(experimentModel.bookingID) - // await apiClient.deleteBooking(experimentModel.bookingID) + await unlockBooking(experimentModel, clients); + await deleteBooking(experimentModel, clients); await deletePeerconnections(experimentModel, clients); await deleteInstances(experimentModel, clients); @@ -99,7 +99,7 @@ async function deleteInstances(experiment: ExperimentModel, clients: Clients) { await clients.device.deleteDevice(device.instance.url); } catch (error) { if (error instanceof UnsuccessfulRequestError && error.response.status === 404) - break; + continue; throw error; } } @@ -114,9 +114,33 @@ async function deletePeerconnections(experiment: ExperimentModel, clients: Clien await clients.device.deletePeerconnection(peerconnection.url); } catch (error) { if (error instanceof UnsuccessfulRequestError && error.response.status === 404) - break; + continue; throw error; } } } } + +async function unlockBooking(experiment: ExperimentModel, clients: Clients) { + if (experiment.bookingID) { + try { + await clients.booking.backend.unlockBooking(experiment.bookingID); + } catch (error) { + if (error instanceof UnsuccessfulRequestError && error.response.status === 404) + return; + throw error; + } + } +} + +async function deleteBooking(experiment: ExperimentModel, clients: Clients) { + if (experiment.bookingID) { + try { + await clients.booking.frontend.deleteBooking(experiment.bookingID); + } catch (error) { + if (error instanceof UnsuccessfulRequestError && error.response.status === 404) + return; + throw error; + } + } +} diff --git a/services/experiment/src/methods/experimentStatus/index.ts b/services/experiment/src/methods/experimentStatus/index.ts index 3e90352a..3cf7df13 100644 --- a/services/experiment/src/methods/experimentStatus/index.ts +++ b/services/experiment/src/methods/experimentStatus/index.ts @@ -35,6 +35,11 @@ export async function transitionExperiment( ); break; case 'booked': + if (experimentModel.status !== 'created' && experimentModel.status !== 'booked') + throw new InvalidChangeError( + `Cannot change status of experiment from "${experimentModel.status}" to "booked"`, + 400, + ); return await bookExperiment(experimentModel); case 'running': return await runExperiment(experimentModel, clients); diff --git a/services/experiment/src/methods/experimentStatus/run.ts b/services/experiment/src/methods/experimentStatus/run.ts index 09d878a9..8b6a7d20 100644 --- a/services/experiment/src/methods/experimentStatus/run.ts +++ b/services/experiment/src/methods/experimentStatus/run.ts @@ -1,10 +1,15 @@ -import { MissingEntityError, MissingPropertyError } from '@crosslab/service-common'; +import { + InvalidChangeError, + MissingEntityError, + MissingPropertyError, +} from '@crosslab/service-common'; import { logger } from '@crosslab/service-common'; import { Clients } from '../../clients/index.js'; import { repositories } from '../../database/dataSource.js'; import { ExperimentModel } from '../../database/model.js'; -import { InvalidStateError } from '../../types/errors.js'; +import { InvalidStateError, MalformedExperimentError } from '../../types/errors.js'; +import { validateExperimentStatus } from '../../types/typeguards.js'; import { ResolvedDevice } from '../../types/types.js'; import { experimentUrlFromId } from '../url.js'; import { bookExperiment } from './book.js'; @@ -34,6 +39,26 @@ export async function runExperiment(experimentModel: ExperimentModel, clients: C await bookExperiment(experimentModel); } + // check if booking times have changed and throw error because currently times may not be changed + if (experimentModel.status === 'booked') { + if (!validateExperimentStatus(experimentModel, 'booked')) + throw new MalformedExperimentError( + `Experiment is in status 'booked', but does not satisfy the requirements for this status`, + 500, + ); + const booking = await clients.booking.frontend.getBooking(experimentModel.bookingID); + if ( + Date.parse(experimentModel.bookingStart) !== + Date.parse(booking.Booking.Time.Start) || + Date.parse(experimentModel.bookingEnd) !== Date.parse(booking.Booking.Time.End) + ) { + throw new InvalidChangeError( + `The start and end of a booking cannot be changed!`, + 400, + ); + } + } + const resolvedDevices: ResolvedDevice[] = await Promise.all( experimentModel.devices.map(async device => { try { diff --git a/services/experiment/src/methods/experimentStatus/setup/bookingLocking.ts b/services/experiment/src/methods/experimentStatus/setup/bookingLocking.ts index e12e3faf..887e73d9 100644 --- a/services/experiment/src/methods/experimentStatus/setup/bookingLocking.ts +++ b/services/experiment/src/methods/experimentStatus/setup/bookingLocking.ts @@ -1,5 +1,6 @@ -import { InvalidValueError, logger } from '@crosslab/service-common'; +import { MissingEntityError, logger } from '@crosslab/service-common'; +import { clients } from '../../../clients/index.js'; import { repositories } from '../../../database/dataSource.js'; import { ExperimentModel } from '../../../database/model.js'; import { InvalidStateError, MalformedExperimentError } from '../../../types/errors.js'; @@ -7,8 +8,6 @@ import { validateExperimentStatus } from '../../../types/typeguards.js'; import { ResolvedDevice } from '../../../types/types.js'; import { experimentUrlFromId } from '../../url.js'; -// import { apiClient } from '../../api.js' - export async function lockBookingExperiment( experimentModel: ExperimentModel, resolvedDevices: ResolvedDevice[], @@ -30,31 +29,27 @@ export async function lockBookingExperiment( 500, ); - // NOTE: temporary solution while booking service is not available - for (const resolvedDevice of resolvedDevices) { - if (resolvedDevice.type !== 'group') { - continue; - } + // TODO: error handling + const lockedDevices = await clients.booking.backend.lockBooking( + experimentModel.bookingID, + ); - if (resolvedDevice.devices.length === 0) - throw new InvalidValueError(`Resolved device group contains no devices`, 400); + for (const [index, resolvedDevice] of resolvedDevices.entries()) { + if (resolvedDevice.type !== 'group') continue; - const index = experimentModel.devices.findIndex( - device => device.url === resolvedDevice.url, - ); + const lockedDeviceUrl = lockedDevices.find( + mapping => mapping.Requested === resolvedDevice.url, + )?.Selected; - if (index === -1) - throw new InvalidValueError( - `Resolved device group is not contained in the experiment`, + if (!lockedDeviceUrl) + throw new MissingEntityError( + `No device has been booked for device group "${resolvedDevice.url}"!`, 500, ); - experimentModel.devices[index].resolvedDevice = resolvedDevice.devices[0].url; + experimentModel.devices[index].resolvedDevice = lockedDeviceUrl; } - // TODO: error handling - // await apiClient.lockBooking(experimentModel.bookingID) - experimentModel.status = 'booking-locked'; await repositories.experiment.save(experimentModel); diff --git a/services/experiment/src/methods/experimentStatus/setup/bookingUpdate.ts b/services/experiment/src/methods/experimentStatus/setup/bookingUpdate.ts index 47cc7d4a..505ba024 100644 --- a/services/experiment/src/methods/experimentStatus/setup/bookingUpdate.ts +++ b/services/experiment/src/methods/experimentStatus/setup/bookingUpdate.ts @@ -1,5 +1,6 @@ import { logger } from '@crosslab/service-common'; +import { clients } from '../../../clients/index.js'; import { repositories } from '../../../database/dataSource.js'; import { ExperimentModel } from '../../../database/model.js'; import { InvalidStateError, MalformedExperimentError } from '../../../types/errors.js'; @@ -7,11 +8,9 @@ import { validateExperimentStatus } from '../../../types/typeguards.js'; import { sendStatusUpdateMessages } from '../../statusUpdateMessage.js'; import { experimentUrlFromId } from '../../url.js'; -// import { apiClient } from '../../api.js' - export async function updateBookingExperiment( experimentModel: ExperimentModel, - _newDeviceUrls: string[], + newDeviceUrls: string[], ) { const experimentUrl = experimentUrlFromId(experimentModel.uuid); logger.log('info', 'Attempting to update booking for experiment', { @@ -31,14 +30,14 @@ export async function updateBookingExperiment( ); // TODO: error handling - // await apiClient.updateBooking(experimentModel.bookingID, { - // Locked: true, - // Devices: newDeviceUrls.map((newDeviceUrl) => { - // return { - // ID: newDeviceUrl, - // } - // }), - // }) + await clients.booking.frontend.updateBooking(experimentModel.bookingID, { + Locked: true, + Devices: newDeviceUrls.map(newDeviceUrl => { + return { + ID: newDeviceUrl, + }; + }), + }); experimentModel.status = 'booking-updated'; diff --git a/services/experiment/src/operations/callbacks/callbackHandler.ts b/services/experiment/src/operations/callbacks/callbackHandler.ts index 12d011d5..b3442695 100644 --- a/services/experiment/src/operations/callbacks/callbackHandler.ts +++ b/services/experiment/src/operations/callbacks/callbackHandler.ts @@ -15,18 +15,36 @@ import { EventCallback } from '../../generated/types.js'; import { finishExperiment } from '../../methods/experimentStatus/finish.js'; import { mutexManager } from '../../methods/mutexManager.js'; import { sendStatusUpdateMessages } from '../../methods/statusUpdateMessage.js'; +import { isBookingChangedCallback } from '../../types/typeguards.js'; +import { BookingChangedCallback } from '../../types/types.js'; class CallbackHandler { - private deviceListeners: Map = new Map(); - private peerconnectionListeners: Map = new Map(); - private deviceMutex: Mutex = new Mutex(); - private peerconnectionMutex: Mutex = new Mutex(); + private callbackListeners: { + device: Map; + peerconnection: Map; + booking: Map; + } = { + device: new Map(), + peerconnection: new Map(), + booking: new Map(), + }; + private mutexes: { + device: Mutex; + peerconnection: Mutex; + booking: Mutex; + } = { + device: new Mutex(), + peerconnection: new Mutex(), + booking: new Mutex(), + }; - public async handleCallback(callback: EventCallback): Promise<200 | 410> { + public async handleEventCallback(callback: EventCallback): Promise<200 | 410> { const release = callback.eventType === 'device-changed' - ? await this.deviceMutex.acquire() - : await this.peerconnectionMutex.acquire(); + ? await this.mutexes.device.acquire() + : callback.eventType === 'booking-changed' + ? await this.mutexes.booking.acquire() + : await this.mutexes.peerconnection.acquire(); try { switch (callback.eventType) { @@ -51,6 +69,14 @@ class CallbackHandler { 400, ); return await this.handlePeerconnectionStatusChangedCallback(callback); + case 'booking-changed': + if (!isBookingChangedCallback(callback)) { + throw new MalformedBodyError( + 'Body of request is not a valid booking-changed event callback', + 400, + ); + } + return await this.handleBookingChangedCallback(callback); default: throw new InvalidValueError( `Event-callbacks of type "${callback.eventType}" are not supported`, @@ -63,51 +89,30 @@ class CallbackHandler { } public addListener( - type: 'device' | 'peerconnection', + type: 'device' | 'peerconnection' | 'booking', url: string, experimentUuid: string, ) { - switch (type) { - case 'device': { - const listeners = this.deviceListeners.get(url) ?? []; - if (!listeners.includes(experimentUuid)) listeners.push(experimentUuid); - this.deviceListeners.set(url, listeners); - break; - } - case 'peerconnection': { - const listeners = this.peerconnectionListeners.get(url) ?? []; - if (!listeners.includes(experimentUuid)) listeners.push(experimentUuid); - this.peerconnectionListeners.set(url, listeners); - break; - } - } + const listeners = this.callbackListeners[type].get(url) ?? []; + if (!listeners.includes(experimentUuid)) listeners.push(experimentUuid); + this.callbackListeners[type].set(url, listeners); } public removeListener( - type: 'device' | 'peerconnection', + type: 'device' | 'peerconnection' | 'booking', url: string, experimentUuid: string, ) { - switch (type) { - case 'device': { - const listeners = this.deviceListeners.get(url) ?? []; - const newListeners = listeners.filter(listener => listener !== experimentUuid); - this.deviceListeners.set(url, newListeners); - break; - } - case 'peerconnection': { - const listeners = this.peerconnectionListeners.get(url) ?? []; - const newListeners = listeners.filter(listener => listener !== experimentUuid); - this.deviceListeners.set(url, newListeners); - break; - } - } + const listeners = this.callbackListeners[type].get(url) ?? []; + const newListeners = listeners.filter(listener => listener !== experimentUuid); + if (newListeners.length > 0) this.callbackListeners[type].set(url, newListeners); + else this.callbackListeners[type].delete(url); } private async handleDeviceChangedCallback( callback: DeviceChangedEventCallback, ): Promise<200 | 410> { - const listeners = this.deviceListeners.get(callback.device.url) ?? []; + const listeners = this.callbackListeners.device.get(callback.device.url) ?? []; for (const listener of listeners) { const release = await mutexManager.acquire(listener); @@ -142,11 +147,11 @@ class CallbackHandler { } } - const newListeners = this.deviceListeners.get(callback.device.url) ?? []; + const newListeners = this.callbackListeners.device.get(callback.device.url) ?? []; if (newListeners.length > 0) { return 200; } else { - this.deviceListeners.delete(callback.device.url); + this.callbackListeners.device.delete(callback.device.url); return 410; } } @@ -154,7 +159,8 @@ class CallbackHandler { private async handlePeerconnectionClosedCallback( callback: PeerconnectionClosedEventCallback, ): Promise<200 | 410> { - const listeners = this.peerconnectionListeners.get(callback.peerconnection.url) ?? []; + const listeners = + this.callbackListeners.peerconnection.get(callback.peerconnection.url) ?? []; for (const listener of listeners) { const release = await mutexManager.acquire(listener); @@ -181,11 +187,11 @@ class CallbackHandler { } const newListeners = - this.peerconnectionListeners.get(callback.peerconnection.url) ?? []; + this.callbackListeners.peerconnection.get(callback.peerconnection.url) ?? []; if (newListeners.length > 0) { return 200; } else { - this.peerconnectionListeners.delete(callback.peerconnection.url); + this.callbackListeners.peerconnection.delete(callback.peerconnection.url); return 410; } } @@ -193,7 +199,8 @@ class CallbackHandler { private async handlePeerconnectionStatusChangedCallback( callback: PeerconnectionStatusChangedEventCallback, ): Promise<200 | 410> { - const listeners = this.peerconnectionListeners.get(callback.peerconnection.url) ?? []; + const listeners = + this.callbackListeners.peerconnection.get(callback.peerconnection.url) ?? []; for (const listener of listeners) { const release = await mutexManager.acquire(listener); @@ -256,11 +263,47 @@ class CallbackHandler { } const newListeners = - this.peerconnectionListeners.get(callback.peerconnection.url) ?? []; + this.callbackListeners.peerconnection.get(callback.peerconnection.url) ?? []; + if (newListeners.length > 0) { + return 200; + } else { + this.callbackListeners.peerconnection.delete(callback.peerconnection.url); + return 410; + } + } + + private async handleBookingChangedCallback( + callback: BookingChangedCallback, + ): Promise<200 | 410> { + const listeners = this.callbackListeners.booking.get(callback.url) ?? []; + + for (const listener of listeners) { + const release = await mutexManager.acquire(listener); + + try { + const experimentModel = await repositories.experiment.findOneOrFail({ + where: { uuid: listener }, + }); + + if (experimentModel.bookingID !== callback.url) { + this.removeListener('booking', callback.url, listener); + continue; + } + + const booking = await clients.booking.frontend.getBooking(callback.url); + + if (booking.Booking.Status === 'cancelled') + await finishExperiment(experimentModel, clients); + } finally { + release(); + } + } + + const newListeners = this.callbackListeners.booking.get(callback.url) ?? []; if (newListeners.length > 0) { return 200; } else { - this.peerconnectionListeners.delete(callback.peerconnection.url); + this.callbackListeners.booking.delete(callback.url); return 410; } } diff --git a/services/experiment/src/operations/callbacks/index.ts b/services/experiment/src/operations/callbacks/index.ts index d90d8577..dc067829 100644 --- a/services/experiment/src/operations/callbacks/index.ts +++ b/services/experiment/src/operations/callbacks/index.ts @@ -21,9 +21,14 @@ export function callbackHandling(app: express.Application) { const callback = req.body; logger.log('info', 'received a callback', { data: { callback } }); + if (!('callbackType' in callback)) { + callback.callbackType = 'event'; + callback.eventType = 'booking-changed'; + } + switch (callback.callbackType) { case 'event': - return res.status(await callbackHandler.handleCallback(callback)).send(); + return res.status(await callbackHandler.handleEventCallback(callback)).send(); default: throw new InvalidValueError( `Callbacks of type "${callback.callbackType}" are not supported`, diff --git a/services/experiment/src/operations/experiments/get.ts b/services/experiment/src/operations/experiments/get.ts index 457ad421..eaee9744 100644 --- a/services/experiment/src/operations/experiments/get.ts +++ b/services/experiment/src/operations/experiments/get.ts @@ -2,23 +2,43 @@ import { logger } from '@crosslab/service-common'; import { repositories } from '../../database/dataSource.js'; import { getExperimentsSignature } from '../../generated/signatures.js'; +import { experimentUrlFromId } from '../../methods/url.js'; /** * This function implements the functionality for handling GET requests on * /experiments endpoint. * @param authorization The authorization helper object for the request. */ -export const getExperiments: getExperimentsSignature = async req => { +export const getExperiments: getExperimentsSignature = async (req, parameters) => { logger.log('info', 'Handling GET request on endpoint /experiments'); await req.authorization.check_authorization_or_fail('view', 'experiment'); const experimentModels = await repositories.experiment.find(); + const visibility = await Promise.all( + experimentModels.map(experiment => + req.authorization.check_authorization( + 'view', + `experiment:${experimentUrlFromId(experiment.uuid)}`, + ), + ), + ); + + const visibleExperiments = experimentModels.filter( + (_value, index) => visibility[index].result, + ); + + const experiments = parameters.experimentStatus + ? visibleExperiments.filter( + experiment => experiment.status === parameters.experimentStatus, + ) + : visibleExperiments; + logger.log('info', 'Successfully handled GET request on endpoint /experiments'); return { status: 200, - body: await Promise.all(experimentModels.map(repositories.experiment.formatOverview)), + body: await Promise.all(experiments.map(repositories.experiment.formatOverview)), }; }; diff --git a/services/experiment/src/types/typeguards.ts b/services/experiment/src/types/typeguards.ts index 445d7a8a..23d9e4c5 100644 --- a/services/experiment/src/types/typeguards.ts +++ b/services/experiment/src/types/typeguards.ts @@ -1,5 +1,5 @@ import { ExperimentModel } from '../database/model.js'; -import { ExperimentModelStatusMapping } from './types.js'; +import { BookingChangedCallback, ExperimentModelStatusMapping } from './types.js'; export function validateExperimentStatus( experimentModel: ExperimentModel, @@ -111,10 +111,10 @@ function validateExperimentStatusFinished( return true; } -function hasBooking(_experimentModel: ExperimentModel) { - // if (!experimentModel.bookingID) return false - // if (!experimentModel.bookingStart) return false - // if (!experimentModel.bookingEnd) return false +function hasBooking(experimentModel: ExperimentModel) { + if (!experimentModel.bookingID) return false; + if (!experimentModel.bookingStart) return false; + if (!experimentModel.bookingEnd) return false; return true; } @@ -122,3 +122,22 @@ function hasBooking(_experimentModel: ExperimentModel) { function hasDevices(experimentModel: ExperimentModel) { return experimentModel.devices && experimentModel.devices.length > 0; } + +export function isBookingChangedCallback( + callback: unknown, +): callback is BookingChangedCallback { + return ( + typeof callback === 'object' && + callback !== null && + 'callbackType' in callback && + typeof callback.callbackType === 'string' && + callback.callbackType === 'event' && + 'eventType' in callback && + typeof callback.eventType === 'string' && + callback.eventType === 'booking-changed' && + 'url' in callback && + typeof callback.url === 'string' && + 'status' in callback && + typeof callback.status === 'string' + ); +} diff --git a/services/experiment/src/types/types.ts b/services/experiment/src/types/types.ts index 03cb858e..5860a60b 100644 --- a/services/experiment/src/types/types.ts +++ b/services/experiment/src/types/types.ts @@ -56,3 +56,10 @@ export type ExperimentModelStatusMapping = : T extends 'finished' ? ExperimentModel : never; + +export type BookingChangedCallback = { + callbackType: 'event'; + eventType: 'booking-changed'; + url: string; + status: string; +}; diff --git a/services/gateway/conf/api_backends.conf b/services/gateway/conf/api_backends.conf index ba388803..d6f0678c 100644 --- a/services/gateway/conf/api_backends.conf +++ b/services/gateway/conf/api_backends.conf @@ -18,7 +18,18 @@ upstream authorization_service { server ${AUTHORIZATION_SERVICE_DOMAIN}; } +upstream booking_frontend { + server ${BOOKING_FRONTEND_DOMAIN}; +} + +upstream booking_backend { + server ${BOOKING_BACKEND_DOMAIN}; +} + +upstream schedule_service { + server ${SCHEDULE_SERVICE_DOMAIN}; +} + upstream lti_service { server ${LTI_SERVICE_DOMAIN}; } - diff --git a/services/gateway/conf/api_gateway.conf b/services/gateway/conf/api_gateway.conf index 3d9d037b..ae2ca200 100644 --- a/services/gateway/conf/api_gateway.conf +++ b/services/gateway/conf/api_gateway.conf @@ -27,6 +27,7 @@ server { include federation_service.conf; include auth_service.conf; include authorization_service.conf; + include booking_service.conf; include lti_service.conf; # Error responses diff --git a/services/gateway/conf/booking_service.conf b/services/gateway/conf/booking_service.conf new file mode 100644 index 00000000..b982c0b7 --- /dev/null +++ b/services/gateway/conf/booking_service.conf @@ -0,0 +1,59 @@ +location = /schedule { + limit_except post { deny all; } + auth_request @auth; + auth_request_set $authentication $upstream_http_x_request_authentication; + + proxy_set_header X-Request-Authentication $authentication; + proxy_set_header X-Request-ID $request_id; + proxy_pass http://schedule_service; +} + +location = /booking { + limit_except post { deny all; } + auth_request @auth; + auth_request_set $authentication $upstream_http_x_request_authentication; + + proxy_set_header X-Request-Authentication $authentication; + proxy_set_header X-Request-ID $request_id; + proxy_pass http://booking_frontend; +} + +location ~ ^/booking/[^/]+$ { + limit_except get delete patch { deny all; } + auth_request @auth; + auth_request_set $authentication $upstream_http_x_request_authentication; + + proxy_set_header X-Request-Authentication $authentication; + proxy_set_header X-Request-ID $request_id; + proxy_pass http://booking_frontend; +} + +location ~ ^/booking/[^/]+/destroy$ { + limit_except delete { deny all; } + auth_request @auth; + auth_request_set $authentication $upstream_http_x_request_authentication; + + proxy_set_header X-Request-Authentication $authentication; + proxy_set_header X-Request-ID $request_id; + proxy_pass http://booking_frontend; +} + +location ~ ^/booking/[^/]+/lock$ { + limit_except put delete { deny all; } + auth_request @auth; + auth_request_set $authentication $upstream_http_x_request_authentication; + + proxy_set_header X-Request-Authentication $authentication; + proxy_set_header X-Request-ID $request_id; + proxy_pass http://booking_backend; +} + +location ~ ^/booking_callback/[^/]+$ { + limit_except post { deny all; } + auth_request @auth; + auth_request_set $authentication $upstream_http_x_request_authentication; + + proxy_set_header X-Request-Authentication $authentication; + proxy_set_header X-Request-ID $request_id; + proxy_pass http://booking_backend; +} \ No newline at end of file diff --git a/services/lti/src/clients/authentication/client.ts b/services/lti/src/clients/authentication/client.ts index 58bd7bbf..b5e90ff7 100644 --- a/services/lti/src/clients/authentication/client.ts +++ b/services/lti/src/clients/authentication/client.ts @@ -1,3 +1,18 @@ + + + + + + + + + + + + + + + /** * This file was automatically generated by openapi-codegeneration. * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, @@ -129,23 +144,9 @@ function parsePathParameters(url: string, endpoint: string): string[] { * // returns ["username", "role_name"] * validateUrl("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") */ -function validateUrl(url: string, baseUrl: string, endpoint: string): string[] { - if (!isValidHttpUrl(url)) - throw new InvalidUrlError('Provided url is not a valid http url'); - if (!url.startsWith(baseUrl)) - throw new InvalidUrlError('Provided url does not start with the provided base url'); - const pathParameters = parsePathParameters(url, endpoint); - - let extendedBaseUrl = baseUrl + endpoint; - - pathParameters.forEach(pathParameter => { - extendedBaseUrl = extendedBaseUrl.replace('{}', pathParameter); - }); - - if (url !== extendedBaseUrl) - throw new InvalidUrlError('Provided url does not match extended base url'); - - return pathParameters; +function validateUrl(url: string, endpoint: string): string[] { + if (!isValidHttpUrl(url)) throw new InvalidUrlError('Provided url is not a valid http url') + return parsePathParameters(url, endpoint) } /** @@ -175,10 +176,11 @@ export class Client { private fixedHeaders: [string, string][] private fetch = async (url: RequestInfo | URL, init: RequestInit) => { let raw_response; + const parsedUrl = new URL(url.toString()) try { if ( - url.toString().startsWith(this.baseUrl) || - url.toString().startsWith(this.serviceUrl) + parsedUrl.toString().startsWith(this.baseUrl) || + parsedUrl.toString().startsWith(this.serviceUrl) ) { raw_response = await fetch(url, init); } else { @@ -209,12 +211,8 @@ export class Client { baseUrl: string, options: { serviceUrl?: string; accessToken?: string, fixedHeaders?: [string, string][] }, ) { - this.baseUrl = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl; - this.serviceUrl = options.serviceUrl - ? options.serviceUrl.endsWith('/') - ? options.serviceUrl.slice(0, -1) - : options.serviceUrl - : this.baseUrl; + this.baseUrl = new URL(baseUrl).toString().slice(0, -1); + this.serviceUrl = new URL(options.serviceUrl ?? this.baseUrl).toString().slice(0, -1); this.accessToken = options.accessToken ?? ''; this.fixedHeaders = options.fixedHeaders ?? []; } @@ -248,6 +246,7 @@ export class Client { headers?: [string, string][], method?: "tui" | "local",}): Promise { const url = appendToUrl(this.baseUrl, "/login") + console.log("trying to fetch url:", url); const body: Signatures.LoginBody = @@ -265,7 +264,8 @@ export class Client { (RequestValidation.validateLoginInput as Types.FunctionWithErrors).errors ) - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "POST", headers: [ ["Content-Type", "application/json"], @@ -307,6 +307,7 @@ export class Client { */ public async logout(options?: { headers?: [string, string][] }): Promise { const url = appendToUrl(this.baseUrl, "/logout") + console.log("trying to fetch url:", url); const body: Signatures.LogoutBody = { token: this.accessToken } @@ -320,7 +321,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "POST", headers: [ ["Content-Type", "application/json"], @@ -370,6 +372,7 @@ export class Client { options?: { headers?: [string, string][],username?: string,url?: string}): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, "/users") + console.log("trying to fetch url:", url); @@ -391,7 +394,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query)); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { method: "GET", headers: [ ["Content-Type", "application/json"], @@ -442,6 +446,7 @@ export class Client { options?: { headers?: [string, string][],url?: string}): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, "/users") + console.log("trying to fetch url:", url); const body = user @@ -455,7 +460,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "POST", headers: [ ["Content-Type", "application/json"], @@ -506,7 +512,8 @@ export class Client { headers?: [string, string][],}): Promise { const urlSuffix = '/users/{}'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [user_id,] = validateUrl(url, this.baseUrl, '/users/{}') + const [user_id,] = validateUrl(new URL(url).toString(), '/users/{}') + console.log("trying to fetch url:", url); @@ -523,7 +530,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "GET", headers: [ ["Content-Type", "application/json"], @@ -575,7 +583,8 @@ export class Client { headers?: [string, string][],}): Promise { const urlSuffix = '/users/{}'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [user_id,] = validateUrl(url, this.baseUrl, '/users/{}') + const [user_id,] = validateUrl(new URL(url).toString(), '/users/{}') + console.log("trying to fetch url:", url); const body = user @@ -592,7 +601,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "PATCH", headers: [ ["Content-Type", "application/json"], @@ -643,7 +653,8 @@ export class Client { headers?: [string, string][],}): Promise { const urlSuffix = '/users/{}'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [user_id,] = validateUrl(url, this.baseUrl, '/users/{}') + const [user_id,] = validateUrl(new URL(url).toString(), '/users/{}') + console.log("trying to fetch url:", url); @@ -660,7 +671,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "DELETE", headers: [ ["Content-Type", "application/json"], @@ -704,6 +716,7 @@ export class Client { options?: { headers?: [string, string][],}): Promise { const url = appendToUrl(this.baseUrl, "/identity") + console.log("trying to fetch url:", url); @@ -717,7 +730,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "GET", headers: [ ["Content-Type", "application/json"], @@ -762,10 +776,11 @@ export class Client { * @returns * The JSON representation of the updated user. */ - public async updateIdentity(user: Types.User<"request">, + public async updateIdentity(user: Types.User<"request"> | undefined, options?: { headers?: [string, string][],}): Promise { const url = appendToUrl(this.baseUrl, "/identity") + console.log("trying to fetch url:", url); const body = user @@ -779,7 +794,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "PATCH", headers: [ ["Content-Type", "application/json"], @@ -854,6 +870,7 @@ export class Client { options?: { headers?: [string, string][],}): Promise { const url = appendToUrl(this.baseUrl, "/token") + console.log("trying to fetch url:", url); @@ -865,7 +882,8 @@ export class Client { (RequestValidation.validateCreateTokenInput as Types.FunctionWithErrors).errors ) - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "POST", headers: [ ["Content-Type", "application/json"], diff --git a/services/lti/src/clients/device/client.ts b/services/lti/src/clients/device/client.ts index 02336a33..629531e9 100644 --- a/services/lti/src/clients/device/client.ts +++ b/services/lti/src/clients/device/client.ts @@ -1,3 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /** * This file was automatically generated by openapi-codegeneration. * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, @@ -129,23 +159,9 @@ function parsePathParameters(url: string, endpoint: string): string[] { * // returns ["username", "role_name"] * validateUrl("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") */ -function validateUrl(url: string, baseUrl: string, endpoint: string): string[] { - if (!isValidHttpUrl(url)) - throw new InvalidUrlError('Provided url is not a valid http url'); - if (!url.startsWith(baseUrl)) - throw new InvalidUrlError('Provided url does not start with the provided base url'); - const pathParameters = parsePathParameters(url, endpoint); - - let extendedBaseUrl = baseUrl + endpoint; - - pathParameters.forEach(pathParameter => { - extendedBaseUrl = extendedBaseUrl.replace('{}', pathParameter); - }); - - if (url !== extendedBaseUrl) - throw new InvalidUrlError('Provided url does not match extended base url'); - - return pathParameters; +function validateUrl(url: string, endpoint: string): string[] { + if (!isValidHttpUrl(url)) throw new InvalidUrlError('Provided url is not a valid http url') + return parsePathParameters(url, endpoint) } /** @@ -175,10 +191,11 @@ export class Client { private fixedHeaders: [string, string][] private fetch = async (url: RequestInfo | URL, init: RequestInit) => { let raw_response; + const parsedUrl = new URL(url.toString()) try { if ( - url.toString().startsWith(this.baseUrl) || - url.toString().startsWith(this.serviceUrl) + parsedUrl.toString().startsWith(this.baseUrl) || + parsedUrl.toString().startsWith(this.serviceUrl) ) { raw_response = await fetch(url, init); } else { @@ -209,12 +226,8 @@ export class Client { baseUrl: string, options: { serviceUrl?: string; accessToken?: string, fixedHeaders?: [string, string][] }, ) { - this.baseUrl = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl; - this.serviceUrl = options.serviceUrl - ? options.serviceUrl.endsWith('/') - ? options.serviceUrl.slice(0, -1) - : options.serviceUrl - : this.baseUrl; + this.baseUrl = new URL(baseUrl).toString().slice(0, -1); + this.serviceUrl = new URL(options.serviceUrl ?? this.baseUrl).toString().slice(0, -1); this.accessToken = options.accessToken ?? ''; this.fixedHeaders = options.fixedHeaders ?? []; } @@ -241,6 +254,7 @@ export class Client { options?: { headers?: [string, string][],url?: string}): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, "/devices") + console.log("trying to fetch url:", url); @@ -254,7 +268,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "GET", headers: [ ["Content-Type", "application/json"], @@ -314,6 +329,7 @@ export class Client { options?: { headers?: [string, string][],changedUrl?: string,url?: string}): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, "/devices") + console.log("trying to fetch url:", url); const body = device @@ -335,7 +351,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query)); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { method: "POST", headers: [ ["Content-Type", "application/json"], @@ -388,7 +405,8 @@ export class Client { headers?: [string, string][],flat_group?: boolean,}): Promise { const urlSuffix = '/devices/{}'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [device_id,] = validateUrl(url, this.baseUrl, '/devices/{}') + const [device_id,] = validateUrl(new URL(url).toString(), '/devices/{}') + console.log("trying to fetch url:", url); @@ -411,7 +429,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query)); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { method: "GET", headers: [ ["Content-Type", "application/json"], @@ -467,12 +486,13 @@ export class Client { * @returns * The JSON Representation of the changed device. */ - public async updateDevice(url: string,deviceUpdate: Types.DeviceUpdate<"request">, + public async updateDevice(url: string,deviceUpdate: Types.DeviceUpdate<"request"> | undefined, options?: { headers?: [string, string][],changedUrl?: string,}): Promise { const urlSuffix = '/devices/{}'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [device_id,] = validateUrl(url, this.baseUrl, '/devices/{}') + const [device_id,] = validateUrl(new URL(url).toString(), '/devices/{}') + console.log("trying to fetch url:", url); const body = deviceUpdate @@ -495,7 +515,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query)); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { method: "PATCH", headers: [ ["Content-Type", "application/json"], @@ -546,7 +567,8 @@ export class Client { headers?: [string, string][],}): Promise { const urlSuffix = '/devices/{}'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [device_id,] = validateUrl(url, this.baseUrl, '/devices/{}') + const [device_id,] = validateUrl(new URL(url).toString(), '/devices/{}') + console.log("trying to fetch url:", url); @@ -563,7 +585,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "DELETE", headers: [ ["Content-Type", "application/json"], @@ -620,7 +643,8 @@ export class Client { headers?: [string, string][],changedUrl?: string,}): Promise { const urlSuffix = '/devices/{}'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [device_id,] = validateUrl(url, this.baseUrl, '/devices/{}') + const [device_id,] = validateUrl(new URL(url).toString(), '/devices/{}') + console.log("trying to fetch url:", url); @@ -643,7 +667,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query)); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { method: "POST", headers: [ ["Content-Type", "application/json"], @@ -697,7 +722,8 @@ export class Client { headers?: [string, string][],startTime?: string,endTime?: string,}): Promise { const urlSuffix = '/devices/{}/availability'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [device_id,] = validateUrl(url, this.baseUrl, '/devices/{}/availability') + const [device_id,] = validateUrl(new URL(url).toString(), '/devices/{}/availability') + console.log("trying to fetch url:", url); @@ -724,7 +750,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query)); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { method: "GET", headers: [ ["Content-Type", "application/json"], @@ -774,7 +801,8 @@ export class Client { headers?: [string, string][],}): Promise { const urlSuffix = '/devices/{}/availability'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [device_id,] = validateUrl(url, this.baseUrl, '/devices/{}/availability') + const [device_id,] = validateUrl(new URL(url).toString(), '/devices/{}/availability') + console.log("trying to fetch url:", url); @@ -791,7 +819,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "DELETE", headers: [ ["Content-Type", "application/json"], @@ -836,12 +865,13 @@ export class Client { * @returns * The JSON Representation of the changed availability. */ - public async addDeviceAvailabilityRules(url: string,availabilityRules: (Types.AvailabilityRule<"request">)[], + public async addDeviceAvailabilityRules(url: string,availabilityRules: (Types.AvailabilityRule<"request">)[] | undefined, options?: { headers?: [string, string][],}): Promise { const urlSuffix = '/devices/{}/availability'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [device_id,] = validateUrl(url, this.baseUrl, '/devices/{}/availability') + const [device_id,] = validateUrl(new URL(url).toString(), '/devices/{}/availability') + console.log("trying to fetch url:", url); const body = availabilityRules @@ -858,7 +888,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "POST", headers: [ ["Content-Type", "application/json"], @@ -909,7 +940,8 @@ export class Client { headers?: [string, string][],}): Promise { const urlSuffix = '/devices/{}/websocket'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [device_id,] = validateUrl(url, this.baseUrl, '/devices/{}/websocket') + const [device_id,] = validateUrl(new URL(url).toString(), '/devices/{}/websocket') + console.log("trying to fetch url:", url); @@ -926,7 +958,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "POST", headers: [ ["Content-Type", "application/json"], @@ -978,7 +1011,8 @@ export class Client { headers?: [string, string][],}): Promise { const urlSuffix = '/devices/{}/signaling'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [device_id,] = validateUrl(url, this.baseUrl, '/devices/{}/signaling') + const [device_id,] = validateUrl(new URL(url).toString(), '/devices/{}/signaling') + console.log("trying to fetch url:", url); const body = sigMessage @@ -995,7 +1029,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "POST", headers: [ ["Content-Type", "application/json"], @@ -1043,6 +1078,7 @@ export class Client { options?: { headers?: [string, string][],url?: string}): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, "/peerconnections") + console.log("trying to fetch url:", url); @@ -1056,7 +1092,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "GET", headers: [ ["Content-Type", "application/json"], @@ -1112,6 +1149,7 @@ export class Client { options?: { headers?: [string, string][],closedUrl?: string,statusChangedUrl?: string,url?: string}): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, "/peerconnections") + console.log("trying to fetch url:", url); const body = peerconnection @@ -1137,7 +1175,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query)); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { method: "POST", headers: [ ["Content-Type", "application/json"], @@ -1188,7 +1227,8 @@ export class Client { headers?: [string, string][],}): Promise { const urlSuffix = '/peerconnections/{}'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [peerconnection_id,] = validateUrl(url, this.baseUrl, '/peerconnections/{}') + const [peerconnection_id,] = validateUrl(new URL(url).toString(), '/peerconnections/{}') + console.log("trying to fetch url:", url); @@ -1205,7 +1245,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "GET", headers: [ ["Content-Type", "application/json"], @@ -1256,7 +1297,8 @@ export class Client { headers?: [string, string][],}): Promise { const urlSuffix = '/peerconnections/{}'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [peerconnection_id,] = validateUrl(url, this.baseUrl, '/peerconnections/{}') + const [peerconnection_id,] = validateUrl(new URL(url).toString(), '/peerconnections/{}') + console.log("trying to fetch url:", url); @@ -1273,7 +1315,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "DELETE", headers: [ ["Content-Type", "application/json"], @@ -1331,7 +1374,8 @@ export class Client { headers?: [string, string][],}): Promise { const urlSuffix = '/peerconnections/{}/device_status'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [peerconnection_id,] = validateUrl(url, this.baseUrl, '/peerconnections/{}/device_status') + const [peerconnection_id,] = validateUrl(new URL(url).toString(), '/peerconnections/{}/device_status') + console.log("trying to fetch url:", url); @@ -1354,7 +1398,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query)); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { method: "PATCH", headers: [ ["Content-Type", "application/json"], diff --git a/services/lti/src/clients/experiment/basicValidation.cjs b/services/lti/src/clients/experiment/basicValidation.cjs index a787c166..e49bb9eb 100644 --- a/services/lti/src/clients/experiment/basicValidation.cjs +++ b/services/lti/src/clients/experiment/basicValidation.cjs @@ -5,4 +5,4 @@ * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, * and run openapi-codegeneration to regenerate this file. */ -"use strict";exports.validateExperimentOverview = validate21;const schema6 = {"title":"Experiment Overview","type":"object","properties":{"url":{"type":"string","description":"URL of the experiment","format":"uri","readOnly":true},"status":{"anyOf":[{"type":"string","description":"Status of the experiment","readOnly":true,"enum":["created","booked","setup","running","finished"]},{"type":"string","description":"Status of the experiment","writeOnly":true,"enum":["created","booked","running","finished"]}]}},"required":["url","status"],"x-standalone":true,"x-name":"ExperimentOverview","x-location":"#/components/schemas/experiment_overview","x-schema-type":"all"};const formats0 = require("ajv-formats/dist/formats").fullFormats.uri;function validate21(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if(((data.url === undefined) && (missing0 = "url")) || ((data.status === undefined) && (missing0 = "status"))){validate21.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'",schema:schema6.required,parentSchema:schema6,data}];return false;}else {if(data.url !== undefined){let data0 = data.url;const _errs1 = errors;if(errors === _errs1){if(errors === _errs1){if(typeof data0 === "string"){if(!(formats0(data0))){validate21.errors = [{instancePath:instancePath+"/url",schemaPath:"#/properties/url/format",keyword:"format",params:{format: "uri"},message:"must match format \""+"uri"+"\"",schema:"uri",parentSchema:schema6.properties.url,data:data0}];return false;}}else {validate21.errors = [{instancePath:instancePath+"/url",schemaPath:"#/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string",schema:schema6.properties.url.type,parentSchema:schema6.properties.url,data:data0}];return false;}}}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data.status !== undefined){let data1 = data.status;const _errs3 = errors;const _errs4 = errors;let valid1 = false;const _errs5 = errors;if(typeof data1 !== "string"){const err0 = {instancePath:instancePath+"/status",schemaPath:"#/properties/status/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string",schema:schema6.properties.status.anyOf[0].type,parentSchema:schema6.properties.status.anyOf[0],data:data1};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(((((data1 === "created") || (data1 === "booked")) || (data1 === "setup")) || (data1 === "running")) || (data1 === "finished"))){const err1 = {instancePath:instancePath+"/status",schemaPath:"#/properties/status/anyOf/0/enum",keyword:"enum",params:{allowedValues: schema6.properties.status.anyOf[0].enum},message:"must be equal to one of the allowed values",schema:schema6.properties.status.anyOf[0].enum,parentSchema:schema6.properties.status.anyOf[0],data:data1};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}var _valid0 = _errs5 === errors;valid1 = valid1 || _valid0;if(!valid1){const _errs7 = errors;if(typeof data1 !== "string"){const err2 = {instancePath:instancePath+"/status",schemaPath:"#/properties/status/anyOf/1/type",keyword:"type",params:{type: "string"},message:"must be string",schema:schema6.properties.status.anyOf[1].type,parentSchema:schema6.properties.status.anyOf[1],data:data1};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!((((data1 === "created") || (data1 === "booked")) || (data1 === "running")) || (data1 === "finished"))){const err3 = {instancePath:instancePath+"/status",schemaPath:"#/properties/status/anyOf/1/enum",keyword:"enum",params:{allowedValues: schema6.properties.status.anyOf[1].enum},message:"must be equal to one of the allowed values",schema:schema6.properties.status.anyOf[1].enum,parentSchema:schema6.properties.status.anyOf[1],data:data1};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}var _valid0 = _errs7 === errors;valid1 = valid1 || _valid0;}if(!valid1){const err4 = {instancePath:instancePath+"/status",schemaPath:"#/properties/status/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:schema6.properties.status.anyOf,parentSchema:schema6.properties.status,data:data1};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;validate21.errors = vErrors;return false;}else {errors = _errs4;if(vErrors !== null){if(_errs4){vErrors.length = _errs4;}else {vErrors = null;}}}var valid0 = _errs3 === errors;}else {var valid0 = true;}}}}else {validate21.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object",schema:schema6.type,parentSchema:schema6,data}];return false;}}validate21.errors = vErrors;return errors === 0;}exports.validateDevice = validate22;const schema7 = {"title":"Device","type":"object","properties":{"device":{"description":"URL to the [device](https://cross-lab-project.github.io/crosslab/api/device.html#get-/devices/-device_id-).","type":"string","format":"uri"},"role":{"type":"string","description":"The name of the device's role."}},"required":["device","role"],"x-standalone":true,"x-name":"Device","x-location":"#/components/schemas/device","x-schema-type":"all"};function validate22(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if(((data.device === undefined) && (missing0 = "device")) || ((data.role === undefined) && (missing0 = "role"))){validate22.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'",schema:schema7.required,parentSchema:schema7,data}];return false;}else {if(data.device !== undefined){let data0 = data.device;const _errs1 = errors;if(errors === _errs1){if(errors === _errs1){if(typeof data0 === "string"){if(!(formats0(data0))){validate22.errors = [{instancePath:instancePath+"/device",schemaPath:"#/properties/device/format",keyword:"format",params:{format: "uri"},message:"must match format \""+"uri"+"\"",schema:"uri",parentSchema:schema7.properties.device,data:data0}];return false;}}else {validate22.errors = [{instancePath:instancePath+"/device",schemaPath:"#/properties/device/type",keyword:"type",params:{type: "string"},message:"must be string",schema:schema7.properties.device.type,parentSchema:schema7.properties.device,data:data0}];return false;}}}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data.role !== undefined){let data1 = data.role;const _errs3 = errors;if(typeof data1 !== "string"){validate22.errors = [{instancePath:instancePath+"/role",schemaPath:"#/properties/role/type",keyword:"type",params:{type: "string"},message:"must be string",schema:schema7.properties.role.type,parentSchema:schema7.properties.role,data:data1}];return false;}var valid0 = _errs3 === errors;}else {var valid0 = true;}}}}else {validate22.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object",schema:schema7.type,parentSchema:schema7,data}];return false;}}validate22.errors = vErrors;return errors === 0;}exports.validateRole = validate23;const schema8 = {"title":"role","type":"object","properties":{"name":{"type":"string","description":"Name for an experiment role."},"description":{"type":"string"},"configuration":{"type":"object","description":"Configuration for all devices with this role.","additionalProperties":true}},"required":["name"],"x-standalone":true,"x-name":"Role","x-location":"#/components/schemas/role","x-schema-type":"all"};function validate23(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.name === undefined) && (missing0 = "name")){validate23.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'",schema:schema8.required,parentSchema:schema8,data}];return false;}else {if(data.name !== undefined){let data0 = data.name;const _errs1 = errors;if(typeof data0 !== "string"){validate23.errors = [{instancePath:instancePath+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string",schema:schema8.properties.name.type,parentSchema:schema8.properties.name,data:data0}];return false;}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data.description !== undefined){let data1 = data.description;const _errs3 = errors;if(typeof data1 !== "string"){validate23.errors = [{instancePath:instancePath+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type: "string"},message:"must be string",schema:schema8.properties.description.type,parentSchema:schema8.properties.description,data:data1}];return false;}var valid0 = _errs3 === errors;}else {var valid0 = true;}if(valid0){if(data.configuration !== undefined){let data2 = data.configuration;const _errs5 = errors;if(errors === _errs5){if(data2 && typeof data2 == "object" && !Array.isArray(data2)){}else {validate23.errors = [{instancePath:instancePath+"/configuration",schemaPath:"#/properties/configuration/type",keyword:"type",params:{type: "object"},message:"must be object",schema:schema8.properties.configuration.type,parentSchema:schema8.properties.configuration,data:data2}];return false;}}var valid0 = _errs5 === errors;}else {var valid0 = true;}}}}}else {validate23.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object",schema:schema8.type,parentSchema:schema8,data}];return false;}}validate23.errors = vErrors;return errors === 0;}exports.validateParticipant = validate24;const schema9 = {"title":"Participant","type":"object","properties":{"role":{"type":"string","description":"The name of the participant's role."},"serviceId":{"type":"string"},"config":{"type":"object","description":"Service configuration of the participant.\n\nThis configuration object will be merged with the service configuration to become the service configuration send to the participant (fields of the participant configuration override the service configuration).\n","additionalProperties":true}},"x-standalone":true,"x-name":"Participant","x-location":"#/components/schemas/participant","x-schema-type":"all"};function validate24(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){if(data.role !== undefined){let data0 = data.role;const _errs1 = errors;if(typeof data0 !== "string"){validate24.errors = [{instancePath:instancePath+"/role",schemaPath:"#/properties/role/type",keyword:"type",params:{type: "string"},message:"must be string",schema:schema9.properties.role.type,parentSchema:schema9.properties.role,data:data0}];return false;}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data.serviceId !== undefined){let data1 = data.serviceId;const _errs3 = errors;if(typeof data1 !== "string"){validate24.errors = [{instancePath:instancePath+"/serviceId",schemaPath:"#/properties/serviceId/type",keyword:"type",params:{type: "string"},message:"must be string",schema:schema9.properties.serviceId.type,parentSchema:schema9.properties.serviceId,data:data1}];return false;}var valid0 = _errs3 === errors;}else {var valid0 = true;}if(valid0){if(data.config !== undefined){let data2 = data.config;const _errs5 = errors;if(errors === _errs5){if(data2 && typeof data2 == "object" && !Array.isArray(data2)){}else {validate24.errors = [{instancePath:instancePath+"/config",schemaPath:"#/properties/config/type",keyword:"type",params:{type: "object"},message:"must be object",schema:schema9.properties.config.type,parentSchema:schema9.properties.config,data:data2}];return false;}}var valid0 = _errs5 === errors;}else {var valid0 = true;}}}}else {validate24.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object",schema:schema9.type,parentSchema:schema9,data}];return false;}}validate24.errors = vErrors;return errors === 0;}exports.validateServiceConfiguration = validate25;const schema10 = {"title":"Service Configuration","type":"object","properties":{"serviceType":{"type":"string","format":"uri","description":"Type of the service"},"configuration":{"type":"object","description":"Configuration of the service\n\nThis configuration object will be merged with the participant configuration to become the service configuration send to the participant (fields of the participant configuration override the service configuration).\n","additionalProperties":true},"participants":{"type":"array","description":"List of participants for the service","items":{"title":"Participant","type":"object","properties":{"role":{"type":"string","description":"The name of the participant's role."},"serviceId":{"type":"string"},"config":{"type":"object","description":"Service configuration of the participant.\n\nThis configuration object will be merged with the service configuration to become the service configuration send to the participant (fields of the participant configuration override the service configuration).\n","additionalProperties":true}}}}},"x-standalone":true,"x-name":"ServiceConfiguration","x-location":"#/components/schemas/service_configuration","x-schema-type":"all"};function validate25(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){if(data.serviceType !== undefined){let data0 = data.serviceType;const _errs1 = errors;if(errors === _errs1){if(errors === _errs1){if(typeof data0 === "string"){if(!(formats0(data0))){validate25.errors = [{instancePath:instancePath+"/serviceType",schemaPath:"#/properties/serviceType/format",keyword:"format",params:{format: "uri"},message:"must match format \""+"uri"+"\"",schema:"uri",parentSchema:schema10.properties.serviceType,data:data0}];return false;}}else {validate25.errors = [{instancePath:instancePath+"/serviceType",schemaPath:"#/properties/serviceType/type",keyword:"type",params:{type: "string"},message:"must be string",schema:schema10.properties.serviceType.type,parentSchema:schema10.properties.serviceType,data:data0}];return false;}}}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data.configuration !== undefined){let data1 = data.configuration;const _errs3 = errors;if(errors === _errs3){if(data1 && typeof data1 == "object" && !Array.isArray(data1)){}else {validate25.errors = [{instancePath:instancePath+"/configuration",schemaPath:"#/properties/configuration/type",keyword:"type",params:{type: "object"},message:"must be object",schema:schema10.properties.configuration.type,parentSchema:schema10.properties.configuration,data:data1}];return false;}}var valid0 = _errs3 === errors;}else {var valid0 = true;}if(valid0){if(data.participants !== undefined){let data2 = data.participants;const _errs6 = errors;if(errors === _errs6){if(Array.isArray(data2)){var valid1 = true;const len0 = data2.length;for(let i0=0; i0 +export declare function validateExperimentStatus( + object: unknown +): ExperimentStatus + export declare function validateChangedURL( object: unknown ): ChangedURL @@ -242,6 +246,14 @@ export declare function validateTemplateUpdateResponse +export declare function validateExperimentStatusRequest( + object: unknown +): ExperimentStatusRequest + +export declare function validateExperimentStatusResponse( + object: unknown +): ExperimentStatusResponse + export declare function validateChangedURLRequest( object: unknown ): ChangedURLRequest diff --git a/services/lti/src/clients/experiment/client.ts b/services/lti/src/clients/experiment/client.ts index 3f9b20c2..be6359c3 100644 --- a/services/lti/src/clients/experiment/client.ts +++ b/services/lti/src/clients/experiment/client.ts @@ -1,3 +1,21 @@ + + + + + + + + + + + + + + + + + + /** * This file was automatically generated by openapi-codegeneration. * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file, @@ -129,23 +147,9 @@ function parsePathParameters(url: string, endpoint: string): string[] { * // returns ["username", "role_name"] * validateUrl("https://api.example.com/users/username/roles/role_name", "/users/{}/roles/{}") */ -function validateUrl(url: string, baseUrl: string, endpoint: string): string[] { - if (!isValidHttpUrl(url)) - throw new InvalidUrlError('Provided url is not a valid http url'); - if (!url.startsWith(baseUrl)) - throw new InvalidUrlError('Provided url does not start with the provided base url'); - const pathParameters = parsePathParameters(url, endpoint); - - let extendedBaseUrl = baseUrl + endpoint; - - pathParameters.forEach(pathParameter => { - extendedBaseUrl = extendedBaseUrl.replace('{}', pathParameter); - }); - - if (url !== extendedBaseUrl) - throw new InvalidUrlError('Provided url does not match extended base url'); - - return pathParameters; +function validateUrl(url: string, endpoint: string): string[] { + if (!isValidHttpUrl(url)) throw new InvalidUrlError('Provided url is not a valid http url') + return parsePathParameters(url, endpoint) } /** @@ -175,10 +179,11 @@ export class Client { private fixedHeaders: [string, string][] private fetch = async (url: RequestInfo | URL, init: RequestInit) => { let raw_response; + const parsedUrl = new URL(url.toString()) try { if ( - url.toString().startsWith(this.baseUrl) || - url.toString().startsWith(this.serviceUrl) + parsedUrl.toString().startsWith(this.baseUrl) || + parsedUrl.toString().startsWith(this.serviceUrl) ) { raw_response = await fetch(url, init); } else { @@ -209,12 +214,8 @@ export class Client { baseUrl: string, options: { serviceUrl?: string; accessToken?: string, fixedHeaders?: [string, string][] }, ) { - this.baseUrl = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl; - this.serviceUrl = options.serviceUrl - ? options.serviceUrl.endsWith('/') - ? options.serviceUrl.slice(0, -1) - : options.serviceUrl - : this.baseUrl; + this.baseUrl = new URL(baseUrl).toString().slice(0, -1); + this.serviceUrl = new URL(options.serviceUrl ?? this.baseUrl).toString().slice(0, -1); this.accessToken = options.accessToken ?? ''; this.fixedHeaders = options.fixedHeaders ?? []; } @@ -222,6 +223,8 @@ export class Client { /** * List experiments * + * @param options.experimentStatus + * Only retrieve experiments with this status. * @param options.url * Url of the to be used. * @@ -239,14 +242,23 @@ export class Client { */ public async listExperiments( options?: { - headers?: [string, string][],url?: string}): Promise { + headers?: [string, string][],experimentStatus?: string,url?: string}): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, "/experiments") + console.log("trying to fetch url:", url); + const parameters = { + experimentStatus: options?.experimentStatus, + } + + const query: [string,string][] = [] + + if (parameters["experimentStatus"]) + query.push(["experimentStatus", parameters["experimentStatus"].toString()]) - if (!RequestValidation.validateListExperimentsInput()) + if (!RequestValidation.validateListExperimentsInput(parameters)) throw new ValidationError( 'Request validation failed!', (RequestValidation.validateListExperimentsInput as Types.FunctionWithErrors).errors @@ -254,7 +266,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query)); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { method: "GET", headers: [ ["Content-Type", "application/json"], @@ -308,6 +321,7 @@ export class Client { options?: { headers?: [string, string][],changedURL?: string,url?: string}): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, "/experiments") + console.log("trying to fetch url:", url); const body = experiment @@ -329,7 +343,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query)); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { method: "POST", headers: [ ["Content-Type", "application/json"], @@ -380,7 +395,8 @@ export class Client { headers?: [string, string][],}): Promise { const urlSuffix = '/experiments/{}'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [experiment_id,] = validateUrl(url, this.baseUrl, '/experiments/{}') + const [experiment_id,] = validateUrl(new URL(url).toString(), '/experiments/{}') + console.log("trying to fetch url:", url); @@ -397,7 +413,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "GET", headers: [ ["Content-Type", "application/json"], @@ -447,12 +464,13 @@ export class Client { * 200: The JSON Representation of the changed experiment * 202: The JSON Representation of the changed experiment, that will be set to running eventually */ - public async updateExperiment(url: string,experimentUpdate: Types.ExperimentUpdate<"request">, + public async updateExperiment(url: string,experimentUpdate: Types.ExperimentUpdate<"request"> | undefined, options?: { headers?: [string, string][],changedURL?: string,}): Promise { const urlSuffix = '/experiments/{}'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [experiment_id,] = validateUrl(url, this.baseUrl, '/experiments/{}') + const [experiment_id,] = validateUrl(new URL(url).toString(), '/experiments/{}') + console.log("trying to fetch url:", url); const body = experimentUpdate @@ -475,7 +493,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query)); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) + '?' + new URLSearchParams(query), { method: "PATCH", headers: [ ["Content-Type", "application/json"], @@ -526,7 +545,8 @@ export class Client { headers?: [string, string][],}): Promise { const urlSuffix = '/experiments/{}'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [experiment_id,] = validateUrl(url, this.baseUrl, '/experiments/{}') + const [experiment_id,] = validateUrl(new URL(url).toString(), '/experiments/{}') + console.log("trying to fetch url:", url); @@ -543,7 +563,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "DELETE", headers: [ ["Content-Type", "application/json"], @@ -590,6 +611,7 @@ export class Client { options?: { headers?: [string, string][],url?: string}): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, "/templates") + console.log("trying to fetch url:", url); @@ -603,7 +625,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "GET", headers: [ ["Content-Type", "application/json"], @@ -655,6 +678,7 @@ export class Client { options?: { headers?: [string, string][],url?: string}): Promise { const url = appendToUrl(options?.url ?? this.baseUrl, "/templates") + console.log("trying to fetch url:", url); const body = template @@ -668,7 +692,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "POST", headers: [ ["Content-Type", "application/json"], @@ -719,7 +744,8 @@ export class Client { headers?: [string, string][],}): Promise { const urlSuffix = '/templates/{}'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [template_id,] = validateUrl(url, this.baseUrl, '/templates/{}') + const [template_id,] = validateUrl(new URL(url).toString(), '/templates/{}') + console.log("trying to fetch url:", url); @@ -736,7 +762,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "GET", headers: [ ["Content-Type", "application/json"], @@ -789,7 +816,8 @@ export class Client { headers?: [string, string][],}): Promise { const urlSuffix = '/templates/{}'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [template_id,] = validateUrl(url, this.baseUrl, '/templates/{}') + const [template_id,] = validateUrl(new URL(url).toString(), '/templates/{}') + console.log("trying to fetch url:", url); const body = templateUpdate @@ -806,7 +834,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "PATCH", headers: [ ["Content-Type", "application/json"], @@ -857,7 +886,8 @@ export class Client { headers?: [string, string][],}): Promise { const urlSuffix = '/templates/{}'.split('{}').at(-1) ?? '' if (urlSuffix && !url.endsWith(urlSuffix)) url = appendToUrl(url, urlSuffix) - const [template_id,] = validateUrl(url, this.baseUrl, '/templates/{}') + const [template_id,] = validateUrl(new URL(url).toString(), '/templates/{}') + console.log("trying to fetch url:", url); @@ -874,7 +904,8 @@ export class Client { const authorization: string = `Bearer ${this.accessToken}` - const response = await this.fetch(url.replace(this.baseUrl, this.serviceUrl) , { + console.log("trying to fetch url:", new URL(url).toString().replace(this.baseUrl, this.serviceUrl) ); + const response = await this.fetch(new URL(url).toString().replace(this.baseUrl, this.serviceUrl) , { method: "DELETE", headers: [ ["Content-Type", "application/json"], diff --git a/services/lti/src/clients/experiment/requestValidation.ts b/services/lti/src/clients/experiment/requestValidation.ts index e2fc37af..77391b54 100644 --- a/services/lti/src/clients/experiment/requestValidation.ts +++ b/services/lti/src/clients/experiment/requestValidation.ts @@ -11,7 +11,21 @@ import * as BasicValidation from "./basicValidation.cjs" /** * This function validates the inputs to listExperiments() */ -export function validateListExperimentsInput() { +export function validateListExperimentsInput(parameters: Signatures.ListExperimentsParameters) { + if (parameters) { + if ( + !BasicValidation.validateExperimentStatusRequest(parameters["experimentStatus"]) + && parameters['experimentStatus'] !== undefined + ) { + (validateListExperimentsInput as FunctionWithErrors).errors = (BasicValidation.validateExperimentStatusRequest as FunctionWithErrors).errors + return false + } + } else { + if (parameters !== undefined) { + return false + } + } + return true } diff --git a/services/lti/src/clients/experiment/signatures.ts b/services/lti/src/clients/experiment/signatures.ts index 791f53cb..3955947c 100644 --- a/services/lti/src/clients/experiment/signatures.ts +++ b/services/lti/src/clients/experiment/signatures.ts @@ -11,6 +11,14 @@ import * as Types from "./types.js" // @ts-ignore import { type Require } from "./types.js" +/** + * Typing for the parameters of the request made by listExperiments() + * @category listExperiments() + */ +export type ListExperimentsParameters = { + "experimentStatus"?: string, +} + /** * Typing for all possible responses to the request made by listExperiments() * @category listExperiments() diff --git a/services/openapi/generate.js b/services/openapi/generate.js index 029cb6bb..1f5a4978 100644 --- a/services/openapi/generate.js +++ b/services/openapi/generate.js @@ -5,6 +5,7 @@ const api_documents = [ '../device/dist/openapi.json', '../experiment/dist/openapi.json', '../federation/dist/openapi.json', + '../booking/dist/openapi.json', '../lti/dist/openapi.json', ];